public class RawMessage extends Object implements Serializable
Typically this is a copy of the exact bytes received over the network, after all de-chunking, removal of transport headers, etc has been performed, but before any parsing, decoding, checking of the actual payload has been performed.
Each raw message has a unique id, a timestamp it was received at (this might be different from the timestamp contained
in the payload, if that has any), a tag of what payload type this is supposed to be (e.g. syslog, GELF, RadioMessage etc.),
as well as an opaque meta data structure.
The format of the meta data is not stable yet, but will likely be a JSON string.
| Modifier and Type | Class and Description |
|---|---|
static class |
RawMessage.SourceNode |
| Modifier and Type | Field and Description |
|---|---|
static byte |
CURRENT_VERSION |
| Constructor and Description |
|---|
RawMessage(byte[] payload) |
RawMessage(byte[] payload,
InetSocketAddress remoteAddress) |
RawMessage(byte[] payload,
ResolvableInetSocketAddress remoteAddress) |
RawMessage(JournalMessages.JournalMessage journalMessage,
long journalOffset) |
RawMessage(long journalOffset,
com.eaio.uuid.UUID id,
org.joda.time.DateTime timestamp,
ResolvableInetSocketAddress remoteAddress,
byte[] payload) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSourceNode(String sourceInputId,
NodeId nodeId) |
static RawMessage |
decode(byte[] buffer,
long journalOffset) |
byte[] |
encode() |
Configuration |
getCodecConfig() |
String |
getCodecName() |
com.eaio.uuid.UUID |
getId() |
byte[] |
getIdBytes() |
long |
getJournalOffset() |
byte[] |
getPayload() |
ResolvableInetSocketAddress |
getRemoteAddress() |
List<RawMessage.SourceNode> |
getSourceNodes() |
org.joda.time.DateTime |
getTimestamp() |
int |
getVersion() |
void |
setCodecConfig(Configuration codecConfig) |
void |
setCodecName(String name) |
void |
setRemoteAddress(ResolvableInetSocketAddress address) |
String |
toString() |
public static final byte CURRENT_VERSION
public RawMessage(@Nonnull byte[] payload)
public RawMessage(@Nonnull byte[] payload, @Nullable InetSocketAddress remoteAddress)
public RawMessage(@Nonnull byte[] payload, @Nullable ResolvableInetSocketAddress remoteAddress)
public RawMessage(long journalOffset,
@Nonnull
com.eaio.uuid.UUID id,
org.joda.time.DateTime timestamp,
@Nullable
ResolvableInetSocketAddress remoteAddress,
@Nonnull
byte[] payload)
public RawMessage(JournalMessages.JournalMessage journalMessage, long journalOffset)
@Nullable public static RawMessage decode(byte[] buffer, long journalOffset)
public byte[] encode()
public int getVersion()
public org.joda.time.DateTime getTimestamp()
public byte[] getPayload()
public com.eaio.uuid.UUID getId()
public byte[] getIdBytes()
@Nullable public ResolvableInetSocketAddress getRemoteAddress()
public void setRemoteAddress(ResolvableInetSocketAddress address)
public String getCodecName()
public void setCodecName(String name)
public Configuration getCodecConfig()
public void setCodecConfig(Configuration codecConfig)
public List<RawMessage.SourceNode> getSourceNodes()
public long getJournalOffset()
Copyright © 2012-2016 Graylog, Inc.. All Rights Reserved.