Class ValidateMetadataService

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

    @ComponentProfile(summary="Verify a message has all the required metadata keys",
                      tag="service,metadata")
    public class ValidateMetadataService
    extends ServiceImp
    Verify that a message has all the required metadata keys set.

    If any of the required keys does not have a values stored against it, a ServiceException is thrown.

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

    • Constructor Detail

      • ValidateMetadataService

        public ValidateMetadataService()

        Creates a new instance.

      • ValidateMetadataService

        public ValidateMetadataService​(java.util.List<java.lang.String> list)
    • 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
      • getRequiredKeys

        public java.util.List<java.lang.String> getRequiredKeys()

        Returns the List of keys which must be present and have non empty values.

        Returns:
        the List of keys which must be present and have non empty values
      • setRequiredKeys

        public void setRequiredKeys​(java.util.List<java.lang.String> l)

        Sets the List of keys which must be present and have non empty values.

        Parameters:
        l - the List of keys which must be present and have non empty values
      • addRequiredKey

        public void addRequiredKey​(java.lang.String key)

        Add a key to the List.

        Parameters:
        key - the key to add