public interface Payload
The Payload
interface represents the actual content exchanged in a message, either a business
documents or attachments to it. It hides the differences among XML messaging protocols from the applications. It
defines methods to allow applications to access various aspects of a payload although not every protocol might be
able to handle all the data and might therefore throw an InvalidParamException
or ignore the parameter
on set methods and return null
on get methods.
The Payload
is generic and can handle any kind of data, including binary data.
Payload
objects are created by factory methods in the Message
interface.
Message
Modifier and Type | Method and Description |
---|---|
void |
clearAttributes()
Removes all currently present payload attributes.
|
String |
getAttribute(String attributeName) |
Set<String> |
getAttributeNames() |
byte[] |
getContent()
Returns the content of this payload as a byte array.
|
String |
getContentType()
Returns the content type of the payload.
|
String |
getDescription()
Returns a description of the papyload.
|
InputStream |
getInputStream()
Returns an
InputStream to the content of this payload. |
String |
getName()
Returns the logical name of this payload.
|
void |
removeAttribute(String attributeName)
Removes the specified payload attribute value for the given content attribute name, like e.g. content-type or
content-disposition.
|
void |
setAttribute(String name,
String value)
Sets the specified payload attribute value for the given content attribute name, like e.g. content-type or
content-disposition.
|
void |
setContent(byte[] bytes)
Set content as byte array into payload.
|
void |
setContentType(String type)
Sets the content type of the payload.
|
void |
setDescription(String text)
Sets a description of the payload.
|
void |
setName(String name)
Sets the name of this payload.
|
String getName()
Message
interface.void setName(String name) throws InvalidParamException
name
- is the name of this payload.InvalidParamException
- if the name is invalid.String getDescription()
void setDescription(String text) throws InvalidParamException
text
- of the description.InvalidParamException
- if the description is invlaid.String getContentType()
void setContentType(String type) throws InvalidParamException
type
- of the content of the payloadInvalidParamException
- if the content type is invalid.InputStream getInputStream()
InputStream
to the content of this payload.null
.byte[] getContent()
null
.void setContent(byte[] bytes) throws InvalidParamException
bytes
- of data in byte array.InvalidParamException
- if the content is invalid.Set<String> getAttributeNames()
void clearAttributes()
String getAttribute(String attributeName)
attributeName
- attributeNamevoid setAttribute(String name, String value)
name
- string namevalue
- string valuevoid removeAttribute(String attributeName)
attributeName
- attributeNameAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.af.ifc.facade
|
api
|
BC-XI
|
Copyright 2019 SAP AG Complete Copyright Notice