Package org.logstash.beats
Class Message
- java.lang.Object
-
- org.logstash.beats.Message
-
- All Implemented Interfaces:
Comparable<Message>
public class Message extends Object implements Comparable<Message>
-
-
Field Summary
Fields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMapper
MAPPER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Message o)
Batch
getBatch()
Map
getData()
Returns a list of key/value pairs representing the contents of the message.String
getIdentityStream()
int
getSequence()
Returns the sequence number of this messsagevoid
setBatch(Batch batch)
-
-
-
Constructor Detail
-
Message
public Message(int sequence, Map map)
Create a message using a map of key, value pairs- Parameters:
sequence
- sequence number of the messagemap
- key/value pairs representing the message
-
Message
public Message(int sequence, io.netty.buffer.ByteBuf buffer)
Create a message using a ByteBuf holding a Json object. Note that this ctr is *lazy* - it will not deserialize the Json object until it is needed.- Parameters:
sequence
- sequence number of the messagebuffer
-ByteBuf
buffer containing Json object
-
-
Method Detail
-
getSequence
public int getSequence()
Returns the sequence number of this messsage- Returns:
-
getData
public Map getData()
Returns a list of key/value pairs representing the contents of the message. Note that this method is lazy if the Message was created using aByteBuf
- Returns:
Map
Map of key/value pairs
-
compareTo
public int compareTo(Message o)
- Specified by:
compareTo
in interfaceComparable<Message>
-
getBatch
public Batch getBatch()
-
setBatch
public void setBatch(Batch batch)
-
getIdentityStream
public String getIdentityStream()
-
-