001/* 002 * Copyright 2006-2007 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.springframework.batch.integration.launch; 017 018import org.springframework.batch.core.Job; 019import org.springframework.batch.core.JobParameters; 020 021/** 022 * Encapsulation of a {@link Job} and its {@link JobParameters} forming a request for a job to be launched. 023 * 024 * @author Dave Syer 025 * 026 */ 027public class JobLaunchRequest { 028 029 private final Job job; 030 031 private final JobParameters jobParameters; 032 033 /** 034 * @param job job to be launched 035 * @param jobParameters parameters to run the job with 036 */ 037 public JobLaunchRequest(Job job, JobParameters jobParameters) { 038 super(); 039 this.job = job; 040 this.jobParameters = jobParameters; 041 } 042 043 /** 044 * @return the {@link Job} to be executed 045 */ 046 public Job getJob() { 047 return this.job; 048 } 049 050 /** 051 * @return the {@link JobParameters} for this request 052 */ 053 public JobParameters getJobParameters() { 054 return this.jobParameters; 055 } 056 057 @Override 058 public String toString() { 059 return "JobLaunchRequest: " + job.getName() + ", parameters=" + jobParameters; 060 } 061 062}