SunSPOT API V3.0


com.sun.spot.peripheral.radio.mhrp.aodv
Class AODVManager

java.lang.Object
  extended by com.sun.spot.peripheral.radio.mhrp.aodv.AODVManager
All Implemented Interfaces:
IRoutingManager, IService

public class AODVManager
extends Object
implements IRoutingManager

Version:
0.1
Author:
Allen Ajit George

Field Summary
 
Fields inherited from interface com.sun.spot.service.IService
PAUSED, PAUSING, RESUMING, RUNNING, STARTING, STOPPED, STOPPING
 
Method Summary
 void deregisterEventListener(IMHEventListener listener)
          Deregisters an application etc. that wasregistered for route events
 boolean findRoute(long address, RouteEventClient eventClient, Object uniqueKey)
          This method triggers a new route request.
 int getCurrentSequenceNumber()
           
 boolean getEnabled()
          Return whether service is started automatically on reboot.
static AODVManager getInstance()
           
 int getNextSequenceNumber()
          This method creates new sequence numbers.
 int getNextSequenceNumber(int givenNumber)
          This method creates new sequence numbers.
 RouteInfo getRouteInfo(long address)
          This method is called to obtain a route info, and to refreshen a route whenever it is used
 String getServiceName()
          Return the name of this service.
 int getStatus()
          Return the current status of this service.
 void initialize(long ourAddress, ILowPan lowPan)
          initializes this routing manager by starting the sender and receiver threads
 boolean initiateRouteDiscovery(long address)
           
 boolean invalidateRoute(long originator, long destination)
          This method is called when it is recognized that the route is broken somewhere.
 boolean isRunning()
          Return whether the service is currently running.
 boolean pause()
          Pause the service, and return whether successful.
 void registerEventListener(IMHEventListener listener)
          Registers an application etc. that is notified when this node processes supported route events
 boolean resume()
          Resume the service, and return whether successful.
 void setEnabled(boolean enable)
          Enable/disable whether service is started automatically.
 void setServiceName(String who)
          Assign a name to this service.
 boolean start()
          Start the service, and return whether successful.
 boolean stop()
          Stop the service, and return whether successful.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AODVManager getInstance()
Returns:
aodvManager instance of this singleton

initialize

public void initialize(long ourAddress,
                       ILowPan lowPan)
initializes this routing manager by starting the sender and receiver threads

Specified by:
initialize in interface IRoutingManager
Parameters:
lowPan - LowPan layer that is our route client

getRouteInfo

public RouteInfo getRouteInfo(long address)
This method is called to obtain a route info, and to refreshen a route whenever it is used

Specified by:
getRouteInfo in interface IRoutingManager
Parameters:
address - destination for which this method returns a route info
Returns:
routeInfo

findRoute

public boolean findRoute(long address,
                         RouteEventClient eventClient,
                         Object uniqueKey)
This method triggers a new route request.

Specified by:
findRoute in interface IRoutingManager
Returns:
true when finished

initiateRouteDiscovery

public boolean initiateRouteDiscovery(long address)

invalidateRoute

public boolean invalidateRoute(long originator,
                               long destination)
This method is called when it is recognized that the route is broken somewhere. The route is marked deactivated and a RERR is being sent.

Specified by:
invalidateRoute in interface IRoutingManager
Returns:
true when finished

registerEventListener

public void registerEventListener(IMHEventListener listener)
Registers an application etc. that is notified when this node processes supported route events

Specified by:
registerEventListener in interface IRoutingManager
Parameters:
listener - object that is notified when route events occur

deregisterEventListener

public void deregisterEventListener(IMHEventListener listener)
Deregisters an application etc. that wasregistered for route events

Specified by:
deregisterEventListener in interface IRoutingManager
Parameters:
listener - object that is notified when route events occur

getNextSequenceNumber

public int getNextSequenceNumber()
This method creates new sequence numbers.

Returns:
seqNumber the next sequence number.

getNextSequenceNumber

public int getNextSequenceNumber(int givenNumber)
This method creates new sequence numbers.

Parameters:
givenNumber -
Returns:
seqNumber the next sequence number that is greater or equal than the given numberk.

getCurrentSequenceNumber

public int getCurrentSequenceNumber()
Returns:
the current sequence number

setServiceName

public void setServiceName(String who)
Assign a name to this service. For some fixed services this may not apply and any new name will just be ignored.

Specified by:
setServiceName in interface IService
Parameters:
who - the name for this service

setEnabled

public void setEnabled(boolean enable)
Enable/disable whether service is started automatically. This may not apply to some services and calls to setEnabled() may be ignored.

Specified by:
setEnabled in interface IService
Parameters:
enable - true if the service should be started automatically on reboot

stop

public boolean stop()
Stop the service, and return whether successful. Stops all running threads. Closes any open IO connections.

Specified by:
stop in interface IService
Returns:
true if the service was successfully stopped

start

public boolean start()
Start the service, and return whether successful.

Specified by:
start in interface IService
Returns:
true if the service was successfully started

resume

public boolean resume()
Resume the service, and return whether successful. Picks up from state when service was paused. If there was no particular state associated with this service then resume() can be implemented by calling start().

Specified by:
resume in interface IService
Returns:
true if the service was successfully resumed

pause

public boolean pause()
Pause the service, and return whether successful. Preserve any current state, but do not handle new requests. Any running threads should block or sleep. Any open IO connections may be kept open. If there is no particular state associated with this service then pause() can be implemented by calling stop().

Specified by:
pause in interface IService
Returns:
true if the service was successfully paused

isRunning

public boolean isRunning()
Return whether the service is currently running.

Specified by:
isRunning in interface IService
Returns:
true if the service is currently running

getStatus

public int getStatus()
Return the current status of this service.

Specified by:
getStatus in interface IService
Returns:
the current status of this service, e.g. STOPPED, STARTING, RUNNING, PAUSED, STOPPING, etc.

getServiceName

public String getServiceName()
Return the name of this service.

Specified by:
getServiceName in interface IService
Returns:
the name of this service

getEnabled

public boolean getEnabled()
Return whether service is started automatically on reboot. This may not apply to some services and for those services it will always return false.

Specified by:
getEnabled in interface IService
Returns:
true if the service is started automatically on reboot

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.