public final class TopicMessage extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
FIELD_DELIM |
static byte |
RECORD_DELIM |
Constructor and Description |
---|
TopicMessage(String topic) |
TopicMessage(String topic,
byte[] message)
Constructor
|
TopicMessage(String topic,
String message)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addUserHeader(String header)
addUserHeader
|
byte[] |
asBytes()
asBytes
|
String |
asString()
asString
|
String |
getAckID()
getAckID
|
com.pushtechnology.mobile.enums.EncodingValue |
getEncoding() |
int |
getTimeout()
getTimeout
|
String |
getTopic()
getTopic
|
Vector |
getUserHeaders()
getUserHeaders
|
boolean |
isAckRequired()
isAckRequired
|
void |
putRecord(byte[][] fields)
Append the content of the message with the given fields.
|
void |
putRecord(String[] fields) |
String |
setAckRequired(int timeout)
setAckRequired
|
void |
setEncoding(com.pushtechnology.mobile.enums.EncodingValue theEncoding)
Set the encoding for this TopicMessage.
|
void |
setMessage(byte[] theMessage) |
void |
setMessage(String theMessage)
Set the content of the message
|
void |
setUserHeaders(Vector headers)
setUserHeaders
|
String |
toString() |
public static final byte RECORD_DELIM
public static final byte FIELD_DELIM
public TopicMessage(String topic, String message)
topic
- message
- public TopicMessage(String topic, byte[] message)
topic
- message
- public TopicMessage(String topic)
public void putRecord(byte[][] fields) throws APIException
fields
- APIException
public void putRecord(String[] fields) throws APIException
APIException
public String getTopic()
public String asString()
public byte[] asBytes()
public void setMessage(String theMessage)
theMessage
- new value for the message payloadpublic void setMessage(byte[] theMessage)
public void setUserHeaders(Vector headers)
headers
- public Vector getUserHeaders()
public void addUserHeader(String header)
header
- public String setAckRequired(int timeout)
timeout
- public int getTimeout()
public String getAckID()
public boolean isAckRequired()
public void setEncoding(com.pushtechnology.mobile.enums.EncodingValue theEncoding)
theEncoding
- public com.pushtechnology.mobile.enums.EncodingValue getEncoding()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.