Interface PersistenceProvider
public interface PersistenceProvider
An interface that can be used for persisting/retrieving the state of real-time digital twins.
-
Method Summary
Modifier and TypeMethodDescriptiongetInstance(String containerName, String instanceId) Retrieves an instance or null if it doesn't exist.getInstanceAsync(String containerName, String instanceId) Retrieves a future that when complete will return an instance or null if it doesn't exist.getInstanceIds(String containerName) Retrieves the instance IDs stored in a container, or an empty list if no instances exist.getInstanceIdsAsync(String containerName) Retrieves a future that when complete will return the instance IDs stored in a container, or an empty list if no instances exist.<T> TgetProperty(String containerName, String instanceId, String propertyName, Class<T> clazz) Retrieves a property or null if the property does not exist.<T> CompletableFuture<T>getPropertyAsync(String containerName, String instanceId, String propertyName, Class<T> clazz) Retrieves a future that will return a property or null if the property does not exist.getPropertyMap(String containerName) Retrieves a map of property names to property types, or an empty map.getPropertyMapAsync(String containerName) Retrieves a future that will return a map of property names to property, or an empty map.Retrieves this persistence providers type.<T> TgetRtdtProperty(String instanceId, String propertyName, Class<T> clazz) Retrieves a property for a RTDT instance or null if the property does not exist.<T> CompletableFuture<T>getRtdtPropertyAsync(String instanceId, String propertyName, Class<T> clazz) Retrieves a future that will return a property value for a RTDT instance or null if the property doesn't exist.booleanisActive()Returns true if this PersistenceProvider is active, false otherwise.voidupdateProperty(String containerName, String instanceId, String propertyName, Object propertyValue) Updates a property for the provided instance id in the provided container specified by the property name and property value.updatePropertyAsync(String containerName, String instanceId, String propertyName, Object propertyValue) Retrieves a future that will complete exceptionally or return void if the instance's property was successfully updated.voidupdateRtdtProperty(String instanceId, String propertyName, Object propertyValue) Updates a RTDT property for the provided instance id specified by the property name and property value.updateRtdtPropertyAsync(String instanceId, String propertyName, Object propertyValue) Retrieves a future that will complete exceptionally or return void if the RTDT's property was successfully updated.
-
Method Details
-
isActive
boolean isActive()Returns true if this PersistenceProvider is active, false otherwise.- Returns:
- true if this PersistenceProvider is active, false otherwise.
-
getProviderType
PersistenceProviderType getProviderType()Retrieves this persistence providers type. Currently supported provider types: AzureDigitalTwins.- Returns:
- the persistence provider type.
-
getInstanceIdsAsync
Retrieves a future that when complete will return the instance IDs stored in a container, or an empty list if no instances exist.- Parameters:
containerName- the container name.- Returns:
- a future that will return a list of instances.
-
getInstanceIds
Retrieves the instance IDs stored in a container, or an empty list if no instances exist.- Parameters:
containerName- the container name.- Returns:
- a list of instances.
-
getInstanceAsync
Retrieves a future that when complete will return an instance or null if it doesn't exist.- Parameters:
containerName- the container name.instanceId- the instance identifier.- Returns:
- a future that will return an instance or null.
-
getInstance
Retrieves an instance or null if it doesn't exist.- Parameters:
containerName- the container nameinstanceId- the instance identifier- Returns:
- the instance or null.
-
getPropertyMapAsync
Retrieves a future that will return a map of property names to property, or an empty map.- Parameters:
containerName- the container name.- Returns:
- a future that will return a map of property names to property types.
-
getPropertyMap
Retrieves a map of property names to property types, or an empty map.- Parameters:
containerName- the container name.- Returns:
- a map of property names to property types.
-
updatePropertyAsync
CompletableFuture<Void> updatePropertyAsync(String containerName, String instanceId, String propertyName, Object propertyValue) Retrieves a future that will complete exceptionally or return void if the instance's property was successfully updated. Updates a property for the provided instance id in the provided container specified by the property name and property value.- Parameters:
containerName- the container name.instanceId- the instance id.propertyName- the property name.propertyValue- the property value.- Returns:
- a future that will complete exceptionally or return void.
-
updateProperty
void updateProperty(String containerName, String instanceId, String propertyName, Object propertyValue) Updates a property for the provided instance id in the provided container specified by the property name and property value.- Parameters:
containerName- the container name.instanceId- the instance id.propertyName- the property name.propertyValue- the property value.
-
getPropertyAsync
<T> CompletableFuture<T> getPropertyAsync(String containerName, String instanceId, String propertyName, Class<T> clazz) Retrieves a future that will return a property or null if the property does not exist.- Type Parameters:
T- the type of the property to return- Parameters:
containerName- the container name.instanceId- the instance id.propertyName- the property name.clazz- the class representing the property.- Returns:
- the property or null if the property does not exist.
-
getProperty
Retrieves a property or null if the property does not exist.- Type Parameters:
T- the type of the property to return.- Parameters:
containerName- the container name.instanceId- the instance id.propertyName- the property nameclazz- the class representing the property.- Returns:
- the property or null if the property does not exist.
-
updateRtdtPropertyAsync
CompletableFuture<Void> updateRtdtPropertyAsync(String instanceId, String propertyName, Object propertyValue) Retrieves a future that will complete exceptionally or return void if the RTDT's property was successfully updated. Updates a RTDT property for the provided instance id specified by the property name and property value.- Parameters:
instanceId- the instance id.propertyName- the property name.propertyValue- the property value.- Returns:
- a future that will complete exceptionally or return void.
-
updateRtdtProperty
Updates a RTDT property for the provided instance id specified by the property name and property value.- Parameters:
instanceId- the instance id.propertyName- the property name.propertyValue- the property value.
-
getRtdtPropertyAsync
<T> CompletableFuture<T> getRtdtPropertyAsync(String instanceId, String propertyName, Class<T> clazz) Retrieves a future that will return a property value for a RTDT instance or null if the property doesn't exist.- Type Parameters:
T- the type of the property to return.- Parameters:
instanceId- the instance id.propertyName- the property name.clazz- the class of the property type- Returns:
- a future that will return a property value for a RTDT instance.
-
getRtdtProperty
Retrieves a property for a RTDT instance or null if the property does not exist.- Type Parameters:
T- the type of the property to return.- Parameters:
instanceId- the instance id.propertyName- the property name.clazz- the class of the property type.- Returns:
- the property value.
-