urv.omolsr.core
Class StandardHandler

java.lang.Object
  extended by urv.omolsr.core.StandardHandler
All Implemented Interfaces:
Handler, UnicastHandlerListener

public class StandardHandler
extends java.lang.Object
implements Handler

This class process all OMOLSR received messages (DATA and CONTROL messages).

Author:
Gerard Paris Aixala, Marcel Arrufat Arias

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
StandardHandler(OMOLSR omolsr, OMOLSRData data, OLSRNode localOLSRNode)
           
 
Method Summary
 boolean handleIncomingDataMessage(org.jgroups.Message msg)
          Receives a multicast message and check if this message has to be forwarded We should get the headers and check if we have to forward the message We do not send the message for ourselves, since it should have been sent in the OMOLSR protocol up method
 void handleOutgoingDataMessage(org.jgroups.Message msg)
          Sends a new message to all direct neighbours in the multicast group (and another message to the local node) with application data and header information about the remaining nodes which the message must be delivered to
 void registerBroadcastMinNeighbour(java.lang.String groupId, int num)
          Register information about the minimun number of neighbours needed to perform local broadcast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

StandardHandler

public StandardHandler(OMOLSR omolsr,
                       OMOLSRData data,
                       OLSRNode localOLSRNode)
Method Detail

handleIncomingDataMessage

public boolean handleIncomingDataMessage(org.jgroups.Message msg)
Receives a multicast message and check if this message has to be forwarded We should get the headers and check if we have to forward the message We do not send the message for ourselves, since it should have been sent in the OMOLSR protocol up method

Specified by:
handleIncomingDataMessage in interface UnicastHandlerListener
Returns:
true if the message must be passed up

handleOutgoingDataMessage

public void handleOutgoingDataMessage(org.jgroups.Message msg)
Sends a new message to all direct neighbours in the multicast group (and another message to the local node) with application data and header information about the remaining nodes which the message must be delivered to

Specified by:
handleOutgoingDataMessage in interface UnicastHandlerListener
Parameters:
msg - An outgoing multicast message

registerBroadcastMinNeighbour

public void registerBroadcastMinNeighbour(java.lang.String groupId,
                                          int num)
Register information about the minimun number of neighbours needed to perform local broadcast

Parameters:
groupId -
num -