SunSPOT API V6.0


com.sun.spot.peripheral.radio.routing
Class RoutingPolicyManager

java.lang.Object
  extended by com.sun.spot.resources.Resource
      extended by com.sun.spot.service.BasicService
          extended by com.sun.spot.peripheral.radio.routing.RoutingPolicyManager
All Implemented Interfaces:
IRoutingPolicyManager, IResource, IService

public class RoutingPolicyManager
extends BasicService
implements IRoutingPolicyManager

The object that oversees the routing policy for this node

Author:
pete

Field Summary
 
Fields inherited from interface com.sun.spot.service.IService
PAUSED, PAUSING, READY, RESUMING, RUNNING, STARTING, STOPPED, STOPPING
 
Method Summary
 boolean bridgeBroadcasts()
          return true if we pass broadcasts without decrementing hop count
static IRoutingPolicyManager getInstance()
          Return a singleton for the RoutingPolicyManager
 String getServiceName()
          Return the name of this service.
 boolean isEndNode()
          determine if we are only a routing consumer
 boolean maySleep()
          determine whether this routing policy allows deepSleep
 void policyHasChanged(RoutingPolicy newPolicy)
          Notify the routing subsystem of a new routing policy
 boolean routeAlways()
          determine if we always pass packets
 String toString()
          create a string representation of this object
 
Methods inherited from class com.sun.spot.service.BasicService
getEnabled, getStatus, isRunning, pause, resume, setEnabled, setServiceName, start, stop
 
Methods inherited from class com.sun.spot.resources.Resource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.spot.service.IService
getEnabled, getStatus, isRunning, pause, resume, setEnabled, setServiceName, start, stop
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Method Detail

getInstance

public static IRoutingPolicyManager getInstance()
Return a singleton for the RoutingPolicyManager

Returns:
the singleton that manages routing policy

getServiceName

public String getServiceName()
Description copied from interface: IService
Return the name of this service.

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

policyHasChanged

public void policyHasChanged(RoutingPolicy newPolicy)
Notify the routing subsystem of a new routing policy

Specified by:
policyHasChanged in interface IRoutingPolicyManager
Parameters:
newPolicy - policy that should now be in effect

toString

public String toString()
create a string representation of this object

Overrides:
toString in class Object
Returns:
the routing policy as a string description

maySleep

public boolean maySleep()
determine whether this routing policy allows deepSleep

Specified by:
maySleep in interface IRoutingPolicyManager
Returns:
true if the deepSleep is not disabled

routeAlways

public boolean routeAlways()
determine if we always pass packets

Specified by:
routeAlways in interface IRoutingPolicyManager
Returns:
true if we pass packets for other nodes

isEndNode

public boolean isEndNode()
determine if we are only a routing consumer

Specified by:
isEndNode in interface IRoutingPolicyManager
Returns:
true if we only generate routing requests for ourself

bridgeBroadcasts

public boolean bridgeBroadcasts()
Description copied from interface: IRoutingPolicyManager
return true if we pass broadcasts without decrementing hop count

Specified by:
bridgeBroadcasts in interface IRoutingPolicyManager
Returns:
true if we pass broadcasts without decrementing hop count

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.