Class MessageImpl

  • All Implemented Interfaces:
    jakarta.xml.soap.SOAPConstants
    Direct Known Subclasses:
    Message1_1Impl, Message1_2Impl

    public abstract class MessageImpl
    extends jakarta.xml.soap.SOAPMessage
    implements jakarta.xml.soap.SOAPConstants
    The message implementation for SOAP messages with attachments. Messages for specific profiles will likely extend this MessageImpl class and add more value for that particular profile.
    Author:
    Anil Vijendran ([email protected]), Rajiv Mordani ([email protected]), Manveen Kaur ([email protected])
    • Field Detail

      • log

        protected static final Logger log
      • MIME_MULTIPART_XOP_SOAP1_1_FLAG

        protected static final int MIME_MULTIPART_XOP_SOAP1_1_FLAG
        See Also:
        Constant Field Values
      • MIME_MULTIPART_XOP_SOAP1_2_FLAG

        protected static final int MIME_MULTIPART_XOP_SOAP1_2_FLAG
        See Also:
        Constant Field Values
      • headers

        protected jakarta.xml.soap.MimeHeaders headers
      • attachments

        protected FinalArrayList<jakarta.xml.soap.AttachmentPart> attachments
      • saved

        protected boolean saved
      • messageBytes

        protected byte[] messageBytes
      • messageByteCount

        protected int messageByteCount
      • attachmentsInitialized

        protected boolean attachmentsInitialized
      • isFastInfoset

        protected boolean isFastInfoset
        True if this part is encoded using Fast Infoset. MIME -> application/fastinfoset
      • acceptFastInfoset

        protected boolean acceptFastInfoset
        True if the Accept header of this message includes application/fastinfoset
    • Constructor Detail

      • MessageImpl

        protected MessageImpl()
        Construct a new message. This will be invoked before message sends.
      • MessageImpl

        protected MessageImpl​(boolean isFastInfoset,
                              boolean acceptFastInfoset)
        Construct a new message. This will be invoked before message sends.
        Parameters:
        isFastInfoset - whether it is fast infoset
        acceptFastInfoset - whether to accept fast infoset
      • MessageImpl

        protected MessageImpl​(jakarta.xml.soap.SOAPMessage msg)
        Shallow copy.
        Parameters:
        msg - SoapMessage
      • MessageImpl

        protected MessageImpl​(jakarta.xml.soap.MimeHeaders headers,
                              InputStream in)
                       throws SOAPExceptionImpl
        Construct a message from an input stream. When messages are received, there's two parts -- the transport headers and the message content in a transport specific stream.
        Parameters:
        headers - MimeHeaders
        in - InputStream
        Throws:
        SOAPExceptionImpl - in case of I/O error
      • MessageImpl

        protected MessageImpl​(jakarta.xml.soap.MimeHeaders headers,
                              ContentType contentType,
                              int stat,
                              InputStream in)
                       throws SOAPExceptionImpl
        Construct a message from an input stream. When messages are received, there's two parts -- the transport headers and the message content in a transport specific stream.
        Parameters:
        headers - headers
        contentType - The parsed content type header from the headers variable. This is redundant parameter, but it avoids reparsing this header again.
        stat - The result of identifyContentType(ContentType) over the contentType parameter. This redundant parameter, but it avoids recomputing this information again.
        in - input stream
        Throws:
        SOAPExceptionImpl - in case of an error
    • Method Detail

      • isSoap1_1Content

        protected static boolean isSoap1_1Content​(int stat)
        Parameters:
        stat - the mask value obtained from identifyContentType(ContentType)
        Returns:
        true if SOAP 1.1 Content
      • isSoap1_2Content

        protected static boolean isSoap1_2Content​(int stat)
        Check whether it is SOAP 1.2 content.
        Parameters:
        stat - the mask value obtained from identifyContentType(ContentType)
        Returns:
        true if it is SOAP 1.2 content
      • isFastInfoset

        public boolean isFastInfoset()
      • acceptFastInfoset

        public boolean acceptFastInfoset()
      • setIsFastInfoset

        public void setIsFastInfoset​(boolean value)
      • isLazySoapBodyParsing

        public boolean isLazySoapBodyParsing()
      • getProperty

        public Object getProperty​(String property)
        Overrides:
        getProperty in class jakarta.xml.soap.SOAPMessage
      • setProperty

        public void setProperty​(String property,
                                Object value)
        Overrides:
        setProperty in class jakarta.xml.soap.SOAPMessage
      • isCorrectSoapVersion

        protected abstract boolean isCorrectSoapVersion​(int contentTypeId)
      • getExpectedContentType

        protected abstract String getExpectedContentType()
      • getExpectedAcceptHeader

        protected abstract String getExpectedAcceptHeader()
      • getMimeHeaders

        public jakarta.xml.soap.MimeHeaders getMimeHeaders()
        Specified by:
        getMimeHeaders in class jakarta.xml.soap.SOAPMessage
      • getContentType

        public String getContentType()
      • setContentType

        public void setContentType​(String type)
      • getBaseType

        public String getBaseType()
      • setBaseType

        public void setBaseType​(String type)
      • getAction

        public String getAction()
      • setAction

        public void setAction​(String action)
      • getCharset

        public String getCharset()
      • setCharset

        public void setCharset​(String charset)
      • saveRequired

        public boolean saveRequired()
        Specified by:
        saveRequired in class jakarta.xml.soap.SOAPMessage
      • getContentDescription

        public String getContentDescription()
        Specified by:
        getContentDescription in class jakarta.xml.soap.SOAPMessage
      • setContentDescription

        public void setContentDescription​(String description)
        Specified by:
        setContentDescription in class jakarta.xml.soap.SOAPMessage
      • getSOAPPart

        public abstract jakarta.xml.soap.SOAPPart getSOAPPart()
        Specified by:
        getSOAPPart in class jakarta.xml.soap.SOAPMessage
      • removeAllAttachments

        public void removeAllAttachments()
        Specified by:
        removeAllAttachments in class jakarta.xml.soap.SOAPMessage
      • countAttachments

        public int countAttachments()
        Specified by:
        countAttachments in class jakarta.xml.soap.SOAPMessage
      • addAttachmentPart

        public void addAttachmentPart​(jakarta.xml.soap.AttachmentPart attachment)
        Specified by:
        addAttachmentPart in class jakarta.xml.soap.SOAPMessage
      • getAttachments

        public Iterator<jakarta.xml.soap.AttachmentPart> getAttachments()
        Specified by:
        getAttachments in class jakarta.xml.soap.SOAPMessage
      • getAttachments

        public Iterator<jakarta.xml.soap.AttachmentPart> getAttachments​(jakarta.xml.soap.MimeHeaders headers)
        Specified by:
        getAttachments in class jakarta.xml.soap.SOAPMessage
      • removeAttachments

        public void removeAttachments​(jakarta.xml.soap.MimeHeaders headers)
        Specified by:
        removeAttachments in class jakarta.xml.soap.SOAPMessage
      • createAttachmentPart

        public jakarta.xml.soap.AttachmentPart createAttachmentPart()
        Specified by:
        createAttachmentPart in class jakarta.xml.soap.SOAPMessage
      • getAttachment

        public jakarta.xml.soap.AttachmentPart getAttachment​(jakarta.xml.soap.SOAPElement element)
                                                      throws jakarta.xml.soap.SOAPException
        Specified by:
        getAttachment in class jakarta.xml.soap.SOAPMessage
        Throws:
        jakarta.xml.soap.SOAPException
      • saveChanges

        public void saveChanges()
                         throws jakarta.xml.soap.SOAPException
        Specified by:
        saveChanges in class jakarta.xml.soap.SOAPMessage
        Throws:
        jakarta.xml.soap.SOAPException
      • writeTo

        public void writeTo​(OutputStream out)
                     throws jakarta.xml.soap.SOAPException,
                            IOException
        Specified by:
        writeTo in class jakarta.xml.soap.SOAPMessage
        Throws:
        jakarta.xml.soap.SOAPException
        IOException
      • getSOAPBody

        public jakarta.xml.soap.SOAPBody getSOAPBody()
                                              throws jakarta.xml.soap.SOAPException
        Overrides:
        getSOAPBody in class jakarta.xml.soap.SOAPMessage
        Throws:
        jakarta.xml.soap.SOAPException
      • getSOAPHeader

        public jakarta.xml.soap.SOAPHeader getSOAPHeader()
                                                  throws jakarta.xml.soap.SOAPException
        Overrides:
        getSOAPHeader in class jakarta.xml.soap.SOAPMessage
        Throws:
        jakarta.xml.soap.SOAPException
      • setLazyAttachments

        public void setLazyAttachments​(boolean flag)