/*
 * @(#)EventListener.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.http;

import java.util.EventListener;


/**
 * Implements methods for capturing events sourced from Http class. Typicaly
 * your application will implement this interface to capture the following
 * events : <br>
 * HttpConnectedEvent<br>
 * HttpDisconnectedEvent<br>
 * HttpProgressEvent
 * <p/>
 * <P>
 * In addition to implementing this interface your application should register
 * itself as an EventListener which may look somewhat like this:<br>
 * <pre>
 * public class Application ... implements HttpListener
 * {
 *  ...
 *    public ... initMethod(...)
 *    {
 *      Http http = new Http();
 *      http.addHttpListener(this);
 *    }
 *  ...
 * }
 * </pre>
 * </p>
 */
public interface HttpListener
        extends EventListener {
    /**
     * Invoked when connection to Http server is established.
     *
     * @param event a <code>HttpConnectedEvent</code>
     *
     * @see com.jscape.inet.http.HttpConnectedEvent
     */
    void connected(HttpConnectedEvent event);

    /**
     * Invoked when connection to Http server is released.
     *
     * @param event a <code>HttpDisconnectedEvent</code>
     *
     * @see com.jscape.inet.http.HttpDisconnectedEvent
     */
    void disconnected(HttpDisconnectedEvent event);


    /**
     * Invoked to mark progress of a download or upload operation.<br>
     *
     * @param event a <code>HttpProgressEvent</code>
     *
     * @see com.jscape.inet.http.HttpProgressEvent
     */
    void progress(HttpProgressEvent event);
}
