1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.jumpmind.symmetric.model;
22
23 import java.io.Serializable;
24 import java.util.Date;
25
26 public class OutgoingBatch implements Serializable {
27
28 private static final long serialVersionUID = 1L;
29
30 public enum Status {
31 NE, SE, ER, OK;
32 }
33
34 private long batchId;
35
36 private String nodeId;
37
38 private String channelId;
39
40 private Status status = Status.NE;
41
42 private BatchType batchType = BatchType.EVENTS;
43
44 private Date createTime;
45
46 public OutgoingBatch() {
47 }
48
49 public OutgoingBatch(Node node, String channelId, BatchType batchType) {
50 this.nodeId = node.getNodeId();
51 this.channelId = channelId;
52 this.status = Status.NE;
53 this.batchType = batchType;
54 }
55
56 public String getNodeBatchId() {
57 return nodeId + "-" + batchId;
58 }
59
60 public long getBatchId() {
61 return batchId;
62 }
63
64 public void setBatchId(long batchId) {
65 this.batchId = batchId;
66 }
67
68 public Status getStatus() {
69 return status;
70 }
71
72 public void setStatus(Status status) {
73 this.status = status;
74 }
75
76 public String getNodeId() {
77 return nodeId;
78 }
79
80 public void setNodeId(String locationId) {
81 this.nodeId = locationId;
82 }
83
84 public String getChannelId() {
85 return channelId;
86 }
87
88 public void setChannelId(String channelId) {
89 this.channelId = channelId;
90 }
91
92 public void setStatus(String status) {
93 this.status = Status.valueOf(status);
94 }
95
96 public BatchType getBatchType() {
97 return batchType;
98 }
99
100 public BatchInfo getBatchInfo() {
101 return new BatchInfo(this.batchId);
102 }
103
104 public void setBatchType(BatchType batchType) {
105 this.batchType = batchType;
106 }
107
108 public void setBatchType(String batchType) {
109 if (BatchType.EVENTS.getCode().equals(batchType)) {
110 this.batchType = BatchType.EVENTS;
111 } else if (BatchType.INITIAL_LOAD.getCode().equals(batchType)) {
112 this.batchType = BatchType.INITIAL_LOAD;
113 } else {
114 batchType = null;
115 }
116 }
117
118 public Date getCreateTime() {
119 return createTime;
120 }
121
122 public void setCreateTime(Date createTime) {
123 this.createTime = createTime;
124 }
125
126 }