twaver.alarm
Class AlarmElementMapping

java.lang.Object
  extended by twaver.alarm.AlarmElementMapping
All Implemented Interfaces:
IAlarmElementMapping

public class AlarmElementMapping
extends java.lang.Object
implements IAlarmElementMapping

In general the elementID property of alarm is used to connected the alarm to corresponding element. So normally it's one-to-one relationship determined by element id, but in some cases you maybe need one-to-many relation or determine the relationship by other alarm property, then you can implement AlarmElementMapping interface to do this job.

See Also:
Alarm.getElementId(), Data.getId(), AlarmBox.setAlarmElementMapping(IAlarmElementMapping)

Constructor Summary
AlarmElementMapping(AlarmBox alarmBox)
          Constructor of this class.
 
Method Summary
 void dispose()
          Dispose the resources used in this class.
 AlarmBox getAlarmBox()
           
 java.util.List<Alarm> getCorrespondingAlarms(Element element)
          Get all corresponding alarms for the given element object.
 java.util.List<Element> getCorrespondingElements(Alarm alarm)
          Get all corresponding elements for the given alarm object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlarmElementMapping

public AlarmElementMapping(AlarmBox alarmBox)
Constructor of this class.

Parameters:
alarmBox - the AlarmBox this mapping class connected to.
Method Detail

getAlarmBox

public AlarmBox getAlarmBox()

getCorrespondingAlarms

public java.util.List<Alarm> getCorrespondingAlarms(Element element)
Get all corresponding alarms for the given element object. In this default implementation, TWaver Flex will try to find all alarms which elementID is given element's ID.

Specified by:
getCorrespondingAlarms in interface IAlarmElementMapping
Parameters:
element - the element object need to find alarms on it.
Returns:
all corresponding alarms for this given element.

getCorrespondingElements

public java.util.List<Element> getCorrespondingElements(Alarm alarm)
Get all corresponding elements for the given alarm object. In this default implementation, TWaver Flex will try to find the element which id is given alarm's elementID, return by an Array.

Specified by:
getCorrespondingElements in interface IAlarmElementMapping
Parameters:
alarm - the alarm object.
Returns:
all corresponding elements for this given alarm. In this defaul implementations class, TWaver will return the element which id equals to the given alarm's elementID.

dispose

public void dispose()
Dispose the resources used in this class.