Class SizeBasedBranchingService

  • All Implemented Interfaces:
    AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator, Service, StateManagedComponent

    @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.

    • Constructor Detail

      • SizeBasedBranchingService

        public SizeBasedBranchingService()
        Creates a new instance.

        size-criteria-bytes = 1024 * 1024 * 10 (10Mb)

    • Method Detail

      • doService

        public void doService​(AdaptrisMessage msg)
                       throws ServiceException
        Description copied from interface: Service

        Apply the service to the message.

        Parameters:
        msg - the AdaptrisMessage to process
        Throws:
        ServiceException - wrapping any underlying Exceptions
      • getGreaterThanServiceId

        public java.lang.String getGreaterThanServiceId()
        Returns:
        the greaterThanServiceId
      • setGreaterThanServiceId

        public void setGreaterThanServiceId​(java.lang.String serviceId)
        Parameters:
        serviceId - the greaterThanServiceId to set
      • getSmallerThanServiceId

        public java.lang.String getSmallerThanServiceId()
        Returns:
        the smallerThanServiceId
      • setSmallerThanServiceId

        public void setSmallerThanServiceId​(java.lang.String serviceId)
        Parameters:
        serviceId - the smallerThanServiceId to set
      • getSizeCriteriaBytes

        public long getSizeCriteriaBytes()
        Returns:
        the sizeCriteriaBytes
      • setSizeCriteriaBytes

        public void setSizeCriteriaBytes​(long l)
        Parameters:
        l - the sizeCriteriaBytes to set