Class ServerPropertiesManager.SetAllResult

java.lang.Object
com.ultikits.ultitools.manager.ServerPropertiesManager.SetAllResult
Enclosing class:
ServerPropertiesManager

@Internal public static final class ServerPropertiesManager.SetAllResult extends Object
Outcome of one set_all batch.

isSuccess() means every key the caller asked for is now on disk, which is the batch analogue of what action: "set" already reports for a single key. Keys carrying an explicit JSON null are not part of that promise — a null reads as "leave this one alone", so it is recorded in getSkipped() for visibility but never fails the batch.

  • Field Details

  • Constructor Details

    • SetAllResult

      public SetAllResult(List<String> updated, List<String> rejected, List<String> failed, List<String> skipped, List<String> malformed, List<String> notPresentOnServer)
      Public so callers outside this package can build one. Each list is copied before being wrapped — unmodifiableList is a view, so wrapping the caller's list directly would leave this "immutable" object mutable through the original reference.
      Parameters:
      notPresentOnServer - keys allowlisted but absent from THIS server's own server.properties (D-15) — Gate-2 finding: kept distinct from failed so the response can say "this key is not in this server's server.properties" rather than making it indistinguishable from a genuine read/write I/O error, matching what a single-key action: "set" already reports via ServerPropertiesManager.describeOutcome(WriteOutcome).
    • SetAllResult

      public SetAllResult(List<String> updated, List<String> rejected, List<String> failed, List<String> skipped, List<String> malformed, List<String> notPresentOnServer, Map<String,String> failureReasons)
      As the six-list constructor, with the reason a failed key was refused (UltiKits/UltiTools-Reborn#607: a key defined on more than one line, or over continuation lines, is not written). Reasons never carry a value.
      Parameters:
      failureReasons - failed key to the reason it was refused; keys without a reason failed on I/O
      Since:
      6.3.0
  • Method Details

    • getUpdated

      public List<String> getUpdated()
      Keys written to disk.
    • getRejected

      public List<String> getRejected()
      Keys refused because they are not on the whitelist.
    • getFailed

      public List<String> getFailed()
      Whitelisted keys whose write failed.
    • getFailureReasons

      public Map<String,String> getFailureReasons()
      Why a failed key was refused, for the keys that were refused rather than failing on I/O.
      Returns:
      failed key to reason (never a value)
      Since:
      6.3.0
    • getSkipped

      public List<String> getSkipped()
      Keys whose value was an explicit JSON null.
    • getMalformed

      public List<String> getMalformed()
      Keys whose value was not a JSON primitive.
    • getNotPresentOnServer

      public List<String> getNotPresentOnServer()
      Keys on ServerPropertiesManager.SAFE_KEYS but absent from THIS server's own server.properties (D-15). Distinct from getFailed() — writing one of these was never attempted; it is a version mismatch, not an I/O failure.
    • isSuccess

      public boolean isSuccess()
      Every requested key was written.
    • describeFailure

      public String describeFailure()
      One line naming what went wrong, for a log record or an error response. Returns null when nothing went wrong.

      The categories stay separate because they need different actions: a rejected key means stop asking for it, a failed key means look at the disk, a malformed key means fix the payload, and a not-present-on-server key means this Paper version does not have it. Collapsing them into one label would send the reader looking in the wrong place — which is the failure mode this whole change exists to remove.

    • describeUnreportedFailure

      String describeUnreportedFailure()
      As describeFailure(), but without the failed keys that carry a refusal reason: the manager has already logged each of those once, with its reason, when it refused the key (17-66 review R66-I1), so the batch summary line names only what nothing else has reported. Returns null when nothing is left.
    • describe

      private String describe(boolean includeRefusedWithReason)