Class BaseCommandContext
- java.lang.Object
- 
- hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
- 
- org.jenkinsci.plugins.workflow.steps.Step
- 
- com.microsoft.jenkins.azurecommons.command.BaseCommandContext
 
 
 
- 
- All Implemented Interfaces:
- IBaseCommandData,- ICommandServiceData,- ExtensionPoint,- Describable<org.jenkinsci.plugins.workflow.steps.Step>
 
 public abstract class BaseCommandContext extends org.jenkinsci.plugins.workflow.steps.Step implements ICommandServiceData, IBaseCommandData A mixed abstract base class with both command data and command service data.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
 
- 
 - 
Constructor SummaryConstructors Constructor Description BaseCommandContext()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(JobContext jobCtx, CommandService aCommandService)protected voidconfigure(Run<?,?> aRun, FilePath aWorkspace, Launcher aLauncher, TaskListener aTaskListener, CommandService aCommandService)voidexecuteCommands()CommandServicegetCommandService()CommandStategetCommandState()Get the command state for the associated completed command.abstract IBaseCommandDatagetDataForCommand(ICommand command)EnvVarsgetEnvVars()When running from pipeline, the result returned fromRun.getEnvironment(TaskListener)won't include the system environments set by theenv.VAR=valueorwithEnv(['VAR=value']).JobContextgetJobContext()CommandStategetLastCommandState()Get the command state for the last command being executed.voidlogError(Exception ex)voidlogError(String message)voidlogError(String prefix, Exception ex)voidlogStatus(String status)voidsetCommandState(CommandState commandState)Set the command state for the associated running command.voidsetLastCommandState(CommandState lastCommandState)Set the command state for the last command being executed in the command service.org.jenkinsci.plugins.workflow.steps.StepExecutionstart(org.jenkinsci.plugins.workflow.steps.StepContext context)Pipeline function call entrance.abstract org.jenkinsci.plugins.workflow.steps.StepExecutionstartImpl(org.jenkinsci.plugins.workflow.steps.StepContext context)
 
- 
- 
- 
Method Detail- 
configureprotected void configure(Run<?,?> aRun, FilePath aWorkspace, Launcher aLauncher, TaskListener aTaskListener, CommandService aCommandService) 
 - 
configureprotected void configure(JobContext jobCtx, CommandService aCommandService) 
 - 
startpublic final org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws ExceptionPipeline function call entrance.- Specified by:
- startin class- org.jenkinsci.plugins.workflow.steps.Step
- Parameters:
- context- the pipeline step context
- Returns:
- the execution logic object.
- Throws:
- Exception
 
 - 
startImplpublic abstract org.jenkinsci.plugins.workflow.steps.StepExecution startImpl(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception- Throws:
- Exception
 
 - 
getEnvVarspublic EnvVars getEnvVars() When running from pipeline, the result returned fromRun.getEnvironment(TaskListener)won't include the system environments set by theenv.VAR=valueorwithEnv(['VAR=value']). We need to callStepContext.get(EnvVar.class)for the full environment variables set.If the field is not null, we are running from pipeline and we use this as the source of environment variables; otherwise we fetch the environment variables from Runas normal.- Specified by:
- getEnvVarsin interface- IBaseCommandData
 
 - 
executeCommandspublic void executeCommands() 
 - 
getDataForCommandpublic abstract IBaseCommandData getDataForCommand(ICommand command) - Specified by:
- getDataForCommandin interface- ICommandServiceData
 
 - 
setCommandStatepublic void setCommandState(CommandState commandState) Description copied from interface:IBaseCommandDataSet the command state for the associated running command.- Specified by:
- setCommandStatein interface- IBaseCommandData
- Parameters:
- commandState- the result command state.
 
 - 
getCommandStatepublic CommandState getCommandState() Description copied from interface:IBaseCommandDataGet the command state for the associated completed command.- Specified by:
- getCommandStatein interface- IBaseCommandData
- Returns:
- the result command state.
 
 - 
getLastCommandStatepublic CommandState getLastCommandState() Description copied from interface:ICommandServiceDataGet the command state for the last command being executed. This will be the state of the command service execution.- Specified by:
- getLastCommandStatein interface- ICommandServiceData
- See Also:
- IBaseCommandData.getCommandState()
 
 - 
setLastCommandStatepublic void setLastCommandState(CommandState lastCommandState) Description copied from interface:ICommandServiceDataSet the command state for the last command being executed in the command service.- Specified by:
- setLastCommandStatein interface- ICommandServiceData
- Parameters:
- lastCommandState- the last command state.
- See Also:
- IBaseCommandData.setCommandState(CommandState)
 
 - 
getCommandServicepublic CommandService getCommandService() - Specified by:
- getCommandServicein interface- ICommandServiceData
 
 - 
getJobContextpublic final JobContext getJobContext() - Specified by:
- getJobContextin interface- IBaseCommandData
 
 - 
logStatuspublic void logStatus(String status) - Specified by:
- logStatusin interface- IBaseCommandData
 
 - 
logErrorpublic void logError(Exception ex) - Specified by:
- logErrorin interface- IBaseCommandData
 
 - 
logErrorpublic void logError(String prefix, Exception ex) - Specified by:
- logErrorin interface- IBaseCommandData
 
 - 
logErrorpublic void logError(String message) - Specified by:
- logErrorin interface- IBaseCommandData
 
 
- 
 
-