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

import java.util.EventListener;


/**
 * Implements methods for capturing events sourced from Smtp class. Typicaly
 * your application will implement this interface to capture the following
 * events :
 * <br><code>SmtpConnectedEvent</code><br><code>SmtpDisconnectedEvent</code><br><code>SmtpCommandEvent</code><br><code>SmtpCommandEvent</code>
 * <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 SmtpListener
 * {
 *  ...
 *  public ... initMethod(...)
 *  {
 *    Smtp smtp = new Smtp();
 *    smtp.addSmtpListener(this);
 *  }
 *  ...
 * }
 * </pre>
 * </p>
 */
public interface SmtpListener
        extends EventListener {
    /**
     * Invoked when connection to SMTP server is established.
     *
     * @param event a <code>SmtpConnectedEvent</code>
     *
     * @see SmtpConnectedEvent
     */
    void connected(SmtpConnectedEvent event);

    /**
     * Invoked when connection to SMTP server is released.
     *
     * @param event a <code>SmtpDisconnectedEvent</code>
     *
     * @see SmtpDisconnectedEvent
     */
    void disconnected(SmtpDisconnectedEvent event);

    /**
     * Invoked when command is sent to the SMTP server
     *
     * @param event a <code>SmtpCommandEvent</code>
     *
     * @see SmtpCommandEvent
     */
    void commandSent(SmtpCommandEvent event);

    /**
     * Invoked when a response is received from SMTP server
     *
     * @param event a <code>SmtpResponseEvent</code>
     *
     * @see SmtpResponseEvent
     */
    void responseReceived(SmtpResponseEvent event);
}
