|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlListElement
com.neeve.pkt.PktSerializable
com.neeve.pkt.PktBody
com.neeve.pkt.PktSubheader
com.neeve.pkt.PktSubheaderFixed
com.neeve.pkt.PktSubheaderRR
public final class PktSubheaderRR
The RR (Request-Response) packet subheader.
This class is the subheader used to indicate that a packet is part of a request-reply exchange and whether it is the request or reply in that exchange. It also carries information to correlate the request to the reply and request processing information.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.neeve.pkt.PktSerializable |
---|
PktSerializable.DeserializeContext, PktSerializable.SerializeContext |
Field Summary |
---|
Fields inherited from class com.neeve.pkt.PktSubheader |
---|
PREAMBLE_LENGTH, PREAMBLE_LENGTH_V1, V1, VERSION |
Fields inherited from class com.neeve.util.UtlListElement |
---|
count, head, next, prev |
Method Summary | |
---|---|
static PktBody |
create()
Creates a default RR subheader |
static PktBody |
create(Properties props)
Creates an RR subheader |
boolean |
equals(Object obj)
Indicates whether some other object is equal to this one. |
long |
getCorrelationId()
Get the correlation id |
int |
getReplyCount()
Get the reply count from a success reply. |
long |
getReplyErrorCode()
Get the error code from a reply indicating a failure. |
int |
getReplyNum()
Get the reply number from a success reply. |
long |
getRequestCode()
Get the request code. |
int |
hashCode()
Returns the hashcode for this object |
boolean |
isReply()
Get if packet is a reply. |
boolean |
isReplySuccess()
Get whether the reply indicates a failure or success. |
boolean |
isRequest()
Get if packet is a request. |
static boolean |
prepareReply(PktPacket request,
PktPacket reply,
int replyCount,
int replyNum)
Prepare a packet as a success reply to a request. |
static boolean |
prepareReply(PktPacket request,
PktPacket reply,
long errorCode)
Prepare a packet as a failure reply to a request. |
void |
setCorrelationId(long corrid)
Set the correlation id. |
void |
setReplyWithCountAndNum(int replyCount,
int replyNum)
Set packet as a reply of a single/multi reply request. |
void |
setReplyWithError(long errorCode)
Set packet as a reply indicating failure. |
void |
setRequest(long requestCode)
Set packet as a request. |
String |
toString()
Returns a string representation of the object |
Methods inherited from class com.neeve.pkt.PktSubheaderFixed |
---|
doGetSerializedLength, getSerializedLength |
Methods inherited from class com.neeve.pkt.PktSubheader |
---|
getType |
Methods inherited from class com.neeve.pkt.PktBody |
---|
deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, dump, getBuffer, getInitialBufferLength, getSerializedLength, getType, initializeBuffer, isNative, reset, serialize, serialize, serialize, serialize, serialize, serialize, serialize |
Methods inherited from class com.neeve.pkt.PktSerializable |
---|
deserialize, getDeserializationPolicy, getSerializationPolicy, isValidDeserializationPolicy, isValidSerializationPolicy, serialize, setDeserializationPolicy, setSerializationPolicy |
Methods inherited from class com.neeve.util.UtlListElement |
---|
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static PktBody create(Properties props)
props
- The property set to use to qualify creation of the body.public static PktBody create()
public static boolean prepareReply(PktPacket request, PktPacket reply, int replyCount, int replyNum)
request
- The request packet for which to prepare the reply.reply
- The reply packet to prepare. The reply can be the same as
the request.replyCount
- The total number of replies for the request.replyNum
- The reply number that this reply is.
public static boolean prepareReply(PktPacket request, PktPacket reply, long errorCode)
request
- The request packet for which to prepare the reply.reply
- The reply packet to prepare. The reply can be the same as
the request.errorCode
- The reply error code.
public final void setCorrelationId(long corrid)
public final long getCorrelationId()
public final void setRequest(long requestCode)
public final boolean isRequest()
public final long getRequestCode()
IllegalStateException
- Thrown in case the packet is not a request.public final void setReplyWithError(long errorCode)
public final void setReplyWithCountAndNum(int replyCount, int replyNum)
public final boolean isReply()
public final boolean isReplySuccess()
IllegalStateException
- Thrown in case the packet is not a reply.public final long getReplyErrorCode()
IllegalStateException
- Thrown in case the packet a success reply.public final int getReplyCount()
IllegalStateException
- Thrown in case the packet a failure reply.public final int getReplyNum()
IllegalStateException
- Thrown in case the packet a failure reply.public final String toString()
toString
in class Object
public final boolean equals(Object obj)
equals
in class Object
public final int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |