org.qi4j.library.alarm

## Interface AlarmModel

- All Known Subinterfaces:
    ExtendedAlarmModelService, SimpleAlarmModelService, StandardAlarmModelService
  All Known Implementing Classes:
    ExtendedAlarmModelService.ExtendedAlarmModelMixin, SimpleAlarmModelService.SimpleAlarmModelMixin, StandardAlarmModelService.StandardAlarmModelMixin

      public interface AlarmModel

  Definition of the behaviour of the alarm model.

  The AlarmModel is basically the state machine of the AlarmPoint system, and it is possible to define different `AlarmModel`s for each and every alarm. Alarms that are assigned the default `AlarmModel` of the `AlarmSystem` can be re-assigned another `AlarmModel` in runtime, just by changing the default `AlarmModel` in the `AlarmSystem`. Alarms can also change the `AlarmModel` by calling the `setAlarmModel` in each alarm individually.

  See Also:
    `AlarmSystem`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `MODEL_BUNDLE_NAME`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<String>` | `alarmTriggers()` Returns an array of alarm triggers valid for this AlarmModel.
    `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()`

- - ### Field Detail

    - #### MODEL_BUNDLE_NAME

          static final String MODEL_BUNDLE_NAME

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### evaluate

          AlarmEvent evaluate(AlarmPoint alarm,
                            String trigger)
                              throws IllegalArgumentException

      Execute the required changes upon an AlarmTrigger. The AlarmSystem calls this method. The AlarmModel must NOT update the AlarmPoint itself, and only return the resulting event, and the AlarmSystem will update the AlarmStatus accordingly.
      Parameters:
        `alarm` - The AlarmPoint the trigger is for.
        `trigger` - the AlarmTrigger that was used.
      Returns:
        An AlarmEvent representing the state change for the given trigger.
      Throws:
        `IllegalArgumentException` - If the trigger given is not supported by this alarm model.

    - #### statusList

          List<String> statusList()

    - #### alarmTriggers

          List<String> alarmTriggers()

      Returns an array of alarm triggers valid for this AlarmModel. Alarms are triggered by alarm triggers, which are predefined java.lang.Strings. The AlarmModel advertise which alarm trigger strings it supports with this method.
      Returns:
        an array of alarm triggers valid for this AlarmModel.

    - #### computeTrigger

          String computeTrigger(AlarmStatus status,
                              boolean condition)

    - #### computeCondition

          boolean computeCondition(AlarmStatus status)

    - #### modelName

          String modelName()

      Returns the Name of the AlarmModel. This normally returns the human readable technical name of the AlarmModel.
      Returns:
        The system name of this alarm model.

    - #### modelDescription

          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.
      Returns:
        the description of the ModelProvider, in the default locale.

    - #### modelDescription

          String modelDescription(@Optional
                                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.
      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.