public interface Message
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(javax.activation.DataHandler content,
Headers headers)
Adds an attachment to the message.
|
void |
addPart(java.lang.String name,
java.lang.Object part)
Normalized messages can support multiple parts.
|
boolean |
arePartsEmpty()
Returns whether there are any parts or not (empty) in the message.
|
boolean |
canCarryBindingHeaders()
Returns if the message can carry binding headers.
|
boolean |
canNormalize()
Returns whether the message can be normalized or not.
|
Message |
copy()
Create a copy of the message.
|
MessageAttachments |
getAttachments()
Provides direct access to the attachments for the message.
|
java.lang.String |
getBindingURI()
Returns the URI of the message's binding if the message is bound (not
normalized).
|
javax.xml.transform.Source |
getContent()
Returns the content of the message.
|
java.lang.String |
getContentPartName()
When using parts in a message one of those parts can be considered the
content of the message (see
getContent() ). |
java.lang.String |
getContentType()
Returns the type of content of the message, i.e., application/xml,
application/json.
|
java.lang.String |
getCorrelationID()
Returns a correlation identifier (if any) that can be used to correlate
this message with another.
|
java.lang.String |
getID()
Returns the ID of the message (if any).
|
java.lang.Object |
getPart(java.lang.String name)
Returns the value/content of the part with the given name.
|
java.util.Set<java.lang.String> |
getPartNames()
Returns the names of the parts in the message (if any).
|
java.util.Map<java.lang.String,java.lang.Object> |
getParts()
Returns a map of parts keyed by their name.
|
java.util.Map |
getProperties()
Provides direct access to the Map of properties for the message.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the property with the given name.
|
java.util.Set |
getPropertyNames()
Returns the names of the properties associated with the message.
|
javax.security.auth.Subject |
getSecuritySubject()
Returns the security subject for the message with the consumer subject
category (urn:org:federatedgovernance:security:subject-category:consumer).
|
Headers |
getTransportHeaders()
Returns the transport headers associated with the message (if any).
|
boolean |
isFault()
Returns whether or not the message is a fault message.
|
boolean |
isNormalized()
Returns whether the message is normalized or not.
|
Message |
normalize()
Normalizes the message.
|
Message |
normalizeCopy()
Normalizes the message leaving the original bound object unchanged.
|
Message |
normalizeCopyToXML()
Normalizes the message to an XML format leaving the original bound object unchanged.
|
Message |
normalizeToXML()
Normalizes the message to an XML format.
|
void |
setAttachments(MessageAttachments attachments)
Replaces the attachments of the message in one call for optimization.
|
void |
setContent(javax.xml.transform.Source content)
Changes the message content.
|
void |
setContentPartName(java.lang.String name)
When using parts in a message one of those parts can be considered the
content of the message (see
getContent() ). |
void |
setContentType(java.lang.String contentType)
Changes the type of content of the message, i.e., application/xml,
application/json.
|
void |
setCorrelationID(java.lang.String id)
Changes the correlation ID of the message.
|
void |
setID(java.lang.String id)
Changes the ID of the message.
|
void |
setProperties(java.util.Map properties)
Replaces the properties of the message in one call for optimization.
|
void |
setProperty(java.lang.String name,
java.lang.Object property)
Associates a property with the message.
|
void |
setSecuritySubject(javax.security.auth.Subject subject)
Changes the security subject for the message with the consumer subject
category (urn:org:federatedgovernance:security:subject-category:consumer).
|
void |
setTransportHeaders(Headers headers)
Replaces the set of transport headers associated with the message.
|
java.lang.String getID()
void setID(java.lang.String id)
id
- String identifier of the message.java.lang.String getCorrelationID()
void setCorrelationID(java.lang.String id)
id
- String correlation identifier.void setSecuritySubject(javax.security.auth.Subject subject)
subject
- Subject identifying the application sending the message.javax.security.auth.Subject getSecuritySubject()
javax.xml.transform.Source getContent() throws GException
setContent(Source)
.GException
- Thrown if unable to retrieve message content.
Possibly caused by badly formed content.void setContent(javax.xml.transform.Source content) throws GException
addPart(String,Object)
if multiple
parts are needed. Do not use both methods.content
- Source holding the message content.GException
- Thrown if unable to change the content. Possibly
caused by passing in badly formed content.void addAttachment(javax.activation.DataHandler content, Headers headers) throws GException
content
- Content of the attachment.headers
- Any headers that are transported along with the attachment content.GException
void setAttachments(MessageAttachments attachments) throws GException
attachments
- MessageAttachments instance.GException
MessageAttachments getAttachments()
java.lang.Object getProperty(java.lang.String name)
name
- Name of the property.void setProperty(java.lang.String name, java.lang.Object property)
name
- Name of the property.property
- Value of the property.java.util.Set getPropertyNames()
void setProperties(java.util.Map properties)
properties
- Map of properties keyed by a String.java.util.Map getProperties()
Headers getTransportHeaders()
void setTransportHeaders(Headers headers)
headers
- Headers holding transport headers for the message.boolean isFault() throws GException
GException
boolean isNormalized()
boolean canNormalize()
Message copy() throws GException
GException
- Thrown if unable to copy.Message normalize() throws GException
normalizeCopyToXML()
instead.GException
- Thrown if unable to normalize.Message normalizeCopy() throws GException
GException
- Thrown if unable to normalize.Message normalizeToXML() throws GException
getContentPartName()
) will be translated into an XML representation.
A new normalized version of the message is returned. Due to the possibility of this
original object using InputStreams to hold its content, after normalization this object's
InputStreams will most likely be exhausted making this object unusable. To continue to use
this object after normalization in its original bound format, use
normalizeCopyToXML()
instead.GException
- Thrown if unable to normalize.Message normalizeCopyToXML() throws GException
getContentPartName()
) will be translated into an XML representation. A
new normalized version of the message is returned. In order to leave the original object
in tact it must be copied which may be expensive from a performance perspective.GException
- Thrown if unable to normalize.boolean canCarryBindingHeaders()
java.lang.String getBindingURI()
java.lang.String getContentType()
void setContentType(java.lang.String contentType)
getContent()
.contentType
- Type of message content.void addPart(java.lang.String name, java.lang.Object part)
getContent()
to get the content of the
message. If the message is normalized there may be content accessed
using getContent()
instead of parts.name
- Name of the part, should correspond to a WSDL definend message
part.part
- Value/content of the part. Typically a part should be an XML
element that corresponds to what is defined in the WSDL
definition. A part could be something other than that but unless
the consumer of the message can read the content it will fail.java.lang.Object getPart(java.lang.String name)
name
- Name of the part.java.lang.String getContentPartName()
getContent()
). This method will return
the name of the part that holds the content.void setContentPartName(java.lang.String name)
getContent()
). This method can be
used to specify the name of the part that should be considered the message
content.name
- Name of the part holding the message content.java.util.Set<java.lang.String> getPartNames()
boolean arePartsEmpty()
getContent()
.java.util.Map<java.lang.String,java.lang.Object> getParts()
?? 2022 Perforce Software, All rights reserved
This software is the confidential and proprietary information of Perforce, Inc. and is subject to copyright protection under laws of the United States of America and other countries. The use of this software should be in accordance with the license agreement terms you entered into with Perforce, Inc.