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).
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
StandardEventsReader(java.io.File eventsFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input file streams of the reader.
|
java.util.List<ExternalEvent> |
readEvents(int nrof)
Read events from the reader
|
public static final java.lang.String CREATE
public static final java.lang.String SEND
public static final java.lang.String DELIVERED
public static final java.lang.String ABORT
public static final java.lang.String DROP
public static final java.lang.String REMOVE
public static final java.lang.String CONNECTION
public static final java.lang.String CONNECTION_DOWN
public static final java.lang.String CONNECTION_UP
public static final java.lang.String ALL_MESSAGES_ID
public java.util.List<ExternalEvent> readEvents(int nrof)
ExternalEventsReaderreadEvents in interface ExternalEventsReadernrof - Maximum number of events to readpublic void close()
ExternalEventsReaderclose in interface ExternalEventsReader