Class InitContext<T extends DigitalTwinBase<T>>

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

public abstract class InitContext<T extends DigitalTwinBase<T>> extends Object
The InitContext is passed as a parameter to the DigitalTwinBase.init(InitContext) method of an initializing digital twin.
  • Constructor Details

    • InitContext

      public InitContext()
      Default constructor.
  • Method Details

    • startTimer

      public abstract TimerActionResult startTimer(String timerName, Duration interval, TimerType timerType, TimerHandler<T> timerHandler, Class<? extends TimerHandler<T>> timerHandlerClass)
      Starts a new timer for the digital twin
      Parameters:
      timerName - the timer name
      interval - the timer interval
      timerType - the timer type
      timerHandler - the time handler callback
      timerHandlerClass - the timer handler callback class
      Returns:
      returns TimerActionResult.Success if the timer was started, TimerActionResult.FailedTooManyTimers if too many timers exist, or TimerActionResult.FailedInternalError if an unexpected error occurs.
    • getSharedModelData

      public abstract SharedData getSharedModelData()
      Retrieve a SharedData accessor for this model's shared data.
      Returns:
      a SharedData instance.
    • getSharedGlobalData

      public abstract SharedData getSharedGlobalData()
      Retrieve a SharedData accessor for globally shared data.
      Returns:
      a SharedData instance.
    • getId

      public abstract String getId()
      Get the model-unique Id identifier of the initializing digital twin instance.
      Returns:
      the id identifier.
    • getModel

      public abstract String getModel()
      Get the Model identifier of the initializing digital twin instance.
      Returns:
      the model identifier.