Class CredentialRotationHandler

java.lang.Object
com.ultikits.ultitools.utils.CredentialRotationHandler
All Implemented Interfaces:
CloudRequestHandler

final class CredentialRotationHandler extends Object implements CloudRequestHandler
Persists a rotated server credential and only then acknowledges it.

The gateway delivers credential.rotate with a new ucs_ credential. Persisting first keeps the promise that a failed write leaves the old credential in place and produces no acknowledgement, so the gateway retries; a redelivery is persisted and acknowledged again. The current connection is not dropped (D-10). In production the persister is CloudSession.rotateCredential(java.lang.String, java.lang.String): the session that owns the connection is the one owner of the current credential, so the next handshake and /ulticloud logout use the rotated secret. The credential is never logged, and no diagnostic here carries it.

  • Field Details

  • Constructor Details

  • Method Details

    • handle

      public void handle(CloudRequest request, CloudChannel channel)
      Description copied from interface: CloudRequestHandler
      Validates the payload and handles it on the dispatching thread. No Bukkit main-thread scheduling is implied; handlers must schedule such work themselves. Synchronous payload validation failures become correlated invalid_message replies; other runtime failures become internal_error without exposing exception text. Asynchronous failures are the handler's responsibility.
      Specified by:
      handle in interface CloudRequestHandler
      Parameters:
      request - the parsed envelope with a defensively copied payload
      channel - the reply channel, which may close during processing