View Javadoc

1   /**
2    * Copyright 2010-2013 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  import org.kuali.common.aws.s3.SimpleFormatter;
23  
24  /**
25   * Holds timing and byte count information about a transfer operation
26   *
27   * @author Jeff Caddel
28   *
29   * @since May 27, 2010 6:51:19 PM
30   */
31  public class SessionTracker {
32  	SimpleFormatter formatter = new SimpleFormatter();
33  	List<TransferTracker> transfers = new ArrayList<TransferTracker>();
34  	List<SessionEvent> sessionEvents = new ArrayList<SessionEvent>();
35  	long opened;
36  	long loggedIn;
37  	long disconnecting;
38  	long loggedOff;
39  	long disconnected;
40  
41  	public TransferTracker getCurrentTransfer() {
42  		if (transfers.size() == 0) {
43  			return null;
44  		} else {
45  			return transfers.get(transfers.size() - 1);
46  		}
47  	}
48  
49  	public void addSessionEvent(SessionEvent sessionEvent) {
50  		sessionEvents.add(sessionEvent);
51  	}
52  
53  	public void addTransfer(TransferTracker transfer) {
54  		transfers.add(transfer);
55  	}
56  
57  	public List<TransferTracker> getTransfers() {
58  		return transfers;
59  	}
60  
61  	public void setTransfers(List<TransferTracker> transfers) {
62  		this.transfers = transfers;
63  	}
64  
65  	public List<SessionEvent> getSessionEvents() {
66  		return sessionEvents;
67  	}
68  
69  	public void setSessionEvents(List<SessionEvent> sessionEvents) {
70  		this.sessionEvents = sessionEvents;
71  	}
72  
73  	public SimpleFormatter getFormatter() {
74  		return formatter;
75  	}
76  
77  	public void setFormatter(SimpleFormatter formatter) {
78  		this.formatter = formatter;
79  	}
80  
81  	public long getOpened() {
82  		return opened;
83  	}
84  
85  	public void setOpened(long opened) {
86  		this.opened = opened;
87  	}
88  
89  	public long getLoggedIn() {
90  		return loggedIn;
91  	}
92  
93  	public void setLoggedIn(long loggedIn) {
94  		this.loggedIn = loggedIn;
95  	}
96  
97  	public long getDisconnecting() {
98  		return disconnecting;
99  	}
100 
101 	public void setDisconnecting(long disconnecting) {
102 		this.disconnecting = disconnecting;
103 	}
104 
105 	public long getLoggedOff() {
106 		return loggedOff;
107 	}
108 
109 	public void setLoggedOff(long loggedOff) {
110 		this.loggedOff = loggedOff;
111 	}
112 
113 	public long getDisconnected() {
114 		return disconnected;
115 	}
116 
117 	public void setDisconnected(long disconnected) {
118 		this.disconnected = disconnected;
119 	}
120 
121 }