Table of Contents

Interface IDigitalTwinModelProvider

Namespace
Scaleout.Modules.DigitalTwin.Abstractions
Assembly
Scaleout.Modules.DigitalTwin.Abstractions.dll

Encapsulates the capabilities of a third-party digital twin persistence provider.

public interface IDigitalTwinModelProvider

Properties

IsActive

Indicates whether the persistence provider is active and can be used.

bool IsActive { get; }

Property Value

bool

ProviderType

Returns type of persistence provider ("AzureDigitalTwinsService", etc).

string ProviderType { get; }

Property Value

string

Methods

GetInstance(string, string)

Returns the JSON-serialized object associated with an instanceId.

string GetInstance(string containerName, string instanceId)

Parameters

containerName string

Name of the persistence container holding the object.

instanceId string

ID of the persisted object.

Returns

string

JSON-serialized object.

Exceptions

ArgumentNullException

containerName or instanceId is empty or null.

PersistenceProviderException

Failed to obtain the object instance for the specified containerName.

GetInstanceAsync(string, string)

Returns a JSON-serialized object associated with an instanceId.

Task<string> GetInstanceAsync(string containerName, string instanceId)

Parameters

containerName string

Name of the persistence container holding the object.

instanceId string

ID of the persisted object.

Returns

Task<string>

JSON-serialized object.

Exceptions

ArgumentNullException

containerName or instanceId is empty or null.

PersistenceProviderException

Failed to obtain the object instance for the specified containerName.

GetInstanceIds(string)

Returns the list of instance identifiers that are held in the specified containerName.

List<string> GetInstanceIds(string containerName)

Parameters

containerName string

Returns

List<string>

The list of object identifiers that are located in the specified containerName.

Remarks

For the relational database providers, a list containing primary key values is returned.

For the Azure Digital Twins service, a list of digital twin instance identifiers is returned.

For Azure Blob storage, a list of Blob names would be returned.

Exceptions

ArgumentNullException

containerName is empty or null.

PersistenceProviderException

Failed to obtain the list of object instance identifiers for the specified containerName.

GetInstanceIdsAsync(string)

Returns the list of instance identifiers that are held in the specified containerName.

Task<List<string>> GetInstanceIdsAsync(string containerName)

Parameters

containerName string

The name of the persistence container.

Returns

Task<List<string>>

The list of object identifiers that are located in the specified containerName.

Remarks

For the relational database providers, a list containing primary key values is returned.

For the Azure Digital Twins service, a list of digital twin instance identifiers is returned.

For Azure Blob storage, a list of Blob names would be returned.

Exceptions

ArgumentNullException

containerName is empty or null.

PersistenceProviderException

Failed to obtain the list of object instance identifiers for the specified containerName.

GetPropertyAsync<T>(string, string, string)

Gets a property value on the specified persisted object located in the containerName container.

Task<T> GetPropertyAsync<T>(string containerName, string instanceId, string propertyName)

Parameters

containerName string

Name of the persistence container.

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

Returns

Task<T>

The current property's value.

Type Parameters

T

Type of the property.

GetPropertyList(string)

Returns the properties on a persisted object. For the Azure Digital Twins service it is a list of digital twin's properties, for the Azure Blob storage it is a list of Blob's properties, and for the relational database providers it is a list of table's columns.

IEnumerable<(string propertyName, string propertyType)> GetPropertyList(string containerName)

Parameters

containerName string

The name of the persistence container.

Returns

IEnumerable<(string propertyName, string propertyType)>

List of object's properties.

Exceptions

ArgumentNullException

containerName is empty or null.

PersistenceProviderException

Failed to build the list of properties for the specified containerName.

GetPropertyListAsync(string)

Returns the properties on a persisted object. For the Azure Digital Twins service, this is a list of digital twin's properties, for the Azure Blob storage it is a list of Blob's properties, and for the relational database providers it is a list of table's columns.

Task<IEnumerable<(string propertyName, string propertyType)>> GetPropertyListAsync(string containerName)

Parameters

containerName string

The name of the persistence container.

Returns

Task<IEnumerable<(string propertyName, string propertyType)>>

List of object's properties.

Exceptions

ArgumentNullException

containerName is empty or null.

PersistenceProviderException

Failed to build the list of properties for the specified containerName.

GetProperty<T>(string, string, string)

Gets a property value on the specified persisted object located in the containerName container.

T GetProperty<T>(string containerName, string instanceId, string propertyName)

Parameters

containerName string

Name of the persistence container.

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

Returns

T

The current property's value.

Type Parameters

T

Type of the property.

GetRTDTPropertyAsync<T>(string, string)

Gets a property value on the specified persisted object instanceId that is part of a ScaleOut component definition in the context of current real-time digital twin (RTDT) model.

Task<T> GetRTDTPropertyAsync<T>(string instanceId, string propertyName)

Parameters

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

Returns

Task<T>

The current property's value.

Type Parameters

T

Type of the property.

GetRTDTProperty<T>(string, string)

Gets a property value on the specified persisted object instanceId that is part of a ScaleOut component definition in the context of current real-time digital twin (RTDT) model.

T GetRTDTProperty<T>(string instanceId, string propertyName)

Parameters

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

Returns

T

The current property's value.

Type Parameters

T

Type of the property.

UpdatePropertyAsync<T>(string, string, string, T)

Updates a property value on a specified persisted object, given an instanceId and containerName.

Task UpdatePropertyAsync<T>(string containerName, string instanceId, string propertyName, T propertyValue)

Parameters

containerName string

Name of the persistence container.

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

propertyValue T

Property's new value.

Returns

Task

Type Parameters

T

Type of the property.

UpdateProperty<T>(string, string, string, T)

Updates a property value on a specified persisted object, given an instanceId and containerName.

void UpdateProperty<T>(string containerName, string instanceId, string propertyName, T propertyValue)

Parameters

containerName string

Name of the persistence container.

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

propertyValue T

Property's new value.

Type Parameters

T

Type of the property.

UpdateRTDTPropertyAsync<T>(string, string, T)

Updates a property value of a persisted object that is part of a ScaleOut definition in the context of current real-time digital twin (RTDT) model.

Task UpdateRTDTPropertyAsync<T>(string instanceId, string propertyName, T propertyValue)

Parameters

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

propertyValue T

Property's new value.

Returns

Task

Type Parameters

T

Type of the property.

UpdateRTDTProperty<T>(string, string, T)

Updates a property value of a persisted object that is part of a ScaleOut definition in the context of current real-time digital twin (RTDT) model.

void UpdateRTDTProperty<T>(string instanceId, string propertyName, T propertyValue)

Parameters

instanceId string

Persisted object's instance Id.

propertyName string

Name of the property.

propertyValue T

Property's new value.

Type Parameters

T

Type of the property.