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
ProviderType
Returns type of persistence provider ("AzureDigitalTwinsService", etc).
string ProviderType { get; }
Property Value
Methods
GetInstance(string, string)
Returns the JSON-serialized object associated with an instanceId.
string GetInstance(string containerName, string instanceId)
Parameters
containerNamestringName of the persistence container holding the object.
instanceIdstringID of the persisted object.
Returns
- string
JSON-serialized object.
Exceptions
- ArgumentNullException
containerNameorinstanceIdis 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
containerNamestringName of the persistence container holding the object.
instanceIdstringID of the persisted object.
Returns
Exceptions
- ArgumentNullException
containerNameorinstanceIdis 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
containerNamestring
Returns
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
containerNameis 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
containerNamestringThe name of the persistence container.
Returns
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
containerNameis 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
containerNamestringName of the persistence container.
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
Returns
- Task<T>
The current property's value.
Type Parameters
TType 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
containerNamestringThe name of the persistence container.
Returns
- IEnumerable<(string propertyName, string propertyType)>
List of object's properties.
Exceptions
- ArgumentNullException
containerNameis 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
containerNamestringThe name of the persistence container.
Returns
- Task<IEnumerable<(string propertyName, string propertyType)>>
List of object's properties.
Exceptions
- ArgumentNullException
containerNameis 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
containerNamestringName of the persistence container.
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
Returns
- T
The current property's value.
Type Parameters
TType 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
Returns
- Task<T>
The current property's value.
Type Parameters
TType 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
Returns
- T
The current property's value.
Type Parameters
TType 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
containerNamestringName of the persistence container.
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Returns
Type Parameters
TType 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
containerNamestringName of the persistence container.
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Type Parameters
TType 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
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Returns
Type Parameters
TType 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
instanceIdstringPersisted object's instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Type Parameters
TType of the property.