Class StoreConfig

java.lang.Object
me.ahoo.cosid.store.StoreConfig

public final class StoreConfig extends Object
What a StoreProvider opens a store with (06-stores.md §1). Immutable; built with builder(String, String), the only way to create one, so fields can be added with a default (api-freeze.md §4).
  • Field Details

    • DEFAULT_TIMEOUT

      public static final Duration DEFAULT_TIMEOUT
      The default operation timeout: 2s.
  • Method Details

    • builder

      public static StoreConfig.Builder builder(String name, String type)
      A builder of a store config.
      Parameters:
      name - the store name in the runtime spec
      type - the store type
      Returns:
      the builder
    • name

      public String name()
      The store name in the runtime spec.
      Returns:
      the name
    • type

      public String type()
      The store type.
      Returns:
      the type
    • timeout

      public Duration timeout()
      The operation timeout, enforced by the backend's own mechanism.
      Returns:
      the timeout, positive; default DEFAULT_TIMEOUT
    • options

      public Map<String,Object> options()
      The backend options, such as initSchema.
      Returns:
      the options, unmodifiable; default none
    • client

      public Optional<Object> client()
      An existing connection object (DataSource, a Lettuce connection, MongoClient, CuratorFramework).
      Returns:
      the client; when empty (the default) the provider creates its own from the options and closes it
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object