Interface StateRepository<K,V>

Type Parameters:
K - Key type
V - Value type
All Superinterfaces:
AutoCloseable, Service

public interface StateRepository<K,V> extends Service
This StateRepository holds a set of key/value pairs for defining a particular state of a component. For instance it can be a set of indexes.

An IdempotentRepository behaves more or less like a Set whereas this StateRepository behaves like a Map.

  • Method Summary

    Modifier and Type
    Method
    Description
    getState(K key)
    Gets the state value for the given key.
    void
    setState(K key, V value)
    Sets the state value for the given key.

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop
  • Method Details

    • setState

      void setState(K key, V value)
      Sets the state value for the given key.
      Parameters:
      key - State key
      value - State value
    • getState

      V getState(K key)
      Gets the state value for the given key. It returns null if the key is unknown.
      Parameters:
      key - State key
      Returns:
      State value or null the key is unknown