GATE
Version 3.1-2270

gate
Interface DataStore

All Superinterfaces:
FeatureBearer, NameBearer
All Known Subinterfaces:
DatabaseDataStore
All Known Implementing Classes:
JDBCDataStore, OracleDataStore, PostgresDataStore, SerialDataStore

public interface DataStore
extends FeatureBearer, NameBearer

Models all sorts of data storage.


Field Summary
static String DATASTORE_FEATURE_NAME
           
static String LR_ID_FEATURE_NAME
           
 
Method Summary
 void addDatastoreListener(DatastoreListener l)
          Registers a new DatastoreListener with this datastore
 LanguageResource adopt(LanguageResource lr, SecurityInfo secInfo)
          Adopt a resource for persistence.
 boolean canReadLR(Object lrID)
          Checks if the user (identified by the sessionID) has read access to the LR
 boolean canWriteLR(Object lrID)
          Checks if the user (identified by the sessionID) has write access to the LR
 void close()
          Close the data store.
 void create()
          Create a new data store.
 void delete()
          Delete the data store.
 void delete(String lrClassName, Object lrId)
          Delete a resource from the data store.
 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
 String getComment()
          Returns the comment displayed by the GUI for this DataStore
 String getIconName()
          Returns the name of the icon to be used when this datastore is displayed in the GUI
 LanguageResource getLr(String lrClassName, Object lrId)
          Get a resource from the persistent store.
 List getLrIds(String lrType)
          Get a list of the IDs of LRs of a particular type that are present.
 String getLrName(Object lrId)
          Get the name of an LR from its ID.
 List getLrNames(String lrType)
          Get a list of the names of LRs of a particular type that are present.
 List getLrTypes()
          Get a list of the types of LR that are present in the data store.
 SecurityInfo getSecurityInfo(LanguageResource lr)
          get security information for LR .
 Session getSession(Session s)
          identify user using this datastore
 String getStorageUrl()
          Get the URL as String for the underlying storage mechanism.
 boolean isAutoSaving()
          Get the autosaving behaviour of the LR.
 boolean lockLr(LanguageResource lr)
          Try to acquire exlusive lock on a resource from the persistent store.
 void open()
          Open a connection to the data store.
 void removeDatastoreListener(DatastoreListener l)
          Removes a a previously registered DatastoreListener from the list listeners for this datastore
 void setAutoSaving(boolean autoSaving)
          Set method for the autosaving behaviour of the data store.
 void setSecurityInfo(LanguageResource lr, SecurityInfo si)
          set security information for LR .
 void setSession(Session s)
          identify user using this datastore
 void setStorageUrl(String storageUrl)
          Set the URL as string for the underlying storage mechanism.
 void sync(LanguageResource lr)
          Save: synchonise the in-memory image of the LR with the persistent image.
 void unlockLr(LanguageResource lr)
          Releases the exlusive lock on a resource from the persistent store.
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

DATASTORE_FEATURE_NAME

static final String DATASTORE_FEATURE_NAME
See Also:
Constant Field Values

LR_ID_FEATURE_NAME

static final String LR_ID_FEATURE_NAME
See Also:
Constant Field Values
Method Detail

setStorageUrl

void setStorageUrl(String storageUrl)
                   throws PersistenceException
Set the URL as string for the underlying storage mechanism.

Throws:
PersistenceException

getStorageUrl

String getStorageUrl()
Get the URL as String for the underlying storage mechanism.


create

void create()
            throws PersistenceException,
                   UnsupportedOperationException
Create a new data store. NOTE: for some data stores creation is an system administrator task; in such cases this method will throw an UnsupportedOperationException.

Throws:
PersistenceException
UnsupportedOperationException

open

void open()
          throws PersistenceException
Open a connection to the data store.

Throws:
PersistenceException

close

void close()
           throws PersistenceException
Close the data store.

Throws:
PersistenceException

delete

void delete()
            throws PersistenceException,
                   UnsupportedOperationException
Delete the data store. NOTE: for some data stores deletion is an system administrator task; in such cases this method will throw an UnsupportedOperationException.

