public class Message extends Object
Modifier and Type | Field and Description |
---|---|
SortedMap<String,byte[]> |
annotations |
int |
annotations_size |
byte[] |
data |
int |
data_size |
int |
flags |
static int |
FLAGS_BATCH |
static int |
FLAGS_COMPRESSED |
static int |
FLAGS_EXCEPTION |
static int |
FLAGS_META_ON_CONNECT |
static int |
FLAGS_ONEWAY |
static int |
HEADER_SIZE |
static int |
MSG_CONNECT |
static int |
MSG_CONNECTFAIL |
static int |
MSG_CONNECTOK |
static int |
MSG_INVOKE |
static int |
MSG_PING |
static int |
MSG_RESULT |
int |
seq |
int |
serializer_id |
static int |
SERIALIZER_JSON |
static int |
SERIALIZER_MARSHAL |
static int |
SERIALIZER_PICKLE |
static int |
SERIALIZER_SERPENT |
int |
type |
Constructor and Description |
---|
Message(int msgType,
byte[] databytes,
int serializer_id,
int flags,
int seq,
SortedMap<String,byte[]> annotations,
byte[] hmac)
construct a full wire message including data and annotations payloads.
|
Message(int msgType,
int serializer_id,
int flags,
int seq)
construct a header-type message, without data and annotations payload.
|
Modifier and Type | Method and Description |
---|---|
static Message |
from_header(byte[] header)
Parses a message header.
|
byte[] |
get_annotations_bytes() |
byte[] |
get_header_bytes() |
byte[] |
hmac(byte[] key)
returns the hmac of the data and the annotation chunk values (except HMAC chunk itself)
|
static Message |
recv(InputStream connection,
int[] requiredMsgTypes,
byte[] hmac)
Receives a pyro message from a given connection.
|
byte[] |
to_bytes()
creates a byte stream containing the header followed by annotations (if any) followed by the data
|
static void |
TraceMessageRecv(int sequenceNr,
byte[] headerdata,
byte[] annotations,
byte[] data) |
static void |
TraceMessageSend(int sequenceNr,
byte[] headerdata,
byte[] annotations,
byte[] data) |
public static final int HEADER_SIZE
public static final int MSG_CONNECT
public static final int MSG_CONNECTOK
public static final int MSG_CONNECTFAIL
public static final int MSG_INVOKE
public static final int MSG_RESULT
public static final int MSG_PING
public static final int FLAGS_EXCEPTION
public static final int FLAGS_COMPRESSED
public static final int FLAGS_ONEWAY
public static final int FLAGS_BATCH
public static final int FLAGS_META_ON_CONNECT
public static final int SERIALIZER_SERPENT
public static final int SERIALIZER_JSON
public static final int SERIALIZER_MARSHAL
public static final int SERIALIZER_PICKLE
public int type
public int flags
public byte[] data
public int data_size
public int annotations_size
public int serializer_id
public int seq
public Message(int msgType, int serializer_id, int flags, int seq)
public byte[] hmac(byte[] key)
public byte[] to_bytes()
public byte[] get_header_bytes()
public byte[] get_annotations_bytes()
public static Message from_header(byte[] header)
public static Message recv(InputStream connection, int[] requiredMsgTypes, byte[] hmac) throws IOException
IOException
public static void TraceMessageSend(int sequenceNr, byte[] headerdata, byte[] annotations, byte[] data) throws IOException
IOException
public static void TraceMessageRecv(int sequenceNr, byte[] headerdata, byte[] annotations, byte[] data) throws IOException
IOException
Copyright © 2016. All Rights Reserved.