org.qi4j.library.alarm
Class SimpleAlarmModelService.SimpleAlarmModelMixin

java.lang.Object
  extended by org.qi4j.library.alarm.SimpleAlarmModelService.SimpleAlarmModelMixin
All Implemented Interfaces:
AlarmModel
Enclosing interface:
SimpleAlarmModelService

public static class SimpleAlarmModelService.SimpleAlarmModelMixin
extends java.lang.Object
implements AlarmModel

The Simple AlarmPoint Model is centered around the Normal and Activated. The triggers "activate" and "deactivate". The following matrix details the resulting grid;

Initial StateTriggerResulting StateEvent Generated
NormalactivateActivatedactivation
NormaldeactivateNormal-
ActivatedactivateActivated-
ActivateddeactivateDeactivateddeactivation


Field Summary
 
Fields inherited from interface org.qi4j.library.alarm.AlarmModel
MODEL_BUNDLE_NAME
 
Constructor Summary
SimpleAlarmModelService.SimpleAlarmModelMixin()
           
 
Method Summary
 java.util.List<java.lang.String> alarmTriggers()
          Returns all the supported AlarmPoint triggers.
 boolean computeCondition(AlarmStatus status)
           
 java.lang.String computeTrigger(AlarmStatus status, boolean condition)
           
 AlarmEvent evaluate(AlarmPoint alarm, java.lang.String trigger)
          Execute the required changes upon an AlarmTrigger.
 java.lang.String modelDescription()
          Returns a Description of the AlarmModel in the default Locale.
 java.lang.String modelDescription(java.util.Locale locale)
          Returns a Description of the AlarmModel.
 java.lang.String modelName()
          Returns the Name of the AlarmModel.
 java.util.List<java.lang.String> statusList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAlarmModelService.SimpleAlarmModelMixin

public SimpleAlarmModelService.SimpleAlarmModelMixin()
Method Detail

modelName

public java.lang.String modelName()
Returns the Name of the AlarmModel. This normally returns the human readable technical name of the AlarmModel.

Specified by:
modelName in interface AlarmModel
Returns:
The system name of this AlarmPoint Model.

modelDescription

public java.lang.String modelDescription()
Returns a Description of the AlarmModel in the default Locale. This normally returns a full Description of the AlarmModel in the default Locale.

Specified by:
modelDescription in interface AlarmModel
Returns:
the description of the ModelProvider.

modelDescription

public java.lang.String modelDescription(java.util.Locale locale)
Returns a Description of the AlarmModel. This normally returns a full Description of the AlarmModel in the Locale. If Locale is null, then the default Locale is used.

Specified by:
modelDescription in interface AlarmModel
Parameters:
locale - The locale for which the description is wanted.
Returns:
the description of th

statusList

public java.util.List<java.lang.String> statusList()
Specified by:
statusList in interface AlarmModel

evaluate

public AlarmEvent evaluate(AlarmPoint alarm,
                           java.lang.String trigger)
Execute the required changes upon an AlarmTrigger. The AlarmSystem calls this method, for the AlarmStatus in the the AlarmPoint to be updated, as well as an AlarmEvent to be created.

Specified by:
evaluate in interface AlarmModel
Parameters:
trigger - the AlarmTrigger that was used.
alarm - The AlarmPoint the trigger is for.
Returns:
An AlarmEvent representing the state change for the given trigger.

alarmTriggers

public java.util.List<java.lang.String> alarmTriggers()
Returns all the supported AlarmPoint triggers.

Specified by:
alarmTriggers in interface AlarmModel
Returns:
an array of alarm triggers valid for this AlarmModel.

computeTrigger

public java.lang.String computeTrigger(AlarmStatus status,
                                       boolean condition)
Specified by:
computeTrigger in interface AlarmModel

computeCondition

public boolean computeCondition(AlarmStatus status)
Specified by:
computeCondition in interface AlarmModel