@ComponentProfile(summary="Store metadata values ready for checking by check-metadata-value-service", tag="service,duplicate") public class StoreMetadataValueService extends DuplicateMetadataValueService
Service
implementation which stores the value held against a configured metadata key in a persistent list, generally
for use by CheckMetadataValueService
. If the configured key returns null or empty, a ServiceException
is thrown. The underlying store may contain duplicate values.
The store of previous values has a configurable maximum size. After a new value is added, if the store exceeds the maximum size the oldest value is removed. The store is then persisted.
Storage will be spun off into a separate interface and imps if required.
In the adapter configuration file this class is aliased as store-metadata-value-service which is the preferred alternative to the fully qualified classname when building your configuration.
previousValuesStore, store
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
StoreMetadataValueService()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
int |
getNumberOfPreviousValuesToStore()
Returns the number of previous values to keep.
|
void |
setNumberOfPreviousValuesToStore(int i)
Sets the number of previous values to keep.
|
closeService, getMetadataKey, getStoreFileUrl, initService, loadPreviouslyReceivedValues, prepare, setMetadataKey, setStoreFileUrl
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public StoreMetadataValueService()
Creates a new instance. Default history size is 1000.
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
s#doService(com.adaptris.core.AdaptrisMessage)
public int getNumberOfPreviousValuesToStore()
Returns the number of previous values to keep.
public void setNumberOfPreviousValuesToStore(int i)
Sets the number of previous values to keep. Must be greater than 0.
i
- the number of previous values to keep