|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.AbstractFeatureBearer | +--gate.persist.SerialDataStore
A data store based on Java serialisation.
Fields inherited from interface gate.DataStore |
DATASTORE_FEATURE_NAME, LR_ID_FEATURE_NAME |
Constructor Summary | |
SerialDataStore()
Default construction. |
|
SerialDataStore(String storageDirUrl)
Construction requires a file protocol URL pointing to the storage directory used for the serialised classes. |
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 lrPersistenceId)
Delete a resource from the data store. |
boolean |
equals(Object other)
Equality: based on storage dir of other. |
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 lrPersistenceId)
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. |
String |
getName()
Returns the name of this resource |
SecurityInfo |
getSecurityInfo(LanguageResource lr)
get security information for LR . |
Session |
getSession(Session s)
identify user using this datastore |
File |
getStorageDir()
Get method for storage URL |
String |
getStorageUrl()
Get the URL for the underlying storage mechanism. |
int |
hashCode()
Calculate a hash code based on the class and the storage dir. |
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 |
setName(String name)
Sets the name of this resource |
void |
setSecurityInfo(LanguageResource lr,
SecurityInfo si)
set security information for LR . |
void |
setSession(Session s)
identify user using this datastore |
void |
setStorageDir(File storageDir)
Set method for storage URL |
void |
setStorageUrl(String urlString)
Set the URL for the underlying storage mechanism. |
void |
sync(LanguageResource lr)
Save: synchonise the in-memory image of the LR with the persistent image. |
String |
toString()
String representation |
void |
unlockLr(LanguageResource lr)
Releases the exlusive lock on a resource from the persistent store. |
Methods inherited from class gate.util.AbstractFeatureBearer |
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gate.util.FeatureBearer |
getFeatures, setFeatures |
Constructor Detail |
public SerialDataStore(String storageDirUrl) throws PersistenceException
public SerialDataStore()
Method Detail |
public void setStorageDir(File storageDir)
public File getStorageDir()
public void setStorageUrl(String urlString) throws PersistenceException
setStorageUrl
in interface DataStore
public String getStorageUrl()
getStorageUrl
in interface DataStore
public void create() throws PersistenceException
create
in interface DataStore
public void delete() throws PersistenceException
delete
in interface DataStore
public void delete(String lrClassName, Object lrPersistenceId) throws PersistenceException
delete
in interface DataStore
gate.DataStore
lrId
- a data-store specific unique identifier for the resourcelrClassName
- class name of the type of resourcepublic LanguageResource adopt(LanguageResource lr, SecurityInfo secInfo) throws PersistenceException, SecurityException
adopt
in interface DataStore
public void open() throws PersistenceException
open
in interface DataStore
public void close() throws PersistenceException
close
in interface DataStore
public void sync(LanguageResource lr) throws PersistenceException
sync
in interface DataStore
public LanguageResource getLr(String lrClassName, Object lrPersistenceId) throws PersistenceException, SecurityException
getLr
in interface DataStore
public List getLrTypes() throws PersistenceException
getLrTypes
in interface DataStore
public List getLrIds(String lrType) throws PersistenceException
getLrIds
in interface DataStore
public List getLrNames(String lrType) throws PersistenceException
getLrNames
in interface DataStore
public String getLrName(Object lrId)
getLrName
in interface DataStore
public void setAutoSaving(boolean autoSaving) throws UnsupportedOperationException
setAutoSaving
in interface DataStore
public boolean isAutoSaving()
isAutoSaving
in interface DataStore
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public void removeDatastoreListener(DatastoreListener l)
DataStore
DatastoreListener
from the list listeners for this datastoreremoveDatastoreListener
in interface DataStore
public void addDatastoreListener(DatastoreListener l)
DataStore
DatastoreListener
with this datastoreaddDatastoreListener
in interface DataStore
public String getIconName()
getIconName
in interface DataStore
public String getComment()
getComment
in interface DataStore
public boolean canReadLR(Object lrID) throws PersistenceException, SecurityException
canReadLR
in interface DataStore
public boolean canWriteLR(Object lrID) throws PersistenceException, SecurityException
canWriteLR
in interface DataStore
public void setName(String name)
setName
in interface NameBearer
public String getName()
getName
in interface NameBearer
public SecurityInfo getSecurityInfo(LanguageResource lr) throws PersistenceException
getSecurityInfo
in interface DataStore
public void setSecurityInfo(LanguageResource lr, SecurityInfo si) throws PersistenceException, SecurityException
setSecurityInfo
in interface DataStore
public void setSession(Session s) throws SecurityException
setSession
in interface DataStore
public Session getSession(Session s) throws SecurityException
getSession
in interface DataStore
public boolean lockLr(LanguageResource lr) throws PersistenceException, SecurityException
lockLr
in interface DataStore
public void unlockLr(LanguageResource lr) throws PersistenceException, SecurityException
unlockLr
in interface DataStore
public List findLrIds(List constraints) throws PersistenceException
findLrIds
in interface DataStore
public List findLrIds(List constraints, String lrType) throws PersistenceException
findLrIds
in interface DataStore
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |