Class FormDataToMetadata

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

    @ComponentProfile(summary="Turn a application/www-url-form-encoded payload into metadata.",
                      tag="service,metadata,http,https",
                      since="3.9.0")
    public class FormDataToMetadata
    extends ServiceImp
    Takes a application/x-www-url-form-encoded payload and extracts it as metadata.

    If the client is sending data to the adapter, it is possible that the client will send data as though it were a standard Html Form post. In situations like that, then the payload is a number of URLEncoded key value pairs. This service can be used to convert all the Request parameters into metadata.

    contentTypeKey will be checked to see if the content-type is in fact application/x-www-url-form-encoded; if it is, then the payload is parsed as into metadata, note that the payload is always unchanged.

    In the adapter configuration file this class is aliased as www-url-form-encoded-payload-to-metadata which is the preferred alternative to the fully qualified classname when building your configuration.

    • Field Detail

      • DEFAULT_CONTENT_TYPE_KEY

        public static final java.lang.String DEFAULT_CONTENT_TYPE_KEY
        See Also:
        Constant Field Values
      • DEFAULT_CONTENT_TYPE_VALUE

        public static final java.lang.String DEFAULT_CONTENT_TYPE_VALUE
        See Also:
        Constant Field Values
    • Constructor Detail

      • FormDataToMetadata

        public FormDataToMetadata()
    • 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
      • getContentTypeKey

        public java.lang.String getContentTypeKey()
      • setContentTypeKey

        public void setContentTypeKey​(java.lang.String s)
        Set the metadata key for finding out the content-type.
        Parameters:
        s - the metadata key.
      • getMetadataPrefix

        public java.lang.String getMetadataPrefix()
      • setMetadataPrefix

        public void setMetadataPrefix​(java.lang.String metadataPrefix)
      • withMetadataPrefix

        public FormDataToMetadata withMetadataPrefix​(java.lang.String s)
      • withContentTypeKey

        public FormDataToMetadata withContentTypeKey​(java.lang.String s)