public class EntryResource extends Object
Modifier and Type | Field and Description |
---|---|
protected NamedCache |
m_cache
NamedCache which stores the referenced entry.
|
protected Class |
m_clzValue
Class of the referenced entry's value.
|
protected MarshallerRegistry |
m_marshallerRegistry
Marshaller registry to obtain marshallers from.
|
protected Object |
m_oKey
Referenced entry's key.
|
protected ProcessorRegistry |
m_processorRegistry
a processor registry that is used to map the given processor name to
an EntryProcessor instance.
|
Constructor and Description |
---|
EntryResource(NamedCache cache,
Object oKey,
Class clzValue)
Construct EntryResource.
|
Modifier and Type | Method and Description |
---|---|
MapEventOutput |
addListener(boolean fLite)
Register SSE event listener for this entry.
|
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(PropertySet propertySet,
javax.ws.rs.core.Request request)
Return the entry value or a subset of its properties.
|
protected Object |
getValue()
Get the entry value.
|
javax.ws.rs.core.Response |
process(String sProc)
Invoke the specified processor against the entry's key.
|
javax.ws.rs.core.Response |
put(javax.ws.rs.core.HttpHeaders headers,
InputStream in)
Update the entry value.
|
protected javax.ws.rs.core.Response |
putInternal(Object oValue)
Update the cache entry.
|
protected Object |
remove()
Remove entry from the cache.
|
protected Object |
setValue(Object oValue)
Set the entry value.
|
protected NamedCache m_cache
protected Object m_oKey
protected Class m_clzValue
@Inject protected MarshallerRegistry m_marshallerRegistry
@Inject protected ProcessorRegistry m_processorRegistry
public EntryResource(NamedCache cache, Object oKey, Class clzValue)
cache
- cache in which referenced entry is storedoKey
- referenced entry's keyclzValue
- class of the referenced entry's value@GET public javax.ws.rs.core.Response get(@MatrixParam(value="p") PropertySet propertySet, @Context javax.ws.rs.core.Request request)
propertySet
- properties to return (if null, value itself will
be returned)request
- current HTTP request@PUT public javax.ws.rs.core.Response put(@Context javax.ws.rs.core.HttpHeaders headers, InputStream in)
headers
- a mutable map of the HTTP message headers.in
- a stream containing a JSON/XML/Binary representation of the new valueVersionable
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)@DELETE public javax.ws.rs.core.Response delete()
@POST @Path(value="{proc: \\s*(\\w(?:\\w|-)*)\\((.*)\\)}") @Produces(value={"application/json","application/xml","text/plain"}) public javax.ws.rs.core.Response process(@PathParam(value="proc") String sProc)
sProc
- name of the processor@GET @Produces(value="text/event-stream") public MapEventOutput addListener(@QueryParam(value="lite") boolean fLite)
fLite
- flag specifying whether to register for lite or full eventsprotected javax.ws.rs.core.Response putInternal(Object oValue)
oValue
- new entry valueVersionable
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)protected Object getValue()
protected Object setValue(Object oValue)
oValue
- new valueprotected Object remove()
protected boolean exists()