public abstract class AbstractMonitorView extends Object implements PersistableMonitorView
MonitorView.
Provided implementation of the AgentStatusListener should not be overridden.
Subclasses should override one of the two sets of methods (both called on EDT):
data field that contains a map of display paths to display channels.
| Modifier and Type | Class and Description |
|---|---|
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 List<MonitorField> |
compactFields |
protected LinkedHashMap<String,DisplayChannel> |
data
Map of display paths to display channels, to be used by subclasses to populate the view.
|
protected List<MonitorField> |
fields |
protected PersistableAgentChannelsFilter |
filter |
protected MonitorFormat |
formatter |
CATEGORY| 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.
|
abstract AbstractMonitorView.Descriptor |
getDescriptor()
Returns a reference to the descriptor maintained by this component.
|
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.
|
String |
getGroup(String displayPath)
Computes group name based on the display path returned by the filter.
|
List<MonitorField> |
getGroupFields()
Retrieves a list
MonitorField for display channel groups from the filter. |
List<String> |
getGroups() |
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.
|
AbstractMonitorView.Descriptor |
save()
Returns JavaBean describing the current state of this component.
|
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, getNamegetPanel, install, setName, uninstallgetCategory, getPath, restore, restoreprotected PersistableAgentChannelsFilter filter
protected MonitorFormat formatter
protected List<MonitorField> fields
protected List<MonitorField> compactFields
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 String getGroup(String displayPath)
displayPath - Display path.null if this display path does not belong to any group.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.public List<MonitorField> getGroupFields()
MonitorField for display channel groups from the filter.
The default implementation calls getFilter().getGroupFields(true) and
then applies stringToField(...).null if the filter does not provide the list.public abstract AbstractMonitorView.Descriptor getDescriptor()
Persistablenull, and
that any properties set on the descriptor returned by this method are reflected by
descriptors subsequently returned by save(), unless modified between the two calls.getDescriptor in interface Persistablepublic AbstractMonitorView.Descriptor save()
PersistablegetDescriptor().save in interface Persistablesave in interface Savablenull if no state information needs to be saved.Copyright © 2023 LSST. All rights reserved.