001package org.kuali.ole.docstore.common.util;
002
003import org.slf4j.Logger;
004import org.slf4j.LoggerFactory;
005
006import java.util.Date;
007
008/**
009 * Created with IntelliJ IDEA.
010 * User: jayabharathreddy
011 * Date: 6/3/14
012 * Time: 4:48 PM
013 * To change this template use File | Settings | File Templates.
014 */
015public class BatchStatistics {
016    private static final Logger LOG = LoggerFactory.getLogger(BatchStatistics.class);
017    private int bibCount;
018    private int holdingsCount;
019    private int itemCount;
020    private long timeTaken;
021    private Date startTime;
022    private Date endTime;
023
024    public Date getEndTime() {
025        return endTime;
026    }
027
028    public void setEndTime(Date endTime) {
029        this.endTime = endTime;
030    }
031
032    public Date getStartTime() {
033        return startTime;
034    }
035
036    public void setStartTime(Date startTime) {
037        this.startTime = startTime;
038    }
039
040
041    public int getBibCount() {
042        return bibCount;
043    }
044
045    public void setBibCount(int bibCount) {
046        this.bibCount = bibCount;
047    }
048
049    public void addBibCount(int bibCount) {
050        this.bibCount = this.bibCount + bibCount;
051    }
052
053    public void setHoldingsCount(int holdingsCount) {
054        this.holdingsCount = holdingsCount;
055    }
056
057    public void setItemCount(int itemCount) {
058        this.itemCount = itemCount;
059    }
060
061    public void setTimeTaken(long timeTaken) {
062        this.timeTaken = timeTaken;
063    }
064
065    public int getHoldingsCount() {
066        return holdingsCount;
067    }
068
069    public void addHoldingsCount(int holdingsCount) {
070        this.holdingsCount = this.holdingsCount + holdingsCount;
071    }
072
073    public int getItemCount() {
074        return itemCount;
075    }
076
077    public void addItemCount(int itemCount) {
078        this.itemCount = this.itemCount + itemCount;
079    }
080
081    public long getTimeTaken() {
082        return timeTaken;
083    }
084
085    public void addTimeTaken(Long timeTaken) {
086        this.timeTaken = this.timeTaken + timeTaken;
087    }
088
089    public void printStatistics(){
090        LOG.info(toString());
091
092    }
093
094    @Override
095    public String toString() {
096        return "BatchStatistics{" +
097                "Bibs=" + bibCount +
098                ", Holdings=" + holdingsCount +
099                ", Items=" + itemCount +
100                ", Time Taken=" + timeTaken +
101                '}';
102    }
103}