Class InitContext
- java.lang.Object
-
- com.scaleoutsoftware.digitaltwin.core.InitContext
-
public abstract class InitContext extends java.lang.ObjectThe InitContext is passed as a parameter to theDigitalTwinBase.init(InitContext)method of an initializing digital twin.
-
-
Constructor Summary
Constructors Constructor Description InitContext()Default constructor.
-
Method Summary
Modifier and Type Method Description abstract java.lang.StringgetId()Get the model-unique Id identifier of the initializing digital twin instance.abstract java.lang.StringgetModel()Get the Model identifier of the initializing digital twin instance.abstract SharedDatagetSharedGlobalData()Retrieve aSharedDataaccessor for globally shared data.abstract SharedDatagetSharedModelData()Retrieve aSharedDataaccessor for this model's shared data.abstract <T extends DigitalTwinBase>
TimerActionResultstartTimer(java.lang.String timerName, java.time.Duration interval, TimerType timerType, TimerHandler<T> timerHandler)Starts a new timer for the digital twin
-
-
-
Method Detail
-
startTimer
public abstract <T extends DigitalTwinBase> TimerActionResult startTimer(java.lang.String timerName, java.time.Duration interval, TimerType timerType, TimerHandler<T> timerHandler)
Starts a new timer for the digital twin- Type Parameters:
T- the type of the digital twin- Parameters:
timerName- the timer nameinterval- the timer intervaltimerType- the timer typetimerHandler- the time handler callback- Returns:
- returns
TimerActionResult.Successif the timer was started,TimerActionResult.FailedTooManyTimersif too many timers exist, orTimerActionResult.FailedInternalErrorif an unexpected error occurs.
-
getSharedModelData
public abstract SharedData getSharedModelData()
Retrieve aSharedDataaccessor for this model's shared data.- Returns:
- a
SharedDatainstance.
-
getSharedGlobalData
public abstract SharedData getSharedGlobalData()
Retrieve aSharedDataaccessor for globally shared data.- Returns:
- a
SharedDatainstance.
-
getId
public abstract java.lang.String getId()
Get the model-unique Id identifier of the initializing digital twin instance.- Returns:
- the id identifier.
-
getModel
public abstract java.lang.String getModel()
Get the Model identifier of the initializing digital twin instance.- Returns:
- the model identifier.
-
-