org.qi4j.library.alarm
Class Alarm.AlarmMixin

java.lang.Object
  extended by org.qi4j.library.alarm.Alarm.AlarmMixin
All Implemented Interfaces:
Alarm
Enclosing interface:
Alarm

public abstract static class Alarm.AlarmMixin
extends Object
implements Alarm


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.library.alarm.Alarm
Alarm.AlarmMixin, Alarm.AlarmState
 
Field Summary
 
Fields inherited from interface org.qi4j.library.alarm.Alarm
EVENT_ACKNOWLEDGEMENT, EVENT_ACTIVATION, EVENT_BLOCKING, EVENT_DEACTIVATION, EVENT_DISABLING, EVENT_ENABLING, EVENT_UNBLOCKING, STATUS_ACKNOWLEDGED, STATUS_ACTIVATED, STATUS_BLOCKED, STATUS_DEACTIVATED, STATUS_DISABLED, STATUS_NORMAL, STATUS_REACTIVATED, TRIGGER_ACKNOWLEDGE, TRIGGER_ACTIVATE, TRIGGER_BLOCK, TRIGGER_DEACTIVATE, TRIGGER_DISABLE, TRIGGER_ENABLE, TRIGGER_UNBLOCK
 
Constructor Summary
Alarm.AlarmMixin()
           
 
Method Summary
 void acknowledge()
          Acknowledges an Alarm.
 void activate()
          Activates an Alarm.
 String attribute(String name)
          Return the attribute of the given name.
 List<String> attributeNames()
          Return all attribute names
 boolean currentCondition()
          Get Alarm condition.
 AlarmStatus currentStatus()
          Returns the current state of the standard.
 void deactivate()
          Deactivates an Alarm.
 String description(Locale locale)
          Returns a Description of the Alarm.
 String descriptionInDefaultLocale()
          Returns a Description of the Alarm.
 AlarmHistory history()
          Returns the AlarmHistory of the standard.
 String name()
          Returns the Name of the Alarm.
 void setAttribute(String name, String value)
          Sets the attribute of the given name.
 String toString()
           
 void trigger(String trigger)
          Trigger a state change.
 void updateCondition(boolean condition)
          Set Alarm condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.qi4j.library.alarm.Alarm
alarmClass, category
 

Constructor Detail

Alarm.AlarmMixin

public Alarm.AlarmMixin()
Method Detail

setAttribute

public void setAttribute(String name,
                         String value)
Description copied from interface: Alarm
Sets the attribute of the given name.

Specified by:
setAttribute in interface Alarm
Parameters:
name - The name of the attribute to set.
value - The value to set the named attribute to.

attribute

public String attribute(String name)
Description copied from interface: Alarm
Return the attribute of the given name.

Specified by:
attribute in interface Alarm
Parameters:
name - The name of the attribute to return.
Returns:
the named attribute of this Alarm.

attributeNames

public List<String> attributeNames()
Description copied from interface: Alarm
Return all attribute names

Specified by:
attributeNames in interface Alarm
Returns:
the names of the attributes of this Alarm.

toString

public String toString()
Overrides:
toString in class Object

trigger

public void trigger(String trigger)
Description copied from interface: Alarm
Trigger a state change.

When the Alarm object receives a trigger, it must consult the AlarmModel and figure out if there is an actual state change occurring and if any AlarmEvents should be fired.

Specified by:
trigger in interface Alarm
Parameters:
trigger - The trigger to execute if existing in the AlarmModel.

activate

public void activate()
Description copied from interface: Alarm
Activates an Alarm.

Convinience method for:

       trigger( "activate" );
   

Specified by:
activate in interface Alarm

deactivate

public void deactivate()
Description copied from interface: Alarm
Deactivates an Alarm. Convinience method for:
     trigger( "deactivate" );
 

Specified by:
deactivate in interface Alarm

acknowledge

public void acknowledge()
Description copied from interface: Alarm
Acknowledges an Alarm. Convinience method for:
     trigger( source, "acknowledge" );
 

Specified by:
acknowledge in interface Alarm

history

public AlarmHistory history()
Description copied from interface: Alarm
Returns the AlarmHistory of the standard.

Specified by:
history in interface Alarm
Returns:
The AlarmHistory object, or null if AlarmHistory is not supported.

currentStatus

public AlarmStatus currentStatus()
Description copied from interface: Alarm
Returns the current state of the standard.

Specified by:
currentStatus in interface Alarm
Returns:
The AlarmStatus (interface) object

name

public String name()
Returns the Name of the Alarm. This normally returns the human readable technical name of the Alarm.

Specified by:
name in interface Alarm
Returns:
the name of the Alarm.

descriptionInDefaultLocale

public String descriptionInDefaultLocale()
Returns a Description of the Alarm. This normally returns a full Description of the Alarm in the default Locale.

Specified by:
descriptionInDefaultLocale in interface Alarm
Returns:
a human-readable description of the Alarm in the default locale.

description

public String description(Locale locale)
Returns a Description of the Alarm. This normally returns a full Description of the Alarm in the Locale. If Locale is null, then the default Locale is used.

Specified by:
description in interface Alarm
Parameters:
locale - The locale to return the description in, or null to use default locale.
Returns:
a human-readable description of the Alarm in the given locale.

updateCondition

public void updateCondition(boolean condition)
Description copied from interface: Alarm
Set Alarm condition. To reduce Alarm condition calculations for Implementors, each Alarm should be able to work with a "true/false" trigger. Only changes to this trigger will cause an event. Causes an Activation or Deactivation if state of condition changes.

Specified by:
updateCondition in interface Alarm
Parameters:
condition - Sets the Alarm condition.

currentCondition

public boolean currentCondition()
Description copied from interface: Alarm
Get Alarm condition. To reduce Alarm condition calculations for Implementors, each Alarm should be able to work with a "true/false" trigger. Only changes to this trigger will cause an event.

Specified by:
currentCondition in interface Alarm
Returns:
The condition of the Alarm, which is used to simplify trigging of activate and deactivate.