Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobParameters


   * @return the next job parameters if they can be located
   * @throws JobParametersNotFoundException if there is a problem
   */
  private JobParameters getNextJobParameters(Job job, boolean fail) throws JobParametersNotFoundException {
    String jobIdentifier = job.getName();
    JobParameters jobParameters;
    List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);

    JobParametersIncrementer incrementer = job.getJobParametersIncrementer();
    if (incrementer == null) {
      throw new JobParametersNotFoundException("No job parameters incrementer found for job=" + jobIdentifier);
    }

    if (lastInstances.isEmpty()) {
      jobParameters = incrementer.getNext(new JobParameters());
      if (jobParameters == null) {
        throw new JobParametersNotFoundException("No bootstrap parameters found from incrementer for job="
            + jobIdentifier);
      }
    } else {
View Full Code Here


   * @param type the job execution type
   * @return converted job execution
   */
  public static JobExecution convertJobExecutionType(JobExecutionType type) {
    JobInstance jobInstance = convertJobInstanceType(type.jobInstance);
    JobParameters jobParameters = convertJobParametersType(type.jobParameters);

    JobExecution jobExecution = new JobExecution(jobInstance, type.id, jobParameters, type.jobConfigurationLocation);

    jobExecution.setVersion(type.version);
    jobExecution.setStatus(type.status);
View Full Code Here

        }
      } else if(parameterType == ParameterType.STRING) {
        map.put(entry.getKey(), new JobParameter((String)entry.getValue().parameter));
      }
    }
    return new JobParameters(map);
  }
View Full Code Here

        this.jobLauncher = jobLauncher;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        JobParameters jobParameters = prepareJobParameters(exchange.getIn().getHeaders());
        JobExecution jobExecution = jobLauncher.run(job, jobParameters);
        exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
        exchange.getOut().setBody(jobExecution);
    }
View Full Code Here

  @Transformer
  public Message<JobLaunchRequest> transform(Message<String> pidMessage) {
    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString(JOB_PARAM_PID_KEY,
        pidMessage.getPayload());
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();

    Job job = null;
    try {
      job = jobLocator.getJob("generateDerivatives");
    } catch (NoSuchJobException e) {
View Full Code Here

    Job derivativeGenerationJob = jobLocator.getJob("generateDerivatives");

    for (String pid : pids) {
      JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
      jobParametersBuilder.addString(JOB_PARAM_PID_KEY, pid);
      JobParameters jobParameters = jobParametersBuilder
          .toJobParameters();
      jobLauncher.run(derivativeGenerationJob, jobParameters);
    }
  }
View Full Code Here

    }

    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString("GUID", guid);
    jobParametersBuilder.addString("URI", uri);
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();
   
    Job job = null;
    try {
      job = jobLocator.getJob("batchIngestJob");
    } catch (NoSuchJobException e) {
View Full Code Here

    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString(Sip.JOB_PARAM_GUID_KEY, sipMessage
        .getPayload().getGuid());
    jobParametersBuilder.addString(Sip.JOB_PARAM_URI_KEY, sipMessage
        .getPayload().getURI().toString());
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();
   
    logger.info("Transforming job launch request {} / {}",
        sipMessage.getPayload().getGuid(),
        sipMessage.getPayload().getURI().toString()
        );
View Full Code Here

    }

    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString("GUID", guid);
    jobParametersBuilder.addString("URI", uri);
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();
   
    Job job = null;
    try {
      job = jobLocator.getJob("batchIngestJob");
    } catch (NoSuchJobException e) {
View Full Code Here

  public void setup() {
    Map<String, JobParameter> p = new LinkedHashMap<String, JobParameter>();
    p.put("mr.input", new JobParameter("/batch-param-test/input/"));
    p.put("mr.output", new JobParameter("/batch-param-test/output/"));
    p.put("properties-file", new JobParameter("dummy-1.properties"));
    params = new JobParameters(p);
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.JobParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.