MigratoryData Client API for Java
Developer's Guide and Reference Manual
MigratoryDataMessage Class Reference

Represent a message. More...

Inheritance diagram for MigratoryDataMessage:

Public Member Functions

 MigratoryDataMessage (String subject, String content)
 Create a MigratoryDataMessage object. More...
 
 MigratoryDataMessage (String subject, String content, String closure)
 Create a MigratoryDataMessage object. More...
 
 MigratoryDataMessage (String subject, String content, List< MigratoryDataField > fields)
 Create a MigratoryDataMessage object. More...
 
 MigratoryDataMessage (String subject, String content, List< MigratoryDataField > fields, String closure)
 Create a MigratoryDataMessage object. More...
 
String getSubject ()
 Get the subject of the message. More...
 
String getContent ()
 Get the content of the message. More...
 
List< MigratoryDataFieldgetFields ()
 Get the fields of the message. More...
 
Map< String, String > getFieldsAsMap ()
 Get the fields of the message. More...
 
String getClosure ()
 Get the closure of the message. More...
 
boolean isSnapshot ()
 Test whether the message is a snapshot message or not. More...
 
void setReplyToSubject (String subject)
 
String getReplyToSubject ()
 
String toString ()
 Return a string representation of the message.
 

Protected Attributes

Map< String, String > fieldMap
 
boolean isSnapshot
 
boolean isRecovery
 
int seq
 
int epoch
 

Detailed Description

Represent a message.

Constructor & Destructor Documentation

◆ MigratoryDataMessage() [1/4]

MigratoryDataMessage.MigratoryDataMessage ( String  subject,
String  content 
)

Create a MigratoryDataMessage object.

Parameters
subjectThe subject of the message
contentThe content of the message

◆ MigratoryDataMessage() [2/4]

MigratoryDataMessage.MigratoryDataMessage ( String  subject,
String  content,
String  closure 
)

Create a MigratoryDataMessage object.

Parameters
subjectThe subject of the message
contentThe content of the message
closureThe closure of the message

◆ MigratoryDataMessage() [3/4]

MigratoryDataMessage.MigratoryDataMessage ( String  subject,
String  content,
List< MigratoryDataField fields 
)

Create a MigratoryDataMessage object.

Parameters
subjectThe subject of the message
contentThe content of the message
fieldsThe fields of the message

◆ MigratoryDataMessage() [4/4]

MigratoryDataMessage.MigratoryDataMessage ( String  subject,
String  content,
List< MigratoryDataField fields,
String  closure 
)

Create a MigratoryDataMessage object.

Parameters
subjectThe subject of the message
contentThe content of the message
fieldsThe fields of the message
closureThe closure of the message

Member Function Documentation

◆ getSubject()

String MigratoryDataMessage.getSubject ( )

Get the subject of the message.

Returns
A string representing the subject of the message

◆ getContent()

String MigratoryDataMessage.getContent ( )

Get the content of the message.

Returns
A string representing the content of the message

◆ getFields()

List<MigratoryDataField> MigratoryDataMessage.getFields ( )

Get the fields of the message.

Returns
The fields of the message as a list of MigratoryDataField objects

◆ getFieldsAsMap()

Map<String, String> MigratoryDataMessage.getFieldsAsMap ( )

Get the fields of the message.

Returns
The fields of the message as a map.

◆ getClosure()

String MigratoryDataMessage.getClosure ( )

Get the closure of the message.

Returns
The closure data of the message

◆ isSnapshot()

boolean MigratoryDataMessage.isSnapshot ( )

Test whether the message is a snapshot message or not.

Returns
true if the message is a snapshot message

◆ setReplyToSubject()

void MigratoryDataMessage.setReplyToSubject ( String  subject)

Set the subject to be used to reply to this message.

If a reply subject is attached to a message with this method, the message acts as a request. The clients which receive a request message will be able to reply by sending a message having as subject the reply subject.

If the reply subject is not already subscribed, it is subscribed by the API library implicitly. It can be reused for subsequent request/reply interactions (and even for receiving multiple replies to one request). When it is not needed anymore, it should be unsubscribed explicitly.

Parameters
subjectThe subject to be used to reply to this message.

◆ getReplyToSubject()

String MigratoryDataMessage.getReplyToSubject ( )

Get the subject to be used to reply to this message.

A client which receives a message containing a reply subject should interpret the message as a request. It has the option to use the reply subject - extracted from the message with this method - to send a reply.

Returns
The subject to be used to reply to this message.