Examples of toJobParameters()


Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

    builder.addString("dontclash", "12");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(MessageHeaders.REPLY_CHANNEL, "response");
    MessageHeaders headers = new MessageHeaders(map);
    GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
        builder.toJobParameters()), headers);
    requestChannel.send(trigger);
    Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);

    assertNotNull("No response received", executionMessage);
    JobExecution execution = executionMessage.getPayload();
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

    builder.addString("dontclash", "12");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(MessageHeaders.REPLY_CHANNEL, "response");
    MessageHeaders headers = new MessageHeaders(map);
    GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(testJob,
        builder.toJobParameters()), headers);
    requestChannel.send(trigger);

    Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);

    assertNotNull("No response received", executionMessage);
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

      this.jdbcTemplate.update("insert into FOO values (?,?,?)", 1, "one", 1);
      this.jdbcTemplate.update("insert into FOO values (?,?,?)", 2, "two", 2);
      this.jdbcTemplate.update("insert into FOO values (?,?,?)", 3, "three", 3);

      JobParametersBuilder builder = new JobParametersBuilder().addLong("min.id", 1L).addLong("max.id", 2L);
      JobExecution jobExecution = this.jobLauncher.run(this.job, builder.toJobParameters());
      assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());

      List<Foo> foos = fooStoringItemWriter.getFoos();
      assertEquals(2, foos.size());
      System.err.println(foos.get(0));
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

    job.setRestartable(true);

    JobParametersBuilder builder = new JobParametersBuilder();
    builder.addString("stringKey", "stringValue").addLong("longKey", 1L).addDouble("doubleKey", 1.1).addDate(
        "dateKey", new Date(1L));
    JobParameters jobParams = builder.toJobParameters();

    JobExecution firstExecution = jobRepository.createJobExecution(job.getName(), jobParams);
    firstExecution.setStartTime(new Date());
    assertNotNull(firstExecution.getLastUpdated());
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

        else if (jobParameters.containsKey(key)) {
          builder.addString(key, jobParameters.get(key).getValue().toString());
        }
      }
    }
    return builder.toJobParameters();
  }

  /**
   * setter to support switching off all parent parameters
   * @param useAllParentParameters
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

    if (start) {

      Calendar c = Calendar.getInstance();
      JobParametersBuilder builder = new JobParametersBuilder();
      builder.addDate("TIMESTAMP", c.getTime());
      JobParameters jobParameters = builder.toJobParameters();

      return jobLauncher.run(job, jobParameters);

    } else {
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

          builder.addString(curParameter.getKey().toString(), curParameter.getValue().toString(), false);
        }
      }
    }

    return builder.toJobParameters();
  }

  /* (non-Javadoc)
   * @see org.springframework.batch.core.converter.JobParametersConverter#getProperties(org.springframework.batch.core.JobParameters)
   */
 
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

      } else {
        propertiesBuilder.addString(entry.getKey().toString(), entry.getValue().toString());
      }
    }

    return propertiesBuilder.toJobParameters();
  }

  /**
   * Convert schedule date to Date, and assume all other parameters can be represented by their default string value.
   *
 
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

        builder.addDate(key, (Date) value);
      } else {
        logger.debug("JobDataMap contains values which are not job parameters (ignoring).");
      }
    }
    return builder.toJobParameters();
  }

  /**
   * Public setter for the {@link JobLocator}.
   *
 
View Full Code Here

Examples of org.springframework.batch.core.JobParametersBuilder.toJobParameters()

    if(!runIdFound) {
      builder.addLong(JOB_RUN_ID, incremeter.nextLongValue());
    }

    return builder.toJobParameters();
  }

  /* (non-Javadoc)
   * @see org.springframework.batch.core.converter.JobParametersConverter#getProperties(org.springframework.batch.core.JobParameters)
   */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.