@Plugin(name="LSST Rest Service Plugin", id="rest-service", description="Plugin that handles connection to the REST server.") public class LsstRestService extends ConsolePlugin
| Modifier and Type | Field and Description |
|---|---|
static String |
CONNECT_ON_STARTUP_PROPERTY |
static String |
FROM_BUS_PROPERTY |
static String |
HOST_PROPERTY |
static String |
PORT_PROPERTY |
| Constructor and Description |
|---|
LsstRestService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ChangeListener listener)
Registers a listener to be notified when the service is (re)connected to a new REST server.
|
org.lsst.ccs.localdb.statusdb.server.DataChannel.DataChannelList |
getChannelList()
Retrieves and returns the list of channels currently available from the REST server.
|
org.lsst.ccs.localdb.statusdb.server.DataChannel.DataChannelList |
getChannelList(long begin)
Retrieves and returns the list of channels currently available from the REST server.
|
org.lsst.ccs.localdb.statusdb.server.TrendingResult |
getData(long begin,
long end,
String flavor,
int nBins,
Integer... ids)
Retrieves and returns the data for the specified channel and time window.
|
org.lsst.ccs.localdb.statusdb.server.Datas |
getData(long begin,
long end,
String flavor,
int nBins,
String... paths)
Retrieves and returns the data for the specified channel and time window.
|
org.lsst.ccs.localdb.statusdb.server.TrendingData |
getLatestData(String path)
Retrieves and returns the latest recorded data for the specified channel.
|
void |
initialize()
Called by the framework when the console starts, to initialize this plugin..
|
void |
propertiesChanged(Object source,
Map<String,Object> changes)
Called by the framework in response to change in preferences.
|
void |
refreshConnection()
Requests reestablishing connection based on current preferences.
|
void |
removeAllListeners()
Removes all listeners.
|
void |
removeListener(ChangeListener listener)
Removes a listener.
|
void |
shutdown()
Called by the framework when the graphical console is shut down.
|
void |
start()
Called by the framework when the console starts, after all plugins have been initialized.
|
getConsole, getServices, restore, save, setServicesProvider, stoppublic static final String FROM_BUS_PROPERTY
public static final String HOST_PROPERTY
public static final String PORT_PROPERTY
public static final String CONNECT_ON_STARTUP_PROPERTY
public void initialize()
ConsolePlugininitialize in class ConsolePluginpublic void start()
ConsolePluginstart in class ConsolePluginpublic void shutdown()
ConsolePluginshutdown in class ConsolePluginpublic void propertiesChanged(Object source, Map<String,Object> changes)
propertiesChanged in class ConsolePluginsource - Source of notification.changes - For the changed properties, map of keys to their new values.public void refreshConnection()
public void addListener(ChangeListener listener)
listener - Listener to be registered.public void removeListener(ChangeListener listener)
listener - Listener to be removed.public void removeAllListeners()
public org.lsst.ccs.localdb.statusdb.server.DataChannel.DataChannelList getChannelList()
nill if the REST server is not available.public org.lsst.ccs.localdb.statusdb.server.DataChannel.DataChannelList getChannelList(long begin)
begin seconds are included.
If the REST service has not been started earlier, if will be initialized before the data is retrieved.begin - Maximum time with no data, in seconds.nill if the REST server is not available.public org.lsst.ccs.localdb.statusdb.server.TrendingData getLatestData(String path)
path - Data channel path.nill if the REST server is not available.com.sun.jersey.api.client.UniformInterfaceException - If the status of the HTTP response is greater than or equal to 300.com.sun.jersey.api.client.ClientHandlerException - On failure to process the request or response.public org.lsst.ccs.localdb.statusdb.server.Datas getData(long begin,
long end,
String flavor,
int nBins,
String... paths)
begin - Start of the time window, milliseconds since January 1, 1970, 00:00:00 GMT.end - End of the time window, milliseconds since January 1, 1970, 00:00:00 GMT.flavor - Data flavor, "raw" or "stat".nBins - Requested number of bins. If non-positive, the number of bins is not specified in the request.paths - Paths of the data channels.nill if the REST server is not available.public org.lsst.ccs.localdb.statusdb.server.TrendingResult getData(long begin,
long end,
String flavor,
int nBins,
Integer... ids)
begin - Start of the time window, milliseconds since January 1, 1970, 00:00:00 GMT.end - End of the time window, milliseconds since January 1, 1970, 00:00:00 GMT.flavor - Data flavor, "raw" or "stat".nBins - Requested number of bins. If non-positive, the number of bins is not specified in the request.ids - IDs of the data channels.nill if the REST server is not available.com.sun.jersey.api.client.UniformInterfaceException - If the status of the HTTP response is greater than or equal to 300.com.sun.jersey.api.client.ClientHandlerException - On failure to process the request or response.Copyright © 2020 LSST. All rights reserved.