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, wait
canNormalize, copy, isFault, isNormalized, normalize, normalizeCopy, normalizeCopyToXML, normalizeToXML
public javax.xml.transform.Source getContent() throws GException
Message
Message.setContent(Source)
.getContent
in interface Message
GException
- Thrown if unable to retrieve message content.
Possibly caused by badly formed content.public void setContent(javax.xml.transform.Source content) throws GException
Message
Message.addPart(String,Object)
if multiple
parts are needed. Do not use both methods.setContent
in interface Message
content
- 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)
Message
getProperty
in interface Message
name
- Name of the property.public void setProperty(java.lang.String name, java.lang.Object property)
Message
setProperty
in interface Message
name
- Name of the property.property
- Value of the property.public java.util.Set getPropertyNames()
Message
getPropertyNames
in interface Message
public java.util.Map getProperties()
Message
getProperties
in interface Message
public void setProperties(java.util.Map properties)
Message
setProperties
in interface Message
properties
- Map of properties keyed by a String.public java.lang.String getID()
Message
public void setID(java.lang.String id)
Message
public java.lang.String getCorrelationID()
Message
getCorrelationID
in interface Message
public void setCorrelationID(java.lang.String id)
Message
setCorrelationID
in interface Message
id
- String correlation identifier.public void setSecuritySubject(javax.security.auth.Subject subject)
Message
setSecuritySubject
in interface Message
subject
- Subject identifying the application sending the message.public javax.security.auth.Subject getSecuritySubject()
Message
getSecuritySubject
in interface Message
public void addAttachment(javax.activation.DataHandler content, Headers headers)
Message
addAttachment
in interface Message
content
- Content of the attachment.headers
- Any headers that are transported along with the attachment content.public void setAttachments(MessageAttachments attachments)
Message
setAttachments
in interface Message
attachments
- MessageAttachments instance.public MessageAttachments getAttachments()
Message
getAttachments
in interface Message
public Headers getTransportHeaders()
Message
getTransportHeaders
in interface Message
public void setTransportHeaders(Headers headers)
Message
setTransportHeaders
in interface Message
headers
- Headers holding transport headers for the message.public boolean canCarryBindingHeaders()
Message
canCarryBindingHeaders
in interface Message
public void setBindingURI(java.lang.String uri)
public java.lang.String getBindingURI()
Message
getBindingURI
in interface Message
public void setContentType(java.lang.String contentType)
Message
Message.getContent()
.setContentType
in interface Message
contentType
- Type of message content.public java.lang.String getContentType()
Message
getContentType
in interface Message
public void addPart(java.lang.String name, java.lang.Object part)
Message
Message.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 Message
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.public java.lang.Object getPart(java.lang.String name)
Message
public java.lang.Object removePart(java.lang.String name)
public java.util.Set<java.lang.String> getPartNames()
Message
getPartNames
in interface Message
public boolean arePartsEmpty()
Message
Message.getContent()
.arePartsEmpty
in interface Message
public java.util.Map<java.lang.String,java.lang.Object> getParts()
Message
public void setContentPartName(java.lang.String name)
Message
Message.getContent()
). This method can be
used to specify the name of the part that should be considered the message
content.setContentPartName
in interface Message
name
- Name of the part holding the message content.public java.lang.String getContentPartName()
Message
Message.getContent()
). This method will return
the name of the part that holds the content.getContentPartName
in interface Message
protected 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.