public class AlarmsReductionContainer extends AlarmsContainer
AlarmsContainer to cope with reduced alarms.
Methods of this class ensure that the model is changed from inside the swing EDT.
Methods that queries the model instead are not forced to be executed inside the EDT and
immediately return the requested value
(i.e. the caller must ensure to query from inside the EDT).
Synchronization is done by thread confinement (inside the EDT). Invocation of read only methods must be done inside the EDT.
AlarmsContainer.AlarmContainerException| Constructor and Description |
|---|
AlarmsReductionContainer(int max)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AlarmTableEntry entry)
Add an entry (i.e a alarm) in the collection.
|
void |
clear()
Remove all the elements in the container
|
AlarmTableEntry |
get(int pos,
boolean reduced)
Return the entry in the given position
|
AlarmCategoryClient |
getCategoryClient() |
int |
hasNotAckAlarms(boolean reduced)
Check if the container has alarm not yet acknowledged.
|
void |
remove(AlarmTableEntry alarm)
Remove the entry for the passed alarm
|
AlarmTableEntry |
removeOldest()
Remove the oldest entry in the container
|
void |
replace(AlarmTableEntry newAlarm)
Replace the alarm in a row with passed one.
|
void |
setCategoryClient(AlarmCategoryClient client)
Set the
CategoryClient |
int |
size(boolean reduced)
Return the number of alarms in the container depending
if the reduction rules are applied or not
|
contains, get, get, hasNotAckAlarms, removeInactiveAlarms, sizepublic AlarmsReductionContainer(int max)
max - AlarmsContainer}public int size(boolean reduced)
true - if the reduction rules are appliedpublic void add(AlarmTableEntry entry) throws AlarmsContainer.AlarmContainerException
If there is no room available in the container, an exception is thrown: checking if there is enough room must be done by the caller.
add in class AlarmsContainerentry - The not null entry to addAlarmsContainer.AlarmContainerExceptionpublic void setCategoryClient(AlarmCategoryClient client)
CategoryClientclient - The CategoryCLient; it can be null.public AlarmTableEntry get(int pos, boolean reduced)
pos - The position of the alarm in the containerreduced - true if the alarms in the table are reducedAlarmTableEntry in the given positionpublic void clear()
clear in class AlarmsContainerpublic void remove(AlarmTableEntry alarm) throws AlarmsContainer.AlarmContainerException
remove in class AlarmsContaineralarm - The alarm whose entry must be removedAlarmContainerException - If the alarm is not in the containerAlarmsContainer.AlarmContainerExceptionpublic AlarmTableEntry removeOldest() throws AlarmsContainer.AlarmContainerException
removeOldest in class AlarmsContainerAlarmContainerException - If the container is emptyAlarmsContainer.AlarmContainerExceptionpublic void replace(AlarmTableEntry newAlarm) throws AlarmsContainer.AlarmContainerException
The entry to replace the alarm is given by the alarm ID of the parameter.
replace in class AlarmsContainernewAlarm - The not null new alarmAlarmContainerException - if the entry is not in the containerAlarmsContainer.AlarmContainerExceptionpublic AlarmCategoryClient getCategoryClient()
public int hasNotAckAlarms(boolean reduced)
throws AlarmsContainer.AlarmContainerException
if there are active alarms to be acknowledged by the user, this method returns the highest of their priorities. Note that for alarm system the highest priority is 0.
AlarmsContainer.AlarmContainerExceptionAlarmContainer#hasNotAckAlarms()