1 package org.kuali.ole.docstore.common.util;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5
6 import java.util.Date;
7
8
9
10
11
12
13
14
15 public class BatchStatistics {
16 private static final Logger LOG = LoggerFactory.getLogger(BatchStatistics.class);
17 private int bibCount;
18 private int holdingsCount;
19 private int itemCount;
20 private long timeTaken;
21 private Date startTime;
22 private Date endTime;
23
24 public Date getEndTime() {
25 return endTime;
26 }
27
28 public void setEndTime(Date endTime) {
29 this.endTime = endTime;
30 }
31
32 public Date getStartTime() {
33 return startTime;
34 }
35
36 public void setStartTime(Date startTime) {
37 this.startTime = startTime;
38 }
39
40
41 public int getBibCount() {
42 return bibCount;
43 }
44
45 public void setBibCount(int bibCount) {
46 this.bibCount = bibCount;
47 }
48
49 public void addBibCount(int bibCount) {
50 this.bibCount = this.bibCount + bibCount;
51 }
52
53 public void setHoldingsCount(int holdingsCount) {
54 this.holdingsCount = holdingsCount;
55 }
56
57 public void setItemCount(int itemCount) {
58 this.itemCount = itemCount;
59 }
60
61 public void setTimeTaken(long timeTaken) {
62 this.timeTaken = timeTaken;
63 }
64
65 public int getHoldingsCount() {
66 return holdingsCount;
67 }
68
69 public void addHoldingsCount(int holdingsCount) {
70 this.holdingsCount = this.holdingsCount + holdingsCount;
71 }
72
73 public int getItemCount() {
74 return itemCount;
75 }
76
77 public void addItemCount(int itemCount) {
78 this.itemCount = this.itemCount + itemCount;
79 }
80
81 public long getTimeTaken() {
82 return timeTaken;
83 }
84
85 public void addTimeTaken(Long timeTaken) {
86 this.timeTaken = this.timeTaken + timeTaken;
87 }
88
89 public void printStatistics(){
90 LOG.info(toString());
91
92 }
93
94 @Override
95 public String toString() {
96 return "BatchStatistics{" +
97 "Bibs=" + bibCount +
98 ", Holdings=" + holdingsCount +
99 ", Items=" + itemCount +
100 ", Time Taken=" + timeTaken +
101 '}';
102 }
103 }