public class WaveRouter extends ActiveRouter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CUSTODY_S
Custody fraction -setting id ("custodyFraction").
|
static java.lang.String |
IMMUNITY_S
Immunity time -setting id ("immunityTime").
|
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 |
|---|---|
|
WaveRouter(Settings s)
Constructor.
|
protected |
WaveRouter(WaveRouter r)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
checkReceiving(Message m,
DTNHost from)
Checks if router "wants" to start receiving message (i.e.
|
protected Message |
getNextMessageToRemove(boolean excludeMsgBeingSent)
Returns the oldest message that has been already sent forward
|
RoutingInfo |
getRoutingInfo()
Returns routing information about this router.
|
Message |
messageTransferred(java.lang.String id,
DTNHost from)
This method should be called (on the receiving host) after a message
was successfully transferred.
|
WaveRouter |
replicate()
Creates a replicate of this router.
|
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, changedConnection, createNewMessage, dropExpiredMessages, exchangeDeliverableMessages, getConnections, getMessagesForConnected, 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 static final java.lang.String IMMUNITY_S
public static final java.lang.String CUSTODY_S
public WaveRouter(Settings s)
s - The settings objectprotected WaveRouter(WaveRouter r)
r - The router prototype where setting values are copied fromprotected int checkReceiving(Message m, DTNHost from)
ActiveRoutercheckReceiving in class ActiveRouterm - The message to checkMessageRouter.receiveMessage(Message, DTNHost), i.e.
MessageRouter.RCV_OK if receiving seems to be OK,
TRY_LATER_BUSY if router is transferring, DENIED_OLD if the router
is already carrying the message or it has been delivered to
this router (as final recipient), or DENIED_NO_SPACE if the message
does not fit into bufferprotected Message getNextMessageToRemove(boolean excludeMsgBeingSent)
getNextMessageToRemove in class ActiveRouterexcludeMsgBeingSent - If true, excludes message(s) that are
being sent from the oldest message check (i.e. if oldest message is
being sent, the second oldest message is returned)public void update()
ActiveRouterupdate in class ActiveRouterActiveRouter.addToSendingConnections(Connection)public 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 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 RoutingInfo getRoutingInfo()
MessageRoutergetRoutingInfo in class ActiveRouterpublic WaveRouter replicate()
MessageRouterreplicate in class MessageRouter