public interface DataStore extends FeatureBearer, NameBearer
Modifier and Type | Field and Description |
---|---|
static String |
DATASTORE_FEATURE_NAME |
static String |
LR_ID_FEATURE_NAME |
Modifier and Type | Method and Description |
---|---|
void |
addDatastoreListener(DatastoreListener l)
Registers a new
DatastoreListener with this datastore |
LanguageResource |
adopt(LanguageResource lr)
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<String> |
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<String> |
getLrNames(String lrType)
Get a list of the names of LRs of a particular type that are present.
|
List<String> |
getLrTypes()
Get a list of the types of LR that are present in the data store.
|
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 |
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.
|
getFeatures, setFeatures
getName, setName
static final String DATASTORE_FEATURE_NAME
static final String LR_ID_FEATURE_NAME
void setStorageUrl(String storageUrl) throws PersistenceException
PersistenceException
String getStorageUrl()
void create() throws PersistenceException, UnsupportedOperationException
void open() throws PersistenceException
PersistenceException
void close() throws PersistenceException
PersistenceException
void delete() throws PersistenceException, UnsupportedOperationException
void delete(String lrClassName, Object lrId) throws PersistenceException, SecurityException
lrId
- a data-store specific unique identifier for the resourcelrClassName
- class name of the type of resourcePersistenceException
SecurityException
void sync(LanguageResource lr) throws PersistenceException, SecurityException
void setAutoSaving(boolean autoSaving) throws UnsupportedOperationException, PersistenceException
boolean isAutoSaving()
LanguageResource adopt(LanguageResource lr) throws PersistenceException
PersistenceException
LanguageResource getLr(String lrClassName, Object lrId) throws PersistenceException, SecurityException
FeatureMap params = Factory.newFeatureMap(); params.put(DataStore.DATASTORE_FEATURE_NAME, datastore); params.put(DataStore.LR_ID_FEATURE_NAME, lrID); LanguageResource lr = (LanguageResource)Factory.createResource(lrClassName, params);
List<String> getLrTypes() throws PersistenceException
PersistenceException
List<String> getLrIds(String lrType) throws PersistenceException
PersistenceException
List<String> getLrNames(String lrType) throws PersistenceException
PersistenceException
List findLrIds(List constraints) throws PersistenceException
PersistenceException
List findLrIds(List constraints, String lrType) throws PersistenceException
PersistenceException
String getLrName(Object lrId) throws PersistenceException
PersistenceException
void addDatastoreListener(DatastoreListener l)
DatastoreListener
with this datastorevoid removeDatastoreListener(DatastoreListener l)
DatastoreListener
from the list listeners for this datastoreString getIconName()
String getComment()
boolean canReadLR(Object lrID) throws PersistenceException
PersistenceException
boolean canWriteLR(Object lrID) throws PersistenceException
PersistenceException
boolean lockLr(LanguageResource lr) throws PersistenceException, SecurityException
void unlockLr(LanguageResource lr) throws PersistenceException, SecurityException
Copyright © 2024 GATE. All rights reserved.