Class RemoteClientRegistry

java.lang.Object
org.jenkins.plugins.lockableresources.remote.RemoteClientRegistry

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public class RemoteClientRegistry extends Object
What this controller currently holds or waits for on other controllers.

The client side of a remote lock lives in a RemoteLockSession per lock() step, which is enough to run the step but leaves nobody able to answer "what is this controller doing remotely right now?" - the question the lockable resources page exists to answer for local resources. This registry is that answer: the client-side counterpart of the server-side RemoteLockManager.

It is deliberately not persisted. A remote lock does not survive a restart of this controller (the session either resumes polling or fails closed), so a stale entry read from disk could only ever be wrong; RemoteLockSession.onResume re-registers what genuinely survived.

  • Constructor Details

    • RemoteClientRegistry

      public RemoteClientRegistry()
  • Method Details

    • get

      public static RemoteClientRegistry get()
    • queued

      public void queued(@NonNull String lockId, @NonNull String serverId, @NonNull String request, @CheckForNull Run<?,?> build)
      Records a request that has been accepted by the remote and is waiting for its resources.
    • acquired

      public void acquired(@NonNull String lockId, @CheckForNull List<String> resourceNames)
      Promotes a waiting entry to held, naming the resources the remote handed over.
    • forget

      public void forget(@CheckForNull String lockId)
      Forgets an entry once the lock is released, skipped or failed.
    • getAll

      @NonNull public List<RemoteClientRegistry.Entry> getAll()
      Everything this controller holds or waits for, held entries first, then oldest first.
    • forServer

      @NonNull public Collection<RemoteClientRegistry.Entry> forServer(@NonNull String serverId)
    • isEmpty

      public boolean isEmpty()