public class StartServicesHelper
extends java.lang.Object
The reference to the services daemon is acquired before starting/stopping services and released when the operation terminates.
| Modifier and Type | Class and Description |
|---|---|
class |
StartServicesHelper.AlarmServicesDefinitionHolder
An object to hold the definitions of the services to start.
|
class |
StartServicesHelper.DaemonException
Encapsulate the exception returned by the daemon
|
class |
StartServicesHelper.DaemonSequenceCallbackImpl
The callback to notify the listeners about the progress of the async start/stop
of services.
|
class |
StartServicesHelper.GettingDaemonException
The exception returned when an error happens getting the services daemon.
|
static interface |
StartServicesHelper.ServicesListener
The listener of events generated starting and stopping
the services.
|
class |
StartServicesHelper.TMCDBException
The exception in case of error from the TMCDB
|
| Constructor and Description |
|---|
StartServicesHelper(Session session,
java.lang.String configurationName,
AcsCorba acsCorba,
AcsLogger logger,
java.lang.String daemonHost,
int instance)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addServiceListener(StartServicesHelper.ServicesListener listener)
Add a listener to be notified about the progress of the start/stop of services.
|
StartServicesHelper.AlarmServicesDefinitionHolder |
getServicesDescription()
Reads from the TMCDB the list of ACS services to start.
|
boolean |
removeServiceListener(StartServicesHelper.ServicesListener listener)
Remove the passed listener of the start/stop of services.
|
StartServicesHelper.AlarmServicesDefinitionHolder |
startACSServices()
Starts the services as they are defined in the TMCDB.
|
void |
startACSServices(java.lang.String xmlListOfServices)
Starts the services whose XML definition is in the parameter.
|
void |
stopServices(java.lang.String xmlListOfServices)
Stops the services whose definition is in the passed parameter.
|
public StartServicesHelper(Session session,
java.lang.String configurationName,
AcsCorba acsCorba,
AcsLogger logger,
java.lang.String daemonHost,
int instance)
Session - The hibernate session to read data from the TMCDBconfigurationName - The name of the configurationacsCorba - The AcsCorbalogger - The loggerdaemonHost - The host where the service daemon runsinstance - The ACS instancepublic StartServicesHelper.AlarmServicesDefinitionHolder getServicesDescription() throws StartServicesHelper.GettingDaemonException, StartServicesHelper.DaemonException, StartServicesHelper.TMCDBException
Using this method is optional and expected only for special cases (in conjunction with startACSServices(java.lang.String)),
because method startACSServices(java.lang.String) includes this step.
This method delegates to #internalGetServicesDescritpion(ServicesDaemon, ServiceDefinitionBuilder)
StartServicesHelper.GettingDaemonException - In case of error getting the daemonStartServicesHelper.DaemonException - In case of error from the daemonStartServicesHelper.TMCDBException - If the list of service read from the TMCDB is empty#internalGetServicesDescritpion(ServicesDaemon, ServiceDefinitionBuilder)public void startACSServices(java.lang.String xmlListOfServices)
throws StartServicesHelper.GettingDaemonException,
StartServicesHelper.DaemonException
The real starting of services is delegated to #internalStartServices(ServicesDaemon, ServiceDefinitionBuilder, String)
The starting of the services is delegated to a acs service daemon.
xmlListOfServices - The XML describing the list of services to start.
It is generally returned by getServicesDescription()StartServicesHelper.GettingDaemonException - in case of error getting the services daemonStartServicesHelper.DaemonException - In case of error from the daemonpublic StartServicesHelper.AlarmServicesDefinitionHolder startACSServices() throws StartServicesHelper.GettingDaemonException, HibernateException, StartServicesHelper.DaemonException, StartServicesHelper.TMCDBException
The real starting of services is delegated to #internalStartServices(ServicesDaemon, ServiceDefinitionBuilder, String)
stopServices(java.lang.String)
and a list of services as they have been read from the TMCDBStartServicesHelper.GettingDaemonException - in case of error getting the services daemonHibernateException - In case of error reading the services from the TMCDBDaemonExceptionIn - case of error from the daemonStartServicesHelper.TMCDBException - If the list of services read from the TMCDB is emptyStartServicesHelper.DaemonExceptionStartServicesHelper.AlarmServicesDefinitionHolderpublic void stopServices(java.lang.String xmlListOfServices)
throws StartServicesHelper.GettingDaemonException,
StartServicesHelper.DaemonException
xmlListOfServices - The XML describing the list of services to stop.StartServicesHelper.GettingDaemonException - In case of error getting the services daemonStartServicesHelper.DaemonException - In case of error from the services daemonpublic void addServiceListener(StartServicesHelper.ServicesListener listener)
listener - The not null listener to add.public boolean removeServiceListener(StartServicesHelper.ServicesListener listener)
listener - The not null listener to remove.true if this set contained the specified element