com.sap.engine.interfaces.messaging.api

Interface Payload

All Known Subinterfaces:
TextPayload, XMLPayload

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.

See Also:
Message

Method Summary
 void clearAttributes()
          Removes all currently present payload attributes.
 String getAttribute(String attributeName)
          Returns the specified payload attribute value for the given content attribute name, like e.g. content-type or content-disposition.
 Set<String> getAttributeNames()
          Returns a set with all available payload content attribute names, like e.g. content-type or content-disposition.
 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.
 

Method Detail

getName

String getName()
Returns the logical name of this payload. Payloads can be accessed by this name from the Message interface.

Returns:
String name

setName

void setName(String name)
             throws InvalidParamException
Sets the name of this payload.

Parameters:
name - is the name of this payload.
Throws:
InvalidParamException - if the name is invalid.

getDescription

String getDescription()
Returns a description of the papyload.

Returns:
String description.

setDescription

void setDescription(String text)
                    throws InvalidParamException
Sets a description of the payload.

Parameters:
text - of the description.
Throws:
InvalidParamException - if the description is invlaid.

getContentType

String getContentType()
Returns the content type of the payload.

Returns:
String

setContentType

void setContentType(String type)
                    throws InvalidParamException
Sets the content type of the payload.

Parameters:
type - of the content of the payload
Throws:
InvalidParamException - if the content type is invalid.

getInputStream

InputStream getInputStream()
Returns an InputStream to the content of this payload.

Returns:
InputStream to read the content of the payload or null.

getContent

byte[] getContent()
Returns the content of this payload as a byte array.

Returns:
byte[] of payload data or null.

setContent

void setContent(byte[] bytes)
                throws InvalidParamException
Set content as byte array into payload.

Parameters:
bytes - of data in byte array.
Throws:
InvalidParamException - if the content is invalid.

getAttributeNames

Set<String> getAttributeNames()
Returns a set with all available payload content attribute names, like e.g. content-type or content-disposition.


clearAttributes

void clearAttributes()
Removes all currently present payload attributes.


getAttribute

String getAttribute(String attributeName)
Returns the specified payload attribute value for the given content attribute name, like e.g. content-type or content-disposition. Please be aware, that a convenience method is available to get the content-type (getContentType).


setAttribute

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. Please be aware, that a convenience method is available to set the content-type (setContentType).


removeAttribute

void removeAttribute(String attributeName)
Removes the specified payload attribute value for the given content attribute name, like e.g. content-type or content-disposition.

Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] SAP_XIAF [sap.com] com.sap.aii.af.ifc.facade api BC-XI


Copyright 2015 SAP AG Complete Copyright Notice