Class DigitalTwinBase<T extends DigitalTwinBase<T>>

java.lang.Object
com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<T>

public abstract class DigitalTwinBase<T extends DigitalTwinBase<T>> extends Object
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 Details

    • Id

      public String Id
      The identifier for this twin instance
    • Model

      public String Model
      The model this twin instance belongs to.
    • SourceNamespaceAppId

      public int SourceNamespaceAppId
      DO NOT MODIFY. This property is managed by the service. Used to send messages to the instances data source.
    • NextSimulationTimeUnixMsec

      public long NextSimulationTimeUnixMsec
      DO 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

      public String getId()
      The identifier of this DigitalTwin.
      Returns:
      the identifier of this digital twin
    • getModel

      public String 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

      public void init(InitContext<T> context) throws IllegalStateException
      Initialization method to set the identifier and model for a DigitalTwin instance. Optionally use the InitContext to start a timer.
      Parameters:
      context - the initialization context.
      Throws:
      IllegalStateException - if init is called after initialization.