Package org.vast.sensorML
Class AbstractProcessImpl
java.lang.Object
net.opengis.gml.v32.impl.AbstractGMLImpl
net.opengis.gml.v32.impl.AbstractFeatureImpl
net.opengis.sensorml.v20.impl.DescribedObjectImpl
org.vast.sensorML.AbstractProcessImpl
- All Implemented Interfaces:
 Serializable,AbstractFeature,AbstractGML,AbstractProcess,DescribedObject,IFeature,IProcedure,IProcessExec,IResource
- Direct Known Subclasses:
 AggregateProcessImpl,PhysicalComponentImpl,SimpleProcessImpl
public abstract class AbstractProcessImpl
extends DescribedObjectImpl
implements AbstractProcess, IProcessExec
 This class implements both AbstractProcess from SensorML v2.0 bindings
 and IProcessExec to allow execution if an executable implementation is
 provided.
 In order to provide execution capabilitiy, this class can wrap an
 implementation of IProcessExec corresponding to a particular algorithm.
 
- Since:
 - Feb 28, 2015
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Settingsprotected Stringprotected IProcessExecprotected FeatureListprotected IOPropertyListprotected ArrayList<AbstractModes>protected IOPropertyListprotected IOPropertyListprotected ReferenceFields inherited from class net.opengis.sensorml.v20.impl.DescribedObjectImpl
capabilitiesList, characteristicsList, classificationList, contactsList, documentationList, extensionList, historyList, identificationList, keywordsList, lang, legalConstraintsList, securityConstraintsList, validTimeListFields inherited from class net.opengis.gml.v32.impl.AbstractFeatureImpl
boundedBy, locationFields inherited from class net.opengis.gml.v32.impl.AbstractGMLImpl
description, descriptionReference, id, identifier, metaDataPropertyList, nameList, UUID_CODEFields inherited from interface net.opengis.sensorml.v20.DescribedObject
DEFAULT_NS_URIFields inherited from interface org.vast.ogc.gml.IFeature
DEFAULT_QNAME - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddInput(String name, DataInterface input) Adds a new inputAsDataInterface propertyvoidaddInput(String name, ObservableProperty input) Adds a new inputAsObservableProperty propertyvoidaddInput(String name, DataComponent input) Adds a new inputAsAbstractDataComponent propertyvoidaddInput(String name, DataStream input) Adds a new inputAsDataStream propertyvoidaddModes(AbstractModes modes) Adds a new modes propertyvoidaddOutput(String name, DataInterface output) Adds a new outputAsDataInterface propertyvoidaddOutput(String name, ObservableProperty output) Adds a new outputAsObservableProperty propertyvoidaddOutput(String name, DataComponent output) Adds a new outputAsAbstractDataComponent propertyvoidaddOutput(String name, DataStream output) Adds a new outputAsDataStream propertyvoidaddParameter(String name, DataInterface parameter) Adds a new parameterAsDataInterface propertyvoidaddParameter(String name, ObservableProperty parameter) Adds a new parameterAsObservableProperty propertyvoidaddParameter(String name, DataComponent parameter) Adds a new parameterAsAbstractDataComponent propertyvoidaddParameter(String name, DataStream parameter) Adds a new parameterAsDataStream propertybooleancanRun()Check that all needed connections are ready for the process to runprotected voidvoidconnect(DataComponent component, IDataConnection connection) Connects one of this process ports with the given connectionvoiddisconnect(IDataConnection connection) Detach connection from this process input, output or parametervoiddispose()Override to dispose of all resources allocated for the process (stop threads, OS resources, etc...)voidexecute()Execute contains the logic to transform input/parameter values into output values.Gets the configuration propertyGets the definition propertyGets the description propertyGets the featuresOfInterest propertyGets the input property with the given namegetInputComponent(String name) Gets the data structure of the input with the given nameGets the list of input propertiesGets the list of modes propertiesgetName()intReturns number of input propertiesintReturns number of modes propertiesintReturns number of output propertiesintReturns number of parameter propertiesGets the output property with the given namegetOutputComponent(String name) Gets the data structure of the output with the given nameGets the list of output propertiesgetParameter(String name) Gets the parameter property with the given namegetParameterComponent(String name) Gets the data structure of the parameter with the given nameGets the list of parameter propertiesGets the typeOf propertyvoidinit()Initialize the process and its internal variables (fixed parameters).booleanbooleanChecks if configuration is setbooleanChecks if definition is setbooleanChecks if featuresOfInterest is setbooleanChecks if typeOf is setprotected voidmergePort(DataComponent smlPort, DataComponent execPort) protected IOPropertyListmergePortDescriptors(IOPropertyList smlPorts, IOPropertyList execPorts) booleanneedSync()voidNotifies the process that one or more parameter values have changed before or during executionvoidrun()Runs the process which includes fetching input data, calling execute and producing output datavoidsetConfiguration(Settings configuration) Sets the configuration propertyvoidsetDefinition(String definition) Sets the definition propertyvoidsetExecutableImpl(IProcessExec processExec) voidsetFeaturesOfInterest(FeatureList featuresOfInterest) Sets the featuresOfInterest propertyvoidsetInstanceName(String name) Sets the name of this process instancevoidsetParentLogger(org.slf4j.Logger log) Set the parent logger for this process.
The parent logger is used to group log events occuring in all processes that are part of the same processing component (e.g.voidSets the typeOf propertyvoidstart(ExecutorService threadPool, Consumer<Throwable> onError) Start process using threads from the given thread poolvoidStart process in its own threadvoidstop()Stop process thread gracefullytoString()Methods inherited from class net.opengis.sensorml.v20.impl.DescribedObjectImpl
addCapabilities, addCharacteristics, addClassification, addContacts, addDocumentation, addExtension, addHistory, addIdentification, addKeywords, addLegalConstraints, addSecurityConstraints, addValidTimeAsTimeInstant, addValidTimeAsTimePeriod, getCapabilities, getCapabilitiesList, getCharacteristics, getCharacteristicsList, getClassificationList, getContactsList, getDocumentationList, getExtensionList, getHistoryList, getIdentificationList, getKeywordsList, getLang, getLegalConstraintsList, getNumCapabilities, getNumCharacteristics, getNumClassifications, getNumContacts, getNumDocumentations, getNumExtensions, getNumHistorys, getNumIdentifications, getNumKeywords, getNumLegalConstraints, getNumSecurityConstraints, getNumValidTimes, getSecurityConstraintsList, getValidTime, getValidTimeList, isSetLang, setLangMethods inherited from class net.opengis.gml.v32.impl.AbstractFeatureImpl
equals, getBoundedBy, getGeometry, getGeometryProperty, hashCode, isSetBoundedBy, isSetGeometry, setBoundedByAsEnvelope, setGeometryMethods inherited from class net.opengis.gml.v32.impl.AbstractGMLImpl
addName, getDescriptionReference, getId, getIdentifier, getMetaDataPropertyList, getNameList, getNumNames, getUniqueIdentifier, isSetDescription, isSetDescriptionReference, isSetIdentifier, setDescription, setDescriptionReference, setId, setIdentifier, setName, setUniqueIdentifierMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.opengis.gml.v32.AbstractFeature
getBoundedBy, getGeometryProperty, isSetBoundedBy, isSetGeometry, setBoundedByAsEnvelope, setGeometryMethods inherited from interface net.opengis.gml.v32.AbstractGML
addName, getDescriptionReference, getId, getIdentifier, getMetaDataPropertyList, getNameList, getNumNames, getUniqueIdentifier, isSetDescription, isSetDescriptionReference, isSetIdentifier, setDescription, setDescriptionReference, setId, setIdentifier, setName, setUniqueIdentifierMethods inherited from interface net.opengis.sensorml.v20.AbstractProcess
getLocation, getType, isSetLocation, setLocationMethods inherited from interface net.opengis.sensorml.v20.DescribedObject
addCapabilities, addCharacteristics, addClassification, addContacts, addDocumentation, addExtension, addHistory, addIdentification, addKeywords, addLegalConstraints, addSecurityConstraints, addValidTimeAsTimeInstant, addValidTimeAsTimePeriod, getCapabilities, getCapabilitiesList, getCharacteristics, getCharacteristicsList, getClassificationList, getContactsList, getDocumentationList, getExtensionList, getHistoryList, getIdentificationList, getKeywordsList, getLang, getLegalConstraintsList, getNumCapabilities, getNumCharacteristics, getNumClassifications, getNumContacts, getNumDocumentations, getNumExtensions, getNumHistorys, getNumIdentifications, getNumKeywords, getNumLegalConstraints, getNumSecurityConstraints, getNumValidTimes, getSecurityConstraintsList, getValidTimeList, isSetLang, setLangMethods inherited from interface org.vast.ogc.gml.IFeature
getGeometry, getId, getProperties, getQName, getUniqueIdentifier, getValidTime, hasCustomGeomProperty, hasCustomTimeProperty 
- 
Field Details
- 
definition
 - 
typeOf
 - 
configuration
 - 
featuresOfInterest
 - 
inputData
 - 
outputData
 - 
paramData
 - 
modesList
 - 
executableProcess
 
 - 
 - 
Constructor Details
- 
AbstractProcessImpl
public AbstractProcessImpl() 
 - 
 - 
Method Details
- 
getDefinition
Gets the definition property- Specified by:
 getDefinitionin interfaceAbstractProcess
 - 
isSetDefinition
public boolean isSetDefinition()Checks if definition is set- Specified by:
 isSetDefinitionin interfaceAbstractProcess
 - 
setDefinition
Sets the definition property- Specified by:
 setDefinitionin interfaceAbstractProcess
 - 
getName
- Specified by:
 getNamein interfaceAbstractGML- Specified by:
 getNamein interfaceIResource- Overrides:
 getNamein classAbstractGMLImpl- Returns:
 - the default name
 
 - 
getDescription
Description copied from class:AbstractGMLImplGets the description property- Specified by:
 getDescriptionin interfaceAbstractGML- Specified by:
 getDescriptionin interfaceIResource- Overrides:
 getDescriptionin classAbstractGMLImpl- Returns:
 - A short description of the resource
 
 - 
setExecutableImpl
- Throws:
 ProcessException
 - 
mergePortDescriptors
protected IOPropertyList mergePortDescriptors(IOPropertyList smlPorts, IOPropertyList execPorts) throws ProcessException - Throws:
 ProcessException
 - 
mergePort
- Throws:
 ProcessException
 - 
isExecutable
public boolean isExecutable() - 
getProcessInfo
- Specified by:
 getProcessInfoin interfaceIProcessExec- Returns:
 - all process information (name, UID, etc.)
 
 - 
init
Description copied from interface:IProcessExecInitialize the process and its internal variables (fixed parameters). This is called only once before the process is executed.- Specified by:
 initin interfaceIProcessExec- Throws:
 ProcessException
 - 
canRun
public boolean canRun()Description copied from interface:IProcessExecCheck that all needed connections are ready for the process to run- Specified by:
 canRunin interfaceIProcessExec- Returns:
 - true if so and false if at least one connection is not ready.
 
 - 
run
Description copied from interface:IProcessExecRuns the process which includes fetching input data, calling execute and producing output data- Specified by:
 runin interfaceIProcessExec- Throws:
 ProcessException
 - 
execute
Description copied from interface:IProcessExecExecute contains the logic to transform input/parameter values into output values. This method should be optimized as much as possible.- Specified by:
 executein interfaceIProcessExec- Throws:
 ProcessException
 - 
start
Description copied from interface:IProcessExecStart process in its own thread- Specified by:
 startin interfaceIProcessExec- Parameters:
 onError- Called when the process ends with an unrecoverable error- Throws:
 ProcessException
 - 
start
Description copied from interface:IProcessExecStart process using threads from the given thread pool- Specified by:
 startin interfaceIProcessExeconError- Called when the process ends with an unrecoverable error- Throws:
 ProcessException
 - 
stop
public void stop()Description copied from interface:IProcessExecStop process thread gracefully- Specified by:
 stopin interfaceIProcessExec
 - 
notifyParamChange
public void notifyParamChange()Description copied from interface:IProcessExecNotifies the process that one or more parameter values have changed before or during execution- Specified by:
 notifyParamChangein interfaceIProcessExec
 - 
dispose
public void dispose()Description copied from interface:IProcessExecOverride to dispose of all resources allocated for the process (stop threads, OS resources, etc...)- Specified by:
 disposein interfaceIProcessExec
 - 
getInputConnections
- Specified by:
 getInputConnectionsin interfaceIProcessExec- Returns:
 - Read-only list of connections input ports
 
 - 
getParamConnections
- Specified by:
 getParamConnectionsin interfaceIProcessExec- Returns:
 - Read-only list of connections parameter ports
 
 - 
getOutputConnections
- Specified by:
 getOutputConnectionsin interfaceIProcessExec- Returns:
 - Read-only list of connections output ports
 
 - 
connect
Description copied from interface:IProcessExecConnects one of this process ports with the given connection- Specified by:
 connectin interfaceIProcessExec- Parameters:
 component- input, parameter or output component to connectconnection- connection object to use- Throws:
 ProcessException- if connection cannot be validated (this usually happens because source and destination components are not compatible)
 - 
setInstanceName
Description copied from interface:IProcessExecSets the name of this process instance- Specified by:
 setInstanceNamein interfaceIProcessExec
 - 
getInstanceName
- Specified by:
 getInstanceNamein interfaceIProcessExec- Returns:
 - name of this process instance
 
 - 
disconnect
Description copied from interface:IProcessExecDetach connection from this process input, output or parameter- Specified by:
 disconnectin interfaceIProcessExec
 - 
setParentLogger
public void setParentLogger(org.slf4j.Logger log) Description copied from interface:IProcessExecSet the parent logger for this process.
The parent logger is used to group log events occuring in all processes that are part of the same processing component (e.g. a process chain for instance) while still allowing to differentiate the actual process instance that issued the log.- Specified by:
 setParentLoggerin interfaceIProcessExec
 - 
needSync
public boolean needSync()- Specified by:
 needSyncin interfaceIProcessExec- Returns:
 - True if this process is asynchronous (i.e. outputs are not generated everytime inputs are read) and thus need synchronization with other processes in the chain
 
 - 
checkExecutable
protected void checkExecutable() - 
toString
 - 
getTypeOf
Gets the typeOf property- Specified by:
 getTypeOfin interfaceAbstractProcess
 - 
isSetTypeOf
public boolean isSetTypeOf()Checks if typeOf is set- Specified by:
 isSetTypeOfin interfaceAbstractProcess
 - 
setTypeOf
Sets the typeOf property- Specified by:
 setTypeOfin interfaceAbstractProcess
 - 
getConfiguration
Gets the configuration property- Specified by:
 getConfigurationin interfaceAbstractProcess
 - 
isSetConfiguration
public boolean isSetConfiguration()Checks if configuration is set- Specified by:
 isSetConfigurationin interfaceAbstractProcess
 - 
setConfiguration
Sets the configuration property- Specified by:
 setConfigurationin interfaceAbstractProcess
 - 
getFeaturesOfInterest
Gets the featuresOfInterest property- Specified by:
 getFeaturesOfInterestin interfaceAbstractProcess
 - 
isSetFeaturesOfInterest
public boolean isSetFeaturesOfInterest()Checks if featuresOfInterest is set- Specified by:
 isSetFeaturesOfInterestin interfaceAbstractProcess
 - 
setFeaturesOfInterest
Sets the featuresOfInterest property- Specified by:
 setFeaturesOfInterestin interfaceAbstractProcess
 - 
getInputList
Description copied from interface:AbstractProcessGets the list of input properties- Specified by:
 getInputListin interfaceAbstractProcess- Specified by:
 getInputListin interfaceIProcessExec- Returns:
 - List of inputs
 
 - 
getNumInputs
public int getNumInputs()Description copied from interface:AbstractProcessReturns number of input properties- Specified by:
 getNumInputsin interfaceAbstractProcess
 - 
getInput
Description copied from interface:AbstractProcessGets the input property with the given name- Specified by:
 getInputin interfaceAbstractProcess
 - 
getInputComponent
Description copied from interface:AbstractProcessGets the data structure of the input with the given name- Specified by:
 getInputComponentin interfaceAbstractProcess
 - 
addInput
Description copied from interface:AbstractProcessAdds a new inputAsAbstractDataComponent property- Specified by:
 addInputin interfaceAbstractProcess
 - 
addInput
Description copied from interface:AbstractProcessAdds a new inputAsObservableProperty property- Specified by:
 addInputin interfaceAbstractProcess
 - 
addInput
Description copied from interface:AbstractProcessAdds a new inputAsDataStream property- Specified by:
 addInputin interfaceAbstractProcess
 - 
addInput
Description copied from interface:AbstractProcessAdds a new inputAsDataInterface property- Specified by:
 addInputin interfaceAbstractProcess
 - 
getOutputList
Description copied from interface:AbstractProcessGets the list of output properties- Specified by:
 getOutputListin interfaceAbstractProcess- Specified by:
 getOutputListin interfaceIProcessExec- Returns:
 - List of outputs
 
 - 
getNumOutputs
public int getNumOutputs()Description copied from interface:AbstractProcessReturns number of output properties- Specified by:
 getNumOutputsin interfaceAbstractProcess
 - 
getOutput
Description copied from interface:AbstractProcessGets the output property with the given name- Specified by:
 getOutputin interfaceAbstractProcess
 - 
getOutputComponent
Description copied from interface:AbstractProcessGets the data structure of the output with the given name- Specified by:
 getOutputComponentin interfaceAbstractProcess
 - 
addOutput
Description copied from interface:AbstractProcessAdds a new outputAsAbstractDataComponent property- Specified by:
 addOutputin interfaceAbstractProcess
 - 
addOutput
Description copied from interface:AbstractProcessAdds a new outputAsObservableProperty property- Specified by:
 addOutputin interfaceAbstractProcess
 - 
addOutput
Description copied from interface:AbstractProcessAdds a new outputAsDataStream property- Specified by:
 addOutputin interfaceAbstractProcess
 - 
addOutput
Description copied from interface:AbstractProcessAdds a new outputAsDataInterface property- Specified by:
 addOutputin interfaceAbstractProcess
 - 
getNumParameters
public int getNumParameters()Description copied from interface:AbstractProcessReturns number of parameter properties- Specified by:
 getNumParametersin interfaceAbstractProcess
 - 
getParameter
Description copied from interface:AbstractProcessGets the parameter property with the given name- Specified by:
 getParameterin interfaceAbstractProcess
 - 
getParameterComponent
Description copied from interface:AbstractProcessGets the data structure of the parameter with the given name- Specified by:
 getParameterComponentin interfaceAbstractProcess
 - 
addParameter
Description copied from interface:AbstractProcessAdds a new parameterAsAbstractDataComponent property- Specified by:
 addParameterin interfaceAbstractProcess
 - 
addParameter
Description copied from interface:AbstractProcessAdds a new parameterAsObservableProperty property- Specified by:
 addParameterin interfaceAbstractProcess
 - 
addParameter
Description copied from interface:AbstractProcessAdds a new parameterAsDataStream property- Specified by:
 addParameterin interfaceAbstractProcess
 - 
addParameter
Description copied from interface:AbstractProcessAdds a new parameterAsDataInterface property- Specified by:
 addParameterin interfaceAbstractProcess
 - 
getParameterList
Description copied from interface:AbstractProcessGets the list of parameter properties- Specified by:
 getParameterListin interfaceAbstractProcess- Specified by:
 getParameterListin interfaceIProcessExec- Returns:
 - List of parameters
 
 - 
getModesList
Gets the list of modes properties- Specified by:
 getModesListin interfaceAbstractProcess
 - 
getNumModes
public int getNumModes()Returns number of modes properties- Specified by:
 getNumModesin interfaceAbstractProcess
 - 
addModes
Adds a new modes property- Specified by:
 addModesin interfaceAbstractProcess
 
 -