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
containerName
stringThe name of the persistence container.
instanceId
stringPersistence object's instance Id.
Returns
- string
The JSON-formatted content of the object's object's
instanceId
that is located in the specifiedcontainerName
.
Exceptions
- ArgumentNullException
containerName
orinstanceId
is 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
containerName
stringThe name of the persistence container.
instanceId
stringPersistence object's instance Id.
Returns
- Task<string>
The JSON-formatted content of the object's object's
instanceId
that is located in the specifiedcontainerName
.
Exceptions
- ArgumentNullException
containerName
orinstanceId
is 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
containerName
stringThe name of the persistence container.
Returns
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 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
containerName
stringThe name of the persistence container.
Returns
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 persistence object located
in the containerName
container.
Task<T> GetPropertyAsync<T>(string containerName, string instanceId, string propertyName)
Parameters
containerName
stringName of the persistence container.
instanceId
stringPersistence object's instance Id.
propertyName
stringName 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 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
containerName
stringThe 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 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
containerName
stringThe 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 persistence object located
in the containerName
container.
T GetProperty<T>(string containerName, string instanceId, string propertyName)
Parameters
containerName
stringName of the persistence container.
instanceId
stringPersistence object's instance Id.
propertyName
stringName 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 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
T
Type 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
T
Type 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
containerName
stringName of the persistence container.
instanceId
stringPersistence object's instance Id.
propertyName
stringName of the property.
propertyValue
TProperty's new value.
Returns
Type Parameters
T
Type 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
containerName
stringName of the persistence container.
instanceId
stringPersistence object's instance Id.
propertyName
stringName of the property.
propertyValue
TProperty's new value.
Type Parameters
T
Type 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
instanceId
stringPersistence object's instance Id.
propertyName
stringName of the property.
propertyValue
TProperty's new value.
Returns
Type Parameters
T
Type 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
instanceId
stringPersistence object's instance Id.
propertyName
stringName of the property.
propertyValue
TProperty's new value.
Type Parameters
T
Type of the property.