Class DuplicateMetadataValueService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.duplicate.DuplicateMetadataValueService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
CheckMetadataValueService
,StoreMetadataValueService
public abstract class DuplicateMetadataValueService extends ServiceImp
Abstract super-class of the two
Service
s which handle duplicate message checking.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>
previousValuesStore
protected java.io.File
store
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description DuplicateMetadataValueService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
java.lang.String
getMetadataKey()
Returns the metadata key whose value should be checked.java.lang.String
getStoreFileUrl()
Returns the persistent store for previously received values in the form of a file URL.protected void
initService()
protected void
loadPreviouslyReceivedValues()
void
prepare()
Prepare for initialisation.void
setMetadataKey(java.lang.String s)
Sets the metadata key whose value should be checked.void
setStoreFileUrl(java.lang.String s)
Sets the persistent store for previously received values in the form of a file URL.-
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
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
loadPreviouslyReceivedValues
protected void loadPreviouslyReceivedValues() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getMetadataKey
public java.lang.String getMetadataKey()
Returns the metadata key whose value should be checked.
- Returns:
- metadataKey the metadata key whose value should be checked
-
setMetadataKey
public void setMetadataKey(java.lang.String s)
Sets the metadata key whose value should be checked. May not be null.
- Parameters:
s
- the metadata key whose value should be checked
-
getStoreFileUrl
public java.lang.String getStoreFileUrl()
Returns the persistent store for previously received values in the form of a file URL. E.g.
file:////Users/adaptris/store.dat/
.- Returns:
- the persistent store for previously received values in the form of a file URL
-
setStoreFileUrl
public void setStoreFileUrl(java.lang.String s)
Sets the persistent store for previously received values in the form of a file URL. E.g.
file:////Users/adaptris/store.dat
. May not be null or empty.- Parameters:
s
- the persistent store for previously received values in the form of a file URL
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
-