org.resilientedge.jockey.peerbridge
Interface PBMessage

All Known Implementing Classes:
LoopbackMessage, PBAbstractMessage, SimpSockMessage

public interface PBMessage

Represents a message transmitted or received from the peer network Subclasses must provide translation from PBABI standard message to a native message for a particular peer framework.

Version:
$Revision: 1.1.1.1 $
Author:
John Gardner

Field Summary
static long NO_ID
           
 
Method Summary
 void fromPeerMessage(PeerMessage message)
          Populate this message with the client side message parameter
 byte[] getContent()
          Gets the content for the message
 PBApplication getDestApp()
          Gets the destination app for this message
 long getMessageId()
          Returns the message ID
 long getResponseId()
          Returns the response ID
 PBApplication getSourceApp()
          Gets the source app for this message
 boolean isAckRequired()
          Return whether or not this message requires an acknowledgement.
 boolean isAsynchronous()
          Return whether or not this message is a request that is being sent asynchronously.
 boolean isResponseExpected()
          Check whether an answer is expected to this message.
 void setAckRequired(boolean newValue)
          Set whether or not this message requires an acknowledgement.
 void setAsynchronous(boolean newValue)
          Set whether or not this message is a request that is being sent asynchronously.
 void setContent(byte[] content)
          Sets the content for the message
 void setDestApp(PBApplication app)
          Sets the destination app for this message
 void setResponseExpected(boolean newValue)
          Set whether or not an answer is expected to this message.
 void setResponseId(long newValue)
          Set the response id for this message.
 void setSourceApp(PBApplication app)
          Sets the source app for this message
 PeerMessage toPeerMessage()
          Construct a client side message object with the contents of this message.
 

Field Detail

NO_ID

public static final long NO_ID
Method Detail

setAckRequired

public void setAckRequired(boolean newValue)
Set whether or not this message requires an acknowledgement. If an ack is required, Jockey will not consider the message sent until an acknowledgement is received from the message recipient(s).
Parameters:
newValue - The new AckRequired value

isAckRequired

public boolean isAckRequired()
Return whether or not this message requires an acknowledgement. If an ack is required, Jockey will not consider the message sent until an acknowledgement is received from the message recipient(s).
Returns:
true if an acknowledgement is required

setAsynchronous

public void setAsynchronous(boolean newValue)
Set whether or not this message is a request that is being sent asynchronously.
Parameters:
newValue - The new asynchronous flag

isAsynchronous

public boolean isAsynchronous()
Return whether or not this message is a request that is being sent asynchronously.
Returns:
true if message is asynchronous

setResponseExpected

public void setResponseExpected(boolean newValue)
Set whether or not an answer is expected to this message.
Parameters:
newValue - The new ResponseExpected value

isResponseExpected

public boolean isResponseExpected()
Check whether an answer is expected to this message.
Returns:
The ResponseExpected value

getMessageId

public long getMessageId()
Returns the message ID
Returns:
The MessageId value

getResponseId

public long getResponseId()
Returns the response ID
Returns:
The ResponseId value

setResponseId

public void setResponseId(long newValue)
Set the response id for this message. (Should contain the message id for which this message is a response.
Returns:
The ResponseId value

getContent

public byte[] getContent()
Gets the content for the message
Returns:
The Content value

setContent

public void setContent(byte[] content)
Sets the content for the message
Parameters:
content - The new Content value

fromPeerMessage

public void fromPeerMessage(PeerMessage message)
Populate this message with the client side message parameter
Parameters:
message - application provided message

toPeerMessage

public PeerMessage toPeerMessage()
Construct a client side message object with the contents of this message.
Returns:
a client side peer message containing the contents of this message.

getDestApp

public PBApplication getDestApp()
Gets the destination app for this message
Returns:
app

setDestApp

public void setDestApp(PBApplication app)
Sets the destination app for this message
Parameters:
app - the destination app

getSourceApp

public PBApplication getSourceApp()
Gets the source app for this message
Returns:
app the emitted this message

setSourceApp

public void setSourceApp(PBApplication app)
Sets the source app for this message
Parameters:
app - the app that emitted this message


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.