|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object obix.Obj obix.Ref obixserver.core.InvocationObj obixserver.core.alarm.AlarmManager
public class AlarmManager
Manages alarm lifecycle: creation, deletion and updates. Alarms are registered by associating conditions with observables (Objs). A condition may have one or more observables associated with it. E.g. they can check if a Real obj representing temperature is higher then a given threshold, or it can check if two Real objs representing temperatures at two points have difference greater than a certain value. The following relationships are part of an Alarm/Condition/Obj interaction: One condition uses one Obj. One condition uses two Objs. An Obj is used by one Condition An Obj is used by several Conditions An alarm is raised because condition evaluates to false. A condition is associated with one alarm instance. A condition is associated with several alarm instances.
Field Summary | |
---|---|
private obix.Obj |
alarmBase
Object that will be parent of newly created alarms |
private String |
alarmServiceUrl
|
private Map |
conditionToAlarmMap
Map for lookup of alarm by condition. |
private Map |
conditionToObjListMap
Map a Condition to a list of Objs. |
private Map |
objToAlarmMap
Map for lookup of alarm by obj. |
private Map |
objToConditionListMap
Maps an obj to a list of Conditions. |
Fields inherited from class obixserver.core.InvocationObj |
---|
objBroker |
Constructor Summary | |
---|---|
AlarmManager()
|
Method Summary | |
---|---|
void |
addCondition(Condition c)
Adds condition to the alarm manager. |
private void |
addToObjToConditionListMap(obix.Obj obj,
Condition condition)
|
private List |
conditionsForTree(obix.Obj obj)
Return all conditions for all obj's that are elements of the tree |
private void |
deleteConditionFromObjToConditionListMap(Condition condition)
|
private void |
deleteObjFromConditionsInObjToConditionListMap(obix.Obj obj)
|
String |
getAlarmServiceUrl()
|
Collection |
getAllarms()
Return all alarms. |
obix.Obj |
invoke(String name,
obix.Obj arg)
|
void |
notifyStatusChange(obix.Obj obj)
Processes notification about status change of an obj. |
void |
removeCondition(Condition c)
Removes condition from alarm manager. |
void |
removeConditionsForObj(obix.Obj obj)
Invoked when an obj is deleted from the system and therefore alarm manager needs to cleanup associated data. |
private void |
removeFromObjToConditionListMap(obix.Obj obj,
Condition condition)
|
void |
setAlarmServiceUrl(String alarmServiceUrl)
|
void |
start()
Starts the service. |
void |
stop()
Stops the service. |
Methods inherited from class obixserver.core.InvocationObj |
---|
getOp, setObjBroker |
Methods inherited from class obix.Ref |
---|
getElement, getResolved, isResolved, toString |
Methods inherited from class obix.Obj |
---|
add, add, addAll, dump, get, getBool, getChildHref, getDisplay, getDisplayName, getHref, getIcon, getInt, getIs, getName, getNormalizedHref, getParent, getReal, getRoot, getStatus, getStr, has, is, is, isAbstime, isBool, isEnum, isErr, isFeed, isInt, isList, isNull, isOp, isReal, isRef, isReltime, isStr, isUri, isVal, isWritable, list, list, remove, removeThis, replace, setBool, setDisplay, setDisplayName, setHref, setIcon, setInt, setIs, setName, setNull, setReal, setStatus, setStr, setWritable, setWritable, size, toClass, toDisplayName, toDisplayString, toObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface obix.IObj |
---|
add, addAll, get, getBool, getDisplay, getDisplayName, getHref, getIcon, getInt, getIs, getName, getNormalizedHref, getParent, getReal, getRoot, getStatus, getStr, isAbstime, isBool, isEnum, isErr, isFeed, isInt, isList, isNull, isOp, isReal, isRef, isReltime, isStr, isUri, isVal, isWritable, list, remove, removeThis, replace, setBool, setDisplay, setDisplayName, setHref, setIcon, setInt, setIs, setNull, setReal, setStatus, setStr, setWritable, setWritable, size, toDisplayName, toDisplayString |
Field Detail |
---|
private String alarmServiceUrl
private Map conditionToObjListMap
private Map objToConditionListMap
private Map conditionToAlarmMap
private Map objToAlarmMap
private obix.Obj alarmBase
Constructor Detail |
---|
public AlarmManager()
Method Detail |
---|
public void start() throws ObixserverException
Service
start
in interface Service
ObixserverException
- if an error occurs during start invocation.public void stop() throws ObixserverException
Service
stop
in interface Service
ObixserverException
- if an error occurs during stop invocation.public obix.Obj invoke(String name, obix.Obj arg)
invoke
in interface InvocationTarget
invoke
in class InvocationObj
public void addCondition(Condition c)
public void removeCondition(Condition c)
c
- condition to be removedpublic void notifyStatusChange(obix.Obj obj)
obj
- public void removeConditionsForObj(obix.Obj obj)
obj
- public Collection getAllarms()
private List conditionsForTree(obix.Obj obj)
obj
-
private void deleteObjFromConditionsInObjToConditionListMap(obix.Obj obj)
private void deleteConditionFromObjToConditionListMap(Condition condition)
private void addToObjToConditionListMap(obix.Obj obj, Condition condition)
private void removeFromObjToConditionListMap(obix.Obj obj, Condition condition)
public String getAlarmServiceUrl()
public void setAlarmServiceUrl(String alarmServiceUrl)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |