input
Class StandardEventsReader

java.lang.Object
  extended by input.StandardEventsReader
All Implemented Interfaces:
ExternalEventsReader

public class StandardEventsReader
extends java.lang.Object
implements ExternalEventsReader

External events reader for standard-format events (created e.g by the dtnsim2parser).

Syntax:
<time> <actionId> <msgId> <hostId> [<host2Id> [<size>] [<respSize>]]

All actions (except CONNECTION) must have first four fields. SEND, DELIVERED and ABORT actions need host2Id field too (the host who the message is/was being transferred to). CREATE action needs the additional size (of the message) field and can have also size-of-the-response field if a response to this message is requested.

CONNNECTION action is followed by the two hosts which connect (or disconnect) to each other and then either "up" or "down" depending on whether the connection was created or destroyed.

Message DROP and REMOVE events can use "*" as the message ID for referring to all messages the node has in message buffer (i.e., to delete all messages).


Field Summary
static java.lang.String ABORT
          Identifier of message transfer aborted event ("A")
static java.lang.String ALL_MESSAGES_ID
          Message identifier to use to refer to all messages ("*")
static java.lang.String CONNECTION
          Identifier of connection event ("CONN")
static java.lang.String CONNECTION_DOWN
          Value identifier of connection down event ("down")
static java.lang.String CONNECTION_UP
          Value identifier of connection up event ("up")
static java.lang.String CREATE
          Identifier of message creation event ("C")
static java.lang.String DELIVERED
          Identifier of message delivered event ("DE")
static java.lang.String DROP
          Identifier of message dropped event ("DR")
static java.lang.String REMOVE
          Identifier of message removed event ("R")
static java.lang.String SEND
          Identifier of message transfer start event ("S")
 
Constructor Summary
StandardEventsReader(java.io.File eventsFile)
           
 
Method Summary
 void close()
          Closes the input file streams of the reader.
 java.util.List<ExternalEvent> readEvents(int nrof)
          Read events from the reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE

public static final java.lang.String CREATE
Identifier of message creation event ("C")

See Also:
Constant Field Values

SEND

public static final java.lang.String SEND
Identifier of message transfer start event ("S")

See Also:
Constant Field Values

DELIVERED

public static final java.lang.String DELIVERED
Identifier of message delivered event ("DE")

See Also:
Constant Field Values

ABORT

public static final java.lang.String ABORT
Identifier of message transfer aborted event ("A")

See Also:
Constant Field Values

DROP

public static final java.lang.String DROP
Identifier of message dropped event ("DR")

See Also:
Constant Field Values

REMOVE

public static final java.lang.String REMOVE
Identifier of message removed event ("R")

See Also:
Constant Field Values

CONNECTION

public static final java.lang.String CONNECTION
Identifier of connection event ("CONN")

See Also:
Constant Field Values

CONNECTION_DOWN

public static final java.lang.String CONNECTION_DOWN
Value identifier of connection down event ("down")

See Also:
Constant Field Values

CONNECTION_UP

public static final java.lang.String CONNECTION_UP
Value identifier of connection up event ("up")

See Also:
Constant Field Values

ALL_MESSAGES_ID

public static final java.lang.String ALL_MESSAGES_ID
Message identifier to use to refer to all messages ("*")

See Also:
Constant Field Values
Constructor Detail

StandardEventsReader

public StandardEventsReader(java.io.File eventsFile)
Method Detail

readEvents

public java.util.List<ExternalEvent> readEvents(int nrof)
Description copied from interface: ExternalEventsReader
Read events from the reader

Specified by:
readEvents in interface ExternalEventsReader
Parameters:
nrof - Maximum number of events to read
Returns:
Events in a List

close

public void close()
Description copied from interface: ExternalEventsReader
Closes the input file streams of the reader.

Specified by:
close in interface ExternalEventsReader