public abstract class AbstractMonitorView extends Object implements PersistableMonitorView
MonitorView.Persistable.Descriptor| Modifier and Type | Field and Description |
|---|---|
protected LinkedHashMap<String,DisplayChannel> |
data
Map of display paths to display channels, to be used by subclasses to populate the view.
|
protected PersistableAgentChannelsFilter |
filter |
protected MonitorFormat |
formatter |
AVAILABLE_GROUP_FIELDS, CATEGORY, DEFAULT_GROUP_FIELD| Constructor and Description |
|---|
AbstractMonitorView() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChannels(List<org.lsst.ccs.bus.data.AgentInfo> agents,
List<Map.Entry<String,AgentChannel>> channels)
Adds channels to this view.
|
void |
configure(AgentStatusEvent event)
Called when the source agent reaches OPERATIONAL state and its all static information
(including channels dictionary) becomes available.
|
void |
connect(AgentStatusEvent event)
Called when a new agent connects to the buses.
|
protected DisplayChannel |
createChannel(String displayPath)
Called on EDT to create new display channels whenever this view is informed of new display paths.
|
void |
disconnect(AgentStatusEvent event)
Called when an agent disconnects from the buses or goes into OFFLINE state.
|
PersistableAgentChannelsFilter |
getFilter()
Returns the filter associated with this view, or
null if there is none. |
MonitorFormat |
getFormater()
Returns formatter associated with this view, if any.
|
List<String> |
getGroups()
Returns a list of display channels groups.
|
boolean |
isEmpty()
Returns
true if this view has no channels to display. |
void |
removeChannels(List<org.lsst.ccs.bus.data.AgentInfo> agents,
List<Map.Entry<String,AgentChannel>> channels)
Removes channels from this view.
|
protected void |
resetChannels()
Called on EDT whenever channels have been added or removed.
|
void |
setDiscardRemovedChannels(boolean discardRemovedChannels)
Sets the policy on dealing with channels reported as removed by the status aggregator.
|
void |
setFilter(AgentChannelsFilter filter)
Sets the channels filter to be used by this view.
|
void |
setFormatter(MonitorFormat formatter)
Associates a formatter with this view.
|
void |
statusChanged(AgentStatusEvent event)
Called on data change.
|
protected void |
update()
Called on EDT at the end of each update, after all DisplayChannel.update(...) methods.
|
void |
updateChannels(List<Map.Entry<String,Map.Entry<AgentChannel,List<String>>>> channels)
Updates channels in this view.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitedit, getNamefieldToString, getFields, getGroup, getPanel, install, setName, stringToField, uninstallgetCategory, getDescriptor, restore, restore, saveprotected PersistableAgentChannelsFilter filter
protected MonitorFormat formatter
protected final LinkedHashMap<String,DisplayChannel> data
public void setDiscardRemovedChannels(boolean discardRemovedChannels)
true, the channels are immediately removed from the data map.
If false (default), the channels are retained until and unless an identically
named agent appears in future status aggregator events.discardRemovedChannels - Policy value.public 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.
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 necessarily 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 have any added or modified channels, but all previously existing
channels are listed as removed. Since the disconnection event might or might not
be triggered by a status message, getMessage() method might return null.
disconnect in interface AgentStatusListenerevent - Event.public void addChannels(List<org.lsst.ccs.bus.data.AgentInfo> agents, List<Map.Entry<String,AgentChannel>> channels)
agents - Newly connected agents these channels belong to.channels - New channels, each entry contains display path and channel.public void updateChannels(List<Map.Entry<String,Map.Entry<AgentChannel,List<String>>>> channels)
channels - Updated channels, each element contains: {display path : {channel : list of modified attributes}}.public void removeChannels(List<org.lsst.ccs.bus.data.AgentInfo> agents, List<Map.Entry<String,AgentChannel>> channels)
discardRemovedChannels flag is not set, the channels are updated but not removed.agents - Names of disconnected agents.channels - Removed channels, each entry contains display path and channel.protected void resetChannels()
data field.
Empty implementation is provided.protected void update()
protected DisplayChannel createChannel(String displayPath)
DisplayChannelMulti without any Updatable target.displayPath - Display path.DisplayChannel to be put into the data map for the specified display path key.public boolean isEmpty()
true if this view has no channels to display.
Implemented to return true if the data map is empty.isEmpty in interface MonitorViewpublic List<String> getGroups()
MonitorViewgetFilter().getDisplayChannels()
and then applies getGroup(displayPath) to the result.getGroups in interface MonitorViewnull is the list is unknown at this time.public PersistableAgentChannelsFilter 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.public MonitorFormat getFormater()
MonitorViewgetFormater in interface MonitorViewnull if there is no formatter.public void setFormatter(MonitorFormat formatter)
MonitorViewsetFormatter in interface MonitorViewformatter - Formatter to be associated with this view.Copyright © 2021 LSST. All rights reserved.