Interface IPersistenceProvider
- Namespace
- Scaleout.Streaming.DigitalTwin.Core
- Assembly
- ScaleOut.Streaming.DigitalTwin.Core.dll
Encapsulates the capabilities of a ScaleOut real-time digital twin persistence provider.
public interface IPersistenceProvider
Properties
IsActive
Indicates whether the persistence provider is active and can be used.
bool IsActive { get; }
Property Value
ProviderType
Returns PersistenceProviderType identifier.
PersistenceProviderType ProviderType { get; }
Property Value
Methods
GetInstance(string, string)
Returns a JSON-serialized object's instanceId
that is part of the specified containerName
string GetInstance(string containerName, string instanceId)
Parameters
containerNamestringThe name of the persistence container.
instanceIdstringPersistence object's instance Id.
Returns
- string
The JSON-formatted content of the object's object's
instanceIdthat is located in the specifiedcontainerName.
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's instanceId
that is part of the specified containerName
Task<string> GetInstanceAsync(string containerName, string instanceId)
Parameters
containerNamestringThe name of the persistence container.
instanceIdstringPersistence object's instance Id.
Returns
- Task<string>
The JSON-formatted content of the object's object's
instanceIdthat is located in the specifiedcontainerName.
Exceptions
- ArgumentNullException
containerNameorinstanceIdis empty or null.- PersistenceProviderException
Failed to obtain the object instance for the specified
containerName.
GetInstanceIds(string)
Returns the list of object identifiers that are part of the specified containerName.
For the Azure Digital Twins service it is a list of digital twin instance identifiers, for the Azure Blob storage it could be
a list of Blob names. For the relational database providers it is a list of table's primary keys.
List<string> GetInstanceIds(string containerName)
Parameters
containerNamestringThe name of the persistence container.
Returns
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 object identifiers that are part of the specified containerName.
For the Azure Digital Twins service it is a list of digital twin instance identifiers, for the Azure Blob storage it could be
a list of Blob names. For the relational database providers it is a list of table's primary keys.
Task<List<string>> GetInstanceIdsAsync(string containerName)
Parameters
containerNamestringThe name of the persistence container.
Returns
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 persistence object located
in the containerName container.
Task<T> GetPropertyAsync<T>(string containerName, string instanceId, string propertyName)
Parameters
containerNamestringName of the persistence container.
instanceIdstringPersistence 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 persistence 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 persistence 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.
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 persistence object located
in the containerName container.
T GetProperty<T>(string containerName, string instanceId, string propertyName)
Parameters
containerNamestringName of the persistence container.
instanceIdstringPersistence 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 persistence 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 persistence 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 persistence object,
given an instanceId and containerName.
Task UpdatePropertyAsync<T>(string containerName, string instanceId, string propertyName, T propertyValue)
Parameters
containerNamestringName of the persistence container.
instanceIdstringPersistence 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 persistence object,
given an instanceId and containerName.
void UpdateProperty<T>(string containerName, string instanceId, string propertyName, T propertyValue)
Parameters
containerNamestringName of the persistence container.
instanceIdstringPersistence 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 persistence 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
instanceIdstringPersistence 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 persistence 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
instanceIdstringPersistence object's instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Type Parameters
TType of the property.