Class SyntaxRoutingService

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

    @ComponentProfile(summary="Identify a message, and set a metadata key based on the identifier",
                      tag="service,routing")
    public class SyntaxRoutingService
    extends ServiceImp
    Extracts data from an AdaptrisMessage and stores it against metadata.

    This is somewhat similar to the available MetadataService, however it uses a list of SyntaxIdentifiers in order to determine the value that should be stored against a particular metadata key.

    Each SyntaxIdentifier is tried in turn, until true is returned by the method isThisSyntax(AdaptrisMessage). At this point, the value returned by getDestination() is stored against the configured key.

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

    • Constructor Detail

      • SyntaxRoutingService

        public SyntaxRoutingService()
    • Method Detail

      • addSyntaxIdentifier

        public void addSyntaxIdentifier​(SyntaxIdentifier ident)
        Add a SyntaxIdentifier to the configured list.
        Parameters:
        ident - the SyntaxIdentifier.
      • getSyntaxIdentifiers

        public java.util.List<SyntaxIdentifier> getSyntaxIdentifiers()
        Return the list of configured SyntaxIdentifers.
        Returns:
        the list.
      • setSyntaxIdentifiers

        public void setSyntaxIdentifiers​(java.util.List<SyntaxIdentifier> l)
        Sets the list of configured SyntaxIdentifers.
        Parameters:
        l - the list.
      • setRoutingKey

        public void setRoutingKey​(java.lang.String key)
        Set the metadata key that the value will be stored against.
        Parameters:
        key - the key.
      • getRoutingKey

        public java.lang.String getRoutingKey()
        Get the metadata key that the value will be stored against.
        Returns:
        the key.