public class RestSource extends Object
This sources watches for external events that can change the list of known channels, and notifies listeners when this happens.
Current implementation note. This class maintains a map of paths to DataChannel,
but only the list of paths is externally available. Metadata provided by DataChannel
is unused. Accordingly, whenever the map is updated (due to time window or REST server
change), listeners are not notified unless the set of available paths changes.
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ChangeListener listener)
Registers a listener to be notified if the list of channels available from this trending source changes.
|
protected void |
fireEvent()
Notifies listeners of changes in this source.
|
TrendData |
get(String path,
long begin,
long end,
EnumSet<Trend.Meta> metadata,
TrendData history)
Retrieves from the REST server and processes historical data for the specified trending channel.
|
List<String> |
getChannels()
Returns the list of known data channel paths.
|
void |
refresh()
Refreshes the list of channels by retrieving them from the REST server.
|
void |
removeAllListeners()
Removes all listeners.
|
void |
removeListener(ChangeListener listener)
Removes a listener.
|
public void refresh()
public void addListener(ChangeListener listener)
listener - Listener to be added.public void removeListener(ChangeListener listener)
listener - Listener to be removed.public void removeAllListeners()
protected void fireEvent()
public List<String> getChannels()
public TrendData get(String path, long begin, long end, EnumSet<Trend.Meta> metadata, TrendData history)
path - Channel path.begin - Beginning of time window.end - End of time window.metadata - Set of metadata types to be included.history - Previously known data.null if retrieval fails for any reason.Copyright © 2020 LSST. All rights reserved.