View Javadoc

1   /**
2    * Copyright 2010-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.maven.wagon;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.apache.maven.wagon.events.SessionEvent;
22  
23  /**
24   * Holds timing and byte count information about a transfer operation
25   * 
26   * @author Jeff Caddel
27   * 
28   * @since May 27, 2010 6:51:19 PM
29   */
30  public class SessionTracker {
31  	SimpleFormatter formatter = new SimpleFormatter();
32  	List<TransferTracker> transfers = new ArrayList<TransferTracker>();
33  	List<SessionEvent> sessionEvents = new ArrayList<SessionEvent>();
34  	long opened;
35  	long loggedIn;
36  	long disconnecting;
37  	long loggedOff;
38  	long disconnected;
39  
40  	public TransferTracker getCurrentTransfer() {
41  		if (transfers.size() == 0) {
42  			return null;
43  		} else {
44  			return transfers.get(transfers.size() - 1);
45  		}
46  	}
47  
48  	public void addSessionEvent(SessionEvent sessionEvent) {
49  		sessionEvents.add(sessionEvent);
50  	}
51  
52  	public void addTransfer(TransferTracker transfer) {
53  		transfers.add(transfer);
54  	}
55  
56  	public List<TransferTracker> getTransfers() {
57  		return transfers;
58  	}
59  
60  	public void setTransfers(List<TransferTracker> transfers) {
61  		this.transfers = transfers;
62  	}
63  
64  	public List<SessionEvent> getSessionEvents() {
65  		return sessionEvents;
66  	}
67  
68  	public void setSessionEvents(List<SessionEvent> sessionEvents) {
69  		this.sessionEvents = sessionEvents;
70  	}
71  
72  	public SimpleFormatter getFormatter() {
73  		return formatter;
74  	}
75  
76  	public void setFormatter(SimpleFormatter formatter) {
77  		this.formatter = formatter;
78  	}
79  
80  	public long getOpened() {
81  		return opened;
82  	}
83  
84  	public void setOpened(long opened) {
85  		this.opened = opened;
86  	}
87  
88  	public long getLoggedIn() {
89  		return loggedIn;
90  	}
91  
92  	public void setLoggedIn(long loggedIn) {
93  		this.loggedIn = loggedIn;
94  	}
95  
96  	public long getDisconnecting() {
97  		return disconnecting;
98  	}
99  
100 	public void setDisconnecting(long disconnecting) {
101 		this.disconnecting = disconnecting;
102 	}
103 
104 	public long getLoggedOff() {
105 		return loggedOff;
106 	}
107 
108 	public void setLoggedOff(long loggedOff) {
109 		this.loggedOff = loggedOff;
110 	}
111 
112 	public long getDisconnected() {
113 		return disconnected;
114 	}
115 
116 	public void setDisconnected(long disconnected) {
117 		this.disconnected = disconnected;
118 	}
119 
120 }