com.softwareag.um.storage.Storage Class Reference

Represents an Event store. More...

Public Member Functions

boolean addEvent (Event event) throws IOException
 Adds an event to the store. More...
 
void atomicEventSwap (Event event, long key) throws IOException
 Removes the existing event for the key and replaces it with the new event. More...
 
void clearCachedMemory () throws IOException
 Force removal of all cached events from the store, useful if looking for memory to clear up. More...
 
void close ()
 Closes the store and releases all resources.
 
void delete ()
 Deletes the store and all resources.
 
Event getEvent (long eventKey) throws IOException
 Retrieves the event based on the key supplied. More...
 
int getEvents (long startKey, Event[] data) throws IOException
 Returns a specified set of events. More...
 
long getFirstKey () throws IOException
 
long getLastKey () throws IOException
 
long getNextKey () throws IOException
 
final StorageProperties getProperties ()
 NOTE: Changing properties after the store has been created is NOT supported. More...
 
void performMaintenance () throws IOException
 Reclaims any unused space within the store. More...
 
int removeEvent (long key) throws IOException
 Removes the event from the store specified by the key. More...
 
long size () throws IOException
 
void sync () throws IOException
 Performs a sync on the event storage.
 

Protected Member Functions

void finalize () throws Throwable
 Do not call directly, used only to clear any resources. More...
 

Detailed Description

Represents an Event store.

Member Function Documentation

boolean com.softwareag.um.storage.Storage.addEvent ( Event  event) throws IOException

Adds an event to the store.

Parameters
eventevent to add
Exceptions
IOExceptionIf underlying File system throws an exception
void com.softwareag.um.storage.Storage.atomicEventSwap ( Event  event,
long  key 
) throws IOException

Removes the existing event for the key and replaces it with the new event.

Parameters
eventNew event to use
keykey of the event to remove and replace
Exceptions
IOException
void com.softwareag.um.storage.Storage.clearCachedMemory ( ) throws IOException

Force removal of all cached events from the store, useful if looking for memory to clear up.

Exceptions
IOException
void com.softwareag.um.storage.Storage.finalize ( ) throws Throwable
protected

Do not call directly, used only to clear any resources.

Exceptions
Throwable
Event com.softwareag.um.storage.Storage.getEvent ( long  eventKey) throws IOException

Retrieves the event based on the key supplied.

Parameters
eventKey,keyof the event to retrieve
Returns
Event represented by the key
Exceptions
IOException
int com.softwareag.um.storage.Storage.getEvents ( long  startKey,
Event[]  data 
) throws IOException

Returns a specified set of events.

Parameters
startKey,:The initial key from which we want events returned
dataThis array is populated with the number of events retrieved. It is assumed to be large enough
Returns
The number of significant elements in data
Exceptions
IOException
long com.softwareag.um.storage.Storage.getFirstKey ( ) throws IOException
Returns
The lowest value key stored
Exceptions
IOException
long com.softwareag.um.storage.Storage.getLastKey ( ) throws IOException
Returns
The key of the highest value key stored
Exceptions
IOException
long com.softwareag.um.storage.Storage.getNextKey ( ) throws IOException
Returns
Returns and increments the internal key
Exceptions
IOException
final StorageProperties com.softwareag.um.storage.Storage.getProperties ( )

NOTE: Changing properties after the store has been created is NOT supported.

Returns
The StorageProperties used to construct the Storage object
void com.softwareag.um.storage.Storage.performMaintenance ( ) throws IOException

Reclaims any unused space within the store.

Exceptions
IOException
int com.softwareag.um.storage.Storage.removeEvent ( long  key) throws IOException

Removes the event from the store specified by the key.

Parameters
keyto remove
Returns
The number of events that where removed
Exceptions
IOException
long com.softwareag.um.storage.Storage.size ( ) throws IOException
Returns
The number of Event objects currently in the store
Exceptions
IOExceptionif unable to access the underlying file system