@ComponentProfile(summary="Retrieve a value from the configured cache", since="3.9.2", tag="service,cache", recommended=CacheConnection.class) public class GetValueFromCache extends SingleKeyValueCacheImpl
RetrieveFromCacheService
that doesn't use CacheEntryEvaluators
.
Most of the time, you only want to retrieve a single item to the cache rather than a list of
items; this simplified service allows you to do just that. It does not have a list of entries
that are evaluated, you simply specify a key and a CacheValueTranslator
which is used to
insert the value from the cache into the current message.
In the adapter configuration file this class is aliased as get-single-value-from-cache which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
GetValueFromCache() |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.Boolean |
getExceptionIfNotFound() |
void |
setExceptionIfNotFound(java.lang.Boolean b)
Whether or not to throw an exception if the key is not in the cache.
|
GetValueFromCache |
withExceptionIfNotFound(java.lang.Boolean b) |
getValueTranslator, prepare, setValueTranslator, withValueTranslator
getKey, setKey, withKey
closeService, getConnection, initService, retrieveCache, setConnection, start, stop, withConnection
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic java.lang.Boolean getExceptionIfNotFound()
public void setExceptionIfNotFound(java.lang.Boolean b)
b
- default is truepublic GetValueFromCache withExceptionIfNotFound(java.lang.Boolean b)