Interface SendDynamicAware

  • All Superinterfaces:
    AutoCloseable, CamelContextAware, Service

    public interface SendDynamicAware
    extends Service, CamelContextAware
    Used for components that can optimise the usage of org.apache.camel.processor.SendDynamicProcessor (toD) to reuse a static Endpoint and Producer that supports using headers to provide the dynamic parts. For example many of the HTTP components supports this.
    • Method Detail

      • setScheme

        void setScheme​(String scheme)
        Sets the component name.
        Parameters:
        scheme - name of the component
      • getScheme

        String getScheme()
        Gets the component name
      • resolveRawParameterValues

        default boolean resolveRawParameterValues()
        Whether to traverses the given parameters, and resolve any parameter values which uses the RAW token syntax: key=RAW(value). And then remove the RAW tokens, and replace the content of the value, with just the value.
      • prepare

        SendDynamicAware.DynamicAwareEntry prepare​(Exchange exchange,
                                                   String uri,
                                                   String originalUri)
                                            throws Exception
        Prepares for using optimised dynamic to by parsing the uri and returning an entry of details that are used for creating the pre and post processors, and the static uri.
        Parameters:
        exchange - the exchange
        uri - the resolved uri which is intended to be used
        originalUri - the original uri of the endpoint before any dynamic evaluation
        Returns:
        prepared information about the dynamic endpoint to use
        Throws:
        Exception - is thrown if error parsing the uri
      • resolveStaticUri

        String resolveStaticUri​(Exchange exchange,
                                SendDynamicAware.DynamicAwareEntry entry)
                         throws Exception
        Resolves the static part of the uri that are used for creating a single Endpoint and Producer that will be reused for processing the optimised toD.
        Parameters:
        exchange - the exchange
        entry - prepared information about the dynamic endpoint to use
        Returns:
        the static uri, or null to not let toD use this optimisation.
        Throws:
        Exception - is thrown if error resolving the static uri.
      • createPreProcessor

        Processor createPreProcessor​(Exchange exchange,
                                     SendDynamicAware.DynamicAwareEntry entry)
                              throws Exception
        Creates the pre Processor that will prepare the Exchange with dynamic details from the given recipient.
        Parameters:
        exchange - the exchange
        entry - prepared information about the dynamic endpoint to use
        Returns:
        the processor, or null to not let toD use this optimisation.
        Throws:
        Exception - is thrown if error creating the pre processor.
      • createPostProcessor

        Processor createPostProcessor​(Exchange exchange,
                                      SendDynamicAware.DynamicAwareEntry entry)
                               throws Exception
        Creates an optional post Processor that will be executed afterwards when the message has been sent dynamic.
        Parameters:
        exchange - the exchange
        entry - prepared information about the dynamic endpoint to use
        Returns:
        the post processor, or null if no post processor is needed.
        Throws:
        Exception - is thrown if error creating the post processor.