|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectequip.data.MemoryDataStore
Core implementation of IDataStore interface which
can hold any data items in memory (only).
Factors out state maintainance code previously included in
DataDelegate before the introduction of the DataStore
internal interface.
| Nested Class Summary | |
(package private) static class |
MemoryDataStore.LeasedItem
|
| Field Summary | |
protected java.util.Hashtable |
idMap
|
protected java.util.Vector |
leasedItems
|
protected java.util.Hashtable |
parentMultimap
|
| Constructor Summary | |
MemoryDataStore()
default constructor. |
|
| Method Summary | |
boolean |
checkAdd(AddEvent add)
check if store would like to/be prepared to handle this AddEvent. |
void |
flush()
Flush any pending persistent records |
java.util.Enumeration |
getCandidateItemBindings(ItemData[] itemTemplates)
get the ItemBinding maintained by this store which should be considered when pattern matching the associated itemTemplates for an add/delete while present pattern. |
java.util.Enumeration |
getExpiredGUIDs(Time now)
returns GUIDs of all leased items expiring at or before time 'now'. |
Time |
getFirstExpireTime()
returns lowest (soonest, or furthest in past) expire time of any leased item in this store. |
ItemBinding |
getItemBinding(GUID id)
get the ItemBinding for the given id iff it is maintained by this store, else null. |
java.util.Enumeration |
getRemoveResponsibleGUIDs(RemoveResponsible remove)
get GUIDs of data items in this store which are process bound to the given responsible ID as per the RemoveResponsible event (or not, according to inverse flag). |
boolean |
handleAdd(AddEvent add)
request that store handle the Add event, adding to itself accordingly. |
boolean |
handleDelete(DeleteEvent del)
request that store handles the given delete, which it must iff it is currently maintaining state for the corresponding data item. |
boolean |
handleUpdate(UpdateEvent update)
request that store handles the given update, which it must iff it is currently maintaining state for it. |
boolean |
holdsGUID(GUID id)
check if store is maintaining state for the given GUID. |
(package private) void |
removeParent(ItemBinding binding)
|
void |
terminate()
terminate - tidy up. |
void |
truncateExpireTimes(GUID responsible,
Time expire)
reduce lease on all leased items with given responsible id to expire at 'expire time'. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable idMap
protected java.util.Hashtable parentMultimap
protected java.util.Vector leasedItems
| Constructor Detail |
public MemoryDataStore()
| Method Detail |
void removeParent(ItemBinding binding)
public boolean handleAdd(AddEvent add)
handleAdd in interface IDataStoreadd - The AddEvent to be handled.
IDataStore.checkAddpublic boolean checkAdd(AddEvent add)
AddEvent.
checkAdd in interface IDataStoreadd - The AddEvent to be handled.
public boolean holdsGUID(GUID id)
GUID.
holdsGUID in interface IDataStoreid - The GUID of the data item in question.
public boolean handleUpdate(UpdateEvent update)
handleUpdate in interface IDataStoreupdate - the UpdateEvent to be handled.
public boolean handleDelete(DeleteEvent del)
handleDelete in interface IDataStorepublic java.util.Enumeration getRemoveResponsibleGUIDs(RemoveResponsible remove)
getRemoveResponsibleGUIDs in interface IDataStoreremove - the RemoveResponsible event.
public ItemBinding getItemBinding(GUID id)
getItemBinding in interface IDataStoreid - the id of the data item being requested.
ItemBinding for that item, else null iff
unknown to this store.public java.util.Enumeration getCandidateItemBindings(ItemData[] itemTemplates)
getCandidateItemBindings in interface IDataStoreitemTemplates - array of template data items, else
null or zero length list for a wild-card (any item).
public Time getFirstExpireTime()
getFirstExpireTime in interface IDataStorepublic java.util.Enumeration getExpiredGUIDs(Time now)
getExpiredGUIDs in interface IDataStorenow - The current time of the expiration clock.
GUIDs of now expiring data items
which the call might now reasonably issue delete events
for).
public void truncateExpireTimes(GUID responsible,
Time expire)
truncateExpireTimes in interface IDataStoreresponsible - required item responsible idexpire - the new expire time for matched items
public void terminate()
terminate in interface IDataStorepublic void flush()
flush in interface IDataStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||