|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.voytechs.jnetstream.codec.event.DecoderEvent
com.voytechs.jnetstream.codec.event.DecoderFlowEvent
public class DecoderFlowEvent
As flows are created, updated and eventually expired, the
DecoderFlowListener are notified. A DecoderFlowEvent is created
to describe the event and pass along some useful information about the
flow, packets and the decoder.
You can retrieve the following information from this event.
getPacket() - the packet which caused this event if one
is available. Can be null.
getFlow() - the flow associated with this event.
getFlowDecoder() - the flow decoder which is decoding
this flow.
getSubType() to get exact event code of this notification.
Typical usage is to put getSubType() into a switch() or if()
statements.
public void processDecoderEvent(DecoderEvent event) throws AssertFailure {
if ( (event instanceof DecoderFlowEvent) == false) {
return false;
}
DecodeFlowEvent flowEvent = (DecoderFlowEvent) event;
switch (flowEvent.getSubType()) {
case DecoderFlowEvent.NEW_FLOW:
break;
case DecoderFlowEvent.RIGHT_PACKET:
break;
case DecoderFlowEvent.LEFT_PACKET:
break;
case DecoderFlowEvent.EXPIRED_FLOW:
break;
}
}
| Field Summary | |
|---|---|
static int |
EXPIRED_FLOW
Event type. |
static int |
LEFT_PACKET
Event type. |
static java.lang.String |
NAME
Name of this event. |
static int |
NEW_FLOW
Event type. |
static int |
RIGHT_PACKET
Event type. |
static java.lang.String |
TYPE
Event type identifier. |
| Constructor Summary | |
|---|---|
DecoderFlowEvent(int subType,
Flow flow,
Packet packet)
New Packet has been created event. |
|
DecoderFlowEvent(int subType,
Flow flow,
Packet packet,
FlowDecoder decoder)
New Packet has been created event. |
|
| Method Summary | |
|---|---|
Flow |
getFlow()
Returns the Flow object reference which generated this event. |
FlowDecoder |
getFlowDecoder()
Returns the flow decoder that through this event and is responsible for management of the flow being thrown about. |
Packet |
getPacket()
Returns the Packet object reference which generated this event. |
int |
getSubType()
Returns the sub type of this event. |
void |
setSubType(int subType)
Sets the sub type for this event. |
| Methods inherited from class com.voytechs.jnetstream.codec.event.DecoderEvent |
|---|
getType, main |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TYPE
public static final int NEW_FLOW
public static final int LEFT_PACKET
public static final int RIGHT_PACKET
public static final int EXPIRED_FLOW
public static final java.lang.String NAME
| Constructor Detail |
|---|
public DecoderFlowEvent(int subType,
Flow flow,
Packet packet)
subType - The subType of this event.packet - The Packet that was constructed that caused the dispatch.flow - The flow which created this event
structures.
public DecoderFlowEvent(int subType,
Flow flow,
Packet packet,
FlowDecoder decoder)
subType - The subType of this event.packet - The Packet that was constructed that caused the dispatch.flow - The flow which created this event
structures.decoder - flow decoder responsible for management of the flow| Method Detail |
|---|
public int getSubType()
getSubType in class DecoderEventpublic void setSubType(int subType)
subType - The new subtype for this event.public Packet getPacket()
public Flow getFlow()
Returns the Flow object reference which generated this event. This decoder was the one used to decode and generate the packet.
This is sometimes needed as multiple decoders can be used in unisome and allows tracking of which decoder the packets are comming from.
public FlowDecoder getFlowDecoder()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||