|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ProtocolInfo<T extends Header>
Defines access to a Protocol. Protocols are supplied to help deal with disecting raw packet byte buffers, analyzing protocol specific structure and state. Also verify protocol integrity and check for errors.
| Nested Class Summary | |
|---|---|
static interface |
ProtocolInfo.Binding
Binding between protocols. |
static interface |
ProtocolInfo.ID
Defines a unique identification of a protocol. |
static interface |
ProtocolInfo.Info
Informational interface which provides information about the protocol. |
static interface |
ProtocolInfo.Registry
Protocol registry factory methods. |
static class |
ProtocolInfo.Suite
Enum structure which defines all of the jNetStream system defined protocol suites. |
| Field Summary | |
|---|---|
static int |
NO_BIT_INDEX
|
| Method Summary | |
|---|---|
void |
addBinding(ProtocolInfo.Binding binding)
|
Codec[] |
getAvailableCodecs()
Returns all available codecs for this protocol. |
ProtocolInfo.Binding[] |
getBindings()
Gets all of the bindings current attached to this protocol |
int |
getBitIndex()
Returns a special bit index for core protocols. |
java.util.Set<Characteristic> |
getCharacteristics()
Gets a set of special characteristics for this protocol. |
int |
getCharacteristicsValue()
Retrieves various characteristics for this protocol. |
HeaderCodec<? extends Header> |
getCodec()
Returns the current Codec that is responsible for Encoding/Decoding the packet's data buffer to a decomposed state accessible using the Packet public API. |
ProtocolInfo.ID |
getID()
Gets the ID, Identification object which uniquely identifies this protocol. |
int |
getLength(com.slytechs.utils.memory.BitBuffer bits,
int offset)
|
java.lang.String |
getName()
Returns the name of this protocol. |
java.util.Set<ProtocolInfo<? extends Header>> |
getProtocolReferences()
Gets a list of all the protocols this protocol references either inside a codec or a binding. |
ProtocolInfo.Suite |
getSuite()
Returns the protocol suite this protocol belongs to. |
java.lang.Class<T> |
getType()
|
boolean |
isLoaded()
Checks if any of the current protocol's codecs have been loaded. |
boolean |
isProtocolGroup()
Method which checks if this protocol is actually a protocol group. |
boolean |
prioritiseBindings()
Forces the protocol to reprioritize its bindings. |
void |
pushCodec(HeaderCodec<? extends Header> codec)
Pushes codec on to a prioritised queue where the highest priority codec is used for actively decoding header content. |
int |
setBindingWeight(int weight)
Changes the prioritisation weight of bindings for this protocol. |
| Field Detail |
|---|
static final int NO_BIT_INDEX
| Method Detail |
|---|
java.util.Set<ProtocolInfo<? extends Header>> getProtocolReferences()
Codec[] getAvailableCodecs()
isLoaded()HeaderCodec<? extends Header> getCodec()
getPriority and change it using
setPriority
HeaderCodec#getPriority(),
HeaderCodec#setPriority(org.jnetstream.protocol.codec.HeaderCodec.Priority)java.lang.String getName()
ProtocolInfo.ID.getIdString()ProtocolInfo.ID getID()
ProtocolInfo.Suite getSuite()
ProtocolInfo.Suiteboolean isLoaded()
pushCodec(HeaderCodec)void pushCodec(HeaderCodec<? extends Header> codec)
codec - codec to push on to the priority queue listHeaderCodec#getPriority(),
HeaderCodec#setPriority(org.jnetstream.protocol.codec.HeaderCodec.Priority)java.util.Set<Characteristic> getCharacteristics()
Protocol ethernet = // from some source
Set<Characteristics> ch = ethernet.getCharacteristics();
if (ch.contains(Frame.HasCRC)) {
// Do something
} else if (ch.contains(Physical.Serial)) {
// Do something with a serial line based protocol
}
int getCharacteristicsValue()
method for description of how decode
characteristic enum constants out of the integer representationboolean prioritiseBindings()
setBindingWeight.
setBindingWeight(int)int setBindingWeight(int weight)
weight - A non negative value specifying the priority weight. The lower the
value the more often reprioritization algorithm is run. A value of
zero turns off prioritization completely.
prioritiseBindings()void addBinding(ProtocolInfo.Binding binding)
ProtocolInfo.Binding[] getBindings()
java.lang.Class<T> getType()
int getBitIndex()
boolean isProtocolGroup()
int getLength(com.slytechs.utils.memory.BitBuffer bits,
int offset)
bits - offset - TODO
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||