
public class Monitor extends Object implements HasLifecycle, HasDataProviderInfos
| 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_TASK |
static String |
MONITOR_PUBLISH_TASK |
static String |
MONITOR_UPDATE_TASK |
| Modifier | Constructor and Description |
|---|---|
protected |
Monitor() |
|
Monitor(Agent a)
Base Monitor framework constructor
|
protected |
Monitor(Agent a,
Monitor.AlarmHandler alarmHand) |
| Modifier and Type | Method and Description |
|---|---|
void |
build()
First lifecycle hook.
|
void |
clearLimitChanges()
Clears limits-changed indicators.
|
static Monitor |
create(Agent agent) |
void |
dropLimitChanges()
Drop the limit values.
|
Alarm |
getAlarm(String name)
Gets the alarm with the given name.
|
List<Monitor.AlarmHandler> |
getAlarmHandlersList()
Here for tests
|
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.
|
MonitorFullState |
getFullState()
Gets the full monitoring state.
|
Line |
getLine(String name)
Gets the line with the given name.
|
MonitorFullState |
getMonitorFullState() |
int |
getNumChans()
Gets the number of channels.
|
void |
init()
Called from the enclosing
Subsystem at initialization
phase. |
void |
postStart()
Called from the enclosing
Subsystem after
HardwareController components have been handled. |
void |
publishDataProviderCurrentData()
Publish the current data of all the
DataProviderInfos managed
by this object. |
Double |
readChannelValue(String name)
Reads a monitored channel value.
|
void |
readSensors()
Reads the sensor data.
|
void |
saveLimits()
Saves the limit values.
|
void |
setOnline(BitSet mask,
boolean online)
Sets channels on- or off-line.
|
void |
setPublishData()
Deprecated.
|
void |
start()
Called from the enclosing
Subsystem when
Agent.startAgent() has been called. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostBuild, postInit, postShutdown, 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 Monitor(Agent a)
a - The Agent that will own the Monitor framework,protected Monitor()
protected Monitor(Agent a, Monitor.AlarmHandler alarmHand)
public void start()
HasLifecycleSubsystem when
Agent.startAgent() has been called. 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 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 void readSensors()
public void postStart()
HasLifecycleSubsystem after
HardwareController components have been handled. At the time it
is called :
HardwareController components have been handled without
throwing HardwareException
If successful, the enclosing subsystem's
PhaseState will change to
OPERATIONAL and the subsystem will invoke
startTicking on its modules components.
If an HardwareException is thrown, the
OperationalState will change to
ENGINEERING_FAULT until a call to
completeInitialization
is successful
It is unnecessary to call super.postStart()
postStart in interface HasLifecyclepublic MonitorFullState getFullState()
@Command(type=QUERY, description="Get the full monitoring state") public MonitorFullState getMonitorFullState()
@Deprecated public void setPublishData()
public void clearLimitChanges()
public Device getDevice(String name)
name - The device name@Command(type=QUERY, description="Get the list of all devices") public List<String> getDeviceNames()
public Line getLine(String name)
name - The line namepublic 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 void setOnline(BitSet mask, boolean online)
mask - Mask of affected channelsonline - True if channels to be set online, false otherwisepublic int getNumChans()
@Command(type=QUERY, description="Get the list of channel names") public List<String> getChannelNames()
@Command(type=QUERY, description="Get a channel value") public Double getChannelValue(String name)
name - The channel name@Command(type=QUERY, description="Read a channel value") public Double readChannelValue(String name)
name - The channel name@Command(type=ACTION, description="Save the monitoring limits") public void saveLimits()
@Command(type=ACTION, description="Drop the changes to the monitoring limits") public void dropLimitChanges()
public List<Monitor.AlarmHandler> getAlarmHandlersList()
public List<DataProviderInfo> getDataProviderInfos()
HasDataProviderInfosDataProviderInfos.getDataProviderInfos in interface HasDataProviderInfosDataProviderInfospublic void publishDataProviderCurrentData()
HasDataProviderInfosDataProviderInfos managed
by this object.publishDataProviderCurrentData in interface HasDataProviderInfosCopyright © 2018 LSST. All rights reserved.