Class ClusterAdminClient

java.lang.Object
org.j7m.middleware.cluster.ClusterAdminClient
All Implemented Interfaces:
ClusterLifecycle

public final class ClusterAdminClient extends Object implements ClusterLifecycle
Authenticated administrative client. Operation identity and expected version remain unchanged on retries; IOException denotes unavailable or UNKNOWN completion and requires operationStatus.
  • Constructor Details

    • ClusterAdminClient

      public ClusterAdminClient(InetSocketAddress address, String cluster, String principal, byte[] key, SSLContext tls)
      Creates an authorized admin client.
      Parameters:
      address - explicit endpoint
      cluster - stable cluster identity
      principal - configured identity
      key - independent authentication key
      tls - mutual TLS context, mandatory outside loopback
  • Method Details

    • inspect

      public ClusterView inspect(Instant deadline) throws IOException
      Inspects actual authenticated hosts and durable workflow state.
      Specified by:
      inspect in interface ClusterLifecycle
      Parameters:
      deadline - absolute deadline
      Returns:
      immutable fleet view
      Throws:
      IOException - for unavailable authority
    • plan

      public DeploymentPlan plan(String id, long expected, String release, List<String> targets, Instant deadline) throws IOException
      Persists a checked deployment plan without replacing any application.
      Specified by:
      plan in interface ClusterLifecycle
      Parameters:
      id - stable planning identity
      expected - optimistic fleet generation
      release - trusted server catalog release
      targets - ordered hosting targets
      deadline - absolute deadline
      Returns:
      immutable plan
      Throws:
      IOException - conflict, incompatible release or unavailable authority
    • apply

      public OperationStatus apply(String id, long expected, String plan, Instant deadline) throws IOException
      Admits a rolling hosted-application upgrade; progress continues through its durable workflow.
      Specified by:
      apply in interface ClusterLifecycle
      Parameters:
      id - stable deployment identity
      expected - optimistic generation used by the plan
      plan - immutable plan identity
      deadline - absolute deadline
      Returns:
      persisted current operation status
      Throws:
      IOException - conflict, incompatible plan or unavailable authority
    • drain

      public OperationStatus drain(String id, long expected, String node, Instant deadline) throws IOException
      Stops new requests and waits for admitted invocations on one safe hosting target.
      Specified by:
      drain in interface ClusterLifecycle
      Parameters:
      id - stable drain identity
      expected - optimistic fleet generation
      node - hosting target
      deadline - absolute deadline
      Returns:
      durable drain status
      Throws:
      IOException - conflict, insufficient capacity or unavailable authority
    • rollback

      public OperationStatus rollback(String id, long expected, String release, List<String> targets, Instant deadline) throws IOException
      Plans and applies only a schema-compatible rollback release.
      Specified by:
      rollback in interface ClusterLifecycle
      Parameters:
      id - stable rollback identity
      expected - inspected fleet generation
      release - trusted retained release
      targets - ordered hosting targets
      deadline - absolute deadline
      Returns:
      persisted rollback status
      Throws:
      IOException - incompatible downgrade, conflict or unavailable authority
    • operationStatus

      public OperationStatus operationStatus(String id, Instant deadline) throws IOException
      Reads a durable operation including an earlier lost response.
      Specified by:
      operationStatus in interface ClusterLifecycle
      Parameters:
      id - admitted identity
      deadline - absolute deadline
      Returns:
      persisted status
      Throws:
      IOException - not found or unavailable authority
    • audit

      public List<AuditEvent> audit(String id, Instant deadline) throws IOException
      Reads retained hash-linked lifecycle events.
      Specified by:
      audit in interface ClusterLifecycle
      Parameters:
      id - workflow identity
      deadline - absolute deadline
      Returns:
      immutable audit sequence
      Throws:
      IOException - unavailable authority