|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aselect.system.storagemanager.StorageManager
public class StorageManager
Store objects to some sort of physical storage.
Description:
The StorageManager is designed to store objects, like a
Hashtable, to some sort of physical storage.
The StorageManager uses StorageHandler s to actual store the
objects. Objects can be stored for a limited amount of time. A Cleaner will
remove the objects that have expired.
Concurrency issues:
-
| Field Summary | |
|---|---|
static java.lang.String |
MODULE
The module name. |
| Constructor Summary | |
|---|---|
StorageManager()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object oKey)
Checks if the supplied key already exists in the physical storage |
void |
destroy()
Clean up all used resources. |
java.lang.Object |
get(java.lang.Object oKey)
Retrieve object from storage. |
java.util.Hashtable |
getAll()
Retrieve all stored objects. |
long |
getCount()
Retrieve the number of stored objects. |
long |
getExpirationTime(java.lang.Object oKey)
Retrieve an object its expiration time from storage. |
long |
getTimestamp(java.lang.Object oKey)
Retrieve an object its timestamp from storage. |
void |
init(java.lang.Object oConfigSection,
ConfigManager oConfigManager,
SystemLogger systemLogger,
SAMAgent oSAMAgent)
(Re)initialize the storage. |
void |
put(java.lang.Object oKey,
java.lang.Object oValue)
Insert an object in storage. |
void |
remove(java.lang.Object oKey)
Remove a storage object. |
void |
removeAll()
Remove all stored objects. |
void |
update(java.lang.Object oKey,
java.lang.Object oValue)
Updates an object in storage. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MODULE
| Constructor Detail |
|---|
public StorageManager()
| Method Detail |
|---|
public void init(java.lang.Object oConfigSection,
ConfigManager oConfigManager,
SystemLogger systemLogger,
SAMAgent oSAMAgent)
throws ASelectStorageException
oConfigManager != nullsystemLogger != nulloSAMAgent != null
oConfigSection - The section within the configuration file in which the
parameters for the StorageManager can be found.oConfigManager - The configuration to be used.systemLogger - The logger for system entries.oSAMAgent - The SAM agent to be used.
ASelectStorageException - If storage initialization fails.
public java.lang.Object get(java.lang.Object oKey)
throws ASelectStorageException
get().oKey != null
oKey - The identifier of the object that needs to be obtained from
the storage.
ASelectStorageException - If retrieving fails.IStorageHandler.get(Object)
public long getExpirationTime(java.lang.Object oKey)
throws ASelectStorageException
getTimestamp() and adds the
configured expiration time.
oKey != null
oKey - The identifier of the object that needs to be obtained from
the storage.
ASelectStorageException - If retrieving fails.IStorageHandler.getTimestamp(Object)
public long getTimestamp(java.lang.Object oKey)
throws ASelectStorageException
getTimestamp().
oKey != null
oKey - The identifier of the object that needs to be obtained from
the storage.
ASelectStorageException - If retrieving fails.IStorageHandler.getTimestamp(Object)
public java.util.Hashtable getAll()
throws ASelectStorageException
getAll().
Hashtable containing all stored object as
key/value.
ASelectStorageException - if retrieving fails.IStorageHandler.getAll()
public long getCount()
throws ASelectStorageException
getCount().
ASelectStorageException - if retrieving fails.IStorageHandler.getCount()
public void put(java.lang.Object oKey,
java.lang.Object oValue)
throws ASelectStorageException
put().oKey != nulloValue != null
oKey - The identifier of the object that is to be stored.oValue - The object that is to be stored.
ASelectStorageException - If storing fails.IStorageHandler.put(Object, Object, Long)
public void update(java.lang.Object oKey,
java.lang.Object oValue)
throws ASelectStorageException
put().oKey must exist in storage.oKey != nulloValue != null
oKey - The identifier of the object that is to be stored.oValue - The object that is to be stored.
ASelectStorageException - If storing fails.IStorageHandler.put(Object, Object, Long)
public boolean containsKey(java.lang.Object oKey)
throws ASelectStorageException
oKey - The unique key that will be checked for existance
ASelectStorageException - if IO error occurred with physical storage
public void remove(java.lang.Object oKey)
throws ASelectStorageException
remove().oKey != null
oKey - The identifier of the object that needs to be removed.
ASelectStorageException - If removal fails.IStorageHandler.remove(Object)
public void removeAll()
throws ASelectStorageException
removeAll().
ASelectStorageException - If removal fails.IStorageHandler.removeAll()public void destroy()
IStorageHandler.destroy(),
Cleaner#destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||