Class RuntimeSpec

java.lang.Object
me.ahoo.cosid.runtime.RuntimeSpec

public final class RuntimeSpec extends Object
Everything a CosIdRuntime starts from (07-runtime-and-spring.md §1). Spring, the server, the migration tool and hand-written code all build one, with builder(String); toBuilder() changes one. Immutable; the builder is the only way to create one, so fields can be added with a default (api-freeze.md §4).
  • Field Details

  • Method Details

    • builder

      public static RuntimeSpec.Builder builder(String namespace)
      A builder of a spec without stores, machine slot or generators.
      Parameters:
      namespace - the namespace of the range keys and slot leases, not blank
      Returns:
      the builder
    • toBuilder

      public RuntimeSpec.Builder toBuilder()
      A builder holding this spec, to change it.
      Returns:
      the builder
    • namespace

      public String namespace()
      The namespace of the range keys and slot leases.
      Returns:
      the namespace
    • stores

      public Map<String,StoreSpec> stores()
      The stores by name.
      Returns:
      the stores, unmodifiable
    • machine

      public Optional<MachineSpec> machine()
      The machine slot; required when a time-based generator exists.
      Returns:
      the machine slot, empty for none
    • machines

      public Map<String,MachineSpec> machines()
      The named machines (D37), such as a slot in a namespace shared by several services: a time-based generator chooses one by name (GeneratorSpec.Snowflake.machine()); only the chosen ones start.
      Returns:
      the named machines, unmodifiable; default none
    • generators

      public Map<String,GeneratorSpec> generators()
      The generators by name; the one named "default" is the 4.x share.
      Returns:
      the generators, unmodifiable
    • 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