Throws:
PersistenceException
UnsupportedOperationException

delete

void delete(String lrClassName,
            Object lrId)
            throws PersistenceException,
                   SecurityException
Delete a resource from the data store.

Parameters:
lrId - a data-store specific unique identifier for the resource
lrClassName - class name of the type of resource
Throws:
PersistenceException
SecurityException

sync

void sync(LanguageResource lr)
          throws PersistenceException,
                 SecurityException
Save: synchonise the in-memory image of the LR with the persistent image.

Throws:
PersistenceException
SecurityException

setAutoSaving

void setAutoSaving(boolean autoSaving)
                   throws UnsupportedOperationException,
                          PersistenceException
Set method for the autosaving behaviour of the data store. NOTE: many types of datastore have no auto-save function, in which case this will throw an UnsupportedOperationException.

Throws:
UnsupportedOperationException
PersistenceException

isAutoSaving

boolean isAutoSaving()
Get the autosaving behaviour of the LR.


adopt

LanguageResource adopt(LanguageResource lr,
                       SecurityInfo secInfo)
                       throws PersistenceException,
                              SecurityException
Adopt a resource for persistence.

Throws:
PersistenceException
SecurityException

getLr

LanguageResource getLr(String lrClassName,
                       Object lrId)
                       throws PersistenceException,
                              SecurityException
Get a resource from the persistent store. Don't use this method - use Factory.createResource with DataStore and DataStoreInstanceId parameters set instead.

Throws:
PersistenceException
SecurityException

getLrTypes

List getLrTypes()
                throws PersistenceException
Get a list of the types of LR that are present in the data store.

Throws:
PersistenceException

getLrIds

List getLrIds(String lrType)
              throws PersistenceException
Get a list of the IDs of LRs of a particular type that are present.

Throws:
PersistenceException

getLrNames

List getLrNames(String lrType)
                throws PersistenceException
Get a list of the names of LRs of a particular type that are present.

Throws:
PersistenceException

findLrIds

List findLrIds(List constraints)
               throws PersistenceException
Get a list of LRs that satisfy some set or restrictions

Throws:
PersistenceException

findLrIds

List findLrIds(List constraints,
               String lrType)
               throws PersistenceException
Get a list of LRs that satisfy some set or restrictions and are of a particular type

Throws:
PersistenceException

getLrName

String getLrName(Object lrId)
                 throws PersistenceException
Get the name of an LR from its ID.

Throws:
PersistenceException

addDatastoreListener

void addDatastoreListener(DatastoreListener l)
Registers a new DatastoreListener with this datastore


removeDatastoreListener

void removeDatastoreListener(DatastoreListener l)
Removes a a previously registered DatastoreListener from the list listeners for this datastore


getIconName

String getIconName()
Returns the name of the icon to be used when this datastore is displayed in the GUI


getComment

String getComment()
Returns the comment displayed by the GUI for this DataStore


canReadLR

boolean canReadLR(Object lrID)
                  throws PersistenceException,
                         SecurityException
Checks if the user (identified by the sessionID) has read access to the LR

Throws:
PersistenceException
SecurityException

canWriteLR

boolean canWriteLR(Object lrID)
                   throws PersistenceException,
                          SecurityException
Checks if the user (identified by the sessionID) has write access to the LR

Throws:
PersistenceException
SecurityException

getSecurityInfo

SecurityInfo getSecurityInfo(LanguageResource lr)
                             throws PersistenceException
get security information for LR .

Throws:
PersistenceException

setSecurityInfo

void setSecurityInfo(LanguageResource lr,
                     SecurityInfo si)
                     throws PersistenceException,
                            SecurityException
set security information for LR .

Throws:
PersistenceException
SecurityException

setSession

void setSession(Session s)
                throws SecurityException
identify user using this datastore

Throws:
SecurityException

getSession

Session getSession(Session s)
                   throws SecurityException
identify user using this datastore

Throws:
SecurityException

lockLr

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

unlockLr

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

Throws:
PersistenceException
SecurityException

GATE
Version 3.1-2270