@ParametersAreNullableByDefault public class Handle extends Object implements Serializable
Constructor and Description |
---|
Handle(RemoteBuildConfiguration remoteBuildConfiguration,
RemoteBuildInfo buildInfo,
String currentItem,
RemoteJenkinsServer effectiveRemoteServer,
net.sf.json.JSONObject remoteJobMetadata) |
Modifier and Type | Method and Description |
---|---|
RemoteBuildInfo |
getBuildInfo()
Gets the current build info of the remote job, containing build status and build result.
|
int |
getBuildNumber()
Get the build number of the remote build.
|
Result |
getBuildResult()
Gets the current build result of the remote job.
|
RemoteBuildStatus |
getBuildStatus()
Gets the current build status of the remote job.
|
URL |
getBuildUrl()
Get the build URL of the remote build.
|
String |
getConfiguredJobNameOrUrl() |
String |
getJobDisplayName() |
String |
getJobFullDisplayName() |
String |
getJobFullName() |
String |
getJobName() |
String |
getJobUrl() |
String |
getQueueId() |
static String |
help()
This method returns a all available methods.
|
boolean |
isFinished()
Check if the remote job build is finished.
|
boolean |
isQueued()
Check if the remote build is still queued (not building yet).
|
String |
lastLog()
This method returns the log entries which resulted from the last method call
to the Handle.
|
Object |
readJsonFileFromBuildArchive(String filename)
This method reads and parses a JSON file which has been archived by the last remote build.
|
void |
setBuildInfo(RemoteBuildInfo buildInfo) |
String |
toString() |
RemoteBuildStatus |
updateBuildStatus()
Updates the current build status of the remote job.
|
RemoteBuildStatus |
updateBuildStatusBlocking()
Updates the build status of the remote build until it is finished.
|
public Handle(@Nonnull RemoteBuildConfiguration remoteBuildConfiguration, @Nonnull RemoteBuildInfo buildInfo, @Nonnull String currentItem, @Nonnull RemoteJenkinsServer effectiveRemoteServer, @Nonnull net.sf.json.JSONObject remoteJobMetadata)
public boolean isQueued() throws IOException, InterruptedException
IOException
- if there is an error retrieving the remote build number.InterruptedException
- if any thread has interrupted the current thread.public boolean isFinished() throws IOException, InterruptedException
IOException
- if there is an error retrieving the remote build number, or,
if there is an error retrieving the remote build status, or,
if there is an error retrieving the console output of the remote build, or,
if the remote build does not succeed.InterruptedException
- if any thread has interrupted the current thread.public String getConfiguredJobNameOrUrl()
@CheckForNull public String getJobName()
@CheckForNull public String getJobFullName()
@CheckForNull public String getJobDisplayName()
@CheckForNull public String getJobFullDisplayName()
@CheckForNull public String getJobUrl()
@CheckForNull public String getQueueId()
@CheckForNull public URL getBuildUrl()
@Nonnull public int getBuildNumber()
@Nonnull public RemoteBuildInfo getBuildInfo()
RemoteBuildInfo
the build info@Nonnull public RemoteBuildStatus getBuildStatus()
RemoteBuildStatus
the build status@Nonnull public RemoteBuildStatus updateBuildStatus() throws IOException, InterruptedException
RemoteBuildStatus
the build statusIOException
- if there is an error retrieving the remote build number, or,
if there is an error retrieving the remote build status, or,
if there is an error retrieving the console output of the remote build, or,
if the remote build does not succeed.InterruptedException
- if any thread has interrupted the current thread.@Nonnull public RemoteBuildStatus updateBuildStatusBlocking() throws IOException, InterruptedException
RemoteBuildStatus
the build statusIOException
- if there is an error retrieving the remote build number, or,
if there is an error retrieving the remote build status, or,
if there is an error retrieving the console output of the remote build, or,
if the remote build does not succeed.InterruptedException
- if any thread has interrupted the current thread.public void setBuildInfo(RemoteBuildInfo buildInfo)
@Nonnull public Result getBuildResult()
Result
the build result@Nonnull public String lastLog()
public static String help()
public Object readJsonFileFromBuildArchive(String filename) throws IOException, InterruptedException
filename
- the filename or path to the remote JSON file relative to the last builds archive folderIOException
- if there is an error identifying the remote host, or
if there is an error setting the authorization header, or
if the request fails due to an unknown host, unauthorized credentials, or another reason.InterruptedException
- if any thread has interrupted the current thread.Copyright © 2016–2023. All rights reserved.