Class DigitalTwinBase
- java.lang.Object
-
- com.scaleoutsoftware.digitaltwin.core.DigitalTwinBase
-
public abstract class DigitalTwinBase extends java.lang.ObjectA real-time digital twin of a data source. The implementation of the real-time DigitalTwin should have a parameterless constructor for basic initialization.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringIdThe identifier for this twin instancejava.lang.StringModelThe model this twin instance belongs to.longNextSimulationTimeNote: Simulation only.java.util.HashMap<java.lang.String,TimerMetadata>TimerHandlersThe timer handlers for this twin instance.
-
Constructor Summary
Constructors Constructor Description DigitalTwinBase()Default constructor.
-
Method Summary
Modifier and Type Method Description java.lang.StringgetId()The identifier of this DigitalTwin.java.lang.StringgetModel()The model for this DigitalTwin.longgetNextSimulationTimeMs()Retrieve the next simulation time in milliseconds.voidinit(InitContext context)Initialization method to set the identifier and model for a DigitalTwin instance.voidsetNextSimulationTime(long nextSimulationTime)Set the next simulation time in milliseconds.
-
-
-
Field Detail
-
Id
public java.lang.String Id
The identifier for this twin instance
-
Model
public java.lang.String Model
The model this twin instance belongs to.
-
TimerHandlers
public java.util.HashMap<java.lang.String,TimerMetadata> TimerHandlers
The timer handlers for this twin instance.
-
NextSimulationTime
public long NextSimulationTime
Note: Simulation only. The next time in milliseconds that this Digital Twin instance will be passed toSimulationProcessor.processModel(ProcessingContext, DigitalTwinBase, Date).
-
-
Method Detail
-
getNextSimulationTimeMs
public long getNextSimulationTimeMs()
Retrieve the next simulation time in milliseconds.- Returns:
- the next simulation time in milliseconds.
-
setNextSimulationTime
public void setNextSimulationTime(long nextSimulationTime)
Set the next simulation time in milliseconds.- Parameters:
nextSimulationTime- set the next simulation time.
-
getId
public java.lang.String getId()
The identifier of this DigitalTwin.- Returns:
- the identifier of this digital twin
-
getModel
public java.lang.String getModel()
The model for this DigitalTwin.- Returns:
- the model for this DigitalTwin
-
init
public void init(InitContext context) throws java.lang.IllegalStateException
Initialization method to set the identifier and model for a DigitalTwin instance. Optionally use theInitContextto start a timer.- Parameters:
context- the initialization context.- Throws:
java.lang.IllegalStateException- if init is called after initialization.
-
-