Class ClusterServer
java.lang.Object
org.j7m.middleware.cluster.ClusterServer
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPrincipal authorization policy. -
Constructor Summary
ConstructorsConstructorDescriptionClusterServer(InetSocketAddress address, String cluster, Map<String, ClusterServer.Principal> principals, ClusterLifecycle lifecycle, ClusterNodeEndpoint node, SSLContext tls) Starts an endpoint with explicitly selected capabilities.ClusterServer(InetSocketAddress address, String cluster, Map<String, ClusterServer.Principal> principals, ClusterLifecycle lifecycle, ClusterNodeEndpoint node, SSLContext tls, int maximumNonces) Starts an endpoint with an explicit bounded anti-replay admission capacity. -
Method Summary
-
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 allowedcluster- stable application cluster identityprincipals- immutable authentication/permission cataloglifecycle- controller capability or null for a hosting-only nodenode- node capability or null for an admin-only endpointtls- 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 addresscluster- stable cluster identityprincipals- exact principal capabilitieslifecycle- optional controllernode- optional nodetls- mutual TLS context outside loopbackmaximumNonces- retained authenticated nonce capacity, 1..65536- Throws:
IOException- bind failure
-
-
Method Details
-
address
-
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
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-