verinec.netsim.loggers.events
Class FirewallEvent

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by verinec.netsim.loggers.events.EventDetail
              extended by verinec.netsim.loggers.events.FirewallEvent
All Implemented Interfaces:
Serializable, Cloneable, Parent

public class FirewallEvent
extends EventDetail

A Firewall Event

Version:
$Revision: 631 $
Author:
Dominik Jungo
See Also:
Serialized Form

Field Summary
private static String DEFAULTPOLICY
           
private static long serialVersionUID
           
private static String TRIGGEREDACTION
           
 
Fields inherited from class verinec.netsim.loggers.events.EventDetail
dHeight, dWidth, dx, dy, endX, endY, label, ownerPCNode, startX, startY
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
FirewallEvent()
          Creates a new Firewall Event
FirewallEvent(IPacketAction action, PacketFilterChain chain)
          Creates a Firewall Event with more detailed information.
FirewallEvent(IPacketAction action, PacketFilterChain chain, PacketFilterRule rule)
          Creates a Firewall Event with more detailed information.
FirewallEvent(String type, String rule)
          Creates a new Firewall Event
 
Method Summary
 Event createSimEvent(Model model, ILogger logger)
          creates a schedulable Simulation event from a Logevent
 String getID()
           
 String getRule()
          Gets the rule which caused the event
 void initializeLabel(DrawPanel drawpanel)
          Initializes the label (the animated object)
private  void logAction(IPacketAction action, PacketFilterChain chain)
          Sets the action as element attributes.
private  void logRuleDetail(PacketFilterRule rule)
          Logs the details of the rule which triggered an action.
 void setID(String id)
          sets the id of this event
 void setRule(String rule)
          Sets the rule which caused the event
protected  void subanimate(int time, int substep, int myPhase, int totalPhase)
          animates a substep of the whole animation
 
Methods inherited from class verinec.netsim.loggers.events.EventDetail
animate, getType, initAnimation, isAnimationInitialized, setType, toString
 
Methods inherited from class org.jdom.Element
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jdom.Parent
getDocument, getParent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

DEFAULTPOLICY

private static final String DEFAULTPOLICY
See Also:
Constant Field Values

TRIGGEREDACTION

private static final String TRIGGEREDACTION
See Also:
Constant Field Values
Constructor Detail

FirewallEvent

public FirewallEvent(String type,
                     String rule)
Creates a new Firewall Event

Parameters:
type - a type
rule - the rule which caused this event

FirewallEvent

public FirewallEvent(IPacketAction action,
                     PacketFilterChain chain)
Creates a Firewall Event with more detailed information. This Firewall Event Constructor is called when a default-policy action was triggered. The Event logs which chain called the action and what the action is.

Parameters:
action - The action to be logged.
chain - From which chain the default-policy action originated from.

FirewallEvent

public FirewallEvent(IPacketAction action,
                     PacketFilterChain chain,
                     PacketFilterRule rule)
Creates a Firewall Event with more detailed information. This Firewall Event Constructor is called when an action was triggered by a match rule. The Event logs which rule in which chain triggered the action.

Parameters:
action - The action to be logged.
chain - From which chain the default-policy action originated from.
rule - The rule which triggered the action.

FirewallEvent

public FirewallEvent()
Creates a new Firewall Event

Method Detail

logAction

private void logAction(IPacketAction action,
                       PacketFilterChain chain)
Sets the action as element attributes.

Parameters:
action - Action to log.
chain - From which chain the action was triggered from.

logRuleDetail

private void logRuleDetail(PacketFilterRule rule)
Logs the details of the rule which triggered an action.

Parameters:
rule - The rule which triggered the action.

getRule

public final String getRule()
Gets the rule which caused the event

Returns:
the rule which caused the event

setRule

public final void setRule(String rule)
Sets the rule which caused the event

Parameters:
rule - a rule

setID

public final void setID(String id)
sets the id of this event

Parameters:
id - the id of the event

getID

public final String getID()
Returns:
gets the id of this event

createSimEvent

public Event createSimEvent(Model model,
                            ILogger logger)
Description copied from class: EventDetail
creates a schedulable Simulation event from a Logevent

Specified by:
createSimEvent in class EventDetail
Parameters:
model - a network model
logger - a log event
Returns:
a schedulable Simulation event
See Also:
EventDetail.createSimEvent(Model, ILogger)

initializeLabel

public void initializeLabel(DrawPanel drawpanel)
                     throws NetSimException
Description copied from class: EventDetail
Initializes the label (the animated object)

Specified by:
initializeLabel in class EventDetail
Parameters:
drawpanel - the panel containing the label
Throws:
NetSimException - if the label can't be set up
See Also:
EventDetail.initializeLabel(verinec.gui.core.DrawPanel)

subanimate

protected void subanimate(int time,
                          int substep,
                          int myPhase,
                          int totalPhase)
Description copied from class: EventDetail
animates a substep of the whole animation

Specified by:
subanimate in class EventDetail
Parameters:
time - actual time
substep - the n'th substep that is animated
myPhase - the phase length that is animated in this substep
totalPhase - the complete phase length
See Also:
EventDetail.subanimate(int, int, int, int)

Copyright © 2005 Verinec, DIUF