|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aselect.system.storagemanager.handler.JDBCStorageHandler
public class JDBCStorageHandler
DBMS storage handler.
Description:
The JDBCStorageHandler uses a DBMS for physical storage.
The DBMS is accessed through JDBC. Objects that are written to the DBMS are
encoded to bytes, using the ObjectOutputStream mechanism of
Java.
Concurrency issues:
-
| Constructor Summary | |
|---|---|
JDBCStorageHandler()
|
|
| Method Summary | |
|---|---|
void |
cleanup(java.lang.Long lTimestamp)
Removes the objects from the database that have expired. |
boolean |
containsKey(java.lang.Object oKey)
Checks if the supplied key already exists in the database |
void |
destroy()
Clean up all used recourses. |
java.lang.Object |
get(java.lang.Object oKey)
Returns a particular object from the database. |
java.util.Hashtable |
getAll()
Returns all the objects stored in the table. |
long |
getCount()
Returns the number of objects stored in the table. |
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)
Initialize the JDBCStorageHandler. |
boolean |
isMaximum(long lItemCount)
Checks if the maximum items is reached. |
void |
put(java.lang.Object oKey,
java.lang.Object oValue,
java.lang.Long lTimestamp)
Inserts a particular object into the database. |
void |
remove(java.lang.Object oKey)
Removes a particular object from the database. |
void |
removeAll()
Removes all the stored objects from the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCStorageHandler()
| Method Detail |
|---|
public void init(java.lang.Object oConfigSection,
ConfigManager oConfigManager,
SystemLogger systemLogger,
SAMAgent oSAMAgent)
throws ASelectStorageException
JDBCStorageHandler.
JDBCStorageHandler:
oConfigSection != nulloConfigManager != nullsystemLogger != nulloSAMAgent != null
init in interface IStorageHandleroConfigSection - The section within the configuration file in which the
parameters for the IStorageHandler can be found.oConfigManager - The configuration.systemLogger - The logger for system entries.oSAMAgent - The SAM agant to use.
ASelectStorageException - If initialisation fails.IStorageHandler.init(java.lang.Object,
org.aselect.system.configmanager.ConfigManager,
org.aselect.system.logging.SystemLogger,
org.aselect.system.sam.agent.SAMAgent)
public java.lang.Object get(java.lang.Object oKey)
throws ASelectStorageException
get in interface IStorageHandleroKey - The identifier of the object that needs to be stored.
ASelectStorageException - If retrieving fails.IStorageHandler.get(java.lang.Object)
public long getTimestamp(java.lang.Object oKey)
throws ASelectStorageException
getTimestamp in interface IStorageHandleroKey - The identifier of the object that needs to be obtained from
the storage.
ASelectStorageException - If retrieving fails.IStorageHandler.getTimestamp(java.lang.Object)
public long getCount()
throws ASelectStorageException
getCount in interface IStorageHandlerASelectStorageException - If retrieving fails.IStorageHandler.getCount()
public java.util.Hashtable getAll()
throws ASelectStorageException
getAll in interface IStorageHandlerASelectStorageException - If retrieving fails.IStorageHandler.getAll()
public void put(java.lang.Object oKey,
java.lang.Object oValue,
java.lang.Long lTimestamp)
throws ASelectStorageException
put in interface IStorageHandleroKey - The identifier of the object that needs to be stored.oValue - The object that needs to be stored.lTimestamp - The time at which the object is stored.
ASelectStorageException - If storing fails.IStorageHandler.put(java.lang.Object, java.lang.Object, java.lang.Long)
public void remove(java.lang.Object oKey)
throws ASelectStorageException
remove in interface IStorageHandleroKey - The identifier of the object that needs to be removed.
ASelectStorageException - If removal fails.IStorageHandler.remove(java.lang.Object)
public void removeAll()
throws ASelectStorageException
removeAll in interface IStorageHandlerASelectStorageException - if removal fails.IStorageHandler.removeAll()
public void cleanup(java.lang.Long lTimestamp)
throws ASelectStorageException
cleanup in interface IStorageHandlerlTimestamp - The expiration time.
ASelectStorageException - If cleaning fails.IStorageHandler.cleanup(java.lang.Long)public void destroy()
destroy in interface IStorageHandlerIStorageHandler.destroy()
public boolean isMaximum(long lItemCount)
throws ASelectStorageException
isMaximum in interface IStorageHandlerlItemCount - number of items that will be checked if it is the maximum
ASelectStorageException - if io error occurred with physical storageIStorageHandler.isMaximum(long)
public boolean containsKey(java.lang.Object oKey)
throws ASelectStorageException
containsKey in interface IStorageHandleroKey - The unique key that will be checked for existance
ASelectStorageException - if IO error occurred with physical storageIStorageHandler.containsKey(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||