com.neeve.pkt
Class PktSubheaderFMC

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.pkt.PktSerializable
          extended by com.neeve.pkt.PktBody
              extended by com.neeve.pkt.PktSubheader
                  extended by com.neeve.pkt.PktSubheaderVariable
                      extended by com.neeve.pkt.PktSubheaderFMC
All Implemented Interfaces:
com.neeve.io.IOElasticBuffer.Initializer, com.neeve.io.IOElasticBuffer.Sizer

public final class PktSubheaderFMC
extends PktSubheaderVariable

The FMC (Fabric Multicast) packet subheader.

This class is the subheader used to transport fabric multicast related information in the packet header e.g. topics.

This packet subheader header is a versioned entity. The subheader version defines the format of the subheader i.e. what fields comprise the subheader and their relative locations when serialized. A crucial aspect of subheader versioning is that a version N subheader will always be a subset of a version M subheader where N < M i.e. all fields in version N of a subheader will be present and in the same position as fields in version M of the subheader. i.e. a subheader never shrinks or moves fields around. With time, the subheader can only grow. See the setter/getter method documentation for information on which subheader version the fields that they affect belong to.

Threading:
Packet subheaders are not safe for concurrent access by multiple threads.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.neeve.pkt.PktSerializable
PktSerializable.DeserializeContext, PktSerializable.SerializeContext
 
Field Summary
 
Fields inherited from class com.neeve.pkt.PktSubheader
PREAMBLE_LENGTH, PREAMBLE_LENGTH_V1
 
Fields inherited from class com.neeve.util.UtlListElement
count, head, next, prev
 
Method Summary
static PktBody create()
          Creates a default FMC subheader.
static PktBody create(Properties props)
          Creates an FMC subheader.
 int doGetSerializedLength()
          Invoked to fetch the serialized length of the body
 boolean equals(Object obj)
          Indicates whether some other object is equal to this one.
static short getLatestSubheaderVersion()
          Get the latest subheader version.
 int getSerializedLength(ByteBuffer buffer, int offset)
          Get the serialized length from the serialized form
 short getSubheaderVersion()
          Get the header format version (V1 Subheader Field).
 String getTopic()
          Get the publication topic (V1 Subheader Field).
 int hashCode()
          Returns the hashcode for this object
 void initialize()
          Invoked by constructor post initialization This method is invoked by the constructor post initialization of the base class.
 void initializeBuffer()
          Implementation of IOElasticBuffer.Initializer.initializeBuffer() The default implementation of this method is no-op.
 void postDeserialize(int len)
          Invoked by PktBody.deserialize(com.neeve.pkt.PktSerializable.DeserializeContext, int, com.neeve.trace.Tracer) after completing deserialization.
 void setTopic(String topic)
          Set the publication topic (V1 Subheader Field).
 String toString()
          Returns a string representation of the object
 
Methods inherited from class com.neeve.pkt.PktSubheader
getType
 
Methods inherited from class com.neeve.pkt.PktBody
deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, dump, getBuffer, getInitialBufferLength, getSerializedLength, getType, isNative, reset, serialize, serialize, serialize, serialize, serialize, serialize, serialize
 
Methods inherited from class com.neeve.pkt.PktSerializable
deserialize, getDeserializationPolicy, getSerializationPolicy, isValidDeserializationPolicy, isValidSerializationPolicy, serialize, setDeserializationPolicy, setSerializationPolicy
 
Methods inherited from class com.neeve.util.UtlListElement
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static PktBody create(Properties props)
Creates an FMC subheader.

Parameters:
props - The property set to use to qualify creation of the body.

create

public static PktBody create()
Creates a default FMC subheader.


initialize

public final void initialize()
Description copied from class: PktBody
Invoked by constructor post initialization

This method is invoked by the constructor post initialization of the base class. Its purpose is to notify the body implementation (subclass) to perform any initialization activities that depend on an initialized base class.

The default implementation is a no-op i.e. it does nothing.


doGetSerializedLength

public final int doGetSerializedLength()
Description copied from class: PktBody
Invoked to fetch the serialized length of the body


getSerializedLength

public final int getSerializedLength(ByteBuffer buffer,
                                     int offset)
Description copied from class: PktSubheader
Get the serialized length from the serialized form

Specified by:
getSerializedLength in class PktSubheader

postDeserialize

public final void postDeserialize(int len)
Description copied from class: PktBody
Invoked by PktBody.deserialize(com.neeve.pkt.PktSerializable.DeserializeContext, int, com.neeve.trace.Tracer) after completing deserialization.

Parameters:
len - The number of bytes deserialized

This method is invoked after body initialization from a byte array. Its purpose isto allow the body implementation (subclass) to perform any post initialization activities e.g. caching element values. This method is called only if the deserialization process successful.

The default implementation is a no-op i.e. it does nothing.


getLatestSubheaderVersion

public static final short getLatestSubheaderVersion()
Get the latest subheader version.

This method returns the latest subheader version i.e. the version used when subheaders are created explicitly i.e. not through deserialization

Threading:
This method is safe for concurrent access by multiple threads

getSubheaderVersion

public final short getSubheaderVersion()
Get the header format version (V1 Subheader Field).

Threading:
This method is not safe for concurrent access by multiple threads

setTopic

public final void setTopic(String topic)
Set the publication topic (V1 Subheader Field).

Threading:
This method is not safe for concurrent access by multiple threads

getTopic

public final String getTopic()
Get the publication topic (V1 Subheader Field).

Threading:
This method is not safe for concurrent access by multiple threads

initializeBuffer

public final void initializeBuffer()
Description copied from class: PktBody
Implementation of IOElasticBuffer.Initializer.initializeBuffer()

The default implementation of this method is no-op. The concrete body implementation should override and implement this method if it needs to do buffer initialization.

Specified by:
initializeBuffer in interface com.neeve.io.IOElasticBuffer.Initializer
Overrides:
initializeBuffer in class PktBody

toString

public final String toString()
Returns a string representation of the object

Overrides:
toString in class Object
Threading:
This method is safe for concurrent access by multiple threads

equals

public final boolean equals(Object obj)
Indicates whether some other object is equal to this one.

Overrides:
equals in class Object
Threading:
This method is safe for concurrent access by multiple threads

hashCode

public final int hashCode()
Returns the hashcode for this object

Overrides:
hashCode in class Object
Threading:
This method is safe for concurrent access by multiple threads


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.