Class CheckMetadataValueService

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

    @ComponentProfile(summary="Perform a branch based on whether a metadata value has already been processed",
                      tag="service,duplicate")
    public class CheckMetadataValueService
    extends DuplicateMetadataValueService

    Branching Service implementation which checks the value stored against a configured metadata key against a list of previously received values. If the value to check is null or empty, a ServiceException is thrown. If the value has previously been received, the configured nextServiceIdIfDuplicate is set on the message. If the value is not contained in the store of previous values, nextServiceIdIfUnique is set.

    In the adapter configuration file this class is aliased as check-metadata-value-service which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • CheckMetadataValueService

        public CheckMetadataValueService()

        Creates a new instance.

    • 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
      • getNextServiceIdIfDuplicate

        public java.lang.String getNextServiceIdIfDuplicate()

        Returns the ID of the next Service to apply if the metadata exists if the store of previous values.

        Returns:
        the ID of the next Service to apply if the metadata exists if the store of previous values
      • setNextServiceIdIfDuplicate

        public void setNextServiceIdIfDuplicate​(java.lang.String s)

        Sets the ID of the next Service to apply if the metadata exists if the store of previous values. May not be null or empty.

        Parameters:
        s - the ID of the next Service to apply if the metadata exists if the store of previous values
      • getNextServiceIdIfUnique

        public java.lang.String getNextServiceIdIfUnique()

        Returns the ID of the next Service to apply if the metadata does not exist if the store of previous values.

        Returns:
        the ID of the next Service to apply if the metadata does not exist if the store of previous values
      • setNextServiceIdIfUnique

        public void setNextServiceIdIfUnique​(java.lang.String s)

        Sets the ID of the next Service to apply if the metadata does not exist if the store of previous values. May not be null or empty.

        Parameters:
        s - the ID of the next Service to apply if the metadata does not exist if the store of previous values