GATE
Version 3.1-2270

gate.persist
Class PostgresDataStore

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.persist.JDBCDataStore
          extended by gate.persist.PostgresDataStore
All Implemented Interfaces:
DataStore, CreoleListener, DatabaseDataStore, FeatureBearer, NameBearer, Serializable, EventListener

public class PostgresDataStore
extends JDBCDataStore

See Also:
Serialized Form

Field Summary
static String DS_ICON_NAME
          the icon for this resource
 
Fields inherited from class gate.persist.JDBCDataStore
ac, datastoreComment, dbSchema, dbType, dependentResources, iconName, jdbcConn, name, session
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.DataStore
DATASTORE_FEATURE_NAME, LR_ID_FEATURE_NAME
 
Constructor Summary
PostgresDataStore()
           
 
Method Summary
protected  void _syncDocumentContent(Document doc)
          helper for sync() - never call directly
protected  void _syncDocumentHeader(Document doc)
          helper for sync() - never call directly
protected  void _syncFeatures(LanguageResource lr)
          helper for sync() - never call directly
protected  void _syncLR(LanguageResource lr)
          helper for sync() NEVER call directly
protected  void _syncRemovedDocumentsFromCorpus(List docLRIDs, Long corpLRID)
          helper for sync() - never call directly
protected  void addDocumentToCorpus(Long docID, Long corpID)
          adds document to corpus in the database if the document is already part of the corpus nothing changes
protected  boolean canAccessLR(Long lrID, int mode)
          Checks if the user (identified by the sessionID) has some access (read/write) to the LR
protected  void createAnnotationSet(Long lrID, AnnotationSet aset)
          creates an entry for annotation set in the database
protected  Long createDoc(Long _lrID, URL _docURL, String _docEncoding, Long _docStartOffset, Long _docEndOffset, Boolean _docIsMarkupAware, Long _corpusID)
          helper for adopt never call directly
protected  void createFeatures(Long entityID, int entityType, FeatureMap features)
          helper metod iterates a FeatureMap and creates all its features in the database
protected  void createFeaturesBulk(Long entityID, int entityType, FeatureMap features)
           
protected  Long createLR(String lrType, String lrName, SecurityInfo si, Long lrParentID)
          helper for adopt() never call directly
protected  void deleteCorpus(Long lrId)
          helper method for delete() never call it directly beause proper events will not be fired
protected  void deleteDocument(Long lrId)
          helper method for delete() never call it directly beause proper events will not be fired
 List findLrIds(List constraints)
          Get a list of LRs that satisfy some set or restrictions
 List findLrIds(List constraints, String lrType)
          Get a list of LRs that satisfy some set or restrictions and are of a particular type
 boolean lockLr(LanguageResource lr)
          Try to acquire exlusive lock on a resource from the persistent store.
protected  FeatureMap readFeatures(Long entityID, int entityType)
          reads the features of an entity entities are of type LR or Annotation
 void setSecurityInfo(LanguageResource parm1, SecurityInfo parm2)
          set security information for LR .
 void unlockLr(LanguageResource lr)
          Releases the exlusive lock on a resource from the persistent store.
protected  void updateDocumentContent(Long docID, DocumentContent content)
          updates the content of the document if it is binary or a long string (that does not fit into VARCHAR2)
 
Methods inherited from class gate.persist.JDBCDataStore
_adopt, _sync, _syncAddedAnnotations, _syncAnnotations, _syncAnnotationSets, _syncChangedAnnotations, _syncRemovedAnnotations, addDatastoreListener, adopt, beginTrans, canReadLR, canWriteLR, close, commitTrans, create, createCorpus, createDocument, createDocument, datastoreClosed, datastoreCreated, datastoreOpened, delete, delete, deleteSince, findFeatureType, fireResourceAdopted, fireResourceDeleted, fireResourceWritten, getComment, getDatabaseID, getIconName, getLockingUser, getLockingUser, getLr, getLrIds, getLrName, getLrNames, getLrTypes, getName, getSecurityInfo, getSession, getStorageUrl, isAutoSaving, open, readDatabaseID, removeDatastoreListener, resourceLoaded, resourceRenamed, resourceUnloaded, rollbackTrans, setAutoSaving, setName, setSession, setStorageUrl, sync, syncCorpus, syncDocument, timestamp, unloadLR
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 

Field Detail

DS_ICON_NAME

public static final String DS_ICON_NAME
the icon for this resource

See Also:
Constant Field Values
Constructor Detail

PostgresDataStore

public PostgresDataStore()
Method Detail

setSecurityInfo

public void setSecurityInfo(LanguageResource parm1,
                            SecurityInfo parm2)
                     throws PersistenceException,
                            SecurityException
Description copied from interface: DataStore
set security information for LR .

Throws:
PersistenceException
SecurityException

findLrIds

public List findLrIds(List constraints,
                      String lrType)
               throws PersistenceException
Description copied from class: JDBCDataStore
Get a list of LRs that satisfy some set or restrictions and are of a particular type

Specified by:
findLrIds in interface DataStore
Specified by:
findLrIds in class JDBCDataStore
Throws:
PersistenceException

findLrIds

