View Javadoc

1   package org.kuali.maven.wagon;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import org.apache.maven.wagon.events.SessionEvent;
7   
8   /**
9    * Holds timing and byte count information about a transfer operation
10   * 
11   * @author Jeff Caddel
12   * 
13   * @since May 27, 2010 6:51:19 PM
14   */
15  public class SessionTracker {
16  	SimpleFormatter formatter = new SimpleFormatter();
17  	List<TransferTracker> transfers = new ArrayList<TransferTracker>();
18  	List<SessionEvent> sessionEvents = new ArrayList<SessionEvent>();
19  	long opened;
20  	long loggedIn;
21  	long disconnecting;
22  	long loggedOff;
23  	long disconnected;
24  
25  	public TransferTracker getCurrentTransfer() {
26  		if (transfers.size() == 0) {
27  			return null;
28  		} else {
29  			return transfers.get(transfers.size() - 1);
30  		}
31  	}
32  
33  	public void addSessionEvent(SessionEvent sessionEvent) {
34  		sessionEvents.add(sessionEvent);
35  	}
36  
37  	public void addTransfer(TransferTracker transfer) {
38  		transfers.add(transfer);
39  	}
40  
41  	public List<TransferTracker> getTransfers() {
42  		return transfers;
43  	}
44  
45  	public void setTransfers(List<TransferTracker> transfers) {
46  		this.transfers = transfers;
47  	}
48  
49  	public List<SessionEvent> getSessionEvents() {
50  		return sessionEvents;
51  	}
52  
53  	public void setSessionEvents(List<SessionEvent> sessionEvents) {
54  		this.sessionEvents = sessionEvents;
55  	}
56  
57  	public SimpleFormatter getFormatter() {
58  		return formatter;
59  	}
60  
61  	public void setFormatter(SimpleFormatter formatter) {
62  		this.formatter = formatter;
63  	}
64  
65  	public long getOpened() {
66  		return opened;
67  	}
68  
69  	public void setOpened(long opened) {
70  		this.opened = opened;
71  	}
72  
73  	public long getLoggedIn() {
74  		return loggedIn;
75  	}
76  
77  	public void setLoggedIn(long loggedIn) {
78  		this.loggedIn = loggedIn;
79  	}
80  
81  	public long getDisconnecting() {
82  		return disconnecting;
83  	}
84  
85  	public void setDisconnecting(long disconnecting) {
86  		this.disconnecting = disconnecting;
87  	}
88  
89  	public long getLoggedOff() {
90  		return loggedOff;
91  	}
92  
93  	public void setLoggedOff(long loggedOff) {
94  		this.loggedOff = loggedOff;
95  	}
96  
97  	public long getDisconnected() {
98  		return disconnected;
99  	}
100 
101 	public void setDisconnected(long disconnected) {
102 		this.disconnected = disconnected;
103 	}
104 
105 }