/*
 * @(#)NntpListener.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.nntp;

import java.util.EventListener;


/**
 * Implements methods for capturing events sourced from Nntp bean. Typicaly
 * your application will implement this interface to capture following events
 * : <br>
 * NntpConnectedEvent<br>
 * NntpDisconnectedEvent<br>
 * NntpArticlePostedEvent<br>
 * NntpArticleEvent<br>
 * NntpArticleHeaderEvent<br>
 * NntpProgressEvent
 * <p/>
 * <p>
 * In addition to implementing this interface your application should register
 * itself as a EventListener which may look somewhat like this:<br>
 * <pre>
 * ...
 * public class Application ... implements NntpListener{
 *  ...
 *  String host;
 *  int port;
 *  ...
 *  public ... initMethod(...){
 *    ...
 *    Nntp nntp = new Nntp(host,port);
 *    nntp.addNntpListener(this);
 *    ...
 *  }
 *  ...
 * }
 * </pre>
 * </p>
 */
public interface NntpListener
        extends EventListener {
    /**
     * Invoked when connection to NNTP server is established.
     *
     * @param event a <code>NntpConnectedEvent</code>
     *
     * @see com.jscape.inet.nntp.NntpConnectedEvent
     */
    void connected(NntpConnectedEvent event);

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

    /**
     * Invoked when an article is posted to NNTP server.
     *
     * @param event a <code>NntpArticlePostedEvent</code>
     *
     * @see com.jscape.inet.nntp.NntpArticlePostedEvent
     */
    void articlePosted(NntpArticlePostedEvent event);

    /**
     * Invoked when an article is retrieved from NNTP server.
     *
     * @param event a <code>NntpArticleEvent</code>
     *
     * @see com.jscape.inet.nntp.NntpArticleEvent
     */
    void articleRetrieved(NntpArticleEvent event);

    /**
     * Invoked when an article header is retrieved from NNTP server.
     *
     * @param event a <code>NntpArticleHeaderEvent</code>
     *
     * @see com.jscape.inet.nntp.NntpArticleHeaderEvent
     */
    void articleHeaderRetrieved(NntpArticleHeaderEvent event);

    /**
     * Invoked when performing lengthy Nntp operations. For example: retrieving
     * a long list of groups or headers.
     *
     * @param event a <CODE>NntpProgressEvent</CODE>
     */
    void progress(NntpProgressEvent event);
}
