Class PluginInitiationUtils.InboundHandlerEntry
- Enclosing class:
PluginInitiationUtils
Capability that must be enabled
before it runs (D-10), and with which side records that decision's verdict in the
RemoteActionLog (CR-01, 06-REVIEW.md).
Exposes exactly two static factories and no capability-free, verdict-recorder-free
construction path — this is the whole point of D-10: of(Capability, VerdictRecorder, BiConsumer) and resolved(Function, VerdictRecorder, BiConsumer) are the only ways
to build an entry, both take these arguments in fixed positions, and neither has a shorter
overload or a default.
Precisely stated (corrected per IN-01, 06-REVIEW.md — an earlier revision of this javadoc
overstated this): omitting either argument from a call site IS a genuine javac
compile error — there is no shorter overload to fall back to. Passing a null
capability, resolver, or PluginInitiationUtils.VerdictRecorder, however, compiles cleanly (a
reference-typed parameter accepts null at the language level) and is instead rejected
by an IllegalArgumentException thrown from of(com.ultikits.ultitools.entities.Capability, com.ultikits.ultitools.utils.PluginInitiationUtils.VerdictRecorder, java.util.function.BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject>)/resolved(java.util.function.Function<com.google.gson.JsonObject, com.ultikits.ultitools.entities.Capability>, com.ultikits.ultitools.utils.PluginInitiationUtils.VerdictRecorder, java.util.function.BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject>) the moment
PluginInitiationUtils.buildInboundHandlers() runs — at class-initialization time, before the server
finishes starting, not by the compiler. Together the two guarantees still mean a new message
type cannot silently ship ungated or with an undeclared verdict recorder — the argument slot
is mandatory (compile-time) and a null value fails immediately and loudly
(class-load-time) — but the null-rejection half is not literally a compile error.
of(Capability, VerdictRecorder, BiConsumer) covers the 23 entries whose capability is
fixed by the message type alone; resolved(Function, VerdictRecorder, BiConsumer) covers file_operation, the one entry whose capability depends on the
message's operation field rather than its type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Capabilityprivate final BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> private final Function<com.google.gson.JsonObject, Capability> private final PluginInitiationUtils.VerdictRecorder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInboundHandlerEntry(Capability capability, Function<com.google.gson.JsonObject, Capability> resolver, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler) -
Method Summary
Modifier and TypeMethodDescription(package private) BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> (package private) static PluginInitiationUtils.InboundHandlerEntryof(Capability capability, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler) An entry whose capability is a fixed constant.(package private) booleanWhether this entry's own handler already records itsRemoteActionLogverdict — seePluginInitiationUtils.VerdictRecorder.HANDLER.(package private) CapabilityresolveCapability(com.google.gson.JsonObject data) Resolves this entry's required capability against one message'sdata.(package private) static PluginInitiationUtils.InboundHandlerEntryresolved(Function<com.google.gson.JsonObject, Capability> resolver, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler) An entry whose capability depends on the inbound message's owndata— thefile_operationcase, whose true capability depends on theoperationfield (D-10's resolver case, D-09).
-
Field Details
-
capability
-
resolver
-
verdictRecorder
-
handler
-
-
Constructor Details
-
InboundHandlerEntry
private InboundHandlerEntry(Capability capability, Function<com.google.gson.JsonObject, Capability> resolver, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler)
-
-
Method Details
-
of
static PluginInitiationUtils.InboundHandlerEntry of(Capability capability, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler) An entry whose capability is a fixed constant.- Parameters:
capability- the required capability — useCapability.NONEfor protocol-level and echo messages that carry no operator-facing policyverdictRecorder- which side records the enabled-branch verdict — seePluginInitiationUtils.VerdictRecorderhandler- the handler to invoke once the gate clears- Returns:
- the entry
-
resolved
static PluginInitiationUtils.InboundHandlerEntry resolved(Function<com.google.gson.JsonObject, Capability> resolver, PluginInitiationUtils.VerdictRecorder verdictRecorder, BiConsumer<com.google.gson.JsonObject, com.google.gson.JsonObject> handler) An entry whose capability depends on the inbound message's owndata— thefile_operationcase, whose true capability depends on theoperationfield (D-10's resolver case, D-09).- Parameters:
resolver- a function from the message'sdatato theCapabilityit requiresverdictRecorder- which side records the enabled-branch verdict — seePluginInitiationUtils.VerdictRecorderhandler- the handler to invoke once the gate clears- Returns:
- the entry
-
resolveCapability
Resolves this entry's required capability against one message'sdata.- Parameters:
data- the message'sdataobject, possiblynull- Returns:
- the required
Capability
-
getHandler
BiConsumer<com.google.gson.JsonObject,com.google.gson.JsonObject> getHandler() -
recordsOwnVerdict
boolean recordsOwnVerdict()Whether this entry's own handler already records itsRemoteActionLogverdict — seePluginInitiationUtils.VerdictRecorder.HANDLER.- Returns:
trueif the handler records its own verdict, soPluginInitiationUtils.dispatchWithCapabilityGate(java.lang.String, com.google.gson.JsonObject, com.google.gson.JsonObject, com.ultikits.ultitools.utils.PluginInitiationUtils.InboundHandlerEntry)must not record a second, blanket entry
-