ActorStateManager Interface
public interface ActorStateManager
Represents the interface that state manager for Actor implements.
Method Summary
Modifier and Type | Method and Description |
---|---|
<T> CompletableFuture<T> |
addOrUpdateStateAsync(String stateName, T addValue, BiFunction<String, T, T> updateValueFactory)
Adds an actor state with given state name, if it does not already exist or updates specified state name and value, if it does not exist. |
<T> CompletableFuture<T> |
addOrUpdateStateAsync(String stateName, T addValue, BiFunction<String, T, T> updateValueFactory, CancellationToken cancellationToken)
Adds an actor state with given state name, if it does not already exist or updates specified state name and value, if it does not exist. |
<T> CompletableFuture<?> |
addStateAsync(String stateName, T value)
Adds an actor state with given state name. |
<T> CompletableFuture<?> |
addStateAsync(String stateName, T value, CancellationToken cancellationToken)
Adds an actor state with given state name. |
CompletableFuture<?> |
clearCacheAsync()
Clears all the cached actor states and any operation(s) performed on ActorStateManager since last state save operation.
Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation. |
CompletableFuture<?> |
clearCacheAsync(CancellationToken cancellationToken)
Clears all the cached actor states and any operation(s) performed on ActorStateManager since last state save operation.
Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation. |
CompletableFuture<Boolean> |
containsStateAsync(String stateName)
Checks if an actor state with specified name exists. |
CompletableFuture<Boolean> |
containsStateAsync(String stateName, CancellationToken cancellationToken)
Checks if an actor state with specified name exists. |
<T> CompletableFuture<T> |
getOrAddStateAsync(String stateName, T value)
Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists. |
<T> CompletableFuture<T> |
getOrAddStateAsync(String stateName, T value, CancellationToken cancellationToken)
Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists. |
<T> CompletableFuture<T> |
getStateAsync(String stateName)
Gets an actor state with specified state name. |
<T> CompletableFuture<T> |
getStateAsync(String stateName, CancellationToken cancellationToken)
Gets an actor state with specified state name. |
CompletableFuture<List<String>> |
getStateNamesAsync()
Creates an List of all actor state names for current actor. |
CompletableFuture<List<String>> |
getStateNamesAsync(CancellationToken cancellationToken)
Creates an List of all actor state names for current actor. |
CompletableFuture<?> |
removeStateAsync(String stateName)
Removes an actor state with given state name to specified value. |
CompletableFuture<?> |
removeStateAsync(String stateName, CancellationToken cancellationToken)
Removes an actor state with given state name to specified value. |
CompletableFuture<?> |
saveStateAsync()
Saves all the cached state changes (add/update/remove) that were made since last call to saveStateAsync(CancellationToken cancellationToken) by actor runtime or by user explicitly. |
CompletableFuture<?> |
saveStateAsync(CancellationToken cancellationToken)
Saves all the cached state changes (add/update/remove) that were made since last call to saveStateAsync(CancellationToken cancellationToken) by actor runtime or by user explicitly. |
<T> CompletableFuture<?> |
setStateAsync(String stateName, T value)
Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added. |
<T> CompletableFuture<?> |
setStateAsync(String stateName, T value, CancellationToken cancellationToken)
Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added. |
<T> CompletableFuture<Boolean> |
tryAddStateAsync(String stateName, T value)
Attempts to add an actor state with given state name. |
<T> CompletableFuture<Boolean> |
tryAddStateAsync(String stateName, T value, CancellationToken cancellationToken)
Attempts to add an actor state with given state name. |
<T> CompletableFuture<Conditional |
tryGetStateAsync(String stateName)
Attempts to get an actor state with specified state name. |
<T> CompletableFuture<Conditional |
tryGetStateAsync(String stateName, CancellationToken cancellationToken)
Attempts to get an actor state with specified state name. |
CompletableFuture<Boolean> |
tryRemoveStateAsync(String stateName)
Attempts to remove an actor state with specified state name. |
CompletableFuture<Boolean> |
tryRemoveStateAsync(String stateName, CancellationToken cancellationToken)
Attempts to remove an actor state with specified state name. |
Method Details
addOrUpdateStateAsync
public
Adds an actor state with given state name, if it does not already exist or updates specified state name and value, if it does not exist.
Parameters:
Returns:
addOrUpdateStateAsync
public
Adds an actor state with given state name, if it does not already exist or updates specified state name and value, if it does not exist.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
addStateAsync
public
Adds an actor state with given state name.
Parameters:
Returns:
addStateAsync
public
Adds an actor state with given state name.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
clearCacheAsync
public CompletableFuture clearCacheAsync()
Clears all the cached actor states and any operation(s) performed on ActorStateManager since last state save operation.
Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation.
Returns:
clearCacheAsync
public CompletableFuture clearCacheAsync(CancellationToken cancellationToken)
Clears all the cached actor states and any operation(s) performed on ActorStateManager since last state save operation.
Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
containsStateAsync
public CompletableFuture
Checks if an actor state with specified name exists.
Parameters:
Returns:
containsStateAsync
public CompletableFuture
Checks if an actor state with specified name exists.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
getOrAddStateAsync
public
Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists.
Parameters:
Returns:
getOrAddStateAsync
public
Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
getStateAsync
public
Gets an actor state with specified state name.
Parameters:
Returns:
getStateAsync
public
Gets an actor state with specified state name.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
getStateNamesAsync
public CompletableFuture> getStateNamesAsync()
Creates an List of all actor state names for current actor.
Returns:
getStateNamesAsync
public CompletableFuture> getStateNamesAsync(CancellationToken cancellationToken)
Creates an List of all actor state names for current actor.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
removeStateAsync
public CompletableFuture removeStateAsync(String stateName)
Removes an actor state with given state name to specified value.
Parameters:
Returns:
removeStateAsync
public CompletableFuture removeStateAsync(String stateName, CancellationToken cancellationToken)
Removes an actor state with given state name to specified value.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
saveStateAsync
public CompletableFuture saveStateAsync()
Saves all the cached state changes (add/update/remove) that were made since last call to saveStateAsync(CancellationToken cancellationToken) by actor runtime or by user explicitly.
Returns:
saveStateAsync
public CompletableFuture saveStateAsync(CancellationToken cancellationToken)
Saves all the cached state changes (add/update/remove) that were made since last call to saveStateAsync(CancellationToken cancellationToken) by actor runtime or by user explicitly.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
setStateAsync
public
Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added.
Parameters:
Returns:
setStateAsync
public
Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
tryAddStateAsync
public
Attempts to add an actor state with given state name.
Parameters:
Returns:
tryAddStateAsync
public
Attempts to add an actor state with given state name.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
tryGetStateAsync
public
Attempts to get an actor state with specified state name.
Parameters:
Returns:
tryGetStateAsync
public
Attempts to get an actor state with specified state name.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
tryRemoveStateAsync
public CompletableFuture
Attempts to remove an actor state with specified state name.
Parameters:
Returns:
tryRemoveStateAsync
public CompletableFuture
Attempts to remove an actor state with specified state name.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
Applies to
Azure SDK for Java