public class SOSVirtualSensor extends AbstractSensorModule<SOSVirtualSensorConfig>
Virtual sensor interface created by SOS InsertSensor
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
protected static String |
STATE_SML_DESC |
DEFAULT_XMLID_PREFIX, ERROR_NO_ENTITIES, ERROR_NO_HISTORY, ERROR_NO_UPDATE, foi, lastUpdatedSensorDescription, LOCATION_OUTPUT_ID, LOCATION_OUTPUT_NAME, locationOutput, randomUniqueID, sensorDescLock, sensorDescription, STATE_LAST_SML_UPDATE, STATE_UNIQUE_ID, uniqueID, UUID_URI_PREFIX, xmlID
config, eventHandler, lastError, logger, securityHandler, startRequested, state, stateLock, statusMsg
Constructor and Description |
---|
SOSVirtualSensor() |
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
|
String |
generateTemplateID(String outputName) |
AbstractFeature |
getCurrentFeatureOfInterest()
Retrieves the feature of interest for which this producer is
currently generating data.
In the case of a module generating data from multiple entities (e.g. |
String |
getName()
Helper method to get the module's name
|
String |
getOutputNameFromTemplateID(String templateID) |
boolean |
isConnected()
Returns the sensor connection status.
This method must do whatever it can to really detect the presence of the sensor. |
void |
loadState(IModuleStateManager loader)
Restores the state of this module
Implementations of this method must block until the module state is successfully loaded or send an exception. |
void |
newFeatureOfInterest(String templateID,
IObservation obsTemplate) |
void |
newObservation(IObservation... observations) |
void |
newResultRecord(String templateID,
DataBlock... dataBlocks) |
String |
newResultTemplate(DataComponent component,
DataEncoding encoding) |
String |
newResultTemplate(DataComponent component,
DataEncoding encoding,
IObservation obsTemplate) |
void |
saveState(IModuleStateManager saver)
Saves the state of this module.
Implementations of this method must block until the module state is successfully saved or send an exception. |
void |
setSensorDescription(AbstractProcess systemDesc) |
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 |
updateSensorDescription()
This method should be called whenever the sensor description needs to be regenerated.
This default implementation reads the base description from the SensorML file if provided and then appends the unique sensor identifier, time validity and the description of all registered outputs and control inputs. |
void |
updateSensorDescription(AbstractProcess systemDesc,
boolean recordHistory) |
protected void |
wrapOutputWithDataStream(String outputName,
DataComponent dataStruct,
DataEncoding encoding) |
addControlInput, addLocationOutput, addOutput, generateUniqueID, generateXmlID, generateXmlIDFromUUID, getAllOutputs, getCommandInputs, getCurrentDescription, getDefaultIdSuffix, getLastDescriptionUpdate, getLocalFrameID, getObservationOutputs, getStatusOutputs, getUniqueIdentifier, init, init, notifyNewDescription, removeAllControlInputs, removeAllOutputs, updateConfig
canInit, canStart, canStop, clearError, clearStatus, getConfiguration, getCurrentError, getCurrentState, getLocalID, getLogger, getStatusMessage, isInitialized, isStarted, notifyConnectionStatus, registerListener, reportError, reportError, reportStatus, requestInit, requestStart, requestStop, setConfiguration, setState, toString, unregisterListener, waitForState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConfiguration, getCurrentError, getCurrentState, getLocalID, getStatusMessage, isInitialized, isStarted, registerListener, requestInit, requestStart, requestStop, setConfiguration, unregisterListener, waitForState
protected static final String STATE_SML_DESC
protected static final org.slf4j.Logger log
public String getName()
IModule
getName
in interface IModule<SOSVirtualSensorConfig>
getName
in class AbstractModule<SOSVirtualSensorConfig>
public AbstractFeature getCurrentFeatureOfInterest()
IDataProducerModule
IMultiSourceDataProducer.getCurrentFeatureOfInterest(String)
getCurrentFeatureOfInterest
in interface IDataProducerModule<SOSVirtualSensorConfig>
getCurrentFeatureOfInterest
in class AbstractSensorModule<SOSVirtualSensorConfig>
public void newObservation(IObservation... observations) throws Exception
Exception
public String newResultTemplate(DataComponent component, DataEncoding encoding)
public String newResultTemplate(DataComponent component, DataEncoding encoding, IObservation obsTemplate)
public void newFeatureOfInterest(String templateID, IObservation obsTemplate)
public void newResultRecord(String templateID, DataBlock... dataBlocks) throws Exception
Exception
public void start() throws SensorHubException
IModule
SensorHubException
public void stop() throws SensorHubException
IModule
SensorHubException
public void cleanup() throws SensorHubException
IModule
SensorHubException
protected void updateSensorDescription()
AbstractSensorModule
updateSensorDescription
in class AbstractSensorModule<SOSVirtualSensorConfig>
public void updateSensorDescription(AbstractProcess systemDesc, boolean recordHistory) throws SensorException
SensorException
public void setSensorDescription(AbstractProcess systemDesc)
public boolean isConnected()
ISensorModule
public void saveState(IModuleStateManager saver) throws SensorHubException
IModule
saveState
in interface IModule<SOSVirtualSensorConfig>
saveState
in class AbstractSensorModule<SOSVirtualSensorConfig>
SensorHubException
public void loadState(IModuleStateManager loader) throws SensorHubException
IModule
loadState
in interface IModule<SOSVirtualSensorConfig>
loadState
in class AbstractSensorModule<SOSVirtualSensorConfig>
SensorHubException
protected void wrapOutputWithDataStream(String outputName, DataComponent dataStruct, DataEncoding encoding)
Copyright © 2016 Sensia Software LLC. All rights reserved.