|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.service.io.rpg.RpgHeader
public class RpgHeader
Representation of contents of RPG header (as defined in Now+ API - Communication Protocol & Events) The header contains: the message type, the message request id the message payload length whether the payload is compressed
Field Summary | |
---|---|
static int |
DELIMITER_BYTE
RPG header delimiter byte. |
static int |
HEADER_LENGTH
RPG header length. |
private boolean |
mCompression
|
private int |
mPayloadLength
|
private int |
mReqId
|
private int |
mReqType
|
private byte[] |
mRpqHeader
|
private static byte |
PADDING_BYTE
|
Constructor Summary | |
---|---|
RpgHeader()
Default constructor. |
Method Summary | |
---|---|
boolean |
compression()
Get RPG request type from header |
byte[] |
createHeader()
Generate RPG header as byte array |
protected boolean |
extractHeaderInfo(byte[] headerdata)
Extract header info from byte array into RpgHeader structure |
protected int |
payloadLength()
Get RPG message body data length |
int |
reqId()
Get request ID from header |
int |
reqType()
Get RPG request type from header |
void |
setCompression(boolean compression)
Set whether compression is used |
void |
setPayloadLength(int payloadLength)
Add message data length to RPG header information |
void |
setReqId(int reqId)
Add request id to RPG header information |
void |
setReqType(int reqType)
Set RPG request type |
private boolean |
validateHeader(int type)
Validate RPG header based on whether it specifies a valid message type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HEADER_LENGTH
public static final int DELIMITER_BYTE
private static final byte PADDING_BYTE
private int mReqType
private int mReqId
private int mPayloadLength
private boolean mCompression
private byte[] mRpqHeader
Constructor Detail |
---|
public RpgHeader()
Method Detail |
---|
protected boolean extractHeaderInfo(byte[] headerdata)
headerdata
- byte array containing header info
private boolean validateHeader(int type)
type
- RPG message type
public final int reqType()
public final int reqId()
protected final int payloadLength()
public final boolean compression()
public void setReqType(int reqType)
reqType
- RPG request typepublic void setReqId(int reqId)
reqId
- requrest idpublic void setPayloadLength(int payloadLength)
payloadLength
- length of message datapublic void setCompression(boolean compression)
compression
- public byte[] createHeader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc