public interface AgentStatusListener
AgentStatusAggregator
to receive notifications when an agent connects or disconnects from the buses, or when
there are changes in data channels published by one of the connected agents.
Typically, a listener is registered with an AgentChannelsFilter
or with explicit sets of agents and channels to limit events that trigger notifications.
See AgentStatusAggregator for details on how the notifications are filtered.
Note that due to asynchronous nature of communication over the buses, agents are
not guaranteed to remain in the reported state by the time listeners are notified.
For every remote agent, the listener will receive events in the following order:
connect(event) - when the agent is first seen on the buses.
configure(event) - when the agent is OPERATIONAL, and all its dictionaries are available.
statusChanged(event) - whenever the data this listener is interested in changes.
disconnect(event) - when the agent disconnects from the buses or goes into OFFLINE state.
All methods are called consecutively on a dedicated thread. Implementations of these methods should return quickly. Any time consuming or potentially blocking operations should be scheduled on separate threads.
Empty default implementations are provided for all methods.
| Modifier and Type | Method and Description |
|---|---|
default void |
configure(AgentStatusEvent event)
Called when the source agent reaches OPERATIONAL state and its all static information
(including channels dictionary) becomes available.
|
default void |
connect(AgentStatusEvent event)
Called when a new agent connects to the buses.
|
default void |
disconnect(AgentStatusEvent event)
Called when an agent disconnects from the buses or goes into OFFLINE state.
|
default void |
statusChanged(AgentStatusEvent event)
Called on data change.
|
default void connect(AgentStatusEvent event)
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.
event - Event.default void configure(AgentStatusEvent event)
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.
event - Event.default void disconnect(AgentStatusEvent event)
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.
event - Event.default void statusChanged(AgentStatusEvent event)
event - event Event.Copyright © 2023 LSST. All rights reserved.