Class RemoteLockRouting
java.lang.Object
org.jenkins.plugins.lockableresources.remote.RemoteLockRouting
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class RemoteLockRouting
extends Object
Client-side routing helpers for
lock(): decides whether a step targets a remote server and to
which RemoteConnection, and derives the human-readable target.
- Peer mode -
lock(..., serverId: 'X')targets serverXexplicitly. - Delegated mode - a configured
forcedServerIdroutes every lock to that server (and overrides any DSLserverId, logging an INFO when they differ).
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdisplayTarget(LockStep step) Human-readable lock target (resource name /label:X/ step description) for logs and UI.static StringeffectiveServerId(LockStep step, LockableResourcesManager lrm, PrintStream logger) Resolves the server to target:forcedServerIdwins over the DSLserverId(delegated mode).static RemoteConnectionfindConnection(LockableResourcesManager lrm, String serverId) Looks up the configuredRemoteConnectionforserverId, or fails the build.static booleanisRemoteRequest(LockStep step, LockableResourcesManager lrm) A step is a remote request iff it names aserverIdor aforcedServerIdis configured.
-
Method Details
-
isRemoteRequest
A step is a remote request iff it names aserverIdor aforcedServerIdis configured. -
effectiveServerId
public static String effectiveServerId(LockStep step, LockableResourcesManager lrm, PrintStream logger) Resolves the server to target:forcedServerIdwins over the DSLserverId(delegated mode). -
findConnection
public static RemoteConnection findConnection(LockableResourcesManager lrm, String serverId) throws AbortException Looks up the configuredRemoteConnectionforserverId, or fails the build.- Throws:
AbortException
-
displayTarget
Human-readable lock target (resource name /label:X/ step description) for logs and UI.- Throws:
AbortException
-