1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.batch.integration.chunk;
18
19 import java.io.Serializable;
20
21 import org.springframework.batch.core.StepContribution;
22
23
24
25
26
27
28
29 public class ChunkResponse implements Serializable {
30
31 private final StepContribution stepContribution;
32
33 private final Long jobId;
34
35 private final boolean status;
36
37 private final String message;
38
39 private final boolean redelivered;
40
41 private final int sequence;
42
43 public ChunkResponse(int sequence, Long jobId, StepContribution stepContribution) {
44 this(true, sequence, jobId, stepContribution, null);
45 }
46
47 public ChunkResponse(boolean status, int sequence, Long jobId, StepContribution stepContribution) {
48 this(status, sequence, jobId, stepContribution, null);
49 }
50
51 public ChunkResponse(boolean status, int sequence, Long jobId, StepContribution stepContribution, String message) {
52 this(status, sequence, jobId, stepContribution, message, false);
53 }
54
55 public ChunkResponse(ChunkResponse input, boolean redelivered) {
56 this(input.status, input.sequence, input.jobId, input.stepContribution, input.message, redelivered);
57 }
58
59 public ChunkResponse(boolean status, int sequence, Long jobId, StepContribution stepContribution, String message, boolean redelivered) {
60 this.status = status;
61 this.sequence = sequence;
62 this.jobId = jobId;
63 this.stepContribution = stepContribution;
64 this.message = message;
65 this.redelivered = redelivered;
66 }
67
68 public StepContribution getStepContribution() {
69 return stepContribution;
70 }
71
72 public Long getJobId() {
73 return jobId;
74 }
75
76 public int getSequence() {
77 return sequence;
78 }
79
80 public boolean isSuccessful() {
81 return status;
82 }
83
84 public boolean isRedelivered() {
85 return redelivered;
86 }
87
88 public String getMessage() {
89 return message;
90 }
91
92
93
94
95 @Override
96 public String toString() {
97 return getClass().getSimpleName() + ": jobId=" + jobId + ", sequence=" + sequence + ", stepContribution=" + stepContribution
98 + ", successful=" + status;
99 }
100
101 }