Interface Store<ApiType>

Type Parameters:
ApiType - kubernetes api type
All Known Subinterfaces:
Indexer<ApiType>
All Known Implementing Classes:
Cache

public interface Store<ApiType>
Interface for implementations which stores objects.

The code has been copied from the official client and modified: Store

  • Method Details

    • getKeyFunction

      Function<ApiType,String> getKeyFunction()
      Returns a function which creates an object key.
      Returns:
      function which creates an object key
    • add

      void add(ApiType obj)
      Inserts an item into the store.
      Parameters:
      obj - specific obj
    • update

      void update(ApiType obj)
      Sets an item in the store to its updated state.
      Parameters:
      obj - specific obj
    • delete

      void delete(ApiType obj)
      Removes an item from the store.
      Parameters:
      obj - specific obj
    • replace

      void replace(List<ApiType> objects)
      Replace the content in the cache completely.
      Parameters:
      objects - list of kubernetes objects
    • listKeys

      List<String> listKeys()
      Returns a list of keys of all objects that are currently in the store.
      Returns:
      list of all keys
    • getByKey

      @Nullable ApiType getByKey(String key)
      Returns the request item with specific key.
      Parameters:
      key - specific key
      Returns:
      the request item
    • list

      List<ApiType> list()
      Returns a list of all the items.
      Returns:
      list of all the items