org.qi4j.library.alarm

## Class SimpleAlarmModelService.SimpleAlarmModelMixin

- java.lang.Object
- - org.qi4j.library.alarm.SimpleAlarmModelService.SimpleAlarmModelMixin

- All Implemented Interfaces:
    AlarmModel
  Enclosing interface:
    SimpleAlarmModelService

      public static class SimpleAlarmModelService.SimpleAlarmModelMixin
      extends 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 State | Trigger | Resulting State | Event Generated
  --- | --- | --- | ---
  Normal | activate | Activated | activation
  Normal | deactivate | Normal | -
  Activated | activate | Activated | -
  Activated | deactivate | Deactivated | deactivation

- - ### Field Summary

    - ### Fields inherited from interface org.qi4j.library.alarm.AlarmModel

      `MODEL_BUNDLE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleAlarmModelService.SimpleAlarmModelMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<String>` | `alarmTriggers()` Returns all the supported AlarmPoint triggers.
    `boolean` | `computeCondition(AlarmStatus status)`
    `String` | `computeTrigger(AlarmStatus status, boolean condition)`
    `AlarmEvent` | `evaluate(AlarmPoint 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

    - #### SimpleAlarmModelService.SimpleAlarmModelMixin

          public SimpleAlarmModelService.SimpleAlarmModelMixin()

  - ### 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 AlarmPoint 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.

    - #### 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 for which the description is wanted.
      Returns:
        the description of th

    - #### statusList

          public List<String> statusList()

      Specified by:
        `statusList` in interface `AlarmModel`

    - #### evaluate

          public AlarmEvent evaluate(AlarmPoint alarm,
                            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 List<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 String computeTrigger(AlarmStatus status,
                              boolean condition)

      Specified by:
        `computeTrigger` in interface `AlarmModel`

    - #### computeCondition

          public boolean computeCondition(AlarmStatus status)

      Specified by:
        `computeCondition` in interface `AlarmModel`