|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetstream.protocol.NullProtocol
public class NullProtocol
An empty, no action, stub stand-in. All methods throw
UnsupportedOperationException.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jnetstream.protocol.ProtocolInfo |
|---|
ProtocolInfo.Binding, ProtocolInfo.ID, ProtocolInfo.Info, ProtocolInfo.Registry, ProtocolInfo.Suite |
| Field Summary |
|---|
| Fields inherited from interface org.jnetstream.protocol.ProtocolInfo |
|---|
NO_BIT_INDEX |
| Constructor Summary | |
|---|---|
NullProtocol()
|
|
| 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 |
getCharacteristics()
Gets a set of special characteristics for this protocol. |
int |
getCharacteristicsValue()
Retrieves various characteristics for this protocol. |
HeaderCodec |
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 |
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 |
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 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NullProtocol()
| Method Detail |
|---|
public void addBinding(ProtocolInfo.Binding binding)
addBinding in interface ProtocolInfopublic Codec[] getAvailableCodecs()
ProtocolInfo
getAvailableCodecs in interface ProtocolInfoProtocolInfo.isLoaded()public ProtocolInfo.Binding[] getBindings()
ProtocolInfo
getBindings in interface ProtocolInfopublic int getBitIndex()
ProtocolInfo
getBitIndex in interface ProtocolInfopublic java.util.Set getCharacteristics()
ProtocolInfo
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
}
getCharacteristics in interface ProtocolInfopublic int getCharacteristicsValue()
ProtocolInfo
getCharacteristicsValue in interface ProtocolInfomethod for description of how decode
characteristic enum constants out of the integer representationpublic HeaderCodec getCodec()
ProtocolInfogetPriority and change it using
setPriority
getCodec in interface ProtocolInfoHeaderCodec#getPriority(),
HeaderCodec#setPriority(org.jnetstream.protocol.codec.HeaderCodec.Priority)public ProtocolInfo.ID getID()
ProtocolInfo
getID in interface ProtocolInfo
public int getLength(com.slytechs.utils.memory.BitBuffer bits,
int offset)
getLength in interface ProtocolInfooffset - TODO
public java.lang.String getName()
ProtocolInfo
getName in interface ProtocolInfoProtocolInfo.ID.getIdString()public java.util.Set getProtocolReferences()
ProtocolInfo
getProtocolReferences in interface ProtocolInfopublic ProtocolInfo.Suite getSuite()
ProtocolInfo
getSuite in interface ProtocolInfoProtocolInfo.Suitepublic java.lang.Class getType()
getType in interface ProtocolInfopublic boolean isLoaded()
ProtocolInfo
isLoaded in interface ProtocolInfoProtocolInfo.pushCodec(HeaderCodec)public boolean isProtocolGroup()
ProtocolInfo
isProtocolGroup in interface ProtocolInfopublic boolean prioritiseBindings()
ProtocolInfosetBindingWeight.
prioritiseBindings in interface ProtocolInfoProtocolInfo.setBindingWeight(int)public void pushCodec(HeaderCodec codec)
ProtocolInfo
pushCodec in interface ProtocolInfocodec - codec to push on to the priority queue listHeaderCodec#getPriority(),
HeaderCodec#setPriority(org.jnetstream.protocol.codec.HeaderCodec.Priority)public int setBindingWeight(int weight)
ProtocolInfo
setBindingWeight in interface ProtocolInfoweight - 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.
ProtocolInfo.prioritiseBindings()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||