Esempio n. 1
0
 private JobParameters getJobParameters(
     RequestContext requestContext, HealthCheckRequestParameter requestParameter) {
   Map<String, org.springframework.batch.core.JobParameter> parameters =
       new HashMap<String, org.springframework.batch.core.JobParameter>();
   parameters.put(
       HealthCheckJobParameter.PARAM_SKIPPED_RESOURCES,
       new org.springframework.batch.core.JobParameter(
           HealthCheckJobParameter.join(requestParameter.getNotToCheckParameter())));
   parameters.put(
       HealthCheckJobParameter.PARAM_REQUEST_ID,
       new org.springframework.batch.core.JobParameter(requestContext.getRequestId().asString()));
   return new JobParameters(parameters);
 }
Esempio n. 2
0
 @Override
 protected JobExecution startJob(RequestContext requestContext) throws Exception {
   if (isAllowedToStart(requestContext)) {
     HealthCheckRequestParameter requestParameter =
         (HealthCheckRequestParameter) requestContext.getRequestParameter();
     JobParameters jobParameters = getJobParameters(requestContext, requestParameter);
     return jobRunner.start(JobConfiguration.JOB_NAME, jobParameters);
   } else {
     throw new IllegalStateException(
         "job not allowed to start - running job executions detected for job name: '"
             + getUsecase().getName()
             + "'");
   }
 }