Package oracle.soa.api.message
Interface Message<T>
- All Superinterfaces:
Serializable
Abstract message representation, the default implementation is an XML based
message, that can be created via XMLMessageFactory.getInstance().createMessage
// create a std dom parser
DOMParser parser = new DOMParser();
parser.parse(new InputSource(new StringReader(xml)));
Element element = parser.getDocument().getDocumentElement();
Map <String, Element> payload = new HashMap<String, Element>();
payload.put(<payload part name>, element);
Message<Element> xmlMessage =
XMLMessageFactory.getInstance().createMessage(payload);
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(Attachment attachment) Adds a message attachmentvoidAdds a protocol header to the messageGets the message attachmentsGets the protocol headersGets the message payloadGets the message propertiesgetProperty(String name) Gets the specified message property valuevoidsetHeaders(List<Element> headers) Replaces the current set of protocol headers with the specified setvoidsetPayload(Payload<T> payload) Specifies the payload associated with the messagevoidsetProperties(Map<String, Object> properties) Replaces all existing properties on the message with the specified setvoidsetProperty(String name, Object value) Sets a specific property on the message
-
Method Details
-
setPayload
Specifies the payload associated with the message- Parameters:
payload- the payload of the message.
-
getPayload
Gets the message payload- Returns:
- The message payload
-
addAttachment
Adds a message attachment- Parameters:
attachment- an attachment
-
getAttachments
List<Attachment> getAttachments()Gets the message attachments- Returns:
- The message attachments
-
addHeader
Adds a protocol header to the message- Parameters:
header- the header
-
setHeaders
Replaces the current set of protocol headers with the specified set- Parameters:
headers- the replacement headers
-
getHeaders
Gets the protocol headers- Returns:
- The protocol headers
-
setProperties
Replaces all existing properties on the message with the specified set- Parameters:
properties- the replacement properties
-
getProperties
Gets the message properties- Returns:
- The message properties
-
setProperty
Sets a specific property on the message- Parameters:
name- the name of the propertyvalue- the value of the named property
-
getProperty
Gets the specified message property value- Parameters:
name- the property name- Returns:
- The value of the specified property
-