context.arch.storage
Interface Storage

All Known Implementing Classes:
VectorStorage

public interface Storage

This interface specifies all the methods a Storage object must support allowing the details of the specific storage techniques used to be abstracted away. Note: currently, the constructors are expected to have the following format: 1) empty constructor (no parameters) 2) constructor(Integer i, Long l) where i is the type of flushing to use (TIME/DATA) and l is either the number of milliseconds between flushes or number of stores between flushes.

See Also:
StorageObject

Field Summary
static int DATA
          Tag to indicate flushing to persistent storage is based on the amount of data stored
static int EQUAL
          Tag to indicate data to retrieve should be equal to that specified
static int GREATERTHAN
          Tag to indicate data to retrieve should be greater than that specified
static int GREATERTHANEQUAL
          Tag to indicate data to retrieve should be greater than or equal to that specified
static int LESSTHAN
          Tag to indicate data to retrieve should be less than that specified
static int LESSTHANEQUAL
          Tag to indicate data to retrieve should be less than or equal to that specified
static java.lang.String NO_STORAGE
          Tag to indicate that there will be no storage in this component
static int TIME
          Tag to indicate flushing to persistent storage is time-based
 
Method Summary
 boolean checkFlushCondition()
          Abstract method that checks whether the locally stored data should be flushed to persistent storage.
 void flushStorage()
          Abstract method that flushes the locally stored data to persistent storage
 RetrievalResults retrieveAttributes(Retrieval retrieval)
          Abstract method that returns a vector containing AttributeNameValue objects that match the given retrieval conditions.
 RetrievalResults retrieveAttributes(java.lang.String accessorId, Retrieval retrieval)
          Abstract method that returns a vector containing AttributeNameValue objects that match the given retrieval conditions, and that are allowed to be given to the object with the given accessorId
 void setAttributes(Attributes attributes, java.util.Hashtable types)
          Abstract method that sets the attributes to use for storage
 void store(AttributeNameValues atts)
          Abstract method that stores the attributes in the AttributeNameValues object
 

Field Detail

EQUAL

public static final int EQUAL
Tag to indicate data to retrieve should be equal to that specified

LESSTHANEQUAL

public static final int LESSTHANEQUAL
Tag to indicate data to retrieve should be less than or equal to that specified

LESSTHAN

public static final int LESSTHAN
Tag to indicate data to retrieve should be less than that specified

GREATERTHANEQUAL

public static final int GREATERTHANEQUAL
Tag to indicate data to retrieve should be greater than or equal to that specified

GREATERTHAN

public static final int GREATERTHAN
Tag to indicate data to retrieve should be greater than that specified

TIME

public static final int TIME
Tag to indicate flushing to persistent storage is time-based

DATA

public static final int DATA
Tag to indicate flushing to persistent storage is based on the amount of data stored

NO_STORAGE

public static final java.lang.String NO_STORAGE
Tag to indicate that there will be no storage in this component
Method Detail

store

public void store(AttributeNameValues atts)
Abstract method that stores the attributes in the AttributeNameValues object
Parameters:
atts - Attributes object containing attributes to be stored

retrieveAttributes

public RetrievalResults retrieveAttributes(Retrieval retrieval)
Abstract method that returns a vector containing AttributeNameValue objects that match the given retrieval conditions.
Parameters:
retrieval - Retrieval object containing retrieval conditions
Returns:
RetrievalResults containing AttributeNameValue objects that match the given retrieval conditions

retrieveAttributes

public RetrievalResults retrieveAttributes(java.lang.String accessorId,
                                           Retrieval retrieval)
Abstract method that returns a vector containing AttributeNameValue objects that match the given retrieval conditions, and that are allowed to be given to the object with the given accessorId
Parameters:
accessorId - Id of the "user" wanting to retrieve data
retrieval - Retrieval object containing retrieval conditions
Returns:
RetrievalResults containing AttributeNameValue objects that match the given retrieval conditions

checkFlushCondition

public boolean checkFlushCondition()
Abstract method that checks whether the locally stored data should be flushed to persistent storage.
Returns:
Boolean value which indicates flushing is necessary or not

flushStorage

public void flushStorage()
Abstract method that flushes the locally stored data to persistent storage

setAttributes

public void setAttributes(Attributes attributes,
                          java.util.Hashtable types)
Abstract method that sets the attributes to use for storage
Parameters:
attributes - to use for storage
types - Hashtable containing name-type pairs