@ComponentProfile(summary="Perform a branch based on the size of the message", tag="service,branching", branchSelector=true) public class SizeBasedBranchingService extends BranchingServiceImp
Branching Service
which sets the unique ID of the next Service
to apply based on the size of the
AdaptrisMessage
.
If the size of the message is exactly equal to the specified criteria then the smaller service id is selected.
In the adapter configuration file this class is aliased as size-based-branching-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
SizeBasedBranchingService()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getGreaterThanServiceId() |
long |
getSizeCriteriaBytes() |
java.lang.String |
getSmallerThanServiceId() |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setGreaterThanServiceId(java.lang.String serviceId) |
void |
setSizeCriteriaBytes(long l) |
void |
setSmallerThanServiceId(java.lang.String serviceId) |
isBranching
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public SizeBasedBranchingService()
size-criteria-bytes = 1024 * 1024 * 10 (10Mb)
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
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.String getGreaterThanServiceId()
public void setGreaterThanServiceId(java.lang.String serviceId)
serviceId
- the greaterThanServiceId to setpublic java.lang.String getSmallerThanServiceId()
public void setSmallerThanServiceId(java.lang.String serviceId)
serviceId
- the smallerThanServiceId to setpublic long getSizeCriteriaBytes()
public void setSizeCriteriaBytes(long l)
l
- the sizeCriteriaBytes to setpublic void prepare() throws CoreException
ComponentLifecycleExtension
CoreException