Class AddFormattedMetadataService

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

    @ComponentProfile(summary="Add a formatted metadata item to a Message",
                      tag="service,metadata")
    public class AddFormattedMetadataService
    extends ServiceImp
    Add a formatted metadata item to a Message.

    Allows you to add a new metadata key using String.format() as the syntax.

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

    • Constructor Detail

      • AddFormattedMetadataService

        public AddFormattedMetadataService()
    • 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
      • getFormatString

        public java.lang.String getFormatString()
        Returns:
        the formatString
      • setFormatString

        public void setFormatString​(java.lang.String formatString)
        Set the format string that complies with String.format(String, Object...).
        Parameters:
        formatString - the formatString to set
      • getArgumentMetadataKeys

        public java.util.List<java.lang.String> getArgumentMetadataKeys()
        Returns:
        the argumentMetadataKeys
      • setArgumentMetadataKeys

        public void setArgumentMetadataKeys​(java.util.List<java.lang.String> l)
        Parameters:
        l - the argumentMetadataKeys to set
      • getMetadataKey

        public java.lang.String getMetadataKey()
        Returns:
        the metadatakey
      • setMetadataKey

        public void setMetadataKey​(java.lang.String metadatakey)
        Parameters:
        metadatakey - the metadatakey to set
      • getElementFormatter

        public ElementFormatter getElementFormatter()
        Get the element formatter.
        Returns:
        The element formatter.
      • setElementFormatter

        public void setElementFormatter​(ElementFormatter elementFormatter)
        Set the element formatter.
        Parameters:
        elementFormatter - The element formatter.