Interface IStateStore

All Known Implementing Classes:
MemoryStateStore, NullStateStore

public interface IStateStore
Interface for state storages that are used to store and retrieve transaction states.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    delete(String correlationId, String key)
    Deletes a state from the store by its key.
    <T> T
    load(String correlationId, String key)
    Loads state from the store using its key.
    <T> List<StateValue<T>>
    loadBulk(String correlationId, List<String> keys)
    Loads an array of states from the store using their keys.
    <T> T
    save(String correlationId, String key, T value)
    Saves state into the store.
  • Method Details

    • load

      <T> T load(String correlationId, String key)
      Loads state from the store using its key. If value is missing in the store it returns null.
      Type Parameters:
      T -
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      key - a unique state key.
      Returns:
      the state value or null if value wasn't found.
    • loadBulk

      <T> List<StateValue<T>> loadBulk(String correlationId, List<String> keys)
      Loads an array of states from the store using their keys.
      Type Parameters:
      T -
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      keys - unique state keys.
      Returns:
      an array with state values and their corresponding keys.
    • save

      <T> T save(String correlationId, String key, T value)
      Saves state into the store.
      Type Parameters:
      T -
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      key - a unique state key.
      value - a state value.
      Returns:
      The state that was stored in the store.
    • delete

      <T> T delete(String correlationId, String key)
      Deletes a state from the store by its key.
      Type Parameters:
      T -
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      key - a unique value key.
      Returns:
      deleted item.