Class ClusterServer

java.lang.Object
org.j7m.middleware.cluster.ClusterServer
All Implemented Interfaces:
AutoCloseable

public final class ClusterServer extends Object implements AutoCloseable
Bounded authenticated TCP management endpoint. Per-principal permissions are checked before dispatch; all fields and trailing bytes are validated before an action. Only loopback development may omit mutual TLS. Nonces have bounded admission and a 30-second maximum lifetime.
  • Constructor Details

    • ClusterServer

      public ClusterServer(InetSocketAddress address, String cluster, Map<String, ClusterServer.Principal> principals, ClusterLifecycle lifecycle, ClusterNodeEndpoint node, SSLContext tls) throws IOException
      Starts an endpoint with explicitly selected capabilities.
      Parameters:
      address - bound address, port zero allowed
      cluster - stable application cluster identity
      principals - immutable authentication/permission catalog
      lifecycle - controller capability or null for a hosting-only node
      node - node capability or null for an admin-only endpoint
      tls - mutual TLS context, mandatory outside loopback
      Throws:
      IOException - bind failure
    • ClusterServer

      public ClusterServer(InetSocketAddress address, String cluster, Map<String, ClusterServer.Principal> principals, ClusterLifecycle lifecycle, ClusterNodeEndpoint node, SSLContext tls, int maximumNonces) throws IOException
      Starts an endpoint with an explicit bounded anti-replay admission capacity.
      Parameters:
      address - bound address
      cluster - stable cluster identity
      principals - exact principal capabilities
      lifecycle - optional controller
      node - optional node
      tls - mutual TLS context outside loopback
      maximumNonces - retained authenticated nonce capacity, 1..65536
      Throws:
      IOException - bind failure
  • Method Details

    • address

      public InetSocketAddress address()
      Bound endpoint address.
      Returns:
      actual listener
    • rejectedRequests

      public long rejectedRequests()
      Rejected authentication, overload or malformed request count.
      Returns:
      monotonic low-cardinality diagnostic counter
    • nonceCapacityRejections

      public long nonceCapacityRejections()
      Authenticated requests rejected because retained nonce capacity is exhausted.
      Returns:
      monotonic overload counter
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException