Class AgentCapabilities

java.lang.Object
com.ultikits.ultitools.utils.AgentCapabilities

final class AgentCapabilities extends Object
The operator's switches as UltiCloud protocol capabilities (plan 22-21, S-65, S-66).

Mapping. MONITORING → telemetry; LOGS → logs; PLAYER_EVENTS → events:players, events:commands; ultipanel.logging.error-reporting.enabled → errors; COMMANDS → commands; PLAYER_ACTIONS → players:actions; FILE_READ → files:read, config:read; FILE_WRITE → files:write, config:write; FILE_DELETE → files:delete; SERVER_PROPERTIES → properties:read, properties:write. power is always declared, so the panel can show "turned off by the operator" from settings.powerActionsEnabled while the handler refuses with power_disabled; link is always declared, because a player link carries no action that is dangerous to the server. backups is never declared. Module names modules:<id>@<X.Y.Z> follow, sorted, and the whole list never exceeds MAX_NAMES.

Per request (S-66). The hello list changes only on the next connection, so enabled(String) reads the switch again for every request; a switch turned off after the handshake refuses the request with capability_not_accepted and refusal(String) names its configuration key. Whether the gateway accepted the capability at the handshake is checked separately, by the router's gate in AgentProtocol.

Availability (22-22 fix). A switched-on name whose feature cannot run on this server (the telemetry of a server without a monitor) is neither declared nor admitted per request; its refusal says it is not available instead of naming a switch that is already on. The hello and the router therefore read one predicate.

  • Field Details

  • Constructor Details

  • Method Details

    • helloCapabilities

      List<String> helloCapabilities()
      Returns:
      the names the next hello declares, framework names first in the order of the mapping, then module names sorted; at most MAX_NAMES
    • switchFor

      static Capability switchFor(String contractCapability)
      Parameters:
      contractCapability - a contract capability name
      Returns:
      the operator switch that decides it, or null when no Capability switch does (the error-report key, power, link, module names, an unknown name)
    • enabled

      boolean enabled(String contractCapability)
      Parameters:
      contractCapability - a contract capability name, or the module sentinel
      Returns:
      whether the operator allows it now: its switch for a mapped name; always for power (its handler applies the switch), link, module names and the module sentinel; never for backups or an unknown name
    • refusal

      String refusal(String contractCapability)
      Parameters:
      contractCapability - a refused contract capability name
      Returns:
      the refusal sentence naming the switch's configuration key, or a fixed sentence for a name no switch decides