Class StoreMetadataValueService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.duplicate.DuplicateMetadataValueService
-
- com.adaptris.core.services.duplicate.StoreMetadataValueService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@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 byCheckMetadataValueService
. If the configured key returns null or empty, aServiceException
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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.duplicate.DuplicateMetadataValueService
previousValuesStore, store
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description StoreMetadataValueService()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class com.adaptris.core.services.duplicate.DuplicateMetadataValueService
closeService, getMetadataKey, getStoreFileUrl, initService, loadPreviouslyReceivedValues, prepare, setMetadataKey, setStoreFileUrl
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s- See Also:
#doService(com.adaptris.core.AdaptrisMessage)
-
getNumberOfPreviousValuesToStore
public int getNumberOfPreviousValuesToStore()
Returns the number of previous values to keep.
- Returns:
- the number of previous values to keep
-
setNumberOfPreviousValuesToStore
public void setNumberOfPreviousValuesToStore(int i)
Sets the number of previous values to keep. Must be greater than 0.
- Parameters:
i
- the number of previous values to keep
-
-