SunSPOT API V5.0


com.sun.spot.peripheral.radio.mhrp.aodv.request
Class RequestTable

java.lang.Object
  extended by com.sun.spot.peripheral.radio.mhrp.aodv.request.RequestTable

public class RequestTable
extends Object

Version:
0.1
Author:
Allen Ajit George

Method Summary
 boolean addRREQ(RREQ message, RouteEventClient eventClient, Object uniqueKey)
          add a route request to the request table
 void cleanTable()
          This method removes all outstanding request that are expired
 RequestEntry findRequest(long destAddr, long origAddr, int reqID, boolean active)
          Helper function to search for an existing (active) entry
 RouteEventClient getCallback(RREP message)
          This method provides access to the client that interested in the route reply message that is passed as an argument
static RequestTable getInstance()
          provides the instance of this singleton
static int getNextRREQID()
          get the next route request ID
 boolean hasActiveRequest(RREP message)
          this method tells the caller if the request table already has an entry for the destination of this route request and it is currently active
 boolean hasActiveRequest(RREQ message)
          this method tells the caller if the request table already has an entry for the destination of this route request and it is currently active
 boolean hasRequest(RREP message)
          this method tells the caller if the request table already has an entry for the destination of this route reply
 boolean hasRequest(RREQ message)
          this method tells the caller if the request table already has an entry for the destination of this route request
 void removeOutstandingRequest(long destination, long originator, int reqID)
          this method removes an outstanding request from the table
 void setOurAddress(long ourAddress)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public void start()

stop

public void stop()

getInstance

public static RequestTable getInstance()
provides the instance of this singleton


getNextRREQID

public static int getNextRREQID()
get the next route request ID

Returns:
nextRREQID

addRREQ

public boolean addRREQ(RREQ message,
                       RouteEventClient eventClient,
                       Object uniqueKey)
add a route request to the request table

Parameters:
message - the rreq that should be added
eventClient - the instance that caused this route request
uniqueKey - identifier for this rreq
Returns:
true when ready

findRequest

public RequestEntry findRequest(long destAddr,
                                long origAddr,
                                int reqID,
                                boolean active)
Helper function to search for an existing (active) entry

Parameters:
destAddr -
origAddr -
reqID - if non-zero then must match request ID
active - if true then only match active requests
Returns:
the request entry that is a match if found

hasActiveRequest

public boolean hasActiveRequest(RREQ message)
this method tells the caller if the request table already has an entry for the destination of this route request and it is currently active

Parameters:
message -
Returns:
hasActiveRequest

hasActiveRequest

public boolean hasActiveRequest(RREP message)
this method tells the caller if the request table already has an entry for the destination of this route request and it is currently active

Parameters:
message -
Returns:
hasActiveRequest

hasRequest

public boolean hasRequest(RREQ message)
this method tells the caller if the request table already has an entry for the destination of this route request

Parameters:
message -
Returns:
hasRequest

hasRequest

public boolean hasRequest(RREP message)
this method tells the caller if the request table already has an entry for the destination of this route reply

Parameters:
message -
Returns:
hasRequest

removeOutstandingRequest

public void removeOutstandingRequest(long destination,
                                     long originator,
                                     int reqID)
this method removes an outstanding request from the table

Parameters:
destination -
originator -

cleanTable

public void cleanTable()
This method removes all outstanding request that are expired


getCallback

public RouteEventClient getCallback(RREP message)
This method provides access to the client that interested in the route reply message that is passed as an argument

Parameters:
message -
Returns:
routeEventClient

setOurAddress

public void setOurAddress(long ourAddress)

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.