Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-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  KeyConverter m_keyConverter
          Key converter.
protected  MarshallerRegistry m_registry
          Marshaller registry to obtain marshallers from.

 

Constructor Summary
CacheResource(NamedCache cache, java.lang.Class clzKey, java.lang.Class clzValue, KeyConverter keyConverter, MarshallerRegistry registry)
          Construct a new CacheResource.
CacheResource(NamedCache cache, java.lang.Class clzKey, java.lang.Class clzValue, MarshallerRegistry registry)
          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 nCount, java.lang.String sSort, PropertySet propertySet, java.lang.String sQuery)
          Return the cache entries values (or a subset of their properties) that satisfies the specified criteria.
 EntryResource getEntryResource(java.lang.String sKey)
          Return a REST sub-resource representing 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 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_registry

protected final MarshallerRegistry m_registry
Marshaller registry to obtain marshallers from.

Constructor Detail

CacheResource

public CacheResource(NamedCache cache,
                     java.lang.Class clzKey,
                     java.lang.Class clzValue,
                     MarshallerRegistry registry)
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
registry - marshaller registry to use

CacheResource

public CacheResource(NamedCache cache,
                     java.lang.Class clzKey,
                     java.lang.Class clzValue,
                     KeyConverter keyConverter,
                     MarshallerRegistry registry)
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
registry - marshaller registry to use

Method Detail

getCacheEntries

public javax.ws.rs.core.Response getCacheEntries(int nStart,
                                                 int nCount,
                                                 java.lang.String sSort,
                                                 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
nCount - 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,
                                           
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,
                                         
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

getEntryResource

public EntryResource getEntryResource(java.lang.String sKey)
Return a REST sub-resource representing a single cache entry.
Parameters:
sKey - referenced entry's key
Returns:
REST resource representing 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

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


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