1 package org.apache.maven.wagon.events;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 /**
23 * Interface for classes which wants to receive and respond to any session update events.
24 *
25 * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
26 *
27 */
28 public interface SessionListener
29 {
30
31 /**
32 * This method will be called when Wagon is about to open
33 * connection to the repository.
34 * The type of the event should
35 * be set to {@link SessionEvent.SESSION_OPENING}
36 *
37 * @param sessionEvent the session event
38 */
39 void sessionOpening( SessionEvent sessionEvent );
40
41 /**
42 * This method will be called when Wagon has successfully connected to
43 * to the repository.
44 * The type of the event should
45 * be set to {@link SessionEvent.SESSION_OPENED}
46 *
47 * @param sessionEvent the session event
48 */
49 void sessionOpened( SessionEvent sessionEvent );
50
51 /**
52 * This method will be called when Wagon has closed connection to
53 * to the repository.
54 * The type of the event should
55 * be set to {@link SessionEvent.SESSION_DISCONNECTING}
56 *
57 * @param sessionEvent the session event
58 */
59 void sessionDisconnecting( SessionEvent sessionEvent );
60
61 /**
62 * This method will be called when Wagon has closed connection to
63 * the repository.
64 * The type of the event should
65 * be set to {@link SessionEvent.SESSION_DISCONNECTED}
66 *
67 * @param sessionEvent the session event
68 */
69 void sessionDisconnected( SessionEvent sessionEvent );
70
71 /**
72 * This method will be called when Wagon when connection to
73 * the repository was refused.
74 * <p/>
75 * The type of the event should
76 * be set to {@link SessionEvent.SESSION_CONNECTION_REFUSED}
77 *
78 * @param sessionEvent the session event
79 */
80 void sessionConnectionRefused( SessionEvent sessionEvent );
81
82 /**
83 * This method will be called by Wagon when Wagon managed
84 * to login to the repository.
85 *
86 * @param sessionEvent the session event
87 */
88 void sessionLoggedIn( SessionEvent sessionEvent );
89
90 /**
91 * This method will be called by Wagon has logged off
92 * from the repository.
93 * <p/>
94 * The type of the event should
95 * be set to {@link SessionEvent.SESSION_LOGGED_OFF}
96 *
97 * @param sessionEvent the session event
98 */
99 void sessionLoggedOff( SessionEvent sessionEvent );
100
101 /**
102 * This method will be called by Wagon when an error occurred.
103 * <p/>
104 * The type of the event should
105 * be set to {@link SessionEvent.SESSION_ERROR_OCCURRED}
106 *
107 * @param sessionEvent the session event
108 */
109 void sessionError( SessionEvent sessionEvent );
110
111 /**
112 * This method allows to send arbitrary debug messages.
113 *
114 * @param message the debug message
115 */
116 void debug( String message );
117
118 }