ist.palcom.routing
Class DSDVRoutingManager

java.lang.Object
  extended by ist.palcom.routing.RoutingManager
      extended by ist.palcom.routing.DSDVRoutingManager

public class DSDVRoutingManager
extends RoutingManager

The DSDVRoutingManager is a table-driven routing manager (DSDV tables) where the nodes in the network periodically exchange routing information. The direction of the traffic is chosen based on number of nodes between sender and receiver and not on actually bandwidth for instance.


Field Summary
 
Fields inherited from class ist.palcom.routing.RoutingManager
manager, pubSubManager, recieverThread, registeredThreads, scheduler
 
Constructor Summary
DSDVRoutingManager(PalcomScheduler scheduler, MediaManager manager, PubSubManager pubSubManager, URN deviceURN)
           
 
Method Summary
protected  void addLocalPeer(URN routingURN, Selector routingSelector)
          Add a peer to the DSDV-table and ensure no duplicates.
protected  DSDVTable getDSDVChangedPeers()
           
protected  DSDVTable getDSDVTable()
           
protected  void handleRoutingMessage(AbstractRoutingMessage message)
          This method handle different types of routing messages
 void send(Message message, URL receiverURL)
           
 boolean send(Message message, URN senderURN, Selector senderSelector, URN receiverURN, Selector receiverSelector)
          Send message lookups the receiver URN in the DSDV-table and route the message to the next routingManager.
protected  boolean sendDirect(Message message, URN senderURN, Selector senderSelector, URN receiverURN, Selector receiverSelector)
           
protected  void startRouting()
          Main method
protected  void updateStatus(URN urn)
           
protected  void updateTable(DSDVTable original, DSDVTable updater, URN updateSenderURN, Selector updateSenderSelector)
          This method takes one original DSDVTable and update it with another DSDVTable.
 
Methods inherited from class ist.palcom.routing.RoutingManager
getDefaultGroupAddresses, getDefaultUnicastURL, getRoutingSelector, getRoutingURN, startReceiving, startReceiving, startReceiving2, stop, stopReceiving, stopReceiving, stopReceiving, stopReceiving
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, println, toString
 

Constructor Detail

DSDVRoutingManager

public DSDVRoutingManager(PalcomScheduler scheduler,
                          MediaManager manager,
                          PubSubManager pubSubManager,
                          URN deviceURN)
Parameters:
manager -
Method Detail

startRouting

protected void startRouting()
Main method

Specified by:
startRouting in class RoutingManager

send

public void send(Message message,
                 URL receiverURL)
Specified by:
send in class RoutingManager

send

public boolean send(Message message,
                    URN senderURN,
                    Selector senderSelector,
                    URN receiverURN,
                    Selector receiverSelector)
Send message lookups the receiver URN in the DSDV-table and route the message to the next routingManager. If the routingManager can't lookup the receiver URN, the message isn't send and the method return false.

Specified by:
send in class RoutingManager

sendDirect

protected boolean sendDirect(Message message,
                             URN senderURN,
                             Selector senderSelector,
                             URN receiverURN,
                             Selector receiverSelector)

handleRoutingMessage

protected void handleRoutingMessage(AbstractRoutingMessage message)
This method handle different types of routing messages

Specified by:
handleRoutingMessage in class RoutingManager
Parameters:
message - - message send between the nodes in the network to update/establish routing.

updateStatus

protected void updateStatus(URN urn)

addLocalPeer

protected void addLocalPeer(URN routingURN,
                            Selector routingSelector)
Add a peer to the DSDV-table and ensure no duplicates. Only local peers are added (metric 0).


updateTable

protected void updateTable(DSDVTable original,
                           DSDVTable updater,
                           URN updateSenderURN,
                           Selector updateSenderSelector)
This method takes one original DSDVTable and update it with another DSDVTable. Table entries with highest sequence number and best connection to a peer remains.


getDSDVTable

protected DSDVTable getDSDVTable()

getDSDVChangedPeers

protected DSDVTable getDSDVChangedPeers()