public class LaserComponent extends CERNAlarmServicePOA implements AlarmSourcesListener.SourceListener
| Modifier and Type | Class and Description |
|---|---|
class |
LaserComponent.LaserComponentTerminator
A class to terminate the alarm service asynchronously.
|
| Constructor and Description |
|---|
LaserComponent(AlarmSystemCorbaServer corbaServer,
AlarmSystemContainerServices alSysContSvcs)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
archiveSearch(int[] categoryIds,
java.lang.String sql,
java.lang.String clientId) |
java.lang.String |
createAdminUser(java.lang.String name,
java.lang.String password) |
void |
createAlarm(java.lang.String userId,
alma.alarmsystem.AlarmDefinition definition) |
void |
createCategory(java.lang.String userId,
alma.alarmsystem.CategoryDefinition definition) |
void |
createSource(java.lang.String userId,
alma.alarmsystem.SourceDefinition definition) |
void |
execute() |
LogLevels |
get_default_logLevels()
Gets the log levels of the default logging configuration.
|
java.lang.String[] |
get_logger_names()
Gets the names of all loggers, to allow configuring their levels
individually.
|
LogLevels |
get_logLevels(java.lang.String logger_name)
Gets log levels for a particular named logger.
|
Alarm[] |
getActiveMultiplicityChildren(java.lang.String parentId) |
Alarm[] |
getActiveNodeChildren(java.lang.String parentId) |
Alarm |
getAlarmById(java.lang.String id) |
Alarm |
getAlarmByTriplet(java.lang.String ff,
java.lang.String fm,
int fc) |
Alarm[] |
getAlarmsByCategory(int categoryId) |
Alarm[] |
getAlarmsByPriority(int priority) |
Alarm[] |
getAlarmsByResponsiblePerson(int responsibleId) |
Alarm[] |
getAlarmsBySource(java.lang.String sourceId) |
Category[] |
getCategories() |
Category |
getCategoryByPath(java.lang.String path) |
Category[] |
getCategoryChildren(int nodeId) |
Category |
getCategoryParent(int nodeId) |
java.lang.String |
getCategoryRootTopic() |
Category |
getCategoryTreeRoot() |
java.lang.String |
getClientRootTopic() |
long |
getHeartbeatFrequency() |
java.lang.String |
getHeartbeatTopic() |
Alarm[] |
getMultiplicityChildren(java.lang.String parentId) |
Alarm[] |
getMultiplicityParents(java.lang.String childId) |
int |
getMultiplicityThreshold(java.lang.String parentId) |
Alarm[] |
getNodeChildren(java.lang.String parentId) |
Alarm[] |
getNodeParents(java.lang.String childId) |
ResponsiblePerson[] |
getResponsiblePersons() |
java.lang.String |
getSearchRootTopic() |
Source[] |
getSources() |
void |
initialize() |
boolean |
isACSAlarmService() |
java.lang.String |
loginAdminUser(java.lang.String name,
java.lang.String password) |
void |
onMessage(java.lang.String message)
The xml recieved from the source (to be unmarshalled
into e
ASIMessage). |
void |
refresh_logging_config()
Commands the container or manager to read in again the logging
configuration from the CDB and to reconfigure the loggers accordingly.
|
void |
search(int[] categoryIds,
java.lang.String sql,
java.lang.String clientId) |
void |
select(int[] categoryIds,
java.lang.String client) |
void |
sendCoreAlarmAsync(LaserCoreFaultState.LaserCoreFaultCodes alarm,
boolean active)
Send a core alarm in a dedicated thread.
|
void |
sentCoreAlarms(java.util.Vector<LaserCoreFaultState.LaserCoreFaultCodes> alarms)
Send alarm services alarms and return when all the alarms
have been processed by the alarm message processor.
|
void |
set_default_logLevels(LogLevels levels)
Sets the log levels of the default logging configuration.
|
void |
set_logLevels(java.lang.String logger_name,
LogLevels levels)
Sets log levels for a particular named logger.
|
void |
shutdown()
Shutdown the alarm service
|
void |
submitAlarm(Triplet triplet,
boolean active,
java.lang.String sourceHostName,
java.lang.String sourceName,
long timestamp,
Property[] alarmProperties)
IDL method: submit an alarm without.
|
public LaserComponent(AlarmSystemCorbaServer corbaServer, AlarmSystemContainerServices alSysContSvcs) throws java.lang.Exception
java.lang.Exceptionpublic void initialize()
public void shutdown()
public void sendCoreAlarmAsync(LaserCoreFaultState.LaserCoreFaultCodes alarm, boolean active)
This method is useful when a core alarm must be sent without waiting
for its processing to be completed by the alarm message processor.
A typical example is a core alarm generated by the alarm
message processor itself.
sendCoreAlarmAsync delegates to sentCoreAlarms(Vector)
that is invoked in a dedicated thread.
alarm - The core alarm to sendtrue - if the alarm must be set and false otherwisepublic void sentCoreAlarms(java.util.Vector<LaserCoreFaultState.LaserCoreFaultCodes> alarms)
The alarms generated by the alarm service are injected in the
component by executing the onMessage
alarms - The alarms to send
alarms can be null or empty;public void onMessage(java.lang.String message)
AlarmSourcesListener.SourceListenerASIMessage).onMessage in interface AlarmSourcesListener.SourceListenerMessageListenerpublic void execute()
throws ComponentLifecycleException
ComponentLifecycleExceptionpublic Alarm[] getActiveMultiplicityChildren(java.lang.String parentId)
public Alarm[] getActiveNodeChildren(java.lang.String parentId)
public Alarm getAlarmById(java.lang.String id)
public Alarm getAlarmByTriplet(java.lang.String ff,
java.lang.String fm,
int fc)
public Alarm[] getAlarmsByCategory(int categoryId)
public Alarm[] getAlarmsByPriority(int priority)
public Alarm[] getAlarmsByResponsiblePerson(int responsibleId)
public Alarm[] getAlarmsBySource(java.lang.String sourceId)
public Category[] getCategories()
public Category getCategoryByPath(java.lang.String path)
public Category[] getCategoryChildren(int nodeId)
public Category getCategoryParent(int nodeId)
public java.lang.String getCategoryRootTopic()
public Category getCategoryTreeRoot()
public java.lang.String getClientRootTopic()
public long getHeartbeatFrequency()
public java.lang.String getHeartbeatTopic()
public Alarm[] getMultiplicityChildren(java.lang.String parentId)
public Alarm[] getMultiplicityParents(java.lang.String childId)
public int getMultiplicityThreshold(java.lang.String parentId)
public Alarm[] getNodeChildren(java.lang.String parentId)
public Alarm[] getNodeParents(java.lang.String childId)
public ResponsiblePerson[] getResponsiblePersons()
public java.lang.String getSearchRootTopic()
public Source[] getSources()
public void archiveSearch(int[] categoryIds,
java.lang.String sql,
java.lang.String clientId)
public void search(int[] categoryIds,
java.lang.String sql,
java.lang.String clientId)
public void select(int[] categoryIds,
java.lang.String client)
throws LaserProcessingException
LaserProcessingExceptionpublic java.lang.String createAdminUser(java.lang.String name,
java.lang.String password)
throws alma.alarmsystem.LaserDefinitionException
alma.alarmsystem.LaserDefinitionExceptionpublic java.lang.String loginAdminUser(java.lang.String name,
java.lang.String password)
public void createCategory(java.lang.String userId,
alma.alarmsystem.CategoryDefinition definition)
throws alma.alarmsystem.LaserDefinitionException
alma.alarmsystem.LaserDefinitionExceptionpublic void createSource(java.lang.String userId,
alma.alarmsystem.SourceDefinition definition)
throws alma.alarmsystem.LaserDefinitionException
alma.alarmsystem.LaserDefinitionExceptionpublic void createAlarm(java.lang.String userId,
alma.alarmsystem.AlarmDefinition definition)
throws alma.alarmsystem.LaserDefinitionException
alma.alarmsystem.LaserDefinitionExceptionpublic boolean isACSAlarmService()
public void submitAlarm(Triplet triplet,
boolean active,
java.lang.String sourceHostName,
java.lang.String sourceName,
long timestamp,
Property[] alarmProperties)
throws BadParameterEx,
UnexpectedExceptionEx
Build a message to sent to the AlarmMessageProcessorImpl.process(Message).
triplet - The triplet of the alarmactive - if true the alarm is activesourceHostName - The name of the host of the sourcetimestamp - The timestamp of the sourcealarmProperties - Additional user-defined properties of the alarmBadParameterExUnexpectedExceptionExpublic LogLevels get_default_logLevels()
public void set_default_logLevels(LogLevels levels)
throws IllegalLogLevelsEx
IllegalLogLevelsExpublic java.lang.String[] get_logger_names()
The returned logger names are randomly ordered.
public LogLevels get_logLevels(java.lang.String logger_name)
throws LoggerDoesNotExistEx
For possible convenience, the default levels are returned in addition to
setting LogLevels#useDefault to true.
LoggerDoesNotExistExpublic void set_logLevels(java.lang.String logger_name,
LogLevels levels)
throws LoggerDoesNotExistEx,
IllegalLogLevelsEx
LoggerDoesNotExistExIllegalLogLevelsExpublic void refresh_logging_config()
Note that unlike for the logging initialization in initialize(),
now we give precedence to the CDB values over any previous settings.