Class MapMetadataService

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

    @ComponentProfile(summary="Change a metadata value based on a regular expression match",
                      tag="service,metadata")
    public class MapMetadataService
    extends MetadataServiceImpl
    Changes the value of a specific metadata key based on a regular expression match of the value associated with the key.

    It supports the special syntax of {n} as the replacement value. This indicates that the corresponding match group should be used as the replacement value.

    There are similiarities between this service and ReplaceMetadataValue . This service could be easily replaced with multiple instances of ReplaceMetadataValue and you should consider using that if you have to use match groups.

    See Also:
    Pattern

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

    • Constructor Detail

      • MapMetadataService

        public MapMetadataService()
    • Method Detail

      • getMetadataKeyMap

        public KeyValuePairList getMetadataKeyMap()

        Returns a KeyValuePairList in which the key is the regular expression to match the metadata value against, and the value is the replacement value.

        It supports the special syntax of {n} which indicates that the corresponding match group should be used as the replacement value

        Returns:
        a KeyValuePairList
      • setMetadataKeyMap

        public void setMetadataKeyMap​(KeyValuePairList m)

        Sets a KeyValuePairList in which the key is the regular expression to match the metadata value against, and the value is the replacement value (the replacement value may be an expression a-la %message{metadataKey}.

        Parameters:
        m - a KeyValuePairList
      • getMetadataKey

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

        public void setMetadataKey​(java.lang.String s)
        Parameters:
        s - the metadataKey to set