Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.coherence.rest
Class CacheResource

java.lang.Object
  extended by com.tangosol.coherence.rest.CacheResource


public class CacheResource
extends java.lang.Object

RESTful wrapper around a Coherence NamedCache.

Author:
as 2011.06.03

Field Summary
protected  NamedCache m_cache
          NamedCache wrapped by this resource.
protected  java.lang.Class m_clzKey
          Key class for the entries stored in the wrapped cache.
protected  java.lang.Class m_clzValue
          Value class for the entries stored in the wrapped cache.
protected  int m_cMaxResults
          Size of the result set this resource is allowed to return.
protected  KeyConverter m_keyConverter
          Key converter.
protected  MarshallerRegistry m_marshallerRegistry
          Marshaller registry to obtain marshallers from.
protected  com.tangosol.coherence.rest.config.QueryConfig m_queryConfig
          Query configuration for this resource.
protected  QueryEngineRegistry m_queryEngineRegistry
          Query engine registry to obtain query engines from.

 

Constructor Summary
CacheResource(NamedCache cache, java.lang.Class clzKey, java.lang.Class clzValue, KeyConverter keyConverter, com.tangosol.coherence.rest.config.QueryConfig queryConfig, int cMaxResults, MarshallerRegistry marshallerRegistry, QueryEngineRegistry queryEngineRegistry)
          Construct a new CacheResource.
CacheResource(NamedCache cache, java.lang.Class clzKey, java.lang.Class clzValue, com.tangosol.coherence.rest.config.QueryConfig queryConfig, int cMaxResults, MarshallerRegistry marshallerRegistry, QueryEngineRegistry queryEngineRegistry)
          Construct a new CacheResource.

 

Method Summary
 javax.ws.rs.core.Response aggregate(java.lang.String sAggr, java.lang.String sQuery, AggregatorRegistry registry)
          Perform an aggregating operation against the entries that satisfy the specified criteria.
 javax.ws.rs.core.Response getCacheEntries(int nStart, int cResults, java.lang.String sSort, com.tangosol.coherence.rest.util.PropertySet propertySet, java.lang.String sQuery)
          Return the cache entries values (or a subset of their properties) that satisfies the specified criteria.
 java.lang.Object getEntryOrQueryResource(java.lang.String sKey)
          Return a REST sub-resource representing either a configured named query or a single cache entry.
 EntrySetResource getEntrySetResource(java.lang.String sKeys)
          Return a REST sub-resource representing a set of cache entries.
 javax.ws.rs.core.Response getKeys(java.lang.String sQuery)
          Return the keys of cache entries that satisfy the given query criteria.
protected  java.util.Set keys(java.lang.String sQuery)
          Returns a set of keys that satisfy the criteria expressed by the query.
 javax.ws.rs.core.Response process(java.lang.String sProc, java.lang.String sQuery, ProcessorRegistry registry)
          Invoke the specified processor against the entries that satisfy the specified criteria.

 

Field Detail

m_cache

protected final NamedCache m_cache
NamedCache wrapped by this resource.

m_clzKey

protected final java.lang.Class m_clzKey
Key class for the entries stored in the wrapped cache.

m_clzValue

protected final java.lang.Class m_clzValue
Value class for the entries stored in the wrapped cache.

m_keyConverter

protected final KeyConverter m_keyConverter
Key converter.

m_cMaxResults

protected final int m_cMaxResults
Size of the result set this resource is allowed to return.

m_marshallerRegistry

protected final MarshallerRegistry m_marshallerRegistry
Marshaller registry to obtain marshallers from.

m_queryConfig

protected final com.tangosol.coherence.rest.config.QueryConfig m_queryConfig
Query configuration for this resource.

m_queryEngineRegistry

protected final QueryEngineRegistry m_queryEngineRegistry
Query engine registry to obtain query engines from.

Constructor Detail

CacheResource

public CacheResource(NamedCache cache,
                     java.lang.Class clzKey,
                     java.lang.Class clzValue,
                     com.tangosol.coherence.rest.config.QueryConfig queryConfig,
                     int cMaxResults,
                     MarshallerRegistry marshallerRegistry,
                     QueryEngineRegistry queryEngineRegistry)
