Package io.jenkins.plugins.servicenow
Class ProgressBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- io.jenkins.plugins.servicenow.ProgressBuilder
-
- All Implemented Interfaces:
ExtensionPoint,Describable<Builder>,BuildStep,SimpleBuildStep
- Direct Known Subclasses:
ActivatePluginBuilder,ApplyChangesBuilder,BatchInstallBuilder,BatchRollbackBuilder,InstallAppBuilder,InstanceScanBuilder,PublishAppBuilder,RollbackAppBuilder,RollbackPluginBuilder,RunTestSuiteWithResultsBuilder
public abstract class ProgressBuilder extends Builder implements SimpleBuildStep
Base class of other build step classes checking a progress of the CI/CD function associated with a passed-in progress ID. See API documentation: https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/cicd-api#cicd-GET-progress?navFilter=sn_cicd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected FilePathworkspace-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description ProgressBuilder(String credentialsId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringbuildErrorDetailFromFailedResponse(Result serviceNowResult)protected ResultcheckProgress(PrintStream logger, int progressCheckInterval)StringgetApiVersion()RunFactorygetClientFactory()StringgetCredentialsId()net.sf.json.JSONObjectgetGlobalSNParams()ServiceNowAPIClientgetRestClient()StringgetUrl()protected ObjectgetValue(Result result, String name)Get value from additional response attribute that was strictly not implemented by current structure of the response object.voidperform(Run<?,?> run, FilePath filePath, Launcher launcher, TaskListener taskListener)protected abstract booleanperform(Run<?,?> run, TaskListener taskListener, Integer progressCheckInterval)voidsetApiVersion(String apiVersion)voidsetClientFactory(RunFactory clientFactory)voidsetCredentialsId(String credentialsId)voidsetRestClient(ServiceNowAPIClient restClient)protected voidsetupBuilderParameters(EnvVars environment)protected List<ParameterValue>setupParametersAfterBuildStep()voidsetUrl(String url)-
Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild
-
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
-
-
-
Field Detail
-
workspace
protected FilePath workspace
-
-
Constructor Detail
-
ProgressBuilder
public ProgressBuilder(String credentialsId)
-
-
Method Detail
-
getUrl
public String getUrl()
-
setUrl
@DataBoundSetter public void setUrl(String url)
-
setCredentialsId
@DataBoundSetter public void setCredentialsId(String credentialsId)
-
getCredentialsId
public String getCredentialsId()
-
setApiVersion
@DataBoundSetter public void setApiVersion(String apiVersion)
-
getApiVersion
public String getApiVersion()
-
getGlobalSNParams
public net.sf.json.JSONObject getGlobalSNParams()
-
getClientFactory
public RunFactory getClientFactory()
-
setClientFactory
@Inject public void setClientFactory(RunFactory clientFactory)
-
getRestClient
public ServiceNowAPIClient getRestClient()
-
setRestClient
public void setRestClient(ServiceNowAPIClient restClient)
-
perform
public void perform(@NonNull Run<?,?> run, @NonNull FilePath filePath, @NonNull Launcher launcher, @NonNull TaskListener taskListener) throws InterruptedException, IOException- Specified by:
performin interfaceSimpleBuildStep- Throws:
InterruptedExceptionIOException
-
perform
protected abstract boolean perform(Run<?,?> run, @NonNull TaskListener taskListener, Integer progressCheckInterval)
-
setupBuilderParameters
protected void setupBuilderParameters(EnvVars environment)
-
setupParametersAfterBuildStep
protected List<ParameterValue> setupParametersAfterBuildStep()
-
checkProgress
protected Result checkProgress(PrintStream logger, int progressCheckInterval) throws InterruptedException
- Throws:
InterruptedException
-
buildErrorDetailFromFailedResponse
protected String buildErrorDetailFromFailedResponse(Result serviceNowResult)
-
getValue
protected Object getValue(Result result, String name)
Get value from additional response attribute that was strictly not implemented by current structure of the response object.- Parameters:
result- Result returned by ServiceNow API and taken from the response object.name- Name of the attribute that should occur in the response- Returns:
- Value of the attribute
-
-