Class ManagedPartitionClient
java.lang.Object
org.j7m.middleware.application.distributed.ManagedPartitionClient
Typed quorum client for a trusted portable reducer program and fixed authenticated scope.
A locality preference gets at most100ms and one quarter of the remaining budget before same-group
fallback; it never extends the original deadline.
Stable request identity and business bytes survive topology refresh; receipt epochs describe
historical commits and never grant current write authority. IOException leaves an UNKNOWN outcome.
This facade is thread-safe with thread-safe borrowed routing/endpoints/codec; it owns no threads.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAuthorized endpoint alternatives within ONE native group; hints cannot change group authority.static interfaceTrusted current topology read; no application metadata supplies routing authority. -
Constructor Summary
ConstructorsConstructorDescriptionManagedPartitionClient(ManagedPartitionClient.Routes routes, Map<String, ManagedPartitionClient.Group> groups, org.j7m.middleware.application.api.ManagedPartitionDefinition<?> program, String fingerprint, String scope, org.j7m.middleware.codec.api.ValueCodec codec, org.j7m.middleware.codec.api.SchemaRegistry schemas) Creates a typed facade over finite authenticated routing and endpoint capabilities. -
Method Summary
Modifier and TypeMethodDescriptionCommits using the actual declared scalar or numeric schema-field shard selector.Commits on an explicit stable key; a declared selector must still match the command itself.<V> VReads a view while checking the caller's requested Java type against the actual program.Reads a concrete view under fresh topology and quorum ownership barriers.routingKey(Object command) Extracts a stable canonical routing key through the actual declared scalar/schema selector.
-
Constructor Details
-
ManagedPartitionClient
public ManagedPartitionClient(ManagedPartitionClient.Routes routes, Map<String, ManagedPartitionClient.Group> groups, org.j7m.middleware.application.api.ManagedPartitionDefinition<?> program, String fingerprint, String scope, org.j7m.middleware.codec.api.ValueCodec codec, org.j7m.middleware.codec.api.SchemaRegistry schemas) Creates a typed facade over finite authenticated routing and endpoint capabilities.- Parameters:
routes- trusted fresh topology source, normally an existing PartitionRoutergroups- authorized native group identities and same-group locality preferences,1..256program- validated generated POJO program metadatafingerprint- locally verified portable program fingerprint, not a caller assertionscope- fixed server-authorized resource scopecodec- borrowed explicit effect-free value codecschemas- explicit matching A01 data allowlist- Throws:
IllegalArgumentException- for invalid types, routing declarations or inventory bounds
-
-
Method Details
-
routingKey
Extracts a stable canonical routing key through the actual declared scalar/schema selector. Use the same key for related reads; it is routing data and grants no ownership authority.- Parameters:
command- concrete command or a data-only key template of the same schema- Returns:
- lowercase64-character key independent of non-key command fields
- Throws:
IllegalArgumentException- for invalid key dataIllegalStateException- when the program does not declare a shard selector
-
execute
public ManagedPartitionResource.Receipt execute(String request, Object command, Instant deadline) throws IOException Commits using the actual declared scalar or numeric schema-field shard selector.- Parameters:
request- stable bounded business identity, unchanged on retriescommand- bounded concrete command datadeadline- original absolute deadline, never extended by topology refresh- Returns:
- first durable receipt or explicit uncommitted OVERLOADED receipt
- Throws:
IOException- for unavailable quorum, cancellation or UNKNOWN outcomeIllegalArgumentException- if no valid shard selector is declared or input conflicts
-
execute
public ManagedPartitionResource.Receipt execute(String request, String key, Object command, Instant deadline) throws IOException Commits on an explicit stable key; a declared selector must still match the command itself.- Parameters:
request- stable bounded business identitykey- explicit routing key, at most128 characterscommand- bounded concrete command datadeadline- original absolute deadline- Returns:
- durable first-commit or uncommitted overload receipt
- Throws:
IOException- for unavailable quorum, cancellation or UNKNOWN outcomeIllegalArgumentException- for mismatched shard or conflicting business input
-
query
Reads a concrete view under fresh topology and quorum ownership barriers.- Parameters:
key- stable application routing keyquery- bounded concrete query datadeadline- original absolute deadline- Returns:
- independent decoded view
- Throws:
IOException- for unavailable quorum or cancellationIllegalArgumentException- for invalid schema or routing input
-
query
public <V> V query(String key, Object query, Class<V> expectedType, Instant deadline) throws IOException Reads a view while checking the caller's requested Java type against the actual program.- Type Parameters:
V- expected concrete view type- Parameters:
key- stable routing keyquery- concrete query dataexpectedType- exact declared view type, including its primitive/boxed equivalentdeadline- original absolute deadline- Returns:
- concrete independent decoded view
- Throws:
IllegalArgumentException- before RPC if the requested view type differsIOException- for unavailable quorum, cancellation or UNKNOWN outcome
-