|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.resilientedge.jockey.peer.PeerMessage
Represents a message received or being sent by a peer. The content may be textual content or a url to a local file.
Field Summary | |
static java.lang.String |
DEFAULT_TAG
A default tag to categorize message information |
static long |
NO_ID
Represents the id as a null |
Constructor Summary | |
PeerMessage(AppToken app)
Construct a new peer message. |
Method Summary | |
byte[] |
getContent(java.lang.String tag)
Retrieve the contents of the message, by tag. |
int |
getContentLength(java.lang.String tag)
Return the length of a message component, by tag. |
AppToken |
getDestApp()
Gets the destination app for this message |
long |
getRequestId()
Gets the request id, which is a unique identifier among messages generated by this Jockey instance. |
long |
getResponseId()
Gets the unique identifier for the message to which this message is a response. |
AppToken |
getSourceApp()
Gets the source app for this message |
java.lang.String[] |
getTags()
Retrieve the tags that are stored in the message. |
boolean |
isAckRequired()
Check whether this message requires an acknowledgement (ack) upon arrival. |
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 |
setContent(java.lang.String tag,
byte[] content)
Sets a tagged piece of the message content. |
void |
setContent(java.lang.String tag,
java.lang.String content)
Sets the content for the message to the parameter string value. |
void |
setContentAsFile(java.lang.String fileName)
Fill this message with the contents of the specified file. |
void |
setDestApp(AppToken app)
Sets the destination app for this message |
void |
setRequestId(long newValue)
Set a unique identifier for this message. |
void |
setResponseExpected(boolean newValue)
Set whether or not an answer is expected to this message. |
void |
setResponseId(long newValue)
Sets the message id for which this message is a response. |
void |
setSourceApp(AppToken app)
Sets the source app for this message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long NO_ID
public static final java.lang.String DEFAULT_TAG
Constructor Detail |
public PeerMessage(AppToken app)
app
- the app generating this message.Method Detail |
public void setContent(java.lang.String tag, byte[] content)
tag
- The new tag valuecontent
- The new Content valuepublic void setContent(java.lang.String tag, java.lang.String content) throws java.io.UnsupportedEncodingException
tag
- The new tag valuecontent
- The new Content valuepublic void setContentAsFile(java.lang.String fileName)
fileName
- The new ContentAsFile valuepublic void setAckRequired(boolean newValue)
newValue
- The new AckRequired valuepublic byte[] getContent(java.lang.String tag)
tag
- label for message componentpublic int getContentLength(java.lang.String tag)
tag
- label for message componentpublic java.lang.String[] getTags()
public long getRequestId()
public long getResponseId()
public boolean isAckRequired()
public void setResponseExpected(boolean newValue)
newValue
- The new ResponseExpected valuepublic boolean isResponseExpected()
public AppToken getDestApp()
public void setDestApp(AppToken app)
app
- the destination apppublic AppToken getSourceApp()
public void setSourceApp(AppToken app)
app
- the app that emitted this messagepublic void setRequestId(long newValue)
newValue
- The new RequestId valuepublic void setResponseId(long newValue)
newValue
- The new ResponseId value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |