Class ClusterNodeClient

java.lang.Object
org.j7m.middleware.cluster.ClusterNodeClient
All Implemented Interfaces:
ClusterNodeEndpoint, ManagedInvocation

public final class ClusterNodeClient extends Object implements ClusterNodeEndpoint
Authenticated bounded TCP node client. TLS is mandatory outside loopback; request and response authentication bind cluster identity and fresh nonce. Deadlines may leave UNKNOWN effects.
  • Constructor Details

    • ClusterNodeClient

      public ClusterNodeClient(InetSocketAddress address, String cluster, String principal, byte[] key, SSLContext tls)
      Creates a node client.
      Parameters:
      address - explicit node endpoint
      cluster - stable cluster identity
      principal - configured principal
      key - principal-specific secret, at least 32 bytes
      tls - mutual TLS context, mandatory outside loopback
  • Method Details

    • status

      public ClusterNodeEndpoint.Status status(Instant deadline) throws IOException
      Reads actual node state.
      Specified by:
      status in interface ClusterNodeEndpoint
      Parameters:
      deadline - absolute deadline
      Returns:
      local hosting and fresh consensus status
      Throws:
      IOException - unavailable
    • step

      public NodeView step(String operation, String phase, String release, String owner, long fence, long epoch, Instant deadline) throws IOException
      Executes one locally journaled fenced physical step, reconciling exact retries.
      Specified by:
      step in interface ClusterNodeEndpoint
      Parameters:
      operation - durable operation identity
      phase - DRAIN or REPLACE
      release - server catalog identity
      owner - lease owner
      fence - current fence
      epoch - current leadership epoch
      deadline - absolute deadline
      Returns:
      actual post-effect hosting view
      Throws:
      IOException - stale authority or uncertain completion
    • invoke

      public byte[] invoke(String requestId, String contract, byte[] payload, Instant deadline) throws IOException
      Invokes a configured service contract; callers cannot select classes or methods.
      Specified by:
      invoke in interface ManagedInvocation
      Parameters:
      requestId - stable business request identity
      contract - server-configured contract alias
      payload - bounded opaque application bytes
      deadline - absolute deadline
      Returns:
      independent application result bytes
      Throws:
      IOException - unavailable, drained or unknown completion
    • invokeRevision

      public byte[] invokeRevision(String release, String requestId, String contract, byte[] payload, Instant deadline) throws IOException
      Invokes only when the admission gate still hosts the selected revision.
      Specified by:
      invokeRevision in interface ManagedInvocation
      Parameters:
      release - selected revision
      requestId - stable identity
      contract - configured alias
      payload - application bytes
      deadline - absolute deadline
      Returns:
      application response
      Throws:
      IOException - when revision pinning is unsupported or admission fails