Class RemoteApiClient
java.lang.Object
org.jenkins.plugins.lockableresources.remote.RemoteApiClient
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class RemoteApiClient
extends Object
Thin HTTP client for the remote lock API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenqueueAcquire(RemoteConnection remote, String authorizationHeader, RemoteLockRequest lockRequest, int heartbeatIntervalSeconds, String clientId) POST /acquire and return accepted lockId.getAcquireStatus(RemoteConnection remote, String authorizationHeader, String lockId) GET /acquire/{requestId}.voidheartbeatLease(RemoteConnection remote, String authorizationHeader, String lockId) POST /lease/{lockId}/heartbeat.voidreleaseLease(RemoteConnection remote, String authorizationHeader, String lockId) POST /lease/{lockId}/release.
-
Constructor Details
-
RemoteApiClient
public RemoteApiClient() -
RemoteApiClient
-
-
Method Details
-
enqueueAcquire
@NonNull public String enqueueAcquire(@NonNull RemoteConnection remote, @NonNull String authorizationHeader, @NonNull RemoteLockRequest lockRequest, int heartbeatIntervalSeconds, @CheckForNull String clientId) throws RemoteApiException POST /acquire and return accepted lockId.- Throws:
RemoteApiException
-
getAcquireStatus
@NonNull public RemoteAcquireStatus getAcquireStatus(@NonNull RemoteConnection remote, @NonNull String authorizationHeader, @NonNull String lockId) throws RemoteApiException GET /acquire/{requestId}.- Throws:
RemoteApiException
-
heartbeatLease
public void heartbeatLease(@NonNull RemoteConnection remote, @NonNull String authorizationHeader, @NonNull String lockId) throws RemoteApiException POST /lease/{lockId}/heartbeat.- Throws:
RemoteApiException
-
releaseLease
public void releaseLease(@NonNull RemoteConnection remote, @NonNull String authorizationHeader, @NonNull String lockId) throws RemoteApiException POST /lease/{lockId}/release.- Throws:
RemoteApiException
-