public class MessageTopicLinks extends Message
The message contents the CommandType, and the "pay load" of the command. For SUSCRIBE and UNSUSCRIBE commands, the payload is and array of Strings.
Header:
[CommandType ordinal (1 bytes)]
Payload:
[ *[ [TopicName size (2 bytes)] + [TopicName (TopicNameSize bytes)] ] ]
Modifier and Type | Class and Description |
---|---|
static class |
MessageTopicLinks.CommandType |
Message.MessageType
Modifier and Type | Field and Description |
---|---|
private MessageTopicLinks.CommandType |
command |
private java.util.ArrayList<java.lang.String> |
topics |
bufferHeader, bufferPayload, bufferPrologue, msgFlag, sourceIPPort, timeStamp, type
Constructor and Description |
---|
MessageTopicLinks()
Creates an empty message to be populated using the
"fromInputStream" method.
|
MessageTopicLinks(IPPort srcIPP,
MessageTopicLinks.CommandType cmd,
java.util.ArrayList<java.lang.String> topicList)
Create a topic links message based on the passed buffer.
|
Modifier and Type | Method and Description |
---|---|
private byte[] |
computeHeader()
Compute the header of a brand new message.
|
private byte[] |
computePayLoad()
Compute the pay load of a brand new message.
|
protected boolean |
fromInputStream(java.io.InputStream is,
int size)
Populates a topic links message reading data from an input stream.
|
MessageTopicLinks.CommandType |
getCommand() |
java.util.ArrayList<java.lang.String> |
getTopics() |
protected void |
toOutputStream(java.io.OutputStream os)
It writes the "MessageXXX" instance to the specified stream.
|
computePrologue, fromInputStream, getBufferHeader, getBufferPayload, getBufferPrologue, getSourceIPPort, getTimeStamp, getType
private MessageTopicLinks.CommandType command
private java.util.ArrayList<java.lang.String> topics
public MessageTopicLinks()
public MessageTopicLinks(IPPort srcIPP, MessageTopicLinks.CommandType cmd, java.util.ArrayList<java.lang.String> topicList)
cmd
- topicList
- private byte[] computeHeader()
private byte[] computePayLoad()
protected boolean fromInputStream(java.io.InputStream is, int size) throws java.io.IOException
fromInputStream
in class Message
java.io.IOException
public MessageTopicLinks.CommandType getCommand()
public java.util.ArrayList<java.lang.String> getTopics()
protected void toOutputStream(java.io.OutputStream os) throws java.io.IOException
Message
toOutputStream
in class Message
java.io.IOException