|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DistributedStateCache
Represents a Caching facility that allows each member of the group to use key-value pairs representing the key to their cachable state and the value being serializable objects representing a state to be cached. This allows a group member to cache some state so that all members can access this cache through a distributed datastructure. When new members arrive to the group, the underlying implementation could choose to ensure that they get the current cache of states to sync with the group. Underlying implementations could also choose to share the cache with all members of the group or pick specific replicas.
Method Summary | |
---|---|
void |
addToCache(String componentName,
String memberTokenId,
Serializable key,
Serializable state)
Caches a serializable object representing state to be cached. |
void |
addToLocalCache(String componentName,
String memberTokenId,
Serializable key,
Serializable state)
Locally caches a serializable object representing state to be cached. |
boolean |
contains(Object key)
returns true if the DSC contains an entry wherein the component key portion of the composite key in the DSC is the same as the key specified in the argument |
boolean |
contains(String componentName,
Object key)
returns true if the DSC contains an entry wherein the componentName and the componet key portion of the composite key in the DSC is the same as the parameters specified in the argument |
Map |
getAllCache()
returns the current cache state to caller. |
Map<GMSCacheable,Object> |
getFromCache(Object key)
returns a Map containing entries that are in the DSC where either the componentName or the memberToken or the key is the same as the key specified in the argument. |
Object |
getFromCache(String componentName,
String memberTokenId,
Serializable key)
retrieves the cache for the given composite key of component name, member token id and the key. |
Map<Serializable,Serializable> |
getFromCacheForPattern(String componentName,
String memberToken)
returns a Map containing key-value pairs matching entries that have keys with the given componentName and memberToken |
boolean |
isFirstSyncDone()
returns true if this cache has been sync'd with any other member For implementations that do not intend to have a synchronized cache on all members, this method can be a no-op |
void |
removeAll()
Empties the DistributedStateCache. |
void |
removeAllForMember(String memberToken)
Empties the DistributedStateCache entries pertaining to a particular member. |
void |
removeFromCache(String componentName,
String memberTokenId,
Serializable key)
removes an entry from the cache for the given composite key of the component name, member token id and the specific key. |
Method Detail |
---|
void addToCache(String componentName, String memberTokenId, Serializable key, Serializable state) throws GMSException
componentName
- - name of the GMS client component that is storing
this cachememberTokenId
- - member token Id of this memberkey
- - a serializable key that differentiates this cache from other
caches of the same component and member.state
- - a serializable object representing the cachable
state
GMSException
void addToLocalCache(String componentName, String memberTokenId, Serializable key, Serializable state)
componentName
- Name of GMS Client componentmemberTokenId
- Member's identitykey
- - an Objectstate
- - an ObjectObject getFromCache(String componentName, String memberTokenId, Serializable key) throws GMSException
componentName
- Name of GMS Client componentmemberTokenId
- Member's identitykey
- - a serializable key that differentiates this cache entry
from other cache entries.
GMSException
Map getAllCache()
void removeFromCache(String componentName, String memberTokenId, Serializable key) throws GMSException
componentName
- Name of GMS Client componentmemberTokenId
- Member's identitykey
- The component provided key
GMSException
Map<Serializable,Serializable> getFromCacheForPattern(String componentName, String memberToken)
componentName
- Name of GMS Client componentmemberToken
- Member's identity
Map<GMSCacheable,Object> getFromCache(Object key)
key
- The key here is one of MemberToken, ComponentName, or the
component-provided key itself
boolean contains(Object key)
key
- component-provided key
boolean contains(String componentName, Object key)
componentName
- Name of componentkey
- component-provided key
boolean isFirstSyncDone()
void removeAll()
void removeAllForMember(String memberToken)
memberToken
- member's identity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |