Class MessageImpl

  • All Implemented Interfaces:
    Message, XMLPart

    public class MessageImpl
    extends Object
    implements Message
    MessageImpl A Message is an XML part + Attachments. Most of the implementation delegates to the XMLPart implementation. NOTE: For XML/HTTP (REST), a SOAP 1.1. Envelope is built and the rest payload is placed in the body. This purposely mimics the Axis2 implementation.
    • Method Detail

      • getAttachmentID

        public String getAttachmentID​(int index)
        Get the indicated (non-soap part) attachment id
        Specified by:
        getAttachmentID in interface Message
        Parameters:
        index -
        Returns:
        CID or null if not present
      • getAttachmentID

        public String getAttachmentID​(String partName)
        Description copied from interface: Message
        Get the indicated (non-soap part) attachment id
        Specified by:
        getAttachmentID in interface Message
        Parameters:
        partName - (WS-I indicates that SWA attachments have a partName prefix)
        Returns:
        CID or null if not present
      • getAttachmentIDs

        public List<String> getAttachmentIDs()
        Description copied from interface: Message
        Get the list of attachment content ids for the message
        Specified by:
        getAttachmentIDs in interface Message
        Returns:
        List
      • getProtocol

        public Protocol getProtocol()
        Description copied from interface: Message
        Get the protocol for this Message (soap11, soap12, etc.)
        Specified by:
        getProtocol in interface Message
        Specified by:
        getProtocol in interface XMLPart
        Returns:
        Protocl
      • getHeaderBlocks

        public List<Block> getHeaderBlocks​(String namespace,
                                           String localPart,
                                           Object context,
                                           BlockFactory blockFactory,
                                           RolePlayer rolePlayer)
                                    throws WebServiceException
        Description copied from interface: XMLPart
        getHeaderBlock Get the header blocks with the specified name The BlockFactory and object context are passed in to help create the proper kind of block.
        Specified by:
        getHeaderBlocks in interface XMLPart
        Parameters:
        namespace - uri of header
        localPart - local name of header
        context - context for blockFactory
        blockFactory - kind of factory (i.e. JAXB)
        Returns:
        List
        Throws:
        WebServiceException
      • isConsumed

        public boolean isConsumed()
        Description copied from interface: XMLPart
        isConsumed Return true if the part is consumed. Once consumed, the information in the part is no longer available.
        Specified by:
        isConsumed in interface XMLPart
        Returns:
        true if the block is consumed (a method was called with consume=true)
      • setBodyBlock

        public void setBodyBlock​(int index,
                                 Block block)
                          throws WebServiceException
        Description copied from interface: XMLPart
        setBodyBlock Set the block at the specified index Once set, the Message owns the block. You must use the getBodyBlock method to access it.
        Specified by:
        setBodyBlock in interface XMLPart
        Throws:
        WebServiceException
      • traceString

        public String traceString​(String indent)
        Description copied from interface: XMLPart
        Get a traceString...the trace string dumps the contents of the Block without forcing an underlying ill-performant transformation of the message.
        Specified by:
        traceString in interface XMLPart
        Returns:
        String containing trace information
      • addDataHandler

        public void addDataHandler​(DataHandler dh,
                                   String id)
        Description copied from interface: Message
        Add Attachment
        Specified by:
        addDataHandler in interface Message
        Parameters:
        dh - DataHandler (type of Attachment is inferred from dh.getContentType)
        id - String which is the Attachment content id
        See Also:
        addAttachment(Attachment)
      • getParent

        public Message getParent()
        Description copied from interface: XMLPart
        getParent Get the Message object that this XMLPart is attached to, if it is attached to one at all.
        Specified by:
        getParent in interface XMLPart
        Returns:
      • setParent

        public void setParent​(Message msg)
        Description copied from interface: XMLPart
        setParent Set the Message object that will hold this XMLPart
        Specified by:
        setParent in interface XMLPart
      • isMTOMEnabled

        public boolean isMTOMEnabled()
        Description copied from interface: Message
        A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM.
        Specified by:
        isMTOMEnabled in interface Message
        Returns:
        true if the binding for this message indicates mtom
      • setMTOMEnabled

        public void setMTOMEnabled​(boolean b)
        Description copied from interface: Message
        A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM. Indicate whether this is an MTOM message
        Specified by:
        setMTOMEnabled in interface Message
        Parameters:
        true - if the binding for this message indicates mtom
      • getXMLPartContentType

        public String getXMLPartContentType()
        Description copied from interface: XMLPart
        The representation of the XMLPart may be in a number of different forms. Currently the forms are UNKNOWN, OM, SOAPENVELOPE, and SPINE. This method returns a String containing one of these types. This method should only be used for trace and testing purposes. The consumer of a Message should not make any decisions based on the representation of the XMLPart
        Specified by:
        getXMLPartContentType in interface XMLPart
        Returns:
        String
      • setStyle

        public void setStyle​(SOAPBinding.Style style)
                      throws WebServiceException
        Description copied from interface: XMLPart
        Set the Style. If the style is DOCUMENT, the body blocks are located underneath the body element. If the style is set to RPC, then the body blocks are located underneath the rpc operation.
        Specified by:
        setStyle in interface XMLPart
        Parameters:
        style - Style
        Throws:
        WebServiceException
        See Also:
        indirection
      • getMimeHeaders

        public Map getMimeHeaders()
        Specified by:
        getMimeHeaders in interface Message
        Returns:
        get the transport headers map.
      • setMimeHeaders

        public void setMimeHeaders​(Map map)
        Description copied from interface: Message
        Set the transport headers
        Specified by:
        setMimeHeaders in interface Message
        Parameters:
        map - Map
      • getBodyBlock

        public Block getBodyBlock​(Object context,
                                  BlockFactory blockFactory)
                           throws WebServiceException
        Description copied from interface: XMLPart
        getBodyBlock Get the single Body Block. The BlockFactory and object context are passed in to help create the proper kind of block. This method should only be invoked when it is known that there is zero or one block.
        Specified by:
        getBodyBlock in interface XMLPart
        Returns:
        Block or null
        Throws:
        WebServiceException
      • setPostPivot

        public void setPostPivot()
        Description copied from interface: Message
        Indicate that this message is passed the pivot point. For example, this is set in the JAX-WS Dispatcher to indicate
        Specified by:
        setPostPivot in interface Message
      • isPostPivot

        public boolean isPostPivot()
        Specified by:
        isPostPivot in interface Message
        Returns:
        true if post pivot
      • getIndirection

        public int getIndirection()
        Description copied from interface: XMLPart
        Get indirection. Used to force the code to look for blocks at a particular location. For DOCUMENT the default is 0 For RPC the default is 1 This method is used to override these settings for special cases.
        Specified by:
        getIndirection in interface XMLPart
        Returns:
        indirection (0 or 1)
      • setIndirection

        public void setIndirection​(int indirection)
        Description copied from interface: XMLPart
        Set indirection. Used to force the code to look for blocks at a particular location. For DOCUMENT the default is 0 For RPC the default is 1 This method is used to override these settings for special cases.
        Specified by:
        setIndirection in interface XMLPart
        Parameters:
        indirection - (0 or 1)
      • setMessageContext

        public void setMessageContext​(MessageContext messageContext)
        Description copied from interface: Message
        JAX-WS Message Context that owns the Message
        Specified by:
        setMessageContext in interface Message
      • setDoingSWA

        public void setDoingSWA​(boolean value)
        Description copied from interface: Message
        Indicate that an SWA DataHandler was added to the message. This information will be used to trigger SWA serialization.
        Specified by:
        setDoingSWA in interface Message
      • isDoingSWA

        public boolean isDoingSWA()
        Specified by:
        isDoingSWA in interface Message
        Returns:
        true if SWA DataHandler is present
      • close

        public void close()
        Description copied from interface: XMLPart
        Used primarily to ensure the parser is forwarded to the end so it can be closed.
        Specified by:
        close in interface XMLPart