report
Class EventLogReport

java.lang.Object
  extended by report.Report
      extended by report.EventLogReport
All Implemented Interfaces:
ConnectionListener, MessageListener

public class EventLogReport
extends Report
implements ConnectionListener, MessageListener

Report that creates same output as the GUI's event log panel but formatted like StandardEventsReader input. Message relying event has extra one-letter identifier to tell whether that message was delivered to final destination, delivered there again, or just normally relayed (see the public constants).


Field Summary
static java.lang.String MESSAGE_TRANS_DELIVERED
          Extra info for message relayed event ("delivered"): "D"
static java.lang.String MESSAGE_TRANS_DELIVERED_AGAIN
          Extra info for message relayed event ("delivered again"): "A"
static java.lang.String MESSAGE_TRANS_RELAYED
          Extra info for message relayed event ("relayed"): "R"
 
Fields inherited from class report.Report
DEF_PRECISION, INTERVAL_SETTING, INTERVALLED_FORMAT, NAN, out, OUT_SUFFIX, OUTPUT_SETTING, PRECISION_SETTING, REPORT_NS, REPORTDIR_SETTING, WARMUP_S, warmupIDs, warmupTime
 
Constructor Summary
EventLogReport()
           
 
Method Summary
 void hostsConnected(DTNHost host1, DTNHost host2)
          Method is called when two hosts are connected.
 void hostsDisconnected(DTNHost host1, DTNHost host2)
          Method is called when connection between hosts is disconnected.
 void messageDeleted(Message m, DTNHost where, boolean dropped)
          Method is called when a message is deleted
 void messageTransferAborted(Message m, DTNHost from, DTNHost to)
          Method is called when a message's transfer was aborted before it finished
 void messageTransferred(Message m, DTNHost from, DTNHost to, boolean firstDelivery)
          Method is called when a message is successfully transferred from a node to another.
 void messageTransferStarted(Message m, DTNHost from, DTNHost to)
          Method is called when a message's transfer is started
 void newMessage(Message m)
          Method is called when a new message is created
 
Methods inherited from class report.Report
addWarmupID, done, format, getAverage, getIntAverage, getIntMedian, getMedian, getScenarioName, getSettings, getSimTime, getVariance, init, isWarmup, isWarmupID, newEvent, setPrefix, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_TRANS_RELAYED

public static final java.lang.String MESSAGE_TRANS_RELAYED
Extra info for message relayed event ("relayed"): "R"

See Also:
Constant Field Values

MESSAGE_TRANS_DELIVERED

public static final java.lang.String MESSAGE_TRANS_DELIVERED
Extra info for message relayed event ("delivered"): "D"

See Also:
Constant Field Values

MESSAGE_TRANS_DELIVERED_AGAIN

public static final java.lang.String MESSAGE_TRANS_DELIVERED_AGAIN
Extra info for message relayed event ("delivered again"): "A"

See Also:
Constant Field Values
Constructor Detail

EventLogReport

public EventLogReport()
Method Detail

hostsConnected

public void hostsConnected(DTNHost host1,
                           DTNHost host2)
Description copied from interface: ConnectionListener
Method is called when two hosts are connected.

Specified by:
hostsConnected in interface ConnectionListener
Parameters:
host1 - Host that initiated the connection
host2 - Host that was connected to

hostsDisconnected

public void hostsDisconnected(DTNHost host1,
                              DTNHost host2)
Description copied from interface: ConnectionListener
Method is called when connection between hosts is disconnected.

Specified by:
hostsDisconnected in interface ConnectionListener
Parameters:
host1 - Host that initiated the disconnection
host2 - Host at the other end of the connection

messageDeleted

public void messageDeleted(Message m,
                           DTNHost where,
                           boolean dropped)
Description copied from interface: MessageListener
Method is called when a message is deleted

Specified by:
messageDeleted in interface MessageListener
Parameters:
m - The message that was deleted
where - The host where the message was deleted
dropped - True if the message was dropped, false if removed

messageTransferred

public void messageTransferred(Message m,
                               DTNHost from,
                               DTNHost to,
                               boolean firstDelivery)
Description copied from interface: MessageListener
Method is called when a message is successfully transferred from a node to another.

Specified by:
messageTransferred in interface MessageListener
Parameters:
m - The message that was transferred
from - Node where the message was transferred from
to - Node where the message was transferred to
firstDelivery - Was the target node final destination of the message and received this message for the first time.

newMessage

public void newMessage(Message m)
Description copied from interface: MessageListener
Method is called when a new message is created

Specified by:
newMessage in interface MessageListener
Parameters:
m - Message that was created

messageTransferAborted

public void messageTransferAborted(Message m,
                                   DTNHost from,
                                   DTNHost to)
Description copied from interface: MessageListener
Method is called when a message's transfer was aborted before it finished

Specified by:
messageTransferAborted in interface MessageListener
Parameters:
m - The message that was being transferred
from - Node where the message was being transferred from
to - Node where the message was being transferred to

messageTransferStarted

public void messageTransferStarted(Message m,
                                   DTNHost from,
                                   DTNHost to)
Description copied from interface: MessageListener
Method is called when a message's transfer is started

Specified by:
messageTransferStarted in interface MessageListener
Parameters:
m - The message that is going to be transferred
from - Node where the message is transferred from
to - Node where the message is transferred to