org.qi4j.library.alarm
Class StandardAlarmModelService.StandardAlarmModelMixin

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

public static class StandardAlarmModelService.StandardAlarmModelMixin
extends java.lang.Object
implements AlarmModel


Field Summary
 
Fields inherited from interface org.qi4j.library.alarm.AlarmModel
MODEL_BUNDLE_NAME
 
Constructor Summary
StandardAlarmModelService.StandardAlarmModelMixin()
           
 
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

StandardAlarmModelService.StandardAlarmModelMixin

public StandardAlarmModelService.StandardAlarmModelMixin()
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 alarm 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 that should be used for the description, or null for the default locale.
Returns:
The human readable, in the given locale, description of this alarm model.

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:
alarm - the AlarmPoint object to be updated.
trigger - the AlarmTrigger that was used.
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.

statusList

public java.util.List<java.lang.String> statusList()
Specified by:
statusList in interface 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