alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory Class Reference

Collaboration diagram for alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static void init (ContainerServicesBase containerServices) throws AcsJContainerServicesEx
static void done ()
static synchronized
ACSAlarmSystemInterface 
createSource (String sourceName) throws ACSASFactoryNotInitedEx, SourceCreationErrorEx
static ACSAlarmSystemInterface createSource () throws ACSASFactoryNotInitedEx, SourceCreationErrorEx
static synchronized ACSFaultState createFaultState () throws ACSASFactoryNotInitedEx, FaultStateCreationErrorEx
static ACSFaultState createFaultState (String family, String member, int code) throws ACSASFactoryNotInitedEx, FaultStateCreationErrorEx
static boolean usingACSAlarmSystem () throws ACSASFactoryNotInitedEx

Static Private Member Functions

static void initCmwMom () throws Exception
static boolean retrieveImplementationType (DAL dal)
static String getProperty (String dao, String propName)

Static Private Attributes

static final String CONFIGURATION_PATH = "Alarms/Administrative/AlarmSystemConfiguration"
static Boolean useACSAlarmSystem = null
static ACSAlarmSystemInterface source = null
static Logger logger = null
static ContainerServicesBase containerServices

Detailed Description

ACSAlarmSystemInterfaceFactory extends the CERN AlarmSystemInterfaceFactory to create sources with different implementations depending on the actual configuration in the CDB.

The type of implementation is in AlarmSystemConfiguration.xml: a property named Implementation. CERN implementation is used only if the property is CERN. If the property is not found, is ACS or the CDB record does not exist the ACS implementation for sources is used.

Author:
acaproni

Member Function Documentation

static ACSFaultState alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::createFaultState ( String  family,
String  member,
int  code 
) throws ACSASFactoryNotInitedEx, FaultStateCreationErrorEx [inline, static]

Factory method for creating ACSFaultState instances.

Returns:
a new ACSFaultState instance.
Parameters:
family the fault family.
member the fault member.
code the fault code.

References createFaultState(), alma::alarmsystem::source::ACSFaultState::setCode(), alma::alarmsystem::source::ACSFaultState::setFamily(), and alma::alarmsystem::source::ACSFaultState::setMember().

static synchronized ACSFaultState alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::createFaultState (  )  throws ACSASFactoryNotInitedEx, FaultStateCreationErrorEx [inline, static]

Factory method for creating ACSFaultState instances.

Returns:
a new ACSFaultState instance.

References useACSAlarmSystem.

Referenced by createFaultState().

static ACSAlarmSystemInterface alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::createSource (  )  throws ACSASFactoryNotInitedEx, SourceCreationErrorEx [inline, static]

Create a new instance of an alarm system interface without binding it to any source.

Returns:
the interface instance.
Exceptions:
ASIException if the AlarmSystemInterface instance can not be created.
static synchronized ACSAlarmSystemInterface alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::createSource ( String  sourceName  )  throws ACSASFactoryNotInitedEx, SourceCreationErrorEx [inline, static]

Create a new instance of an alarm system interface.

Parameters:
sourceName the source name.
Returns:
the interface instance.
Exceptions:
ASIException if the AlarmSystemInterface instance can not be created.

References logger, source, and useACSAlarmSystem.

static void alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::done (  )  [inline, static]

Cleanup the class. This method has to be called outside of the class and performs all the necessary clean up

References useACSAlarmSystem.

static String alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::getProperty ( String  dao,
String  propName 
) [inline, static, private]

Get the value of a property from the DAO.

Parameters:
dao The dao (XML string)
propName The name of the property
Returns:
The value of the property with the given name null if the property doesn't exist

Referenced by retrieveImplementationType().

static void alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::init ( ContainerServicesBase  containerServices  )  throws AcsJContainerServicesEx [inline, static]

Init the static variables of the class This method has to be called before executing any other method.

Parameters:
logger The logger
dal The DAL to init the AS with CERN or ACS implementation
Exceptions:
AcsJContainerServicesEx 

References containerServices, alma::acs::container::ContainerServicesBase::getCDB(), alma::acs::container::ContainerServicesBase::getLogger(), initCmwMom(), logger, retrieveImplementationType(), and useACSAlarmSystem.

static void alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::initCmwMom (  )  throws Exception [inline, static, private]

Initialize cmw-mom (that in turn inits acs-jms) by setting the container services.

The container services must be set in a cmw-mom static variable in order the messages are published into the NC. The container services will be passed from this class down to the acs-jms classes.

See also:
cern.cmw.mom.pubsub.impl.ACSJMSTopicConnectionImpl

References containerServices, and logger.

Referenced by init().

static boolean alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::retrieveImplementationType ( DAL  dal  )  [inline, static, private]

Read the Implementation property from the Alarm System Configuration

Parameters:
dal The DAL
Returns:
false if the Implementation property is CERN true otherwise

References CONFIGURATION_PATH, com::cosylab::CDB::DALOperations::get_DAO(), and getProperty().

Referenced by init().

static boolean alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::usingACSAlarmSystem (  )  throws ACSASFactoryNotInitedEx [inline, static]

Return the type of AS used

Returns:
True if ACS AS is used, false otherwise

References useACSAlarmSystem.


Member Data Documentation

final String alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::CONFIGURATION_PATH = "Alarms/Administrative/AlarmSystemConfiguration" [static, private]

The path in the CDB of the AS configuraton

Referenced by retrieveImplementationType().

Container services

Referenced by init(), and initCmwMom().

The logger

Referenced by createSource(), init(), and initCmwMom().

At the present, while using the CERN implementation, we use the same source for sending all the alarms so we can use a singleton and return the same object to all the clients.

See also:
AlarmSystemInterfaceProxy

Referenced by createSource().

It is true if ACS implementation for sources must be used; false means CERN implementation.

It is null if it has not yet been initialized.

Referenced by createFaultState(), createSource(), done(), init(), and usingACSAlarmSystem().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2