public final class PktSubheaderRR extends PktSubheaderFixed
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.
PktSerializable.DeserializeContext, PktSerializable.SerializeContextPREAMBLE_LENGTH, PREAMBLE_LENGTH_V1, V1, VERSIONcount, head, next, prev| Modifier and Type | Method and Description |
|---|---|
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
|
doGetSerializedLength, getSerializedLengthgetTypedeserialize, deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, dump, getBuffer, getInitialBufferLength, getSerializedLength, getType, initializeBuffer, isNative, reset, serialize, serialize, serialize, serialize, serialize, serialize, serializedeserialize, getDeserializationPolicy, getSerializationPolicy, isValidDeserializationPolicy, isValidSerializationPolicy, serialize, setDeserializationPolicy, setSerializationPolicycount, insertAfter, insertBefore, isLinked, next, previous, unlink, wipepublic 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()
public final boolean equals(Object obj)
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.