javax.jbi.messaging
Interface NormalizedMessage

All Known Subinterfaces:
Fault
All Known Implementing Classes:
FaultImpl, NormalizedMessageImpl

public interface NormalizedMessage

Represents a JBI Normalized Message.

Author:
JSR208 Expert Group

Method Summary
 void addAttachment(String id, DataHandler content)
          Add an attachment to the message.
 DataHandler getAttachment(String id)
          Retrieve attachment with the specified identifier.
 Set getAttachmentNames()
          Returns a list of identifiers for each attachment to the message.
 Source getContent()
          Retrieve the content of the message.
 Object getProperty(String name)
          Retrieve a property from the message.
 Set getPropertyNames()
          Retrieve a list of property names for the message.
 Subject getSecuritySubject()
          Retrieve the security Subject from the message.
 void removeAttachment(String id)
          Removes attachment with the specified unique identifier.
 void setContent(Source content)
          Set the content of the message.
 void setProperty(String name, Object value)
          Set a property on the message.
 void setSecuritySubject(Subject subject)
          Set the security Subject for the message.
 

Method Detail

addAttachment

public void addAttachment(String id,
                          DataHandler content)
                   throws MessagingException
Add an attachment to the message.

Parameters:
id - unique identifier for the attachment
content - attachment content
Throws:
MessagingException - failed to add attachment

getContent

public Source getContent()
Retrieve the content of the message.

Returns:
message content

getAttachment

public DataHandler getAttachment(String id)
Retrieve attachment with the specified identifier.

Parameters:
id - unique identifier for attachment
Returns:
DataHandler representing attachment content, or null if an attachment with the specified identifier is not found

getAttachmentNames

public Set getAttachmentNames()
Returns a list of identifiers for each attachment to the message.

Returns:
iterator over String attachment identifiers

removeAttachment

public void removeAttachment(String id)
                      throws MessagingException
Removes attachment with the specified unique identifier.

Parameters:
id - attachment identifier
Throws:
MessagingException - failed to remove attachment

setContent

public void setContent(Source content)
                throws MessagingException
Set the content of the message.

Parameters:
content - message content
Throws:
MessagingException - failed to set content

setProperty

public void setProperty(String name,
                        Object value)
Set a property on the message.

Parameters:
name - property name
value - property value

setSecuritySubject

public void setSecuritySubject(Subject subject)
Set the security Subject for the message.

Parameters:
subject - Subject to associated with message.

getPropertyNames

public Set getPropertyNames()
Retrieve a list of property names for the message.

Returns:
list of property names

getProperty

public Object getProperty(String name)
Retrieve a property from the message.

Parameters:
name - property name
Returns:
property value, or null if the property does not exist

getSecuritySubject

public Subject getSecuritySubject()
Retrieve the security Subject from the message.

Returns:
security Subject associated with message, or null.


Copyright © 2005 ServiceMix.. All Rights Reserved.