public List findLrIds(List constraints)
               throws PersistenceException
Description copied from class: JDBCDataStore
Get a list of LRs that satisfy some set or restrictions

Specified by:
findLrIds in interface DataStore
Specified by:
findLrIds in class JDBCDataStore
Throws:
PersistenceException

unlockLr

public void unlockLr(LanguageResource lr)
              throws PersistenceException,
                     SecurityException
Releases the exlusive lock on a resource from the persistent store.

Throws:
PersistenceException
SecurityException

canAccessLR

protected boolean canAccessLR(Long lrID,
                              int mode)
                       throws PersistenceException,
                              SecurityException
Checks if the user (identified by the sessionID) has some access (read/write) to the LR

Overrides:
canAccessLR in class JDBCDataStore
Throws:
PersistenceException
SecurityException

lockLr

public boolean lockLr(LanguageResource lr)
               throws PersistenceException,
                      SecurityException
Try to acquire exlusive lock on a resource from the persistent store. Always call unlockLR() when the lock is no longer needed

Throws:
PersistenceException
SecurityException

createLR

protected Long createLR(String lrType,
                        String lrName,
                        SecurityInfo si,
                        Long lrParentID)
                 throws PersistenceException,
                        SecurityException
helper for adopt() never call directly

Specified by:
createLR in class JDBCDataStore
Throws:
PersistenceException
SecurityException

createDoc

protected Long createDoc(Long _lrID,
                         URL _docURL,
                         String _docEncoding,
                         Long _docStartOffset,
                         Long _docEndOffset,
                         Boolean _docIsMarkupAware,
                         Long _corpusID)
                  throws PersistenceException
helper for adopt never call directly

Specified by:
createDoc in class JDBCDataStore
Throws:
PersistenceException

createAnnotationSet

protected void createAnnotationSet(Long lrID,
                                   AnnotationSet aset)
                            throws PersistenceException
creates an entry for annotation set in the database

Specified by:
createAnnotationSet in class JDBCDataStore
Throws:
PersistenceException

updateDocumentContent

protected void updateDocumentContent(Long docID,
                                     DocumentContent content)
                              throws PersistenceException
updates the content of the document if it is binary or a long string (that does not fit into VARCHAR2)

Specified by:
updateDocumentContent in class JDBCDataStore
Throws:
PersistenceException

createFeatures

protected void createFeatures(Long entityID,
                              int entityType,
                              FeatureMap features)
                       throws PersistenceException
helper metod iterates a FeatureMap and creates all its features in the database

Specified by:
createFeatures in class JDBCDataStore
Throws:
PersistenceException

createFeaturesBulk

protected void createFeaturesBulk(Long entityID,
                                  int entityType,
                                  FeatureMap features)
                           throws PersistenceException
Specified by:
createFeaturesBulk in class JDBCDataStore
Throws:
PersistenceException

_syncLR

protected void _syncLR(LanguageResource lr)
                throws PersistenceException,
                       SecurityException
helper for sync() NEVER call directly

Specified by:
_syncLR in class JDBCDataStore
Throws:
PersistenceException
SecurityException

_syncDocumentHeader

protected void _syncDocumentHeader(Document doc)
                            throws PersistenceException
helper for sync() - never call directly

Specified by:
_syncDocumentHeader in class JDBCDataStore
Throws:
PersistenceException

_syncDocumentContent

protected void _syncDocumentContent(Document doc)
                             throws PersistenceException
helper for sync() - never call directly

Specified by:
_syncDocumentContent in class JDBCDataStore
Throws:
PersistenceException

_syncFeatures

protected void _syncFeatures(LanguageResource lr)
                      throws PersistenceException
helper for sync() - never call directly

Specified by:
_syncFeatures in class JDBCDataStore
Throws:
PersistenceException

readFeatures

protected FeatureMap readFeatures(Long entityID,
                                  int entityType)
                           throws PersistenceException
reads the features of an entity entities are of type LR or Annotation

Specified by:
readFeatures in class JDBCDataStore
Throws:
PersistenceException

deleteDocument

protected void deleteDocument(Long lrId)
                       throws PersistenceException
helper method for delete() never call it directly beause proper events will not be fired

Specified by:
deleteDocument in class JDBCDataStore
Throws:
PersistenceException

deleteCorpus

protected void deleteCorpus(Long lrId)
                     throws PersistenceException
helper method for delete() never call it directly beause proper events will not be fired

Specified by:
deleteCorpus in class JDBCDataStore
Throws:
PersistenceException

_syncRemovedDocumentsFromCorpus

protected void _syncRemovedDocumentsFromCorpus(List docLRIDs,
                                               Long corpLRID)
                                        throws PersistenceException
helper for sync() - never call directly

Specified by:
_syncRemovedDocumentsFromCorpus in class JDBCDataStore
Throws:
PersistenceException

addDocumentToCorpus

protected void addDocumentToCorpus(Long docID,
                                   Long corpID)
                            throws PersistenceException,
                                   SecurityException
adds document to corpus in the database if the document is already part of the corpus nothing changes

Specified by:
addDocumentToCorpus in class JDBCDataStore
Throws:
PersistenceException
SecurityException

GATE
Version 3.1-2270