|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.push.CTPService.CTPMessage
protected class CTPService.CTPMessage
This class represents a CTP message. Messages format is described in the CTP design document. This class purpose is to allow users to easily create a CTP message, setting all its properties and then to generate the byte sequence that represent such a message. The second goal of the class is to allow the opposite transformation. A byte stream received from the server can be parsed and translated into a CTPMessage object.
Constructor Summary | |
---|---|
CTPService.CTPMessage()
Build an empty message |
|
CTPService.CTPMessage(byte[] rawMessage)
Build a message decoding the given byte stream |
Method Summary | |
---|---|
void |
addParameter(int code,
byte[] value)
Add one parameter |
byte[] |
getBytes()
Get a byte representation of this message. |
int |
getCommand()
Returns the command or status code |
byte[] |
getNonce()
Return the last nonce that has been parsed. |
int |
getParameterCode(int idx)
Get the parameter code of a given parameter. |
int |
getParametersNumber()
Returns the number of parameters. |
byte[] |
getParameterValue(int idx)
Get the parameter value of a given parameter. |
void |
setCommand(int commandCode)
Sets the command or status code |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CTPService.CTPMessage()
public CTPService.CTPMessage(byte[] rawMessage)
rawMessage
- is the byte stream representing the CTP messageMethod Detail |
---|
public void setCommand(int commandCode)
the
- new codepublic int getCommand()
public void addParameter(int code, byte[] value)
code
- parameter codevalue
- parameter valuepublic int getParametersNumber()
public int getParameterCode(int idx)
idx
- parameter index
public byte[] getParameterValue(int idx)
public byte[] getBytes()
public byte[] getNonce()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |