|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrouting.MessageRouter
routing.ActiveRouter
routing.EpidemicOracleRouter
public class EpidemicOracleRouter
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()
Field Summary |
---|
Fields inherited from class routing.ActiveRouter |
---|
DELETE_DELIVERED_S, deleteDelivered, RESPONSE_PREFIX, sendingConnections, TTL_CHECK_INTERVAL |
Fields inherited from class routing.MessageRouter |
---|
B_SIZE_S, DENIED_NO_SPACE, DENIED_OLD, DENIED_TTL, DENIED_UNSPECIFIED, MSG_TTL_S, msgTtl, Q_MODE_FIFO, Q_MODE_RANDOM, RCV_OK, SEND_QUEUE_MODE_S, TRY_LATER_BUSY |
Constructor Summary | |
---|---|
protected |
EpidemicOracleRouter(EpidemicOracleRouter r)
Copy constructor. |
|
EpidemicOracleRouter(Settings s)
Constructor. |
Method Summary | |
---|---|
void |
changedConnection(Connection con)
Called when a connection's state changes. |
protected int |
checkReceiving(Message m)
Checks if router "wants" to start receiving message (i.e. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EpidemicOracleRouter(Settings s)
s
- The settings objectprotected EpidemicOracleRouter(EpidemicOracleRouter r)
r
- The router prototype where setting values are copied fromMethod Detail |
---|
public void changedConnection(Connection con)
ActiveRouter
changedConnection
in class ActiveRouter
con
- The connection that changedpublic boolean createNewMessage(Message m)
MessageRouter
createNewMessage
in class ActiveRouter
m
- The message to create
public void removeDeliveredMessage(java.lang.String id)
id
- ID of the message to be removedpublic Message messageTransferred(java.lang.String id, DTNHost from)
MessageRouter
messageTransferred
in class ActiveRouter
id
- Id of the transferred messagefrom
- Host the message was from (previous hop)
protected int checkReceiving(Message m)
ActiveRouter
checkReceiving
in class ActiveRouter
m
- The message to check
MessageRouter.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 void transferDone(Connection con)
ActiveRouter
ActiveRouter.update()
.
Subclasses that are interested of the event may want to override this.
transferDone
in class ActiveRouter
con
- The connection whose transfer was finalizedpublic void update()
ActiveRouter
update
in class ActiveRouter
ActiveRouter.addToSendingConnections(Connection)
public EpidemicOracleRouter replicate()
MessageRouter
replicate
in class MessageRouter
public static void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |