public abstract class AbstractMessage extends java.lang.Object implements Message
| Constructor and Description |
|---|
AbstractMessage() |
| 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.
|
void |
copy(Message from) |
protected void |
createAttachments() |
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
Message.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).
|
java.lang.Object |
removePart(java.lang.String name) |
void |
setAttachments(MessageAttachments attachments)
Replaces the attachments of the message in one call for optimization.
|
void |
setBindingURI(java.lang.String uri) |
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
Message.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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanNormalize, copy, isFault, isNormalized, normalize, normalizeCopy, normalizeCopyToXML, normalizeToXMLpublic javax.xml.transform.Source getContent()
throws GException
MessageMessage.setContent(Source).getContent in interface MessageGException - Thrown if unable to retrieve message content.
Possibly caused by badly formed content.public void setContent(javax.xml.transform.Source content)
throws GException
MessageMessage.addPart(String,Object) if multiple
parts are needed. Do not use both methods.setContent in interface Messagecontent - Source holding the message content.GException - Thrown if unable to change the content. Possibly
caused by passing in badly formed content.public java.lang.Object getProperty(java.lang.String name)
MessagegetProperty in interface Messagename - Name of the property.public void setProperty(java.lang.String name,
java.lang.Object property)
MessagesetProperty in interface Messagename - Name of the property.property - Value of the property.public java.util.Set getPropertyNames()
MessagegetPropertyNames in interface Messagepublic java.util.Map getProperties()
MessagegetProperties in interface Messagepublic void setProperties(java.util.Map properties)
MessagesetProperties in interface Messageproperties - Map of properties keyed by a String.public java.lang.String getID()
Messagepublic void setID(java.lang.String id)
Messagepublic java.lang.String getCorrelationID()
MessagegetCorrelationID in interface Messagepublic void setCorrelationID(java.lang.String id)
MessagesetCorrelationID in interface Messageid - String correlation identifier.public void setSecuritySubject(javax.security.auth.Subject subject)
MessagesetSecuritySubject in interface Messagesubject - Subject identifying the application sending the message.public javax.security.auth.Subject getSecuritySubject()
MessagegetSecuritySubject in interface Messagepublic void addAttachment(javax.activation.DataHandler content,
Headers headers)
MessageaddAttachment in interface Messagecontent - Content of the attachment.headers - Any headers that are transported along with the attachment content.public void setAttachments(MessageAttachments attachments)
MessagesetAttachments in interface Messageattachments - MessageAttachments instance.public MessageAttachments getAttachments()
MessagegetAttachments in interface Messagepublic Headers getTransportHeaders()
MessagegetTransportHeaders in interface Messagepublic void setTransportHeaders(Headers headers)
MessagesetTransportHeaders in interface Messageheaders - Headers holding transport headers for the message.public boolean canCarryBindingHeaders()
MessagecanCarryBindingHeaders in interface Messagepublic void setBindingURI(java.lang.String uri)
public java.lang.String getBindingURI()
MessagegetBindingURI in interface Messagepublic void setContentType(java.lang.String contentType)
MessageMessage.getContent().setContentType in interface MessagecontentType - Type of message content.public java.lang.String getContentType()
MessagegetContentType in interface Messagepublic void addPart(java.lang.String name,
java.lang.Object part)
MessageMessage.getContent() to get the content of the
message. If the message is normalized there may be content accessed
using Message.getContent() instead of parts.addPart in interface Messagename - 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.public java.lang.Object getPart(java.lang.String name)
Messagepublic java.lang.Object removePart(java.lang.String name)
public java.util.Set<java.lang.String> getPartNames()
MessagegetPartNames in interface Messagepublic boolean arePartsEmpty()
MessageMessage.getContent().arePartsEmpty in interface Messagepublic java.util.Map<java.lang.String,java.lang.Object> getParts()
Messagepublic void setContentPartName(java.lang.String name)
MessageMessage.getContent()). This method can be
used to specify the name of the part that should be considered the message
content.setContentPartName in interface Messagename - Name of the part holding the message content.public java.lang.String getContentPartName()
MessageMessage.getContent()). This method will return
the name of the part that holds the content.getContentPartName in interface Messageprotected void createAttachments()
public void copy(Message from)
?? 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.