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 FilePath
workspace
-
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 String
buildErrorDetailFromFailedResponse(Result serviceNowResult)
protected Result
checkProgress(PrintStream logger, int progressCheckInterval)
String
getApiVersion()
RunFactory
getClientFactory()
String
getCredentialsId()
net.sf.json.JSONObject
getGlobalSNParams()
ServiceNowAPIClient
getRestClient()
String
getUrl()
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.void
perform(Run<?,?> run, FilePath filePath, Launcher launcher, TaskListener taskListener)
protected abstract boolean
perform(Run<?,?> run, TaskListener taskListener, Integer progressCheckInterval)
void
setApiVersion(String apiVersion)
void
setClientFactory(RunFactory clientFactory)
void
setCredentialsId(String credentialsId)
void
setRestClient(ServiceNowAPIClient restClient)
protected void
setupBuilderParameters(EnvVars environment)
protected List<ParameterValue>
setupParametersAfterBuildStep()
void
setUrl(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:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
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
-
-