Class DigitalTwinBase<T extends DigitalTwinBase<T>>
java.lang.Object
com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<T>
A 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
FieldsModifier and TypeFieldDescriptionThe identifier for this twin instanceThe model this twin instance belongs to.longDO NOT MODIFY.intDO NOT MODIFY. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()The identifier of this DigitalTwin.getModel()The model for this DigitalTwin.longINTERNAL: DO NOT MODIFY.intINTERNAL: DO NOT MODIFY.voidinit(InitContext<T> context) Initialization method to set the identifier and model for a DigitalTwin instance.voidsetNextSimulationTimeUnixMsec(long nextSimulationTimeUnixMsec) INTERNAL: DO NOT MODIFY.voidsetSourceAppIdNamespace(int sourceAppIdNamespace) INTERNAL: DO NOT MODIFY.
-
Field Details
-
Id
The identifier for this twin instance -
Model
The model this twin instance belongs to. -
SourceNamespaceAppId
public int SourceNamespaceAppIdDO NOT MODIFY. This property is managed by the service. Used to send messages to the instances data source. -
NextSimulationTimeUnixMsec
public long NextSimulationTimeUnixMsecDO NOT MODIFY. This property is managed by the service. Used to store the instances next simulation time; managed by the service in case of load balancing or server failures.
-
-
Constructor Details
-
DigitalTwinBase
public DigitalTwinBase()Default constructor.
-
-
Method Details
-
getId
The identifier of this DigitalTwin.- Returns:
- the identifier of this digital twin
-
getModel
The model for this DigitalTwin.- Returns:
- the model for this DigitalTwin
-
getSourceAppIdNamespace
public int getSourceAppIdNamespace()INTERNAL: DO NOT MODIFY. This property is managed by the service. Used for sending messages back to the instances data source.- Returns:
- the source App ID namespace
-
setSourceAppIdNamespace
public void setSourceAppIdNamespace(int sourceAppIdNamespace) INTERNAL: DO NOT MODIFY. This property is managed by the service.- Parameters:
sourceAppIdNamespace- assign this instance a new source app ID namespace.
-
getNextSimulationTimeUnixMsec
public long getNextSimulationTimeUnixMsec()INTERNAL: DO NOT MODIFY. This property is managed by the service. Retrieve the next simulation time for this instance.- Returns:
- the next simulation time for this instance.
-
setNextSimulationTimeUnixMsec
public void setNextSimulationTimeUnixMsec(long nextSimulationTimeUnixMsec) INTERNAL: DO NOT MODIFY. This property is managed by the service. Assign this instance the next simulation time when the instance will be run.- Parameters:
nextSimulationTimeUnixMsec- the next simulation time when the instance will be run.
-
init
Initialization method to set the identifier and model for a DigitalTwin instance. Optionally use theInitContextto start a timer.- Parameters:
context- the initialization context.- Throws:
IllegalStateException- if init is called after initialization.
-