Construct a new CacheResource.
Parameters:
cache - cache to create a resource for
clzKey - key class of the cached entries
clzValue - value class of the cached entries
queryConfig - query configuration for this resource
cMaxResults - max size of result set for this resource
marshallerRegistry - marshaller registry to use
queryEngineRegistry - query engine registry to use

CacheResource

public CacheResource(NamedCache cache,
                     java.lang.Class clzKey,
                     java.lang.Class clzValue,
                     KeyConverter keyConverter,
                     com.tangosol.coherence.rest.config.QueryConfig queryConfig,
                     int cMaxResults,
                     MarshallerRegistry marshallerRegistry,
                     QueryEngineRegistry queryEngineRegistry)
Construct a new CacheResource.
Parameters:
cache - cache to create a resource for
clzKey - key class of the cached entries
clzValue - value class of the cached entries
keyConverter - key converter to use
cMaxResults - max ize of result set for this resource
queryConfig - queries configured for this resource
marshallerRegistry - marshaller registry to use
queryEngineRegistry - query engine registry to use

Method Detail

getCacheEntries

public javax.ws.rs.core.Response getCacheEntries(int nStart,
                                                 int cResults,
                                                 java.lang.String sSort,
                                                 com.tangosol.coherence.rest.util.PropertySet propertySet,
                                                 java.lang.String sQuery)
Return the cache entries values (or a subset of their properties) that satisfies the specified criteria.
Parameters:
nStart - starting index of result set to be returned
cResults - size of result set to be returned (page size)
sSort - a string expression that represents ordering
propertySet - properties to return (if null, values will be returned)
sQuery - where predicate of Coherence Query Language to filter cache entries. If null, all cache values will be returned
Returns:
the cache entries values (or a subset of their properties) that satisfies specified criteria

aggregate

public javax.ws.rs.core.Response aggregate(java.lang.String sAggr,
                                           java.lang.String sQuery,
                                           AggregatorRegistry registry)
Perform an aggregating operation against the entries that satisfy the specified criteria. If the query string is empty all cache entries are aggregated.
Parameters:
sAggr - name of the aggregator
sQuery - where predicate of Coherence Query Language to filter cache entries (optional)
registry - aggregator registry that is used to map the given aggregator name to an EntryAggregator instance
Returns:
the result of the aggregation

process

public javax.ws.rs.core.Response process(java.lang.String sProc,
                                         java.lang.String sQuery,
                                         ProcessorRegistry registry)
Invoke the specified processor against the entries that satisfy the specified criteria. If the query string is empty all cache entries are processed.
Parameters:
sProc - the name of the processor
sQuery - where predicate of Coherence Query Language to filter cache entries (optional)
registry - processor registry that is used to map the given processor name to an the EntryProcessor instance
Returns:
a Map containing the results of invoking the EntryProcessor against the entries that are selected by the given query

getKeys

public javax.ws.rs.core.Response getKeys(java.lang.String sQuery)
Return the keys of cache entries that satisfy the given query criteria.
Parameters:
sQuery - query expression
Returns:
the keys of cache entries that satisfy the given query criteria

getEntryOrQueryResource

public java.lang.Object getEntryOrQueryResource(java.lang.String sKey)
Return a REST sub-resource representing either a configured named query or a single cache entry.
Parameters:
sKey - name of the configured query or referenced entry's key
Returns:
REST resource representing either a configured named query or a single cache entry

getEntrySetResource

public EntrySetResource getEntrySetResource(java.lang.String sKeys)
Return a REST sub-resource representing a set of cache entries.
Parameters:
sKeys - keys of the referenced entries
Returns:
REST sub-resource representing a set of cache entries

keys

protected java.util.Set keys(java.lang.String sQuery)
Returns a set of keys that satisfy the criteria expressed by the query.
Parameters:
sQuery - query used to filter cache entries
Returns:
a set of keys for entries that satisfy the specified criteria

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.