Interface IDigitalTwinModelEndpoint
- Namespace
- Scaleout.Streaming.DigitalTwin.Core
- Assembly
- ScaleOut.Streaming.DigitalTwin.Core.dll
Interface for use by client applications that send messages to digital twin instances.
public interface IDigitalTwinModelEndpoint
Properties
SharedGlobalData
Gets an ISharedData instance for accessing objects that are shared globally between all models.
ISharedData SharedGlobalData { get; }
Property Value
SharedModelData
Gets an ISharedData instance for accessing shared objects that are associated with the endpoint's model.
ISharedData SharedModelData { get; }
Property Value
Methods
CreateTwin(string, object)
Creates a new digital twin instance.
SendingResult CreateTwin(string digitalTwinId, object digitalTwin)
Parameters
digitalTwinId
stringID of the digital twin instance.
digitalTwin
objectDigital twin instance to create. It could an object of a real digital twin model type or simply an anonymous object with a set of digital twin model's properties and their initial values.
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.
CreateTwinFromPersistenceStore(string)
Create a new digital twin instance in the ScaleOut data grid. This method assumes that persistence store is
enabled for the target model and the twin instance with the specified digitalTwinId
exists there. In this case, a new twin instance is created and initialized from the persistence store.
Otherwise, the DigitalTwinInstantiationException
is thrown.
SendingResult CreateTwinFromPersistenceStore(string digitalTwinId)
Parameters
digitalTwinId
stringDigital twin identifier.
Returns
- SendingResult
Handled in case of success, otherwise the method throws DigitalTwinInstantiationException with the error details.
CreateTwinFromPersistenceStore(string, object)
Create a new digital twin instance . This method first tries to create
a new twin instance from a persistence store if it is enabled. If a persistence store is not enabled or
if the twin instance is not found there, the property values of the specified fallback
defaultValue
are used to create and initialize a new twin instance.
SendingResult CreateTwinFromPersistenceStore(string digitalTwinId, object defaultValue)
Parameters
digitalTwinId
stringDigital twin identifier.
defaultValue
objectDigital twin instance to create. It could an object of a real digital twin model type or simply an anonymous object with a set of digital twin model's properties and their initial values.
Returns
- SendingResult
Handled in case of success, otherwise the method throws DigitalTwinInstantiationException with the error details.
DeleteTwin(string)
Delete a digital twin instance from the ScaleOut data grid.
SendingResult DeleteTwin(string digitalTwinId)
Parameters
digitalTwinId
stringDigital twin identifier.
Returns
- SendingResult
Handled in case of success, otherwise the method throws DigitalTwinProcessingException with the error details.
Send(string, byte[])
Sends a JSON serialized message to a digital twin instance.
SendingResult Send(string digitalTwinId, byte[] message)
Parameters
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.
Send(string, IEnumerable<byte[]>)
Sends JSON serialized messages to a digital twin instance.
SendingResult Send(string digitalTwinId, IEnumerable<byte[]> messages)
Parameters
digitalTwinId
stringID of the digital twin instance.
messages
IEnumerable<byte[]>Enumerable collection of serialized messages.
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.
Send(string, IEnumerable<object>)
Sends messages to a digital twin instance.
SendingResult Send(string digitalTwinId, IEnumerable<object> message)
Parameters
digitalTwinId
stringID of the digital twin instance.
message
IEnumerable<object>Messages to send to the instance.
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.
Send(string, object)
Sends a message to a digital twin instance.
SendingResult Send(string digitalTwinId, object message)
Parameters
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.
Send(string, string)
Sends a JSON serialized message to a digital twin instance.
SendingResult Send(string digitalTwinId, string message)
Parameters
Returns
- SendingResult
Handled if the message was successfully sent, NotHandled otherwise.