org.robokind.api.motion.utils
Class RobotManager

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.utils.RobotManager
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource

public class RobotManager
extends org.robokind.api.common.property.PropertyChangeNotifier

Manages Robots and provides RobotControllers.

Author:
Matthew Stevenson

Field Summary
static String PROP_ADD_ROBOT
          Property change event name for adding a Robot.
static String PROP_REMOVE_ROBOT
          Property change event name for removing a Robot.
 
Constructor Summary
RobotManager(org.osgi.framework.BundleContext context)
          Creates a new RobotManager.
 
Method Summary
 void addRobot(Robot robot)
          Adds a RobotController for the given Robot.
 Map<Robot.Id,RobotController> getControllerMap()
          Returns the Manager's Map of Robot Ids and RobotControllers.
 List<RobotController> getControllers()
          Returns a List of RobotControllers owned by this RobotManager.
 void removeRobot(Robot.Id robotId)
          Removes a Robot from the manager.
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_ADD_ROBOT

public static final String PROP_ADD_ROBOT
Property change event name for adding a Robot.

See Also:
Constant Field Values

PROP_REMOVE_ROBOT

public static final String PROP_REMOVE_ROBOT
Property change event name for removing a Robot.

See Also:
Constant Field Values
Constructor Detail

RobotManager

public RobotManager(org.osgi.framework.BundleContext context)
Creates a new RobotManager.

Parameters:
context - BundleContext for OSGi
Method Detail

addRobot

public void addRobot(Robot robot)
Adds a RobotController for the given Robot.

Parameters:
robotId - id of the Robot to add

removeRobot

public void removeRobot(Robot.Id robotId)
Removes a Robot from the manager. If the Robot's ServiceRegistration is available, the Robot is unregistered from OSGi.

Parameters:
robotId - robot to remove

getControllerMap

public Map<Robot.Id,RobotController> getControllerMap()
Returns the Manager's Map of Robot Ids and RobotControllers.

Returns:
Manager's Map of Robot Ids and RobotControllers

getControllers

public List<RobotController> getControllers()
Returns a List of RobotControllers owned by this RobotManager.

Returns:
List of RobotControllers owned by this RobotManager


Copyright © 2011-2013. All Rights Reserved.