org.qi4j.library.alarm
Class ExtendedAlarmModelService.ExtendedAlarmModelMixin

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

public static class ExtendedAlarmModelService.ExtendedAlarmModelMixin
extends Object
implements AlarmModel


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

Constructor Detail

ExtendedAlarmModelService.ExtendedAlarmModelMixin

public ExtendedAlarmModelService.ExtendedAlarmModelMixin()
Method Detail

modelName

public 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 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, in the default locale.

modelDescription

public String modelDescription(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(Alarm alarm,
                           String trigger)
Execute the required changes upon an AlarmTrigger. The AlarmSystem calls this method, for the AlarmStatus in the the Alarm to be updated, as well as an AlarmEvent to be created.

Specified by:
evaluate in interface AlarmModel
Parameters:
alarm - the Alarm object to be updated.
trigger - the AlarmTrigger that was used.
Returns:
An AlarmEvent representing the state change for the given trigger.

alarmTriggers

public List<String> alarmTriggers()
Returns all the supported Alarm triggers.

Specified by:
alarmTriggers in interface AlarmModel
Returns:
The Alarm triggers that this AlarmModel supports.

statusList

public List<String> statusList()
Specified by:
statusList in interface AlarmModel

computeTrigger

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

computeCondition

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