class SimpleJob extends AbstractJob {

	private final List<Step> steps = new ArrayList<>();

	/**
	 * Default constructor for job with null name
	 */
	public SimpleJob() {
		this(null);
	}

	/**
	 * @param name the job name.
	 */
	public SimpleJob(String name) {
		super(name);
	}

	/**
	 * Public setter for the steps in this job. Overrides any calls to
	 * {@link #addStep(Step)}.
	 * @param steps the steps to execute
	 */
	public void setSteps(List<Step> steps) {
		this.steps.clear();
		this.steps.addAll(steps);
	}

	/**
	 * Convenience method for clients to inspect the steps for this job.
	 * @return the step names for this job
	 */
	@Override
	public Collection<String> getStepNames() {
		List<String> names = new ArrayList<>();
		for (Step step : steps) {
			names.add(step.getName());

			if (step instanceof StepLocator) {
				names.addAll(((StepLocator) step).getStepNames());
			}
		}
		return names;
	}

	/**
	 * Convenience method for adding a single step to the job.
	 * @param step a {@link Step} to add
	 */
	public void addStep(Step step) {
		this.steps.add(step);
	}

	@Override
	public Step getStep(String stepName) {
		for (Step step : this.steps) {
			if (step.getName().equals(stepName)) {
				return step;
			}
			else if (step instanceof StepLocator) {
				Step result = ((StepLocator) step).getStep(stepName);
				if (result != null) {
					return result;
				}
			}
		}
		return null;
	}

	/**
	 * Handler of steps sequentially as provided, checking each one for success before
	 * moving to the next. Returns the last {@link StepExecution} successfully processed
	 * if it exists, and null if none were processed.
	 * @param execution the current {@link JobExecution}
	 *
	 * @see AbstractJob#handleStep(Step, JobExecution)
	 */
	@Override
	protected void doExecute(JobExecution execution)
			throws JobInterruptedException, JobRestartException, StartLimitExceededException {<FILL_FUNCTION_BODY>}

}


		StepExecution stepExecution = null;
		for (Step step : steps) {
			stepExecution = handleStep(step, execution);
			if (stepExecution.getStatus() != BatchStatus.COMPLETED) {
				//
				// Terminate the job if a step fails
				//
				break;
			}
		}

		//
		// Update the job status to be the same as the last step
		//
		if (stepExecution != null) {
			if (logger.isDebugEnabled()) {
				logger.debug("Upgrading JobExecution status: " + stepExecution);
			}
			execution.upgradeStatus(stepExecution.getStatus());
			execution.setExitStatus(stepExecution.getExitStatus());
		}
	
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void afterPropertiesSet() throws java.lang.Exception,public final void execute(org.springframework.batch.core.JobExecution) ,public org.springframework.batch.core.JobParametersIncrementer getJobParametersIncrementer() ,public org.springframework.batch.core.JobParametersValidator getJobParametersValidator() ,public java.lang.String getName() ,public abstract org.springframework.batch.core.Step getStep(java.lang.String) ,public abstract Collection<java.lang.String> getStepNames() ,public boolean isRestartable() ,public void registerJobExecutionListener(org.springframework.batch.core.JobExecutionListener) ,public void setBeanName(java.lang.String) ,public void setJobExecutionListeners(org.springframework.batch.core.JobExecutionListener[]) ,public void setJobParametersIncrementer(org.springframework.batch.core.JobParametersIncrementer) ,public void setJobParametersValidator(org.springframework.batch.core.JobParametersValidator) ,public void setJobRepository(org.springframework.batch.core.repository.JobRepository) ,public void setMeterRegistry(io.micrometer.core.instrument.MeterRegistry) ,public void setName(java.lang.String) ,public void setObservationConvention(org.springframework.batch.core.observability.BatchJobObservationConvention) ,public void setObservationRegistry(io.micrometer.observation.ObservationRegistry) ,public void setRestartable(boolean) ,public java.lang.String toString() <variables>private org.springframework.batch.core.JobParametersIncrementer jobParametersIncrementer,private org.springframework.batch.core.JobParametersValidator jobParametersValidator,private org.springframework.batch.core.repository.JobRepository jobRepository,private final org.springframework.batch.core.listener.CompositeJobExecutionListener listener,protected static final org.apache.commons.logging.Log logger,private io.micrometer.core.instrument.MeterRegistry meterRegistry,private java.lang.String name,private org.springframework.batch.core.observability.BatchJobObservationConvention observationConvention,private io.micrometer.observation.ObservationRegistry observationRegistry,private boolean restartable,private org.springframework.batch.core.job.StepHandler stepHandler