public class RestSource extends Object
This sources watches for external events that can change the list of known channels, and notifies listeners on EDT 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.
|
ArrayList<TrendData> |
get(List<Trend> trends,
long begin,
long end,
Boolean raw,
Integer bins)
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 ArrayList<TrendData> get(List<Trend> trends, long begin, long end, Boolean raw, Integer bins)
trends - List of trends for which the data has to be retrieved.begin - Beginning of time window.end - End of time windowraw - TRUE or FALSE depending on whether raw or statistical data should be retrieved;
if null, current application preferences will be consulted.bins - Approximate desired number of bins in the resulting dataset;
if null, current application preferences will be consulted.trends order.
Note that this list will never be null, but individual elements
can be null if data retrieval for corresponding trends fails for any reason.Copyright © 2023 LSST. All rights reserved.