IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.continuousquery
Interface ContinuousQueryCache<KeyType,ValueType>

Type Parameters:
KeyType - Type of the key object for the map being queried
ValueType - Type of the value object for the map being queried

public interface ContinuousQueryCache<KeyType,ValueType>

A Continuous Query Cache contains the keys and optionally the values that match a defined continuous query. The contents of this cache arrive asynchronously from the grid for which the query is defined. If the query is defined such that only the keys are stored in the continuous query cache then all operations that return a value will return null.

Since:
8.6

Method Summary
 boolean containsKey(KeyType key)
          Returns true if the cache contains the given key.
 boolean containsValue(ValueType value)
          Returns true if the cache contains the given value.
 ValueType get(KeyType key)
          Returns the value for the given key.
 List<SessionHandle> getSessionHandles(KeyType key)
          Returns SessionHandle objects that can be used to retrieve all query matches associated with this key.
 boolean includesValues()
          Returns true if this cache includes the values associated with the keys that have matched the query.
 Set<KeyType> keySnapshot()
          Returns a Set view of a snapshot of the keys contained in the cache.
 int size()
          Return the number of keys in the cache.
 

Method Detail

keySnapshot

Set<KeyType> keySnapshot()
Returns a Set view of a snapshot of the keys contained in the cache.

Returns:
a set view of the keys in the cache.

size

int size()
Return the number of keys in the cache.

Returns:
the number of keys in the cache.

get

ValueType get(KeyType key)
Returns the value for the given key.

Parameters:
key - - the key whose associated value is to be returned
Returns:
the value in the cache for the specified key or null if either the cache does not contain this key or if the cache is configured to not contain values.

getSessionHandles

List<SessionHandle> getSessionHandles(KeyType key)
Returns SessionHandle objects that can be used to retrieve all query matches associated with this key.

Parameters:
key - - the key for which SessionHandles will be returned
Returns:
a List of SessionHandles, one for each instance of this key in the grid.

containsKey

boolean containsKey(KeyType key)
Returns true if the cache contains the given key.

Parameters:
key - - key to check for
Returns:
true if the specified key is in the cache at the time of the request.

containsValue

boolean containsValue(ValueType value)
Returns true if the cache contains the given value.

Parameters:
value - - value to check for
Returns:
true if the specified object is in the cache at the time of the request.

includesValues

boolean includesValues()
Returns true if this cache includes the values associated with the keys that have matched the query. If true, containsValue(Object) and get(Object) will return usable values, otherwise they will return null.

Returns:
true if this query cache contains values in addition to keys.
See Also:
ContinuousQueryManager.defineContinuousQuery(java.lang.String, com.ibm.websphere.objectgrid.continuousquery.ContinuousQueryFilter, boolean, boolean, boolean, java.util.Collection>, boolean, boolean, java.lang.Integer...)

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.