public class RpcPacket extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FragHeaderLen |
static int |
ResponseAuthFailLen |
static int |
ResponseMismatchLen |
Modifier | Constructor and Description |
---|---|
|
RpcPacket()
Default constructor
|
|
RpcPacket(byte[] buf)
Class constructor
|
|
RpcPacket(byte[] buf,
int offset,
int len)
Class constructor
|
|
RpcPacket(int len)
Class constructor
|
protected |
RpcPacket(int len,
RpcPacketPool owner)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
alignPosition()
Align the buffer position on a longword/32bit boundary
|
void |
buildAcceptErrorResponse(int stsCode)
Build an RPC accept error response
|
void |
buildAuthFailResponse(int stsCode)
Build an RPC authentication failure response
|
void |
buildErrorResponse(int stsCode)
Build an error response packet where the RPC has been accepted but returns a status code in the parameter area.
|
void |
buildProgramMismatchResponse(int verLow,
int verHigh)
Build a program mismatch error response
|
void |
buildRequestHeader(int progId,
int verId,
int procId,
int credType,
byte[] cred,
int verfType,
byte[] verf)
Build an RPC request header, and set the buffer pointer ready to stream data into the parameter
area of the request
|
void |
buildResponseHeader()
Build a response header for a valid RPC response and set the buffer pointer ready to stream data
into the parameter area of the response.
|
void |
buildRpcMismatchResponse()
Build an RPC version mismatch response
|
int |
getAcceptStatus()
Return the accept status for the RPC response
|
int |
getAuthFailStatus()
Return the authentication failure status
|
int |
getAvailableLength()
Return the available buffer size
|
byte[] |
getBuffer()
Return the buffer
|
InetAddress |
getClientAddress()
Return the client network address
|
String |
getClientDetails()
Return the client details as a string
|
int |
getClientPort()
Return the client port
|
int |
getClientProtocol()
Return the client protocol
|
int |
getCredentialsLength()
Return the credentials length
|
int |
getCredentialsType()
Return the credentials type
|
int |
getLength()
Return the used buffer length
|
int |
getMessageType()
Return the message type
|
int |
getMismatchVersionHigh()
Return the version mismatch high version
|
int |
getMismatchVersionLow()
Return the version mismatch low version
|
int |
getOffset()
Return the start of data offset
|
RpcPacketPool |
getOwnerPacketPool()
Return the packet pool that owns this packet
|
RpcPacketHandler |
getPacketHandler()
Return the packet handler interface used to send/receive a packet
|
int |
getPosition()
Return the current buffer position
|
int |
getProcedureId()
Return the procedure id
|
int |
getProcedureParameterLength()
Return the procedure parameters length
|
int |
getProcedureParameterOffset()
Return the procedure specific parameters offset
|
int |
getProgramId()
Return the program id
|
int |
getProgramVersion()
Return the program version
|
int |
getRejectStatus()
Return the reject reply status
|
int |
getReplyState()
Return the reply state
|
int |
getRpcVersion()
Return the RPC version
|
int |
getTxLength()
Return the RPC + fragment header length
|
int |
getVerifierLength()
Return the verifier length
|
int |
getVerifierOffset()
Return the buffer offset to the verifier
|
int |
getVerifierType()
Return the verifier type
|
int |
getXID()
Return the XID
|
boolean |
hasClientAddress()
Determine if the client address has been set
|
boolean |
hasPacketHandler()
Determine if the packet handler is valid
|
boolean |
hasSuccessStatus()
Check if the response has a success status
|
boolean |
isAllocatedFromPool()
Detemrine if the packet is allocated from a packet pool
|
void |
packByte(int bval)
Pack a byte value
|
void |
packByteArray(byte[] buf)
Pack a byte array
|
void |
packByteArrayWithLength(byte[] buf)
Pack a byte array with a length
|
void |
packInt(int ival)
Pack an integer value
|
void |
packIntArrayWithLength(int[] iarray)
Pack an integer array
|
void |
packLong(long lval)
Pack a long value
|
void |
packNulls(int len)
Pack nulls
|
void |
packPortMapping(PortMapping portMap)
Pack a port mapping structure
|
void |
packString(String str)
Pack a string
|
void |
packUTF8String(String str)
Pack a UTF-8 string
|
void |
positionAtCredentialsData()
Position the read pointer at the credentials data
|
void |
positionAtParameters()
Position the read pointer at the procedure specific parameters
|
void |
positionAtVerifierData()
Position the read pointer at the verifier data
|
void |
setAuthFailStatus(int authSts)
Set the authentication failure status
|
void |
setBuffer(byte[] buf,
int offset,
int len)
Reset the buffer details
|
void |
setBuffer(int offset,
int len)
Reset the buffer details
|
void |
setClientDetails(InetAddress addr,
int port,
int protocol)
Set the client details
|
void |
setCredentialsLength(int credlen)
Set the credentials length
|
void |
setCredentialsType(int credtype)
Set the credentials type
|
void |
setLength()
Set the used buffer length
|
void |
setLength(int len)
Set the used buffer length
|
void |
setMessageType(int msgType)
Set the message type
|
protected void |
setOwnerPacketPool(RpcPacketPool pool)
Set the owner packet pool, if the packet was allocated from a pool
|
void |
setPacketHandler(RpcPacketHandler pktHandler)
Set the associated packet handler interface for the packet
|
void |
setPosition(int pos)
Set the buffer position
|
void |
setProcedureId(int procId)
Set the procedure id
|
void |
setProgramId(int progId)
Set the program id
|
void |
setProgramVersion(int progVer)
Set the program version
|
void |
setRejectStatus(int rejSts)
Set the reject status
|
void |
setReplyState(int replySts)
Set the reply state
|
void |
setRpcMismatch(int rpcLow,
int rpcHigh)
Set the RPC mismatch values
|
void |
setRpcVersion(int rpcVer)
Set the RPC version
|
void |
setVerifierLength(int verflen)
Set the verifier length
|
void |
setVerifierType(int verftype)
Set the verifier type
|
void |
setXID(int xid)
Set the XID
|
void |
skipBytes(int cnt)
Skip a number of bytes in the buffer, rounded to the next int boundary
|
String |
toString()
Return the RPC packet as a string
|
void |
unpackByteArray(byte[] buf)
Unpack a byte array, using the buffer length
|
void |
unpackByteArrayWithLength(byte[] buf)
Unpack a byte array with a length
|
int |
unpackInt()
Unpack an integer value
|
void |
unpackIntArray(int[] buf)
Unpack an integer array, using the buffer length
|
long |
unpackLong()
Unpack a long value
|
String |
unpackString()
Unpack a string
|
String |
unpackUTF8String()
Unpack a UTF-8 string
|
public static final int FragHeaderLen
public static final int ResponseMismatchLen
public static final int ResponseAuthFailLen
public RpcPacket()
public RpcPacket(int len)
len
- intprotected RpcPacket(int len, RpcPacketPool owner)
len
- intowner
- RpcPacketPoolpublic RpcPacket(byte[] buf)
buf
- byte[]public RpcPacket(byte[] buf, int offset, int len)
buf
- byte[]offset
- intlen
- intpublic final boolean hasPacketHandler()
public final RpcPacketHandler getPacketHandler()
public final boolean isAllocatedFromPool()
public final RpcPacketPool getOwnerPacketPool()
public final boolean hasClientAddress()
public final InetAddress getClientAddress()
public final int getClientPort()
public final int getClientProtocol()
public final String getClientDetails()
public final int getPosition()
public final byte[] getBuffer()
public final int getAvailableLength()
public final int getLength()
public final int getTxLength()
public final int getOffset()
public final int getMessageType()
public final int getRpcVersion()
public final int getProgramId()
public final int getProgramVersion()
public final int getProcedureId()
public final int getCredentialsType()
public final int getCredentialsLength()
public final int getVerifierType()
public final int getVerifierLength()
public final int getVerifierOffset()
public final int getProcedureParameterOffset()
public final int getProcedureParameterLength()
public final int getXID()
public final boolean hasSuccessStatus()
public final int getReplyState()
public final int getRejectStatus()
public final int getMismatchVersionLow()
public final int getMismatchVersionHigh()
public final int getAuthFailStatus()
public final int getAcceptStatus()
protected final void alignPosition()
public final void packByte(int bval)
bval
- intpublic final void packNulls(int len)
len
- intpublic final void packInt(int ival)
ival
- intpublic final void packLong(long lval)
lval
- longpublic final void packByteArrayWithLength(byte[] buf)
buf
- byte[]public final void packByteArray(byte[] buf)
buf
- byte[]public final void packIntArrayWithLength(int[] iarray)
iarray
- int[]public final void packString(String str)
str
- Stringpublic final void packUTF8String(String str)
str
- Stringpublic final void packPortMapping(PortMapping portMap)
portMap
- PortMappingpublic final int unpackInt()
public final long unpackLong()
public final String unpackString()
public final String unpackUTF8String()
public final void unpackByteArrayWithLength(byte[] buf)
buf
- byte[]public final void unpackByteArray(byte[] buf)
buf
- byte[]public final void unpackIntArray(int[] buf)
buf
- int[]public final void positionAtCredentialsData()
public final void positionAtVerifierData()
public final void positionAtParameters()
public final void skipBytes(int cnt)
cnt
- intpublic final void setClientDetails(InetAddress addr, int port, int protocol)
addr
- InetAddressport
- intprotocol
- intpublic final void setBuffer(byte[] buf, int offset, int len)
buf
- byte[]offset
- intlen
- intpublic final void setBuffer(int offset, int len)
offset
- intlen
- intpublic final void setLength(int len)
len
- intpublic final void setLength()
public final void setPosition(int pos)
pos
- intpublic final void setMessageType(int msgType)
msgType
- intpublic final void setRpcVersion(int rpcVer)
rpcVer
- intpublic final void setProgramId(int progId)
progId
- intpublic final void setProgramVersion(int progVer)
progVer
- intpublic final void setProcedureId(int procId)
procId
- intpublic final void setCredentialsType(int credtype)
credtype
- intpublic final void setCredentialsLength(int credlen)
credlen
- intpublic final void setReplyState(int replySts)
replySts
- intpublic final void setRejectStatus(int rejSts)
rejSts
- intpublic final void setRpcMismatch(int rpcLow, int rpcHigh)
rpcLow
- intrpcHigh
- intpublic final void setAuthFailStatus(int authSts)
authSts
- intpublic final void setVerifierType(int verftype)
verftype
- intpublic final void setVerifierLength(int verflen)
verflen
- intpublic final void setPacketHandler(RpcPacketHandler pktHandler)
pktHandler
- RpcPacketHandlerpublic final void setXID(int xid)
xid
- intprotected final void setOwnerPacketPool(RpcPacketPool pool)
pool
- RpcPacketPoolpublic final void buildRequestHeader(int progId, int verId, int procId, int credType, byte[] cred, int verfType, byte[] verf)
progId
- intverId
- intprocId
- intcredType
- intcred
- byte[]verfType
- intverf
- byte[]public final void buildResponseHeader()
public final void buildErrorResponse(int stsCode)
stsCode
- intpublic final void buildRpcMismatchResponse()
public final void buildAuthFailResponse(int stsCode)
stsCode
- intpublic final void buildAcceptErrorResponse(int stsCode)
stsCode
- intpublic final void buildProgramMismatchResponse(int verLow, int verHigh)
verLow
- intverHigh
- intCopyright © 2005–2017 Alfresco Software. All rights reserved.