public class SOSTClient extends AbstractModule<SOSTClientConfig> implements IClientModule<SOSTClientConfig>, IEventListener
Implementation of an SOS-T client that listens to sensor events and
forwards them to an SOS via InsertSensor/UpdateSensor, InsertResultTemplate
and InsertResult requests.
Modifier and Type | Class and Description |
---|---|
class |
SOSTClient.StreamInfo |
config, eventHandler, lastError, logger, securityHandler, startRequested, state, stateLock, statusMsg
Constructor and Description |
---|
SOSTClient() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Cleans up all ressources used by the module when deleted
All persistent resources created by the module should be cleaned
when this is called
|
Map<ISensorDataInterface,SOSTClient.StreamInfo> |
getDataStreams() |
protected String |
getSosEndpointUrl() |
void |
handleEvent(Event<?> e) |
void |
init()
Initializes the module synchronously with the current configuration.
Implementations of this method must block until the module is successfully initialized or send an exception. Module lifecycle events may not be generated when calling this method directly. |
boolean |
isConnected()
Returns the client connection status.
|
protected void |
registerDataStream(ISensorDataInterface sensorOutput) |
protected void |
registerSensor(ISensorModule<?> sensor) |
void |
requestStart()
Requests the module to start.
Implementations of this method may block until the module is started or return immediately while they wait for the proper start conditions. When this method returns without error the module state is guaranteed to be ModuleEvent.ModuleState.STARTING |
void |
setConfiguration(SOSTClientConfig config)
Sets the module configuration
|
void |
start()
Starts the module synchronously with the current configuration.
Implementations of this method must block until the module is successfully started or send an exception. Module lifecycle events may not be generated when calling this method directly. init() should always be called before start(). |
void |
stop()
Stops the module.
All temporary resources created by the module should be cleaned when this is called (ex: memory, files, connections, etc.) Implementations of this method must block until the module is successfully stopped or send an exception. Module lifecycle events may not be generated when calling this method directly. stop() can be called right after init() even if start() hasn't been called. |
protected void |
stopStream(ISensorDataInterface output,
SOSTClient.StreamInfo streamInfo) |
protected void |
updateSensor(ISensorModule<?> sensor) |
canInit, canStart, canStop, clearError, clearStatus, getConfiguration, getCurrentError, getCurrentState, getLocalID, getLogger, getName, getStatusMessage, init, isInitialized, isStarted, loadState, notifyConnectionStatus, registerListener, reportError, reportError, reportStatus, requestInit, requestStop, saveState, setState, toString, unregisterListener, updateConfig, waitForState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConfiguration, getCurrentError, getCurrentState, getLocalID, getName, getStatusMessage, init, isInitialized, isStarted, loadState, registerListener, requestInit, requestStop, saveState, unregisterListener, updateConfig, waitForState
protected String getSosEndpointUrl()
public void setConfiguration(SOSTClientConfig config)
IModule
setConfiguration
in interface IModule<SOSTClientConfig>
setConfiguration
in class AbstractModule<SOSTClientConfig>
public void init() throws SensorHubException
IModule
init
in interface IModule<SOSTClientConfig>
init
in class AbstractModule<SOSTClientConfig>
SensorHubException
public void requestStart() throws SensorHubException
IModule
ModuleEvent.ModuleState.STARTING
requestStart
in interface IModule<SOSTClientConfig>
requestStart
in class AbstractModule<SOSTClientConfig>
SensorHubException
- if startup could not be initiatedpublic void start() throws SensorHubException
IModule
start
in interface IModule<SOSTClientConfig>
SensorHubException
public void stop() throws SensorHubException
IModule
stop
in interface IModule<SOSTClientConfig>
SensorHubException
protected void stopStream(ISensorDataInterface output, SOSTClient.StreamInfo streamInfo)
protected void registerSensor(ISensorModule<?> sensor) throws OWSException
OWSException
protected void updateSensor(ISensorModule<?> sensor) throws OWSException
OWSException
protected void registerDataStream(ISensorDataInterface sensorOutput) throws OWSException
OWSException
public void handleEvent(Event<?> e)
handleEvent
in interface IEventListener
public boolean isConnected()
IClientModule
isConnected
in interface IClientModule<SOSTClientConfig>
public Map<ISensorDataInterface,SOSTClient.StreamInfo> getDataStreams()
public void cleanup() throws SensorHubException
IModule
cleanup
in interface IModule<SOSTClientConfig>
SensorHubException
Copyright © 2016 Sensia Software LLC. All rights reserved.