|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.util.FilePersistentStore
public class FilePersistentStore
File system implementation of PersistentStore.
Constructor Summary | |
---|---|
FilePersistentStore()
Public constructor. |
|
FilePersistentStore(java.lang.ClassLoader loader)
Public constructor. |
|
FilePersistentStore(java.lang.String storeDirectory)
Public constructor that allows one to specify the directory (repository) where objects are stored/retrieved. |
|
FilePersistentStore(java.lang.String storeDirectory,
java.lang.ClassLoader loader)
Public constructor that allows one to specify the directory (repository) where objects are stored/retrieved. |
Method Summary | |
---|---|
void |
delete(java.lang.String key)
Method to delete a a key. |
boolean |
exists(java.lang.String key)
Method to query if an an object is stored. |
java.lang.String |
getStoreDirectory()
Returns the location where objects are stored/retrieved. |
java.util.Enumeration |
keys()
Method that returns an enumration of the keys of this persistent store. |
java.lang.Object |
remove(java.lang.String key)
Method to simultaneously retrieve and remove an object from persistent store. |
java.lang.Object |
retrieve(java.lang.String key)
Method to retrieve a stored object. |
void |
store(java.lang.String key,
java.io.Serializable obj)
Method to store and object (persistent). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilePersistentStore() throws com.lutris.util.PersistentStoreException
storeDirectory
,
the directory (repository) where objects
are stored/retreived to /tmp
.
java.io.IOException
- If /tmp
already exists but is not a directory. Or if
/tmp
does not exist and could
not be created.
java.lang.SecurityException
- If a security
manager is running but /tmp
could not be created due to inappropriate
permissions.
com.lutris.util.PersistentStoreException
public FilePersistentStore(java.lang.ClassLoader loader) throws java.io.IOException, java.lang.SecurityException, com.lutris.util.PersistentStoreException
storeDirectory
,
the directory (repository) where objects
are stored/retreived to /tmp
.
loader
- the class loader to use when reading
in serialized data.
java.io.IOException
- If /tmp
already exists but is not a directory. Or if
/tmp
does not exist and could
not be created.
java.lang.SecurityException
- If a security
manager is running but /tmp
could not be created due to inappropriate
permissions.
com.lutris.util.PersistentStoreException
public FilePersistentStore(java.lang.String storeDirectory) throws com.lutris.util.PersistentStoreException
storeDirectory
- The repository (directory) for storing and retrieving objects.
java.io.IOException
- If storeDirectory
already exists but is not a directory. Or if the
storeDirectory
does not exist and could
not be created.
java.lang.SecurityException
- If a security
manager is running but storeDirectory
could not be created due to inappropriate
permissions.
com.lutris.util.PersistentStoreException
public FilePersistentStore(java.lang.String storeDirectory, java.lang.ClassLoader loader) throws com.lutris.util.PersistentStoreException
storeDirectory
- The repository (directory) for storing and retrieving objects.
java.io.IOException
- If storeDirectory
already exists but is not a directory. Or if the
storeDirectory
does not exist and could
not be created.
java.lang.SecurityException
- If a security
manager is running but storeDirectory
could not be created due to inappropriate
permissions.
com.lutris.util.PersistentStoreException
Method Detail |
---|
public java.lang.String getStoreDirectory()
public void store(java.lang.String key, java.io.Serializable obj) throws com.lutris.util.PersistentStoreException
store
in interface com.lutris.util.PersistentStore
key
- The key by which to identify the stored object.
The key name has some system constraints. Its length
must not exceed half the maximum file name length on
the system. If it does, an exception is thrown.obj
- The serializable object to store.
PersistentStoreException
- if the object cannot cannot be stored.public java.lang.Object retrieve(java.lang.String key) throws com.lutris.util.PersistentStoreException
retrieve
in interface com.lutris.util.PersistentStore
key
- The key of the object that is to be retreived.
null
is returned.
PersistentStoreException
- if the object could not be retrieved.remove(java.lang.String)
public boolean exists(java.lang.String key) throws com.lutris.util.PersistentStoreException
exists
in interface com.lutris.util.PersistentStore
key
- The key by which to identify the stored object.
PersistentStoreException
- If The exsitence of object could not be determined.public java.lang.Object remove(java.lang.String key) throws com.lutris.util.PersistentStoreException
remove
in interface com.lutris.util.PersistentStore
key
- The key by which to identify the stored object
that is to be removed.
PersistentStoreException
- If the object could not be retrieved before being deleted.public void delete(java.lang.String key)
delete
in interface com.lutris.util.PersistentStore
key
- The key to remove.public java.util.Enumeration keys() throws com.lutris.util.PersistentStoreException
keys
in interface com.lutris.util.PersistentStore
com.lutris.util.PersistentStoreException
- if the enumeration could not be determined.
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |