Class HeaderUtils

  • public abstract class HeaderUtils
    extends Object
    Utilities for handling HTTP and SOAP headers in Web Service interactions.
    Dmytro Rud
    • Method Detail

      • processIncomingHeaders

        public static void processIncomingHeaders​(Map<String,​Object> messageContext,
                                                  org.apache.camel.Message message)
      • processUserDefinedOutgoingHeaders

        public static void processUserDefinedOutgoingHeaders​(Map<String,​Object> messageContext,
                                                             org.apache.camel.Message message,
                                                             boolean isRequest)
      • getHeaders

        public static <T> T getHeaders​(Map<String,​Object> messageContext,
                                       String key,
                                       boolean useInputMessage,
                                       boolean needCreateWhenNotExist,
                                       Supplier<T> defaultValueFactory)
        Returns headers of the message represented by the given context.
        Type Parameters:
        T - type of headers' container.
        messageContext - Web Service message context.
        key - key under which the headers reside in the message context.
        useInputMessage - whether input message should the used.
        needCreateWhenNotExist - whether the headers' map should be created when it does not exist.
        defaultValueFactory - factory for producing default values.
        either the map of HTTP headers as found in the message context, or a newly created map when none found, or null when creation of a new map is not allowed.