
public class Monitor extends Object implements HasLifecycle, HasDataProviderInfos, AgentService
| Modifier and Type | Class and Description |
|---|---|
static interface |
Monitor.AlarmHandler
Interface for handling alarm events.
|
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
log |
static String |
MONITOR_CHECK_SCHEDULER |
static String |
MONITOR_CHECK_TASK |
static String |
MONITOR_PUBLISH_TASK |
static String |
MONITOR_UPDATE_PUBLISH_SCHEDULER |
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.
|
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. |
void |
publishDataProviderCurrentData()
Publish the current data of all the
DataProviderInfos managed
by this object. |
Double |
readChannelValue(String name)
Reads a monitored channel value.
|
void |
start()
Called from the enclosing
Subsystem when
Agent.startAgent() has been called and
after HardwareController components have been handled. |
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, shutdownprotected Logger log
public static final String MONITOR_CHECK_TASK
public static final String MONITOR_UPDATE_TASK
public static final String MONITOR_PUBLISH_TASK
public static final String MONITOR_CHECK_SCHEDULER
public static final String MONITOR_UPDATE_PUBLISH_SCHEDULER
public String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic boolean startForAgent(AgentInfo agentInfo)
AgentServicestartForAgent in interface AgentServicepublic void start()
HasLifecycleSubsystem when
Agent.startAgent() has been called and
after HardwareController components have been handled.
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 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="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()
HasDataProviderInfosDataProviderInfos managed
by this object.publishDataProviderCurrentData in interface HasDataProviderInfosCopyright © 2019 LSST. All rights reserved.