Class InitContext
java.lang.Object
com.scaleoutsoftware.digitaltwin.core.InitContext
The InitContext is passed as a parameter to the
DigitalTwinBase.init(InitContext) method of an initializing
digital twin.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetId()Get the model-unique Id identifier of the initializing digital twin instance.abstract StringgetModel()Get the Model identifier of the initializing digital twin instance.abstract SharedDataRetrieve aSharedDataaccessor for globally shared data.abstract SharedDataRetrieve aSharedDataaccessor for this model's shared data.abstract <T extends DigitalTwinBase>
TimerActionResultstartTimer(String timerName, Duration interval, TimerType timerType, TimerHandler<T> timerHandler) Starts a new timer for the digital twin
-
Constructor Details
-
InitContext
public InitContext()Default constructor.
-
-
Method Details
-
startTimer
public abstract <T extends DigitalTwinBase> TimerActionResult startTimer(String timerName, 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.
-
getId
Get the model-unique Id identifier of the initializing digital twin instance.- Returns:
- the id identifier.
-
getModel
Get the Model identifier of the initializing digital twin instance.- Returns:
- the model identifier.
-