|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlListElement
com.neeve.sma.MessageMetadata
public final class MessageMetadata
Helper class to transport message metadata.
This class serves as helper class for provider implementations that do not possess native capabilities to transport message metadata elements (sender, flow, sno, ...) natively. The class provides facilities to serialize and deserialize metadata elements to/from a flat wire format for use by the provider implementations to transport the metadata elements across the wire.
Field Summary | |
---|---|
static int |
FIXED_WIRE_LENGTH
|
static int |
FIXED_WIRE_LENGTH_V1
|
static int |
FIXED_WIRE_LENGTH_V2
|
static byte |
V1
|
static byte |
V2
|
static byte |
VERSION
|
Fields inherited from class com.neeve.util.UtlListElement |
---|
count, head, next, prev |
Method Summary | |
---|---|
MessageMetadata |
acquire()
Acquires the MessageMetadata preventing it from being
returned to the underlying pool. |
int |
deserialize(ByteBuffer serializedMetadata)
Deserialize contents from a byte buffer |
void |
dispose()
Dispose off this MessageMetadata |
PktBuffer |
getBuffer()
Get the backing buffer The metadata object manipulates its field in place in its backing buffer returned by this method. |
static short |
getLatestVersion()
Get the latest metadata version. |
short |
getMessageChannelId()
Get the message channel id (V1 metadata Field). |
static short |
getMessageChannelId(ByteBuffer buffer)
Get the message channel id (V1 metadata Field) from a serialized buffer. |
String |
getMessageChannelName()
Get the message channel name (V1 metadata Field). |
static String |
getMessageChannelName(ByteBuffer buffer)
Get the message channel name (V1 metadata Field) from a serialized buffer. |
XString |
getMessageChannelNameAsRaw()
Get the message channel name (V1 metadata Field). |
static void |
getMessageChannelNameToRaw(ByteBuffer buffer,
XString target)
Get the message channel name (V1 metadata Field) from a serialized buffer. |
byte |
getMessageEncodingType()
Get the message encoding type (V1 metadata Field). |
static byte |
getMessageEncodingType(ByteBuffer buffer)
Get the message encoding type (V1 metadata Field) from a serialized buffer. |
int |
getMessageFlow()
Get the message flow (V1 metadata Field). |
static int |
getMessageFlow(ByteBuffer buffer)
Get the message flow (V1 metadata Field) from a serialized buffer. |
int |
getMessageSender()
Get the message sender (V1 metadata Field). |
static int |
getMessageSender(ByteBuffer buffer)
Get the message sender (V1 metadata Field) from a serialized buffer |
long |
getMessageSno()
Get the message sequence number (V1 metadata Field). |
static long |
getMessageSno(ByteBuffer buffer)
Get the message sequence number (V1 metadata Field) from a serialized buffer. |
short |
getMessageViewFactory()
Get the message view factory (V1 metadata Field). |
static short |
getMessageViewFactory(ByteBuffer buffer)
Get the message view factory (V1 metadata Field) from a serialized buffer. |
short |
getMessageViewType()
Get the message view (V2 metadata Field). |
static short |
getMessageViewType(ByteBuffer buffer)
Get the message view (V2 metadata Field) from a serialized buffer. |
UtlPool<MessageMetadata> |
getPool()
Implementation of UtlPool.Item#getPool |
int |
getSerializedLength()
Get the serialized length of the message metadata elements. |
short |
getVersion()
Get the metadata version (V1 metadata Field). |
MessageMetadata |
init()
Implementation of UtlPool.Item#init |
void |
serializeV1(byte encodingType,
short vfid,
int sender,
int flow,
long sno,
short channelId,
XString channelName)
Serialize version 1 metadata content |
void |
serializeV2(byte encodingType,
short vfid,
short vid,
int sender,
int flow,
long sno,
short channelId,
XString channelName)
Serialize version 2 metadata content |
MessageMetadata |
setPool(UtlPool<MessageMetadata> pool)
Implementation of UtlPool.Item#setPool |
String |
toString()
Return a string representation of the object. |
int |
wrap(com.neeve.io.IOBuffer serializedMetadata)
Wrap a metadata object around an IO buffer. |
Methods inherited from class com.neeve.util.UtlListElement |
---|
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FIXED_WIRE_LENGTH_V1
public static final int FIXED_WIRE_LENGTH_V2
public static final int FIXED_WIRE_LENGTH
public static final byte V1
public static final byte V2
public static final byte VERSION
Method Detail |
---|
public static final short getLatestVersion()
public final short getVersion()
public static final byte getMessageEncodingType(ByteBuffer buffer)
public final byte getMessageEncodingType()
public static final short getMessageViewFactory(ByteBuffer buffer)
public final short getMessageViewFactory()
public static final short getMessageViewType(ByteBuffer buffer)
public final short getMessageViewType()
public static final int getMessageSender(ByteBuffer buffer)
public final int getMessageSender()
public static final int getMessageFlow(ByteBuffer buffer)
public final int getMessageFlow()
public static final long getMessageSno(ByteBuffer buffer)
public final long getMessageSno()
public static final short getMessageChannelId(ByteBuffer buffer)
public final short getMessageChannelId()
public static final String getMessageChannelName(ByteBuffer buffer)
public static final void getMessageChannelNameToRaw(ByteBuffer buffer, XString target)
public final XString getMessageChannelNameAsRaw()
public final String getMessageChannelName()
public final PktBuffer getBuffer()
The metadata object manipulates its field in place in its backing buffer returned by this method. The caller can call this method to get the buffer with the latest copy of its contents at any time during the lifecycle of the metadata object.
public final void serializeV1(byte encodingType, short vfid, int sender, int flow, long sno, short channelId, XString channelName)
public final void serializeV2(byte encodingType, short vfid, short vid, int sender, int flow, long sno, short channelId, XString channelName)
public final int wrap(com.neeve.io.IOBuffer serializedMetadata) throws SmaException
serializedMetadata
- Contains the serialized form of the metadata
This method wraps a message metadata object around a supplied IO buffer. The method assumes that the serialized form of the metadata starts at the beginning of the IO buffer and the number of valid bytes in the buffer is equal to the length of the IO buffer.
SmaException
public final int deserialize(ByteBuffer serializedMetadata) throws SmaException
SmaException
public final int getSerializedLength()
This method returns the serialized length of the message metadata elements. This length is governed by the metadata wire format version. /P>
public final MessageMetadata acquire()
MessageMetadata
preventing it from being
returned to the underlying pool.
MessageMetadata
for invocation chaining.public final void dispose()
MessageMetadata
public final MessageMetadata init()
init
in interface UtlPool.Item<MessageMetadata>
public final MessageMetadata setPool(UtlPool<MessageMetadata> pool)
setPool
in interface UtlPool.Item<MessageMetadata>
public final UtlPool<MessageMetadata> getPool()
getPool
in interface UtlPool.Item<MessageMetadata>
UtlPool.Item.setPool(com.neeve.util.UtlPool)
public final String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |