public class EpidemicOracleRouter extends ActiveRouter
Epidemic message router with an oracle that tells when a message is delivered and that message is then removed from all nodes that use this routing module. This router also ignores message size and all messages are delivered immediately.
Note: This router module also bypasses ActiveRouter.update()
DELETE_DELIVERED_S, deleteDelivered, RESPONSE_PREFIX, sendingConnectionsB_SIZE_S, DENIED_LOW_RESOURCES, DENIED_NO_SPACE, DENIED_OLD, DENIED_POLICY, DENIED_TTL, DENIED_UNSPECIFIED, MSG_TTL_S, msgTtl, Q_MODE_FIFO, Q_MODE_RANDOM, RCV_OK, SEND_QUEUE_MODE_S, TRY_LATER_BUSY| Modifier | Constructor and Description |
|---|---|
protected |
EpidemicOracleRouter(EpidemicOracleRouter r)
Copy constructor.
|
|
EpidemicOracleRouter(Settings s)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changedConnection(Connection con)
Called when a connection's state changes.
|
protected int |
checkReceiving(Message m) |
boolean |
createNewMessage(Message m)
Creates a new message to the router.
|
Message |
messageTransferred(java.lang.String id,
DTNHost from)
This method should be called (on the receiving host) after a message
was successfully transferred.
|
void |
removeDeliveredMessage(java.lang.String id)
Removes the message with the given ID from this router, if the router
has that message; otherwise does nothing.
|
EpidemicOracleRouter |
replicate()
Creates a replicate of this router.
|
static void |
reset()
Resets the static router list
|
protected void |
transferDone(Connection con)
Method is called just before a transfer is finalized
at
ActiveRouter.update(). |
void |
update()
Checks out all sending connections to finalize the ready ones
and abort those whose connection went down.
|
addToSendingConnections, canStartTransfer, checkReceiving, dropExpiredMessages, exchangeDeliverableMessages, getConnections, getMessagesForConnected, getNextMessageToRemove, getRoutingInfo, hasEnergy, init, isSending, isTransferring, makeRoomForMessage, makeRoomForNewMessage, receiveMessage, requestDeliverableMessages, shuffleMessages, startTransfer, transferAborted, tryAllMessages, tryAllMessagesToAllConnections, tryMessagesForConnected, tryMessagesToConnectionsaddApplication, addToMessages, compareByQueueMode, deleteMessage, getApplications, getBufferSize, getFreeBufferSize, getHost, getMessage, getMessageCollection, getNrofMessages, hasMessage, isBlacklistedMessage, isDeliveredMessage, isIncomingMessage, messageAborted, putToIncomingBuffer, removeFromIncomingBuffer, removeFromMessages, sendMessage, sortByQueueMode, toStringpublic EpidemicOracleRouter(Settings s)
s - The settings objectprotected EpidemicOracleRouter(EpidemicOracleRouter r)
r - The router prototype where setting values are copied frompublic void changedConnection(Connection con)
ActiveRouterchangedConnection in class ActiveRoutercon - The connection that changedpublic boolean createNewMessage(Message m)
MessageRoutercreateNewMessage in class ActiveRouterm - The message to createpublic void removeDeliveredMessage(java.lang.String id)
id - ID of the message to be removedpublic Message messageTransferred(java.lang.String id, DTNHost from)
MessageRoutermessageTransferred in class ActiveRouterid - Id of the transferred messagefrom - Host the message was from (previous hop)protected int checkReceiving(Message m)
protected void transferDone(Connection con)
ActiveRouterActiveRouter.update().
Subclasses that are interested of the event may want to override this.transferDone in class ActiveRoutercon - The connection whose transfer was finalizedpublic void update()
ActiveRouterupdate in class ActiveRouterActiveRouter.addToSendingConnections(Connection)public EpidemicOracleRouter replicate()
MessageRouterreplicate in class MessageRouterpublic static void reset()