1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.batch.admin.web.resource;
18
19 import org.springframework.batch.admin.domain.StepExecutionInfo;
20 import org.springframework.batch.admin.domain.StepExecutionInfoResource;
21 import org.springframework.batch.admin.web.BatchStepExecutionsController;
22 import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
23
24
25
26
27
28
29
30
31 public class StepExecutionInfoResourceAssembler extends
32 ResourceAssemblerSupport<StepExecutionInfo, StepExecutionInfoResource> {
33
34 public StepExecutionInfoResourceAssembler() {
35 super(BatchStepExecutionsController.class, StepExecutionInfoResource.class);
36 }
37
38 @Override
39 public StepExecutionInfoResource toResource(StepExecutionInfo entity) {
40 return createResourceWithId(entity.getId(), entity, entity.getJobExecutionId());
41 }
42
43 @Override
44 protected StepExecutionInfoResource instantiateResource(StepExecutionInfo entity) {
45 return new StepExecutionInfoResource(entity.getStepExecution(), entity.getTimeZone());
46 }
47 }