View Javadoc

1   /*
2    * SymmetricDS is an open source database synchronization solution.
3    *   
4    * Copyright (C) Chris Henson <chenson42@users.sourceforge.net>,
5    *               Eric Long <erilong@users.sourceforge.net>
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 3 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, see
19   * <http://www.gnu.org/licenses/>.
20   */
21  
22  package org.jumpmind.symmetric.model;
23  
24  import java.io.Serializable;
25  import java.util.Date;
26  
27  import org.jumpmind.symmetric.load.IDataLoaderContext;
28  
29  public class IncomingBatch implements Serializable {
30  
31      private static final long serialVersionUID = 1L;
32  
33      public enum Status {
34          OK, ER;
35      }
36  
37      private long batchId;
38  
39      private String nodeId;
40  
41      private Status status;
42  
43      private Date createTime;
44  
45      private boolean isRetry;
46  
47      public IncomingBatch() {
48      }
49  
50      public IncomingBatch(IDataLoaderContext context) {
51          batchId = context.getBatchId();
52          nodeId = context.getNodeId();
53          status = Status.OK;
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 nodeId) {
81          this.nodeId = nodeId;
82      }
83  
84      public boolean isRetry() {
85          return isRetry;
86      }
87  
88      public void setRetry(boolean isRetry) {
89          this.isRetry = isRetry;
90      }
91  
92      public Date getCreateTime() {
93          return createTime;
94      }
95  
96      public void setCreateTime(Date createTime) {
97          this.createTime = createTime;
98      }
99  
100 }