public class Monitor extends Object implements HasLifecycle, HasDataProviderInfos, AgentService
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
log |
static String |
MONITOR_CHECK_TASK |
static String |
MONITOR_PUBLISH_TASK |
static String |
MONITOR_UPDATE_TASK |
| Constructor and Description |
|---|
Monitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
build()
First lifecycle hook.
|
String |
getAgentServiceName()
Get the name of this service.
|
Alarm |
getAlarm(String name)
Gets the alarm with the given name.
|
Channel |
getChannel(int id)
Gets the channel with the given ID.
|
Channel |
getChannel(String name)
Gets the channel with the given name.
|
int |
getChannelId(String name)
Gets the ID of the channel with the given name.
|
List<String> |
getChannelNames()
Gets the list of channel names.
|
Double |
getChannelValue(String name)
Gets a monitored channel value.
|
List<DataProviderInfo> |
getDataProviderInfos()
Get the list of available
DataProviderInfos. |
Device |
getDevice(String name)
Gets the device with the given name.
|
List<String> |
getDeviceNames()
Gets the list of all device names.
|
String |
getMonitorPublishTaskName(MonitorUpdateTask task) |
List<MonitorUpdateTask> |
getMonitorTasksList() |
String |
getMonitorUpdateTaskName(MonitorUpdateTask task) |
List<MonitorUpdateTask> |
getMonitorUpdateTasksForDevice(Device dev) |
int |
getNumChans()
Gets the number of channels.
|
void |
init()
Called from the enclosing
Subsystem at initialization
phase. |
void |
postInit()
Called from the enclosing
Subsystem at construction
phase. |
String |
printMonitoringThreads()
Gets a printout of the monitoring threads.
|
void |
publishDataProviderCurrentData(AgentInfo... agents)
Publish the current data of all the
DataProviderInfos managed
by this object for the provided list of Agents. |
Double |
readChannelValue(String name)
Reads a monitored channel value.
|
void |
start()
Called from the enclosing
Subsystem. |
boolean |
startForAgent(AgentInfo agentInfo)
This method is invoked after an agent service is created to see if
this service is to be started for the tiven Agent.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostBuild, postShutdown, postStart, shutdownfinalizeDictionaryprotected Logger log
public static final String MONITOR_CHECK_TASK
public static final String MONITOR_UPDATE_TASK
public static final String MONITOR_PUBLISH_TASK
public String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic boolean startForAgent(AgentInfo agentInfo)
AgentServicestartForAgent in interface AgentServicepublic void start()
HasLifecycleSubsystem.
At the time it is called :
PhaseState is
INITIALIZING
connection with the messaging layer is effective, the enclosing
subsystem has started StatusHeartBeat
publication
the startup configuration has been loaded (if provided). IMPORTANT
NOTE : This statement will not be true in future releases. Code that
expect the startup configuration to be loaded should be moved from
start to postStart.
super.start()start in interface HasLifecyclepublic void build()
HasLifecyclebuild in interface HasLifecyclepublic List<MonitorUpdateTask> getMonitorTasksList()
public List<MonitorUpdateTask> getMonitorUpdateTasksForDevice(Device dev)
public void postInit()
HasLifecycleSubsystem at construction
phase. This method is called after init and postInit have
been called on this component's children.postInit in interface HasLifecyclepublic void init()
HasLifecycleSubsystem at initialization
phase.
This method is called before the children components of this
object have their init method called.
At the time it is called, connection to the messaging layer is not yet
done, so there should be no attempt to send messages in the body of
this method. Configuration for message listening can nevertheless be
done here, such as adding MessageListener
objects.
It is unnecessary to call super.init()
init in interface HasLifecyclepublic Device getDevice(String name)
name - The device name@Command(type=QUERY, description="Show the monitoring threads", category=SYSTEM) public String printMonitoringThreads()
@Command(type=QUERY, description="Get the list of all devices", category=CORE) public List<String> getDeviceNames()
public Alarm getAlarm(String name)
name - The alarm namepublic Channel getChannel(String name)
name - The channel namepublic Channel getChannel(int id)
id - The channel IDpublic int getChannelId(String name)
name - The channel namepublic int getNumChans()
@Command(type=QUERY, description="Get the list of channel names", category=CORE) public List<String> getChannelNames()
@Command(type=QUERY, description="Get a channel value", category=CORE) public Double getChannelValue(String name)
name - The channel name@Command(type=QUERY, description="Read a channel value", category=CORE, level=1) public Double readChannelValue(String name)
name - The channel namepublic List<DataProviderInfo> getDataProviderInfos()
HasDataProviderInfosDataProviderInfos.getDataProviderInfos in interface HasDataProviderInfosDataProviderInfospublic void publishDataProviderCurrentData(AgentInfo... agents)
HasDataProviderInfosDataProviderInfos managed
by this object for the provided list of Agents.publishDataProviderCurrentData in interface HasDataProviderInfosagents - The array of AgentInfo for which we are requesting to publish the data.public String getMonitorUpdateTaskName(MonitorUpdateTask task)
public String getMonitorPublishTaskName(MonitorUpdateTask task)
Copyright © 2024 LSST. All rights reserved.