com.bea.b2b.protocol.messaging
Interface Message

All Known Implementing Classes:
MessageBase, RNMessage, XOCPMessage

public interface Message
extends java.io.Serializable, java.lang.Cloneable

The Message interface contains all of the information required for processing a business message in WebLogic Collaborate, either on the c-hub or on a c-enabler node.

Author:
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.

Method Summary
 void addPayloadPart(PayloadPart payloadPart)
          Adds a single payload part to this business message.
 void addPayloadParts(PayloadPart[] payloadParts)
          Adds one or more payload parts to this business message.
 void addRecipient(java.lang.String rec)
          Adds a recipient to the current list of recipients of this business message.
 java.lang.String getConversationId()
          Gets the conversation ID for the conversation in which this business message is sent.
 ConversationType getConversationType()
          Gets the conversation type of this message.
 long getCreationTime()
          Gets the time when this business message was created.
 java.lang.String getMessageId()
          Returns the unique message ID of this business message.
 PayloadPart[] getPayloadParts()
          Gets all of the payload parts of this business message.
 java.lang.String[] getRecipients()
          Gets a copy of the current list of recipients for this business message.
 boolean isBusinessMessage()
          Determines whether this message is a valid business message (true) or not (false).
 void removeAllPayloadParts()
          Removes all payload parts from this business message.
 void removeAllRecipients()
          Removes all recipients from the message recipient list, resulting in an empty list.
 boolean removeRecipient(java.lang.String rec)
          Removes the specified recipient from the recipient list of this business message.
 MessageToken send()
          Sends this business message to the c-hub.
 void setRecipient(java.lang.String recipient)
          Sets the recipients list of this business message to the single specified trading partner.
 void setToRole(java.lang.String tRole)
          Sets the to-role for the recipients of this business message.
 

Method Detail

getMessageId

public java.lang.String getMessageId()
Returns the unique message ID of this business message. This identifier is for the business message received.

The message ID is used to help tracking this business message. It can also be used in crash recovery to help identify duplicate messages that may have occurred during system failure. The message ID is not set until the c-enabler sends this business message.

Returns:
String - Message ID.

getCreationTime

public long getCreationTime()
Gets the time when this business message was created.

Returns:
long - Number of milliseconds since January 1, 1970.

getConversationId

public java.lang.String getConversationId()
Gets the conversation ID for the conversation in which this business message is sent.

Returns:
String - Conversation ID.

getConversationType

public ConversationType getConversationType()
Gets the conversation type of this message.

Returns:
ConversationType - Conversation type.

setToRole

public void setToRole(java.lang.String tRole)
Sets the to-role for the recipients of this business message. Usage of this method is restricted to c-enablers only.

Parameters:
tRole - To-role of recipient trading partners.

isBusinessMessage

public boolean isBusinessMessage()
Determines whether this message is a valid business message (true) or not (false). Usage of this method is restricted to the c-hub only.

Returns:
boolean - true if this is a valid business message, or false if it is not.

addRecipient

public void addRecipient(java.lang.String rec)
                  throws ModificationException
Adds a recipient to the current list of recipients of this business message. Duplicate recipients are removed automatically. All recipients are validated later when this business message is about to be queued for delivery to trading partners. Usage of this method is restricted to the c-hub only.

Throws:
ModificationException - If an error occurred during message modification.

removeAllRecipients

public void removeAllRecipients()
                         throws ModificationException
Removes all recipients from the message recipient list, resulting in an empty list. Usage of this method is restricted to the c-hub only.

Throws:
ModificationException - If an error occurred during message modification.

removeRecipient

public boolean removeRecipient(java.lang.String rec)
                        throws ModificationException
Removes the specified recipient from the recipient list of this business message. Usage of this method is restricted to the c-hub only.

Returns:
boolean - true if the specified recipient existed and was removed, or false if the specified recipient did not exist in the recipient list.

getRecipients

public java.lang.String[] getRecipients()
Gets a copy of the current list of recipients for this business message. Usage of this method is restricted to the c-hub only.

Returns:
String[] - Message recipients.

setRecipient

public void setRecipient(java.lang.String recipient)
                  throws ModificationException
Sets the recipients list of this business message to the single specified trading partner. Usage of this method is restricted to c-enablers only.

Parameters:
recipient - recipient of the message

getPayloadParts

public PayloadPart[] getPayloadParts()
Gets all of the payload parts of this business message.

Returns:
PayloadPart[] - Payload parts.

addPayloadPart

public void addPayloadPart(PayloadPart payloadPart)
Adds a single payload part to this business message. Usage of this method is restricted to c-enablers only.

Parameters:
payloadPart - Payload part.

addPayloadParts

public void addPayloadParts(PayloadPart[] payloadParts)
Adds one or more payload parts to this business message. Usage of this method is restricted to c-enablers only.

Parameters:
payloadParts - Payload parts.

removeAllPayloadParts

public void removeAllPayloadParts()
Removes all payload parts from this business message. Usage of this method is restricted to c-enablers only.


send

public MessageToken send()
                  throws MessageDeliveryException
Sends this business message to the c-hub. Usage of this method is restricted to c-enablers only.

Returns:
MessageToken - Message token.
Throws:
MessageDeliveryException - If an error occurred during message delivery.