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 EntryResource

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


public class EntryResource
extends java.lang.Object

REST resource representing a single cache entry.

Author:
as 2011.06.06

Field Summary
protected  NamedCache m_cache
          NamedCache which stores the referenced entry.
protected  java.lang.Class m_clzValue
          Class of the referenced entry's value.
protected  java.lang.Object m_oKey
          Referenced entry's key.
protected  MarshallerRegistry m_registry
          Marshaller registry to obtain marshallers from.

 

Constructor Summary
EntryResource(NamedCache cache, java.lang.Object oKey, java.lang.Class clzValue, MarshallerRegistry registry)
          Construct EntryResource.

 

Method Summary
 javax.ws.rs.core.Response delete()
          Remove the entry.
protected  boolean exists()
          Return true if the referenced entry exists in the cache.
 javax.ws.rs.core.Response get(com.tangosol.coherence.rest.util.PropertySet propertySet, javax.ws.rs.core.Request request)
          Return the entry value or a subset of its properties.
protected  java.lang.Object getValue()
          Get the entry value.
 javax.ws.rs.core.Response process(java.lang.String sProc, ProcessorRegistry registry)
          Invoke the specified processor against the entry's key.
 javax.ws.rs.core.Response put(javax.ws.rs.core.HttpHeaders headers, java.io.InputStream in)
          Update the entry value.
protected  javax.ws.rs.core.Response putInternal(java.lang.Object oValue)
          Update the cache entry.
protected  java.lang.Object remove()
          Remove entry from the cache.
protected  java.lang.Object setValue(java.lang.Object oValue)
          Set the entry value.

 

Field Detail

m_cache

protected final NamedCache m_cache
NamedCache which stores the referenced entry.

m_oKey

protected final java.lang.Object m_oKey
Referenced entry's key.

m_clzValue

protected final java.lang.Class m_clzValue
Class of the referenced entry's value.

m_registry

protected final MarshallerRegistry m_registry
Marshaller registry to obtain marshallers from.

Constructor Detail

EntryResource

public EntryResource(NamedCache cache,
                     java.lang.Object oKey,
                     java.lang.Class clzValue,
                     MarshallerRegistry registry)
Construct EntryResource.
Parameters:
cache - cache in which referenced entry is stored
oKey - referenced entry's key
clzValue - class of the referenced entry's value
registry - a registry to obtain marshallers from

Method Detail

get

public javax.ws.rs.core.Response get(com.tangosol.coherence.rest.util.PropertySet propertySet,
                                     @Context
                                     javax.ws.rs.core.Request request)
Return the entry value or a subset of its properties.
Parameters:
propertySet - properties to return (if null, value itself will be returned)
request - current HTTP request
Returns:
entry value or a subset of its properties

put

public javax.ws.rs.core.Response put(@Context
                                     javax.ws.rs.core.HttpHeaders headers,
                                     java.io.InputStream in)
Update the entry value.
Parameters:
in - a stream containing a JSON/XML/Binary representation of the new value
Returns:
response, as documented by the putInternal(java.lang.Object) method

delete

public javax.ws.rs.core.Response delete()
Remove the entry.
Returns:
response with a status of 200 (OK) if entry was removed successfully, or with a status of 404 (Not Found) if it wasn't present in the cache

process

public javax.ws.rs.core.Response process(java.lang.String sProc,
                                         ProcessorRegistry registry)
Invoke the specified processor against the entry's key.
Parameters:
sProc - name of the processor
registry - a processor registry that is used to map the given processor name to an EntryProcessor instance
Returns:
the result of the invocation as returned from the EntryProcessor

putInternal

protected javax.ws.rs.core.Response putInternal(java.lang.Object oValue)
Update the cache entry.
Parameters:
oValue - new entry value
Returns:
response with a status of 200 (OK) if the entry was updated successfully, or a status of 409 (Conflict) if the value class implements the Versionable interface and the version of the entry in the cache does not match the version of the entry in the request (in case of conflict, the current entry value will be returned in the body of the response as well)

getValue

protected java.lang.Object getValue()
Get the entry value.
Returns:
entry value, or void if the entry does not exist

setValue

protected java.lang.Object setValue(java.lang.Object oValue)
Set the entry value.
Parameters:
oValue - new value
Returns:
current entry value if there is a conflict, or null otherwise

remove

protected java.lang.Object remove()
Remove entry from the cache.
Returns:
entry value, or void if the entry does not exist

exists

protected boolean exists()
Return true if the referenced entry exists in the cache.
Returns:
true if the entry exists, false otherwise

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.