Package com.sun.xml.messaging.saaj.soap
Class MessageImpl
- java.lang.Object
-
- javax.xml.soap.SOAPMessage
-
- com.sun.xml.messaging.saaj.soap.MessageImpl
-
- All Implemented Interfaces:
javax.xml.soap.SOAPConstants
- Direct Known Subclasses:
Message1_1Impl,Message1_2Impl
public abstract class MessageImpl extends javax.xml.soap.SOAPMessage implements javax.xml.soap.SOAPConstantsThe 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 (akv@eng.sun.com), Rajiv Mordani (rajiv.mordani@sun.com), Manveen Kaur (manveen.kaur@sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanacceptFastInfosetTrue if the Accept header of this message includes application/fastinfosetprotected FinalArrayList<javax.xml.soap.AttachmentPart>attachmentsprotected booleanattachmentsInitializedstatic StringCONTENT_IDstatic StringCONTENT_LOCATIONprotected ContentTypecontentTypeprotected static intFI_ENCODED_FLAGprotected javax.xml.soap.MimeHeadersheadersprotected booleanisFastInfosetTrue if this part is encoded using Fast Infoset.static StringLAZY_SOAP_BODY_PARSINGprotected static Loggerlogprotected intmessageByteCountprotected byte[]messageBytesprotected static intMIME_MULTIPART_FLAGprotected static intMIME_MULTIPART_XOP_SOAP1_1_FLAGprotected static intMIME_MULTIPART_XOP_SOAP1_2_FLAGprotected MimeMultipartmmpprotected MimeMultipartmultiPartprotected static intPLAIN_XML_FLAGprotected Map<String,Object>propertiesstatic StringSAAJ_MIME_SOAP_BODY_PART_SIZE_LIMITprotected booleansavedprotected static intSOAP1_1_FLAGprotected static intSOAP1_2_FLAGprotected SOAPPartImplsoapPartImplprotected static intXOP_FLAG-
Fields inherited from class javax.xml.soap.SOAPMessage
CHARACTER_SET_ENCODING, WRITE_XML_DECLARATION
-
Fields inherited from interface javax.xml.soap.SOAPConstants
DEFAULT_SOAP_PROTOCOL, DYNAMIC_SOAP_PROTOCOL, SOAP_1_1_CONTENT_TYPE, SOAP_1_1_PROTOCOL, SOAP_1_2_CONTENT_TYPE, SOAP_1_2_PROTOCOL, SOAP_DATAENCODINGUNKNOWN_FAULT, SOAP_ENV_PREFIX, SOAP_MUSTUNDERSTAND_FAULT, SOAP_RECEIVER_FAULT, SOAP_SENDER_FAULT, SOAP_VERSIONMISMATCH_FAULT, URI_NS_SOAP_1_1_ENVELOPE, URI_NS_SOAP_1_2_ENCODING, URI_NS_SOAP_1_2_ENVELOPE, URI_NS_SOAP_ENCODING, URI_NS_SOAP_ENVELOPE, URI_SOAP_1_2_ROLE_NEXT, URI_SOAP_1_2_ROLE_NONE, URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER, URI_SOAP_ACTOR_NEXT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMessageImpl()Construct a new message.protectedMessageImpl(boolean isFastInfoset, boolean acceptFastInfoset)Construct a new message.protectedMessageImpl(javax.xml.soap.MimeHeaders headers, ContentType contentType, int stat, InputStream in)Construct a message from an input stream.MessageImpl(javax.xml.soap.MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader)protectedMessageImpl(javax.xml.soap.MimeHeaders headers, InputStream in)Construct a message from an input stream.protectedMessageImpl(javax.xml.soap.SOAPMessage msg)Shallow copy.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanacceptFastInfoset()voidaddAttachmentPart(javax.xml.soap.AttachmentPart attachment)intcountAttachments()javax.xml.soap.AttachmentPartcreateAttachmentPart()StringgetAction()javax.xml.soap.AttachmentPartgetAttachment(javax.xml.soap.SOAPElement element)Iterator<javax.xml.soap.AttachmentPart>getAttachments()Iterator<javax.xml.soap.AttachmentPart>getAttachments(javax.xml.soap.MimeHeaders headers)StringgetBaseType()StringgetCharset()StringgetContentDescription()StringgetContentType()protected abstract StringgetExpectedAcceptHeader()protected abstract StringgetExpectedContentType()javax.xml.soap.MimeHeadersgetMimeHeaders()ObjectgetProperty(String property)javax.xml.soap.SOAPBodygetSOAPBody()javax.xml.soap.SOAPHeadergetSOAPHeader()abstract javax.xml.soap.SOAPPartgetSOAPPart()protected abstract booleanisCorrectSoapVersion(int contentTypeId)booleanisFastInfoset()booleanisLazySoapBodyParsing()protected static booleanisSoap1_1Content(int stat)protected static booleanisSoap1_2Content(int stat)Check whether it is SOAP 1.2 content.voidremoveAllAttachments()voidremoveAttachments(javax.xml.soap.MimeHeaders headers)voidsaveChanges()booleansaveRequired()voidsetAction(String action)voidsetBaseType(String type)voidsetCharset(String charset)voidsetContentDescription(String description)voidsetContentType(String type)voidsetIsFastInfoset(boolean value)voidsetLazyAttachments(boolean flag)voidsetProperty(String property, Object value)voidwriteTo(OutputStream out)
-
-
-
Field Detail
-
CONTENT_ID
public static final String CONTENT_ID
- See Also:
- Constant Field Values
-
CONTENT_LOCATION
public static final String CONTENT_LOCATION
- See Also:
- Constant Field Values
-
log
protected static final Logger log
-
PLAIN_XML_FLAG
protected static final int PLAIN_XML_FLAG
- See Also:
- Constant Field Values
-
MIME_MULTIPART_FLAG
protected static final int MIME_MULTIPART_FLAG
- See Also:
- Constant Field Values
-
SOAP1_1_FLAG
protected static final int SOAP1_1_FLAG
- See Also:
- Constant Field Values
-
SOAP1_2_FLAG
protected static final int SOAP1_2_FLAG
- See Also:
- Constant Field Values
-
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
-
XOP_FLAG
protected static final int XOP_FLAG
- See Also:
- Constant Field Values
-
FI_ENCODED_FLAG
protected static final int FI_ENCODED_FLAG
- See Also:
- Constant Field Values
-
headers
protected javax.xml.soap.MimeHeaders headers
-
contentType
protected ContentType contentType
-
soapPartImpl
protected SOAPPartImpl soapPartImpl
-
attachments
protected FinalArrayList<javax.xml.soap.AttachmentPart> attachments
-
saved
protected boolean saved
-
messageBytes
protected byte[] messageBytes
-
messageByteCount
protected int messageByteCount
-
multiPart
protected MimeMultipart multiPart
-
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
-
mmp
protected MimeMultipart mmp
-
LAZY_SOAP_BODY_PARSING
public static final String LAZY_SOAP_BODY_PARSING
- See Also:
- Constant Field Values
-
SAAJ_MIME_SOAP_BODY_PART_SIZE_LIMIT
public static final String SAAJ_MIME_SOAP_BODY_PART_SIZE_LIMIT
- See Also:
- Constant Field Values
-
-
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 infosetacceptFastInfoset- whether to accept fast infoset
-
MessageImpl
protected MessageImpl(javax.xml.soap.SOAPMessage msg)
Shallow copy.- Parameters:
msg- SoapMessage
-
MessageImpl
protected MessageImpl(javax.xml.soap.MimeHeaders headers, InputStream in) throws SOAPExceptionImplConstruct 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- MimeHeadersin- InputStream- Throws:
SOAPExceptionImpl- in case of I/O error
-
MessageImpl
protected MessageImpl(javax.xml.soap.MimeHeaders headers, ContentType contentType, int stat, InputStream in) throws SOAPExceptionImplConstruct 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- headerscontentType- The parsed content type header from the headers variable. This is redundant parameter, but it avoids reparsing this header again.stat- The result ofidentifyContentType(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
-
MessageImpl
public MessageImpl(javax.xml.soap.MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader) throws SOAPExceptionImpl- Throws:
SOAPExceptionImpl
-
-
Method Detail
-
isSoap1_1Content
protected static boolean isSoap1_1Content(int stat)
- Parameters:
stat- the mask value obtained fromidentifyContentType(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 fromidentifyContentType(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:
getPropertyin classjavax.xml.soap.SOAPMessage
-
setProperty
public void setProperty(String property, Object value)
- Overrides:
setPropertyin classjavax.xml.soap.SOAPMessage
-
isCorrectSoapVersion
protected abstract boolean isCorrectSoapVersion(int contentTypeId)
-
getExpectedContentType
protected abstract String getExpectedContentType()
-
getExpectedAcceptHeader
protected abstract String getExpectedAcceptHeader()
-
getMimeHeaders
public javax.xml.soap.MimeHeaders getMimeHeaders()
- Specified by:
getMimeHeadersin classjavax.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:
saveRequiredin classjavax.xml.soap.SOAPMessage
-
getContentDescription
public String getContentDescription()
- Specified by:
getContentDescriptionin classjavax.xml.soap.SOAPMessage
-
setContentDescription
public void setContentDescription(String description)
- Specified by:
setContentDescriptionin classjavax.xml.soap.SOAPMessage
-
getSOAPPart
public abstract javax.xml.soap.SOAPPart getSOAPPart()
- Specified by:
getSOAPPartin classjavax.xml.soap.SOAPMessage
-
removeAllAttachments
public void removeAllAttachments()
- Specified by:
removeAllAttachmentsin classjavax.xml.soap.SOAPMessage
-
countAttachments
public int countAttachments()
- Specified by:
countAttachmentsin classjavax.xml.soap.SOAPMessage
-
addAttachmentPart
public void addAttachmentPart(javax.xml.soap.AttachmentPart attachment)
- Specified by:
addAttachmentPartin classjavax.xml.soap.SOAPMessage
-
getAttachments
public Iterator<javax.xml.soap.AttachmentPart> getAttachments()
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
getAttachments
public Iterator<javax.xml.soap.AttachmentPart> getAttachments(javax.xml.soap.MimeHeaders headers)
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
removeAttachments
public void removeAttachments(javax.xml.soap.MimeHeaders headers)
- Specified by:
removeAttachmentsin classjavax.xml.soap.SOAPMessage
-
createAttachmentPart
public javax.xml.soap.AttachmentPart createAttachmentPart()
- Specified by:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
getAttachment
public javax.xml.soap.AttachmentPart getAttachment(javax.xml.soap.SOAPElement element) throws javax.xml.soap.SOAPException- Specified by:
getAttachmentin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
saveChanges
public void saveChanges() throws javax.xml.soap.SOAPException- Specified by:
saveChangesin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
writeTo
public void writeTo(OutputStream out) throws javax.xml.soap.SOAPException, IOException
- Specified by:
writeToin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPExceptionIOException
-
getSOAPBody
public javax.xml.soap.SOAPBody getSOAPBody() throws javax.xml.soap.SOAPException- Overrides:
getSOAPBodyin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
getSOAPHeader
public javax.xml.soap.SOAPHeader getSOAPHeader() throws javax.xml.soap.SOAPException- Overrides:
getSOAPHeaderin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
setLazyAttachments
public void setLazyAttachments(boolean flag)
-
-