本文整理汇总了Java中org.springframework.batch.core.JobInstance.getId方法的典型用法代码示例。如果您正苦于以下问题:Java JobInstance.getId方法的具体用法?Java JobInstance.getId怎么用?Java JobInstance.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.batch.core.JobInstance
的用法示例。
在下文中一共展示了JobInstance.getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AdaptedJobInstance
import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
public AdaptedJobInstance(JobInstance jobInstance) {
this.id = jobInstance.getId();
if (jobInstance.getVersion() == null) {
jobInstance.setVersion(0);
} else {
this.setVersion(jobInstance.getVersion());
}
this.jobName = jobInstance.getJobName();
}
示例2: findJobExecutions
import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
@Override
public List<JobExecution> findJobExecutions(JobInstance jobInstance) {
String directory = properties.getJobRepositoryDirectory() + "/" + jobInstance.getId() + "/";
StructuredQueryBuilder qb = new StructuredQueryBuilder(properties.getSearchOptions());
StructuredQueryDefinition querydef =
qb.and(
qb.directory(true, directory),
qb.collection(properties.getJobExecutionCollection())
);
QueryManager queryMgr = databaseClient.newQueryManager();
SearchHandle results = queryMgr.search(querydef, new SearchHandle());
MatchDocumentSummary[] summaries = results.getMatchResults();
List<JobExecution> jobExecutions = new ArrayList<JobExecution>();
DocumentManager docMgr = databaseClient.newXMLDocumentManager();
for (MatchDocumentSummary summary : summaries) {
DocumentDescriptor desc = docMgr.exists(summary.getUri());
JAXBHandle<AdaptedJobExecution> jaxbHandle = new JAXBHandle<AdaptedJobExecution>(jaxbContext());
summary.getFirstSnippet(jaxbHandle);
AdaptedJobExecution aJobExecution = jaxbHandle.get();
try {
JobExecution jobExecution = adapter.unmarshal(aJobExecution);
jobExecution.setVersion((int) desc.getVersion());
jobExecutions.add(jobExecution);
} catch (Exception e) {
e.printStackTrace();
}
}
return jobExecutions;
}
示例3: toJobInstanceResource
import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
public static JobInstanceResource toJobInstanceResource(final JobInstance jobInstance) {
final JobInstanceResource job = new JobInstanceResource(jobInstance.getId());
job.setName(jobInstance.getJobName());
return job;
}
示例4: toInstanceInfo
import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
private JobInstanceInfo toInstanceInfo(final JobInstance instance) {
final LatestExecutions latest = getLatestExecutions(instance);
return new JobInstanceInfo(instance.getId(), instance.getJobName(), latest.getLatestExecution(),
latest.getLatestSuccessfulExecution());
}
示例5: getJobName
import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
private String getJobName(JobInstance jobInstance, JobStartParams jobStartParams) {
return jobInstance.getJobName() + " id: " + jobInstance.getId();
}