de.upb.swtpra05.group03.shuttle
Class ActivityController

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.ActivityController
All Implemented Interfaces:
ActivityControllerInterface, Module, ShuttleModule

public class ActivityController
extends java.lang.Object
implements ShuttleModule, ActivityControllerInterface

Controls the deactivation and reactivation of one shuttle by the company control.

Version:
$Revision: 1.3 $

Field Summary
private  ShuttleControlInterface agent
          The shuttle control
private  java.util.HashSet deactivatedShuttleList
          deactivatedShuttleList holds the deactivated Shuttles
private static java.util.logging.Logger log
          Logger for debugging
 
Constructor Summary
ActivityController()
          Constructor
 
Method Summary
 boolean getShuttleActiveStatus(de.upb.swtpra.kernel.id.ID shuttleID)
          Returns false if the Shuttle is set to be deactive from the CompanyControl
 void init(ModuleContainerInterface container)
          Initializes this module.
 boolean isActive()
          Returns if the shuttle is active or deactivated by company control.
 void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
          React on the received message of the shuttle or not.
private  void setShuttleActiveStatus(int shuttleID, boolean shuttleActivity)
          This method keeps the deactivatedShuttleList up to date
private  void setShuttleActivity(SetActivityOfShuttleMessage msg)
          Sets the shuttle activity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log
Logger for debugging


agent

private ShuttleControlInterface agent
The shuttle control


deactivatedShuttleList

private java.util.HashSet deactivatedShuttleList
deactivatedShuttleList holds the deactivated Shuttles

Constructor Detail

ActivityController

public ActivityController()
Constructor

Method Detail

init

public void init(ModuleContainerInterface container)
Description copied from interface: Module
Initializes this module. References to other modules should be set here to avoid circle dependencies.

Specified by:
init in interface Module
Parameters:
container - The module manager which contain all modules

newMessageReceived

public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: ShuttleModule
React on the received message of the shuttle or not.

Specified by:
newMessageReceived in interface ShuttleModule
Parameters:
msg - The received message of the shuttle

setShuttleActivity

private void setShuttleActivity(SetActivityOfShuttleMessage msg)
Sets the shuttle activity.

Parameters:
msg - The SetActivityOfShuttleMessage

setShuttleActiveStatus

private void setShuttleActiveStatus(int shuttleID,
                                    boolean shuttleActivity)
This method keeps the deactivatedShuttleList up to date

Parameters:
shuttleID - shuttle id
shuttleActivity - shuttle activity status

getShuttleActiveStatus

public boolean getShuttleActiveStatus(de.upb.swtpra.kernel.id.ID shuttleID)
Returns false if the Shuttle is set to be deactive from the CompanyControl

Parameters:
shuttleID - shuttle id
Returns:
The activity status

isActive

public boolean isActive()
Description copied from interface: ActivityControllerInterface
Returns if the shuttle is active or deactivated by company control.

Specified by:
isActive in interface ActivityControllerInterface
Returns:
if the shuttle is active or deactivated by company control.