verinec.netsim.loggers.events
Class Event

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

public class Event
extends Element
implements ILogger

The Event Element as described in the Events XML Schema.

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

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
Event()
          Creates a new Event Element
Event(String time, String node, String layer, String service)
          Creates a new Event Element
Event(String time, String node, String layer, String service, String src)
          Creates a new Event Element
Event(String time, String node, String layer, String service, String src, String dst)
          Creates a new Event Element
 
Method Summary
 void addEvent(Event event)
          logs an event
 void animate(DrawPanel drawPanel, int time, int substep, int myPhase, int totalPhase)
          Alternates Events if they occur on the same location during the same periode of time.
 String getDescription()
          gets the Event's description.
 String getDst()
          gets the destination of the packet in an event with addressed communiction
 EventDetail getEventDetail()
          gets the eventdetail element of this event.
 String getId()
          gets the id of this event
 String getInterface()
          gets the name of the interface(nic) where this event occured
 String getLayer()
          gets the layer where the event happend
 String getNode()
          gets the node where the event happend
 String getPacketId()
          gets the id of the packed associated with this event
 String getService()
          gets the service where the event happend
 String getSrc()
          gets the source of the packet in an event with addressed communiction
 String getTime()
          gets the time when the event happend
 void setDescription(String string)
          sets the discrption the the Event.
 void setDst(String string)
          sets the destination of the packet in an event with addressed communiction
 void setEventDetail(EventDetail event)
          sets the eventdetail of this event.
 void setId(String id)
          sets this Events ID.
 void setInterface(String iface)
          sets the name of the interface(nic) where this event occured
 void setLayer(String string)
          sets the layer where the event happend.
 void setNode(String string)
          sets the node where the event happend
 void setPacketId(String packetid)
          sets the packetid of a packed that can be related to this event
 void setService(String string)
          sets the name of the service where the event happend
 void setSrc(String string)
          sets the source of the packet in an event with addressed communiction
 void setTime(String i)
          sets the time when the event happend
 String toString()
          This returns the XML Representation of this Event
 
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
Constructor Detail

Event

public Event()
Creates a new Event Element


Event

public Event(String time,
             String node,
             String layer,
             String service)
Creates a new Event Element

Parameters:
time - timestamp of this happend
node - node where the event happend
layer - layer on which the event happend
service - service or protocol that created the event

Event

public Event(String time,
             String node,
             String layer,
             String service,
             String src)
Creates a new Event Element

Parameters:
time - timestamp of this event
node - node where the event happend
layer - layer on which the event happend
service - service or protocol that created the event
src - Source Address for Events with addressed communication

Event

public Event(String time,
             String node,
             String layer,
             String service,
             String src,
             String dst)
Creates a new Event Element

Parameters:
time - timestamp of this event
node - node where the event happend
layer - layer on which the event happend
service - service or protocol that created the event
src - Source Address for Events with addressed communication
dst - Destination Address for Events with addressed communication
Method Detail

getEventDetail

public EventDetail getEventDetail()
gets the eventdetail element of this event.

Returns:
the eventdetail element of this event

setEventDetail

public void setEventDetail(EventDetail event)
sets the eventdetail of this event. It ensures that the event only has one eventdetail.

Parameters:
event - a eventdetail

getId

public String getId()
gets the id of this event

Returns:
the id of this event

getPacketId

public String getPacketId()
gets the id of the packed associated with this event

Returns:
id of the packed associated with this event

getDescription

public String getDescription()
gets the Event's description. The description explains nearer why the event happed. the descrption field is not nearer described and free to use.

Returns:
the discription of this event.

getDst

public String getDst()
gets the destination of the packet in an event with addressed communiction

Returns:
the destination of the packet

getLayer

public String getLayer()
gets the layer where the event happend

Returns:
the layer where the event happend

getNode

public String getNode()
gets the node where the event happend

Returns:
the node where the event happend

getService

public String getService()
gets the service where the event happend

Returns:
the service where the event happend

getSrc

public String getSrc()
gets the source of the packet in an event with addressed communiction

Returns:
the source of the packet

getTime

public String getTime()
gets the time when the event happend

Returns:
the time when the event happend

setDescription

public void setDescription(String string)
sets the discrption the the Event. The description explains nearer why the event happed. the descrption field is not nearer described and free to use.

Parameters:
string - a description

setDst

public void setDst(String string)
sets the destination of the packet in an event with addressed communiction

Parameters:
string - the destination address

setLayer

public void setLayer(String string)
sets the layer where the event happend. The layers are named after their number in the osi model.

Parameters:
string - a layer

setNode

public void setNode(String string)
sets the node where the event happend

Parameters:
string - a node

setService

public void setService(String string)
sets the name of the service where the event happend

Parameters:
string - a service

setSrc

public void setSrc(String string)
sets the source of the packet in an event with addressed communiction

Parameters:
string - the source of the packet in an event with addressed communiction

setTime

public void setTime(String i)
sets the time when the event happend

Parameters:
i - a time

setId

public void setId(String id)
sets this Events ID. A unique ID seems adequate, but this is not tested.

Parameters:
id - a ID

setPacketId

public void setPacketId(String packetid)
sets the packetid of a packed that can be related to this event

Parameters:
packetid - a packet id

addEvent

public void addEvent(Event event)
Description copied from interface: ILogger
logs an event

Specified by:
addEvent in interface ILogger
Parameters:
event - an event to log
See Also:
ILogger.addEvent(verinec.netsim.loggers.events.Event)

setInterface

public void setInterface(String iface)
sets the name of the interface(nic) where this event occured

Parameters:
iface - a interface(nic)

getInterface

public String getInterface()
gets the name of the interface(nic) where this event occured

Returns:
the name of the interface(nic) where this event occured

toString

public String toString()
This returns the XML Representation of this Event

Overrides:
toString in class Element
See Also:
XMLOutputter.outputString(org.jdom.Element), Element.toString()

animate

public void animate(DrawPanel drawPanel,
                    int time,
                    int substep,
                    int myPhase,
                    int totalPhase)
             throws NetSimException
Alternates Events if they occur on the same location during the same periode of time.

Parameters:
drawPanel - the panel displaying the animation
time - Current simulation time.
substep - Current substep.
myPhase - Phase the event belongs to.
totalPhase - Total number of events occurring at the same time and location.
Throws:
NetSimException

Copyright © 2005 Verinec, DIUF