public abstract class AbstractMonitorView extends Object implements MonitorView
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractMonitorView.ChannelDisplay |
static interface |
AbstractMonitorView.ChannelHandle |
static class |
AbstractMonitorView.DefaultChannelHandle |
static class |
AbstractMonitorView.Descriptor
JavaBean that contains information required to re-create this view in its current state.
|
| Modifier and Type | Field and Description |
|---|---|
protected AbstractMonitorView.Descriptor |
descriptor |
protected AgentChannelsFilter |
filter |
protected LinkedHashMap<String,AbstractMonitorView.ChannelHandle> |
path2data |
| Constructor and Description |
|---|
AbstractMonitorView() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,AgentChannel> channels)
Adds channels to display.
|
void |
configure(AgentStatusEvent event)
Called when the complete static information on the source agent (including
channels dictionary) becomes available for the first time, and when it changes.
|
protected void |
connect(org.lsst.ccs.bus.data.AgentInfo agent) |
void |
connect(AgentStatusEvent event)
Called when a new agent connects to the buses.
|
protected AbstractMonitorView.ChannelHandle |
createChannelHandle(String path,
AgentChannel channel,
AbstractMonitorView.ChannelDisplay view)
Creates a new instance of
ChannelHandle. |
protected void |
disconnect(org.lsst.ccs.bus.data.AgentInfo agent) |
void |
disconnect(AgentStatusEvent event)
Called when an agent disconnects from the buses or goes into OFFLINE state.
|
protected AbstractMonitorView.Descriptor |
getDescriptor()
Returns a reference to the descriptor maintained by this view.
|
AgentChannelsFilter |
getFilter()
Returns the filter associated with this view, or
null if there is none. |
protected boolean |
isChannelListFixed() |
boolean |
isEmpty()
Returns
true if this view has no content to display at the moment. |
protected void |
removeChannels(org.lsst.ccs.bus.data.AgentInfo agent,
List<String> paths)
Removes a channels from this view.
|
protected void |
resetChannels()
Rebuilds the view based on
path2data. |
void |
restore(MonitorView.Descriptor descriptor)
Restores this view to the state described by the provided descriptor, to the extent possible.
|
AbstractMonitorView.Descriptor |
save()
Returns a descriptor that contains information required to re-create this view in its current state.
|
void |
setFilter(AgentChannelsFilter filter)
Sets the channels filter to be used by this view.
|
void |
statusChanged(AgentStatusEvent event)
Called on status change.
|
protected void |
updateChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,Map.Entry<AgentChannel,List<String>>> channels)
Called to notify this view that the specified channels have been updated.
|
protected AgentChannelsFilter filter
protected AbstractMonitorView.Descriptor descriptor
protected final LinkedHashMap<String,AbstractMonitorView.ChannelHandle> path2data
public AgentChannelsFilter getFilter()
MonitorViewnull if there is none.getFilter in interface MonitorViewpublic void setFilter(AgentChannelsFilter filter)
MonitorViewsetFilter in interface MonitorViewfilter - Filter to be associated with this view.protected boolean isChannelListFixed()
public boolean isEmpty()
MonitorViewtrue if this view has no content to display at the moment.
This can be used report that the view can be closed, for example.
The default implementation returns false.isEmpty in interface MonitorViewpublic void connect(AgentStatusEvent event)
AgentStatusListener
The event passed to this method does not contain any information on channels
(corresponding methods return empty collections) or a reference to a status message.
The event can only be used to retrieve AgentInfo descriptor and a reference
to the AgentStatusAggregator instance.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
connect in interface AgentStatusListenerevent - Event.public void configure(AgentStatusEvent event)
AgentStatusListener
The event passed to this method contains a list of added channels. Methods accessing lists
of changed and removed channels will return empty collections. Since the configuration event
is not triggered by a status message, getMessage() method returns null.
configure in interface AgentStatusListenerevent - Event.public void statusChanged(AgentStatusEvent event)
AgentStatusListenerstatusChanged in interface AgentStatusListenerevent - event Event.public void disconnect(AgentStatusEvent event)
AgentStatusListener
The event passed to this method does not contain any information on channels status -
corresponding methods return empty collections. Since the disconnection event might or might not
be triggered by a status message, getMessage() method might return null.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
disconnect in interface AgentStatusListenerevent - Event.protected void connect(org.lsst.ccs.bus.data.AgentInfo agent)
protected void disconnect(org.lsst.ccs.bus.data.AgentInfo agent)
protected void addChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,AgentChannel> channels)
agent - Source agent.channels - Map of paths to channels.protected void removeChannels(org.lsst.ccs.bus.data.AgentInfo agent,
List<String> paths)
agent - Source agent.paths - Paths to remove.protected void updateChannels(org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,Map.Entry<AgentChannel,List<String>>> channels)
agent - Source agent.channels - Map of paths to key-value pairs, where the key is as AgentChannel object
and the value is a list of changed attributes.protected void resetChannels()
path2data.protected AbstractMonitorView.ChannelHandle createChannelHandle(String path, AgentChannel channel, AbstractMonitorView.ChannelDisplay view)
ChannelHandle.
The implementation provided by this class creates an instance of DefaultChannelHandle.
Subclasses may override this method to return a different implementation of ChannelHandle.path - Display path.channel - Agent channel.view - View displaying the channel.ChannelHandle.public AbstractMonitorView.Descriptor save()
restore(...).save in interface MonitorViewnull is this view does not support saving.public void restore(MonitorView.Descriptor descriptor)
save() later.restore in interface MonitorViewdescriptor - View descriptor.protected AbstractMonitorView.Descriptor getDescriptor()
AbstractMonitorView.Descriptor.Copyright © 2017 LSST. All rights reserved.