|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object context.arch.storage.StorageObject
This class allows storage and retrieval of data in String, Integer, Long, Float, Double, or Short format. It uses a default storage class (context.arch.storage.VectorStorage), but can use any given storage class that implements the Storage interface.
Storage
Field Summary | |
static java.lang.String |
DEFAULT_STORAGE_CLASS
The default storage class is context.arch.storage.VectorStorage |
static java.lang.String |
PASSWORD
The default password |
static java.lang.String |
PROTOCOL
The default protocol to use is JDBC |
static java.lang.String |
RETRIEVE_DATA
Tag for retrieving data |
static java.lang.String |
RETRIEVE_DATA_REPLY
Tag for reply to retrieve data request |
static java.lang.String |
SUBPROTOCOL
The default subprotocol to use is msql |
static java.lang.String |
URL
The default url to use for storage |
static java.lang.String |
USER
The default username |
Constructor Summary | |
StorageObject(java.lang.String table)
Basic constructor that uses the default storage class |
|
StorageObject(java.lang.String storeClass,
java.lang.String table)
Constructor that sets the storage class to use and creates the storage class. |
|
StorageObject(java.lang.String storageClass,
java.lang.String table,
java.lang.Integer flushType,
java.lang.Long flushCondition)
Constructor that sets the storage class to use |
Method Summary | |
void |
flushStorage()
Flushes the locally stored data to persistent storage |
RetrievalResults |
retrieveAttributes(Retrieval retrieval)
This method returns a vector containing AttributeNameValues objects that matches the given conditions in the Retrieval object |
RetrievalResults |
retrieveAttributes(java.lang.String requestorId,
Retrieval retrieval)
This method returns a vector containing AttributeNameValues objects that matches the given conditions in the Retrieval object, and that the given requestorId is allowed to have access to |
Attributes |
retrieveLastAttributes()
Returns the last AttributeNameValues object stored |
void |
setAttributes(Attributes attributes,
java.util.Hashtable attributeTypes)
This method sets the attributes to use for storage. |
void |
store(Attributes atts)
This method stores the given AttributeNameValues object and checks whether the locally stored data should be flushed to persistent storage. |
void |
store(DataObject data)
This method stores the attributes in the given DataObject and checks whether the locally stored data should be flushed to persistent 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 RETRIEVE_DATA
public static final java.lang.String RETRIEVE_DATA_REPLY
public static final java.lang.String PROTOCOL
public static final java.lang.String SUBPROTOCOL
public static final java.lang.String URL
public static final java.lang.String USER
public static final java.lang.String PASSWORD
public static final java.lang.String DEFAULT_STORAGE_CLASS
Constructor Detail |
public StorageObject(java.lang.String table) throws InvalidStorageException
table
- Name of the table to use - should be the id of the calling object
InvalidStorageException
- when the default storage class can't be createdDEFAULT_STORAGE_CLASS
public StorageObject(java.lang.String storeClass, java.lang.String table) throws InvalidStorageException
table
- Name of the table to use - should be the id of the calling object
InvalidStorageException
- thrown when there are any errors creating the
storage class object or connecting to the persistent storage
InvalidStorageException
- when the given storage class can't be createdDEFAULT_STORAGE_CLASS
public StorageObject(java.lang.String storageClass, java.lang.String table, java.lang.Integer flushType, java.lang.Long flushCondition) throws InvalidStorageException
storageClass
- Class to use for storagetable
- Name of the table to use - should be the id of the calling objectflushType
- Flush to database based on TIME or DATAflushCondition
- Condition to flush local storage to database
InvalidStorageException
- when the given storage class can't be createdMethod Detail |
public void store(Attributes atts)
atts
- AttributeNameValues to storecontext.arch.storage.Storage#store(context.arch.storage.AttributeNameValues)
,
Storage.flushStorage()
,
Storage.checkFlushCondition()
public void store(DataObject data)
data
- DataObject containing the attributes to store#store(context.arch.storage.AttributeNameValues)
public Attributes retrieveLastAttributes()
public void flushStorage()
public RetrievalResults retrieveAttributes(Retrieval retrieval)
retrieval
- Retrieval object that contains conditions for retrievalcompare Flag that dictates the type of comparison
public RetrievalResults retrieveAttributes(java.lang.String requestorId, Retrieval retrieval)
retrieval
- Retrieval object that contains conditions for retrievalcompare Flag that dictates the type of comparison
public void setAttributes(Attributes attributes, java.util.Hashtable attributeTypes)
attributes
- AttributeNameValues containing attribute info for this objectattributeTypes
- Hashtable containing attributes and type info
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |