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.
| 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 nBins)
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()
Triggers refreshing of the list of channels by retrieving them from the REST server.
|
void |
removeAllListeners()
Removes all listeners.
|
void |
removeListener(ChangeListener listener)
Removes a listener.
|
public static final String VALUE_KEY
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 nBins)
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.nBins - 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 © 2024 LSST. All rights reserved.