Classes | Public Member Functions | Static Public Attributes

alma.acs.alarmsystem.source.AlarmSourceImpl Class Reference

Inheritance diagram for alma.acs.alarmsystem.source.AlarmSourceImpl:
alma.acs.alarmsystem.source.AlarmSource

List of all members.

Classes

class  OscillationTask
class  QueueFlusherTask

Public Member Functions

 AlarmSourceImpl (ContainerServicesBase containerServices)
void raiseAlarm (String faultFamily, String faultMember, int faultCode)
void raiseAlarm (String faultFamily, String faultMember, int faultCode, Properties properties)
void clearAlarm (String faultFamily, String faultMember, int faultCode)
void setAlarm (String faultFamily, String faultMember, int faultCode, Properties alarmProps, boolean active)
void setAlarm (String faultFamily, String faultMember, int faultCode, boolean active)
void terminateAllAlarms ()
synchronized void queueAlarms (long delayTime, TimeUnit unit)
void queueAlarms ()
synchronized void flushAlarms ()
void disableAlarms ()
void enableAlarms ()
void start ()
void tearDown ()

Static Public Attributes

static final int ALARM_OSCILLATION_TIME = 1

Detailed Description

The implementation of AlarmSource.

Flushing of queued alarms is done by a thread to avoid blocking the caller if there are too many queued alarm. There is possible critical race if the user executes a sequence of queueAlarms()/flushAlarms(), it happens if the queueAlarms() is called when the the thread has not yet finished flushing the alarms. This is avoided by copying the alarms in AlarmSourceImpl#queue in a temporary immutable vector.

Author:
acaproni

Constructor & Destructor Documentation

alma.acs.alarmsystem.source.AlarmSourceImpl.AlarmSourceImpl ( ContainerServicesBase  containerServices  ) 

Member Function Documentation

void alma.acs.alarmsystem.source.AlarmSourceImpl.clearAlarm ( String  faultFamily,
String  faultMember,
int  faultCode 
)

The alarm to clear is not sent directly to the alarm service. It is instead queued in AlarmSourceImpl#alarmsToClean and will be cleared by the oscillation loop.

Implements alma.acs.alarmsystem.source.AlarmSource.

References alma.acs.alarmsystem.source.AlarmQueue.add().

Referenced by alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm(), and alma.acs.alarmsystem.source.AlarmSourceImpl.terminateAllAlarms().

void alma.acs.alarmsystem.source.AlarmSourceImpl.disableAlarms (  ) 

Disable the sending of alarms.

When the alarms are disabled, all the alarms submitted with raise, clear and set are discarded. This means that those alarms are immediately discarded. They are not queued, and will never arrive at the alarm service.

See also:
AlarmSource.enableAlarms()

Implements alma.acs.alarmsystem.source.AlarmSource.

void alma.acs.alarmsystem.source.AlarmSourceImpl.enableAlarms (  ) 

Enable the sending of alarms.

Better just "This method reverts the effect of a previous call to disableAlarms(), so that alarms will get processed again.

Alarms are enabled by default.

See also:
AlarmSource.disableAlarms()

Implements alma.acs.alarmsystem.source.AlarmSource.

synchronized void alma.acs.alarmsystem.source.AlarmSourceImpl.flushAlarms (  ) 
void alma.acs.alarmsystem.source.AlarmSourceImpl.queueAlarms (  ) 

Start queuing the alarms.

The alarms are queued until flushAlarms() is executed.

The purpose of the queuing is to avoid alarms flickering for example during the initialization phase of a device where spurious states could trigger the event of false alarms.

See also:
AlarmSource.flushAlarms()

Implements alma.acs.alarmsystem.source.AlarmSource.

synchronized void alma.acs.alarmsystem.source.AlarmSourceImpl.queueAlarms ( long  delayTime,
TimeUnit  unit 
)

Start queuing the alarms.

The alarms are flushed when the passed time expires or flush gets called.

The purpose of the queuing is to avoid alarms flickering for example during the initialization phase of a device where spurious states could trigger the event of false alarms

Parameters:
delayTime The time to queue alarms
unit The unit of the delay

Implements alma.acs.alarmsystem.source.AlarmSource.

References alma.acs.alarmsystem.source.AlarmSourceImpl.flushAlarms().

void alma.acs.alarmsystem.source.AlarmSourceImpl.raiseAlarm ( String  faultFamily,
String  faultMember,
int  faultCode,
Properties  properties 
)

Raise an alarm with the given triplet and a set of properties.

If the alarm is already active, it is not sent again to the alarm service.

Parameters:
faultFamily The FaultFamily
faultMember The FaultMember
faultCode The FaultCode
properties The user properties. It can be null or empty.

Implements alma.acs.alarmsystem.source.AlarmSource.

References alma.acs.alarmsystem.source.AlarmQueue.add(), alma.acs.alarmsystem.source.AlarmsMap.raise(), and alma.acs.alarmsystem.source.AlarmSender.sendAlarm().

void alma.acs.alarmsystem.source.AlarmSourceImpl.raiseAlarm ( String  faultFamily,
String  faultMember,
int  faultCode 
)

Raise an alarm with the given triplet.

If the alarm is already active, it is not sent again to the alarm service.

Parameters:
faultFamily The FaultFamily
faultMember The FaultMember
faultCode The FaultCode

Implements alma.acs.alarmsystem.source.AlarmSource.

Referenced by alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm().

void alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm ( String  faultFamily,
String  faultMember,
int  faultCode,
Properties  alarmProps,
boolean  active 
)

Send the alarm with the passed triplet and properties to the alarm service. The state activate/terminate of the alarm depends on the passed boolean.

This method is the most complete way to send an alarm.

If the alarm is already active, it is not sent again to the alarm service. If the alarm is already terminated, it is not sent again to the alarm service.

Parameters:
faultFamily The FaultFamily
faultMember The FaultMember
faultCode The FaultCode
alarmProps The user properties. It can be null or empty.
active if true the alarm is activated otherwise it is terminated.

Implements alma.acs.alarmsystem.source.AlarmSource.

References alma.acs.alarmsystem.source.AlarmSourceImpl.clearAlarm(), and alma.acs.alarmsystem.source.AlarmSourceImpl.raiseAlarm().

Referenced by alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm().

void alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm ( String  faultFamily,
String  faultMember,
int  faultCode,
boolean  active 
)

Send the alarm with the passed triplet to the alarm service. The state activate/terminate of the alarm depends on the passed boolean.

This method is the most complete way to send an alarm.

If the alarm is already active, it is not sent again to the alarm service. If the alarm is already terminated, it is not sent again to the alarm service.

Parameters:
faultFamily The FaultFamily
faultMember The FaultMember
faultCode The FaultCode
active if true the alarm is activated otherwise it is terminated.

Implements alma.acs.alarmsystem.source.AlarmSource.

References alma.acs.alarmsystem.source.AlarmSourceImpl.setAlarm().

void alma.acs.alarmsystem.source.AlarmSourceImpl.tearDown (  ) 
void alma.acs.alarmsystem.source.AlarmSourceImpl.terminateAllAlarms (  ) 

Member Data Documentation

To limit the effect of oscillations, publishing of inactive alarms is delayed of ALARM_OSCILLATION_TIME (in seconds)

If during this time interval, the alarm is activated again then it will not be deactivated.

Visibility is public for testing purposes.

Referenced by alma.acs.alarmsystem.source.AlarmSourceImpl.AlarmSourceImpl().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties