SSF.OS.NetFlow
Class NetFlow

java.lang.Object
  |
  +--SSF.OS.NetFlow.NetFlow
Direct Known Subclasses:
IpNetFlow

public abstract class NetFlow
extends java.lang.Object

This is an ABSTRACT class that only includs few implemented functions that would be helpful to most kinds of netflows.


Field Summary
 NetFlow next
          next pointer
 
Constructor Summary
NetFlow()
           
 
Method Summary
abstract  boolean acceptPacket(ProtocolMessage packet)
          check whether the given packet belongs to this flow since we may have different standards (resolution) of flows, this is an abstract method here
 void dumpBinaryOut(java.io.DataOutputStream outStream)
          Dump the flow to a stream
abstract  byte[] dumpToBytes()
          Generate a byte array from this record.
abstract  java.lang.Long makeKey()
          construct a key for this flow that can be used as hash key.
 void readBinaryIn(java.io.DataInputStream inStream)
          read data from a binary stream
abstract  void readFromBytes(byte[] bytes, int len)
          extract the record information from a byte array
 int recordSize()
          recordSize the "next" field is NOT included when count the size of the record.
 NetFlow removeFlow(NetFlow flow)
          remove the give flow from the list with this flow as the head return the rest of the list
abstract  void update(ProtocolMessage packet, float curTime)
          update the flow for the given packet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

public NetFlow next
next pointer

Constructor Detail

NetFlow

public NetFlow()
Method Detail

dumpToBytes

public abstract byte[] dumpToBytes()
Generate a byte array from this record.


readFromBytes

public abstract void readFromBytes(byte[] bytes,
                                   int len)
extract the record information from a byte array

Parameters:
bytes - the byte array that stores the data
len - the length of the data stored in the array (Not the length of the array)

dumpBinaryOut

public void dumpBinaryOut(java.io.DataOutputStream outStream)
Dump the flow to a stream

Parameters:
outStream - the outputStream into which the data is dumped.

readBinaryIn

public void readBinaryIn(java.io.DataInputStream inStream)
read data from a binary stream


makeKey

public abstract java.lang.Long makeKey()
construct a key for this flow that can be used as hash key.


removeFlow

public NetFlow removeFlow(NetFlow flow)
remove the give flow from the list with this flow as the head return the rest of the list


recordSize

public int recordSize()
recordSize the "next" field is NOT included when count the size of the record.


acceptPacket

public abstract boolean acceptPacket(ProtocolMessage packet)
check whether the given packet belongs to this flow since we may have different standards (resolution) of flows, this is an abstract method here

Parameters:
packet - the packet to be checked.

update

public abstract void update(ProtocolMessage packet,
                            float curTime)
update the flow for the given packet

Parameters:
packet - given packet
curTime - the current time