com.resilientedge.jockey.peerbridge
Class SimpSockMessage

java.lang.Object
  |
  +--com.resilientedge.jockey.peerbridge.SimpSockMessage
All Implemented Interfaces:
PBMessage, java.io.Serializable

public class SimpSockMessage
extends java.lang.Object
implements PBMessage, java.io.Serializable

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
See Also:
Serialized Form

Fields inherited from interface org.resilientedge.jockey.peerbridge.PBMessage
NO_ID
 
Constructor Summary
SimpSockMessage()
          Construct a new message.
 
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 responseId)
          Set response ID.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpSockMessage

public SimpSockMessage()
Construct a new message.
Method Detail

fromPeerMessage

public void fromPeerMessage(PeerMessage message)
Populate this message with the client side message parameter
Specified by:
fromPeerMessage in interface PBMessage
Parameters:
message - application provided message

toPeerMessage

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

setAsynchronous

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

isAsynchronous

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

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).
Specified by:
setAckRequired in interface PBMessage
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).
Specified by:
isAckRequired in interface PBMessage
Returns:
true if an acknowledgement is required

setResponseExpected

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

isResponseExpected

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

getMessageId

public long getMessageId()
Returns the message ID
Specified by:
getMessageId in interface PBMessage
Returns:
The MessageId value

getResponseId

public long getResponseId()
Returns the response ID
Specified by:
getResponseId in interface PBMessage
Returns:
The ResponseId value

setResponseId

public void setResponseId(long responseId)
Set response ID. This is the message ID from the request to which this message is a response.
Specified by:
setResponseId in interface PBMessage
Parameters:
responseId - the new response ID value

getContent

public byte[] getContent()
Gets the content for the message
Specified by:
getContent in interface PBMessage
Returns:
The Content value

setContent

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

getDestApp

public PBApplication getDestApp()
Gets the destination app for this message
Specified by:
getDestApp in interface PBMessage
Returns:
app

setDestApp

public void setDestApp(PBApplication app)
Sets the destination app for this message
Specified by:
setDestApp in interface PBMessage
Parameters:
app - the destination app

getSourceApp

public PBApplication getSourceApp()
Gets the source app for this message
Specified by:
getSourceApp in interface PBMessage
Returns:
app the emitted this message

setSourceApp

public void setSourceApp(PBApplication app)
Sets the source app for this message
Specified by:
setSourceApp in interface PBMessage
Parameters:
app - the app that emitted this message


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