public class MigratoryDataMessage extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
MigratoryDataMessage.MessageType |
static class |
MigratoryDataMessage.QoS
The quality of service (QoS) levels for MigratoryData messaging.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
compressed |
protected int |
epoch |
protected MigratoryDataMessage.MessageType |
messageType |
protected boolean |
retained |
protected int |
seq |
| Constructor and Description |
|---|
MigratoryDataMessage(String subject,
byte[] content)
Create a MigratoryDataMessage object.
|
MigratoryDataMessage(String subject,
byte[] content,
String closure)
Create a MigratoryDataMessage object.
|
MigratoryDataMessage(String subject,
byte[] content,
String closure,
MigratoryDataMessage.QoS qos,
boolean retained)
Create a MigratoryDataMessage object.
|
MigratoryDataMessage(String subject,
byte[] content,
String closure,
MigratoryDataMessage.QoS qos,
boolean retained,
String replySubject)
Create a MigratoryDataMessage object.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClosure()
Get the closure of the message.
|
byte[] |
getContent()
Get the content of the message.
|
int |
getEpoch() |
MigratoryDataMessage.MessageType |
getMessageType()
Get the MessageType of the message.
|
MigratoryDataMessage.QoS |
getQos()
Get the QoS level of the message.
|
String |
getReplySubject()
Get the reply subject of the message.
|
String |
getResponse() |
int |
getSeq() |
String |
getSubject()
Get the subject of the message.
|
boolean |
isCompressed()
Indicate whether or not the message should be/was compressed.
|
boolean |
isRetained()
Indicate whether or not the message should be/was retained by the server.
|
void |
respond(String response) |
void |
setCompressed(boolean compressed)
Set whether to compress the content of the message or not.
|
String |
toString() |
boolean |
waitForResponse(long timeout,
TimeUnit unit) |
protected boolean retained
protected int seq
protected int epoch
protected boolean compressed
protected MigratoryDataMessage.MessageType messageType
public MigratoryDataMessage(String subject, byte[] content)
subject - the subject of the messagecontent - the content of the messagepublic MigratoryDataMessage(String subject, byte[] content, String closure)
subject - the subject of the messagecontent - the content of the messageclosure - the closure of the messagepublic MigratoryDataMessage(String subject, byte[] content, String closure, MigratoryDataMessage.QoS qos, boolean retained)
subject - the subject of the messagecontent - the content of the messageclosure - the closure of the messageqos - the QoS level of the message; the default is QoS.GUARANTEEDretained - indicate whether or not the message should be/was retained by the server; the default is truepublic MigratoryDataMessage(String subject, byte[] content, String closure, MigratoryDataMessage.QoS qos, boolean retained, String replySubject)
subject - the subject of the messagecontent - the content of the messageclosure - the closure of the messageqos - the QoS level of the message; the default is QoS.GUARANTEEDretained - indicate whether or not the message should be/was retained by the server; the default is truereplySubject - the reply subject of the messagepublic String getSubject()
public byte[] getContent()
public String getClosure()
public boolean isRetained()
public String getReplySubject()
public MigratoryDataMessage.QoS getQos()
public MigratoryDataMessage.MessageType getMessageType()
public void setCompressed(boolean compressed)
compressed - if \c true, the content of the message will be published in ZLIB-compressed format; if \c false
no compression format will be used; the default value is \c false.public boolean isCompressed()
public boolean waitForResponse(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic String getResponse()
public void respond(String response)
public String toString()
public int getSeq()
public int getEpoch()
Copyright © 2024. All rights reserved.