Class InitContext
- java.lang.Object
-
- com.scaleoutsoftware.digitaltwin.core.InitContext
-
public abstract class InitContext extends java.lang.Object
The 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.String
getId()
Get the model-unique Id identifier of the initializing digital twin instance.abstract java.lang.String
getModel()
Get the Model identifier of the initializing digital twin instance.abstract SharedData
getSharedGlobalData()
Retrieve aSharedData
accessor for globally shared data.abstract SharedData
getSharedModelData()
Retrieve aSharedData
accessor 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.Success
if the timer was started,TimerActionResult.FailedTooManyTimers
if too many timers exist, orTimerActionResult.FailedInternalError
if an unexpected error occurs.
-
getSharedModelData
public abstract SharedData getSharedModelData()
Retrieve aSharedData
accessor for this model's shared data.- Returns:
- a
SharedData
instance.
-
getSharedGlobalData
public abstract SharedData getSharedGlobalData()
Retrieve aSharedData
accessor for globally shared data.- Returns:
- a
SharedData
instance.
-
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.
-
-