001package org.apache.maven.wagon.events;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022/**
023 * Interface for classes which wants to receive and respond to any session update events.
024 *
025 * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
026 *
027 */
028public interface SessionListener
029{
030
031    /**
032     * This method will be called when Wagon is about to open
033     * connection to the repository.
034     * The type of the event should
035     * be set to {@link SessionEvent#SESSION_OPENING}
036     *
037     * @param sessionEvent the session event
038     */
039    void sessionOpening( SessionEvent sessionEvent );
040
041    /**
042     * This method will be called when Wagon has successfully connected to
043     * to the repository.
044     * The type of the event should
045     * be set to {@link SessionEvent#SESSION_OPENED}
046     *
047     * @param sessionEvent the session event
048     */
049    void sessionOpened( SessionEvent sessionEvent );
050
051    /**
052     * This method will be called when Wagon has closed connection to
053     * to the repository.
054     * The type of the event should
055     * be set to {@link SessionEvent#SESSION_DISCONNECTING}
056     *
057     * @param sessionEvent the session event
058     */
059    void sessionDisconnecting( SessionEvent sessionEvent );
060
061    /**
062     * This method will be called when Wagon has closed connection to
063     * the repository.
064     * The type of the event should
065     * be set to {@link SessionEvent#SESSION_DISCONNECTED}
066     *
067     * @param sessionEvent the session event
068     */
069    void sessionDisconnected( SessionEvent sessionEvent );
070
071    /**
072     * This method will be called when Wagon when connection to
073     * the repository was refused.
074     * <p/>
075     * The type of the event should
076     * be set to {@link SessionEvent#SESSION_CONNECTION_REFUSED}
077     *
078     * @param sessionEvent the session event
079     */
080    void sessionConnectionRefused( SessionEvent sessionEvent );
081
082    /**
083     * This method will be called by Wagon when Wagon managed
084     * to login to the repository.
085     *
086     * @param sessionEvent the session event
087     */
088    void sessionLoggedIn( SessionEvent sessionEvent );
089
090    /**
091     * This method will be called by Wagon has logged off
092     * from the repository.
093     * <p/>
094     * The type of the event should
095     * be set to {@link SessionEvent#SESSION_LOGGED_OFF}
096     *
097     * @param sessionEvent the session event
098     */
099    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}