Class ClusterNodeClient
java.lang.Object
org.j7m.middleware.cluster.ClusterNodeClient
- All Implemented Interfaces:
ClusterNodeEndpoint, ManagedInvocation
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClusterNodeEndpoint
ClusterNodeEndpoint.Status -
Constructor Summary
ConstructorsConstructorDescriptionClusterNodeClient(InetSocketAddress address, String cluster, String principal, byte[] key, SSLContext tls) Creates a node client. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Invokes a configured service contract; callers cannot select classes or methods.byte[]invokeRevision(String release, String requestId, String contract, byte[] payload, Instant deadline) Invokes only when the admission gate still hosts the selected revision.Reads actual node state.step(String operation, String phase, String release, String owner, long fence, long epoch, Instant deadline) Executes one locally journaled fenced physical step, reconciling exact retries.
-
Constructor Details
-
ClusterNodeClient
public ClusterNodeClient(InetSocketAddress address, String cluster, String principal, byte[] key, SSLContext tls) Creates a node client.- Parameters:
address- explicit node endpointcluster- stable cluster identityprincipal- configured principalkey- principal-specific secret, at least 32 bytestls- mutual TLS context, mandatory outside loopback
-
-
Method Details
-
status
Reads actual node state.- Specified by:
statusin interfaceClusterNodeEndpoint- 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:
stepin interfaceClusterNodeEndpoint- Parameters:
operation- durable operation identityphase- DRAIN or REPLACErelease- server catalog identityowner- lease ownerfence- current fenceepoch- current leadership epochdeadline- 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:
invokein interfaceManagedInvocation- Parameters:
requestId- stable business request identitycontract- server-configured contract aliaspayload- bounded opaque application bytesdeadline- 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:
invokeRevisionin interfaceManagedInvocation- Parameters:
release- selected revisionrequestId- stable identitycontract- configured aliaspayload- application bytesdeadline- absolute deadline- Returns:
- application response
- Throws:
IOException- when revision pinning is unsupported or admission fails
-