verinec.netsim.firewall.util.tables
Class TableEntry

java.lang.Object
  extended by verinec.netsim.firewall.util.tables.TableEntry

public class TableEntry
extends Object

Version:
$Revision: 825 $
Author:
jason.hug@unifr.ch

Field Summary
static int DEFAULTTIMEOUT
          Default Timeout value for a connection.
private  String direction
          In which direction the initial packet was going.
private  boolean reply
          States if the connection has seen reply traffic
private  String stateValue
          Describes in which state this Table Entry is in.
private  int timeout
          Timeout value for this entry.
 
Constructor Summary
TableEntry(String state, String direction)
          Creates a new hash table entry.
TableEntry(String state, String direction, int timeout)
          Creates a new hash table entry with a given timeout.
 
Method Summary
 void decrementTimeout(int time)
          Method which decrements the timeout value by one.
 String getDirection()
           
 String getStateValue()
          Get the state of the connection.
 int getTimeout()
          Get the timeout value.
 boolean isReply()
           
 void setReply(boolean reply)
           
 void setStateValue(String stateValue)
          Set the state of the connection.
 void setTimeout(int timeout)
          Set the timeout value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULTTIMEOUT

public static final int DEFAULTTIMEOUT
Default Timeout value for a connection.

See Also:
Constant Field Values

stateValue

private String stateValue
Describes in which state this Table Entry is in.


timeout

private int timeout
Timeout value for this entry.


reply

private boolean reply
States if the connection has seen reply traffic


direction

private String direction
In which direction the initial packet was going.

Constructor Detail

TableEntry

public TableEntry(String state,
                  String direction)
Creates a new hash table entry. The entries is complimented with the default timeout value of 3600 with which the entry is valid.

Parameters:
state - state of the connection.
direction - In which direction the initial packet is going.

TableEntry

public TableEntry(String state,
                  String direction,
                  int timeout)
Creates a new hash table entry with a given timeout. The timeout for which this entry is valid can be set manually.

Parameters:
state - state of the connection.
direction - In which direction the initial packet is going.
timeout - for how long this entry is kept in the hashtable.
Method Detail

decrementTimeout

public void decrementTimeout(int time)
Method which decrements the timeout value by one.

Parameters:
time - Simulation time that has passed. Value by which the timeout should be subtracted by.

getTimeout

public int getTimeout()
Get the timeout value.

Returns:
Returns the timeout.

setTimeout

public void setTimeout(int timeout)
Set the timeout value.

Parameters:
timeout - The timeout to set.

getStateValue

public String getStateValue()
Get the state of the connection.

Returns:
Returns the stateValue.

setStateValue

public void setStateValue(String stateValue)
Set the state of the connection.

Parameters:
stateValue - The stateValue to set.

isReply

public boolean isReply()
Returns:
Returns the reply.

setReply

public void setReply(boolean reply)
Parameters:
reply - The reply to set.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getDirection

public String getDirection()
Returns:
Returns the direction.

Copyright © 2005 Verinec, DIUF