Class MAPCodec

java.lang.Object
org.apache.cxf.phase.AbstractPhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
org.apache.cxf.ws.addressing.soap.MAPCodec
All Implemented Interfaces:
org.apache.cxf.binding.soap.interceptor.SoapInterceptor, org.apache.cxf.interceptor.Interceptor<org.apache.cxf.binding.soap.SoapMessage>, org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

public class MAPCodec extends org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
SOAP interceptor responsible for {en|de}coding the Message Addressing Properties for {outgo|incom}ing messages.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MAPCodec
     
    protected final Map<String,org.apache.cxf.message.Exchange>
    REVISIT: map usage that the *same* interceptor instance is used in all chains.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    decodeAsNative(String encodedAs, Class<T> clz, Element headerElement, jakarta.xml.bind.Unmarshaller unmarshaller)
    Decodes a MAP from a exposed version.
    protected <T> T
    decodeMAP(Class<T> clz, Element headerElement, jakarta.xml.bind.Unmarshaller unmarshaller)
    Decodes a MAP from a SOAP header.
    protected <T> void
    encodeMAP(org.apache.cxf.binding.soap.SoapMessage message, T value, QName qname, Class<T> clz, jakarta.xml.bind.JAXBContext ctx, boolean mustUnderstand)
    Encodes an MAP as a SOAP header.
     
    static MAPCodec
    getInstance(org.apache.cxf.Bus bus)
     
    Map<String,org.apache.cxf.message.Exchange>
     
     
    void
    handleFault(org.apache.cxf.binding.soap.SoapMessage message)
    Invoked when unwinding normal interceptor chain when a fault occurred.
    void
    handleMessage(org.apache.cxf.binding.soap.SoapMessage message)
    Invoked for normal processing of inbound and outbound messages.
    protected void
     
    org.apache.cxf.ws.addressing.AddressingProperties
    unmarshalMAPs(org.apache.cxf.binding.soap.SoapMessage message)
    Decode the MAPs from protocol-specific headers.

    Methods inherited from class org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor

    getFaultCodePrefix, getRoles, prepareStackTrace

    Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor

    addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, isGET, isRequestor, setAfter, setBefore

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final MAPCodec INSTANCE
    • uncorrelatedExchanges

      protected final Map<String,org.apache.cxf.message.Exchange> uncorrelatedExchanges
      REVISIT: map usage that the *same* interceptor instance is used in all chains.
  • Constructor Details

    • MAPCodec

      public MAPCodec()
      Constructor.
  • Method Details

    • getInstance

      public static MAPCodec getInstance(org.apache.cxf.Bus bus)
    • getUncorrelatedExchanges

      public Map<String,org.apache.cxf.message.Exchange> getUncorrelatedExchanges()
    • getUnderstoodHeaders

      public Set<QName> getUnderstoodHeaders()
      Specified by:
      getUnderstoodHeaders in interface org.apache.cxf.binding.soap.interceptor.SoapInterceptor
      Overrides:
      getUnderstoodHeaders in class org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
      Returns:
      the set of SOAP headers understood by this handler
    • handleMessage

      public void handleMessage(org.apache.cxf.binding.soap.SoapMessage message)
      Invoked for normal processing of inbound and outbound messages.
      Parameters:
      message - the messsage
    • handleFault

      public void handleFault(org.apache.cxf.binding.soap.SoapMessage message)
      Invoked when unwinding normal interceptor chain when a fault occurred.
      Specified by:
      handleFault in interface org.apache.cxf.interceptor.Interceptor<org.apache.cxf.binding.soap.SoapMessage>
      Overrides:
      handleFault in class org.apache.cxf.phase.AbstractPhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
      Parameters:
      message - the messsage message
    • unmarshalMAPs

      public org.apache.cxf.ws.addressing.AddressingProperties unmarshalMAPs(org.apache.cxf.binding.soap.SoapMessage message)
      Decode the MAPs from protocol-specific headers.
      Parameters:
      message - the SOAP message
      Returns:
      the decoded MAPs
      Throws:
      SOAPFaultException - if decoded MAPs are invalid
    • decodeAsNative

      public <T> T decodeAsNative(String encodedAs, Class<T> clz, Element headerElement, jakarta.xml.bind.Unmarshaller unmarshaller) throws jakarta.xml.bind.JAXBException
      Decodes a MAP from a exposed version.
      Parameters:
      encodedAs - specifies the encoded version
      clz - the class
      headerElement - the SOAP header element
      unmarshaller - the JAXB unmarshaller to use
      Returns:
      the decoded value
      Throws:
      jakarta.xml.bind.JAXBException
    • encodeMAP

      protected <T> void encodeMAP(org.apache.cxf.binding.soap.SoapMessage message, T value, QName qname, Class<T> clz, jakarta.xml.bind.JAXBContext ctx, boolean mustUnderstand) throws jakarta.xml.bind.JAXBException
      Encodes an MAP as a SOAP header.
      Parameters:
      message - the message to store the headers on
      value - the value to encode
      qname - the QName for the header
      clz - the class
      ctx - the JAXBContent
      mustUnderstand -
      Throws:
      jakarta.xml.bind.JAXBException
    • decodeMAP

      protected <T> T decodeMAP(Class<T> clz, Element headerElement, jakarta.xml.bind.Unmarshaller unmarshaller) throws jakarta.xml.bind.JAXBException
      Decodes a MAP from a SOAP header.
      Parameters:
      clz - the class
      headerElement - the SOAP header element
      unmarshaller - the JAXB unmarshaller to use
      Returns:
      the decoded value
      Throws:
      jakarta.xml.bind.JAXBException
    • getHeaderFactory

      protected MAPCodec.HeaderFactory getHeaderFactory()
    • setHeaderFactory

      protected void setHeaderFactory(MAPCodec.HeaderFactory factory)