jhomenet.server.responsive
Class ResponsiveManagerImpl

java.lang.Object
  extended by jhomenet.server.responsive.ResponsiveManagerImpl

public class ResponsiveManagerImpl
extends java.lang.Object

A class that is responsible for managing the sensor response system.

Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)

Field Summary
protected  javax.swing.event.EventListenerList listenerList
          List of listeners
 
Constructor Summary
ResponsiveManagerImpl(SensorResponsiveConfiguration responsiveConfig, ServerContext serverContext)
          Constructor.
 
Method Summary
 void addOrUpdateCondition(Condition condition)
           
 void addOrUpdatePlan(Plan plan)
          Add a plan to the plan scheduler.
 void addOrUpdateResponse(Response response)
           
 void addOrUpdateTrigger(TriggerWrapper trigger)
          Add a trigger to the plan scheduler.
 void addResponsiveManagerListener(ResponsiveManagerListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 java.util.List<Condition> getConditions()
           
 Plan getPlan(java.lang.String id)
           
 java.util.List<Plan> getPlans()
           
 java.util.List<Response> getResponses()
           
 ResponsiveExecutor getResponsiveExecutor()
           
 java.util.List<java.lang.String> getTriggerGroups()
           
 java.util.List<TriggerWrapper> getTriggers()
           
 java.util.List<TriggerWrapper> getTriggers(java.lang.String id)
           
 void loadConditions()
           
 void loadPlans()
          Attempt to load the plans from the persistence layer.
 void loadResponses()
           
 void loadTriggers()
           
 void removeCondition(Condition conditionToRemove)
          Remove a condition.
 void removePlan(Plan planToRemove)
          Remove a plan from the scheduler.
 void removeResponse(Response responseToRemove)
           
 void removeResponsiveManagerListener(ResponsiveManagerListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void removeTrigger(TriggerWrapper triggerToRemove)
          Remove a trigger from the scheduler.
 void schedule(Plan plan, TriggerWrapper triggerWrapper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
List of listeners

Constructor Detail

ResponsiveManagerImpl

public ResponsiveManagerImpl(SensorResponsiveConfiguration responsiveConfig,
                             ServerContext serverContext)
Constructor.

Parameters:
responsiveConfig -
Method Detail

getResponsiveExecutor

public ResponsiveExecutor getResponsiveExecutor()
See Also:
jhomenet.commons.responsive.ResponsiveManager#getResponsiveExecutor()

addOrUpdateCondition

public void addOrUpdateCondition(Condition condition)
Parameters:
condition -

removeCondition

public void removeCondition(Condition conditionToRemove)
Remove a condition.

Parameters:
conditionToRemove - A reference to the condition to remove

getConditions

public java.util.List<Condition> getConditions()
Returns:

loadConditions

public void loadConditions()
                    throws ResponsiveException
Throws:
ResponsiveException
See Also:
jhomenet.commons.responsive.ResponsiveManager#loadConditions()

addOrUpdateResponse

public void addOrUpdateResponse(Response response)
See Also:
jhomenet.commons.responsive.ResponsiveManager#addOrUpdateResponse(jhomenet.commons.responsive.response.Response)

removeResponse

public void removeResponse(Response responseToRemove)
See Also:
jhomenet.commons.responsive.ResponsiveManager#removeResponse(jhomenet.commons.responsive.response.Response)

getResponses

public java.util.List<Response> getResponses()
See Also:
jhomenet.commons.responsive.ResponsiveManager#getResponses()

loadResponses

public void loadResponses()
                   throws ResponsiveException
Throws:
ResponsiveException
See Also:
jhomenet.commons.responsive.ResponsiveManager#loadResponses()

addOrUpdatePlan

public void addOrUpdatePlan(Plan plan)
Add a plan to the plan scheduler.

Parameters:
plan - Reference to the plan to add

removePlan

public void removePlan(Plan planToRemove)
Remove a plan from the scheduler.

Parameters:
planToRemove - A reference to the plan to remove

getPlans

public java.util.List<Plan> getPlans()
Returns:

loadPlans

public void loadPlans()
               throws ResponsiveException
Attempt to load the plans from the persistence layer.

Throws:
ResponsiveException

addOrUpdateTrigger

public void addOrUpdateTrigger(TriggerWrapper trigger)
Add a trigger to the plan scheduler.

Parameters:
trigger - Reference to the trigger to add

removeTrigger

public void removeTrigger(TriggerWrapper triggerToRemove)
Remove a trigger from the scheduler.

Parameters:
triggerToRemove - Trigger to remove

getTriggers

public java.util.List<TriggerWrapper> getTriggers()
Returns:

loadTriggers

public void loadTriggers()
                  throws ResponsiveException
Throws:
ResponsiveException
See Also:
jhomenet.commons.responsive.ResponsiveManager#loadTriggers()

getTriggerGroups

public java.util.List<java.lang.String> getTriggerGroups()
See Also:
jhomenet.commons.responsive.ResponsiveManager#getTriggerGroups()

schedule

public final void schedule(Plan plan,
                           TriggerWrapper triggerWrapper)
                    throws ResponsiveException
Throws:
ResponsiveException
See Also:
jhomenet.commons.responsive.ResponsiveManager#schedule(jhomenet.commons.responsive.plan.Plan, jhomenet.commons.responsive.trigger.TriggerWrapper)

getPlan

public Plan getPlan(java.lang.String id)
See Also:
jhomenet.commons.responsive.ResponsiveManager#getPlan(java.lang.String)

getTriggers

public java.util.List<TriggerWrapper> getTriggers(java.lang.String id)
See Also:
jhomenet.commons.responsive.ResponsiveManager#getTriggers(java.lang.String)

addResponsiveManagerListener

public void addResponsiveManagerListener(ResponsiveManagerListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Parameters:
l - the ResponsvieManagerListener

removeResponsiveManagerListener

public void removeResponsiveManagerListener(ResponsiveManagerListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Parameters:
l - the ResponsiveManagerListener


Copyright © 2004-2007 David Irwin. All Rights Reserved.