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

/**
 * Implements methods for capturing events sourced from Telnet class. Typicaly
 * your application will implement this interface to capture the following
 * events :
 * <p/>
 * <p>
 * <code>TelnetConnectedEvent</code><br>
 * <code>TelnetDisconnectedEvent</code><br>
 * <code>DoOptionEvent</code><br>
 * <code>DontOptionEvent</code><br>
 * <code>WillOptionEvent</code><br>
 * <code>WontOptionEvent</code><br>
 * <code>DoSubOptionEvent</code><br>
 * <code>TelnetDataReceivedEvent</code>
 * </p>
 * <p/>
 * <p>
 * In addition to extending this class your application should register
 * itself as an EventListener which may look somewhat like this:<br>
 * <pre>
 * public class Application ... extends TelnetAdapter
 * {
 *  ...
 *  public ... initMethod(...)
 *  {
 *    Telnet telnet = new Telnet("myserver.com");
 *    telnet.addTelnetListener(this);
 *  }
 *  ...
 * }
 * </pre>
 * </p>
 */
public class TelnetAdapter
        implements TelnetListener {
    /**
     * Invoked when Telnet connection is established.
     * Option negotiation has not yet been completed at this point.
     *
     * @param event a TelnetConnectedEvent
     *
     * @see TelnetConnectedEvent
     * @see Telnet#connect
     */
    public void connected(TelnetConnectedEvent event) {
    }

    /**
     * Invoked when Telnet connection is released. Disconnect can occur in many
     * circumstances including IOException during socket read/write or manually invoking
     * the <code>Telnet#disconnect</code> method
     *
     * @param event a TelnetDisconnectedEvent
     *
     * @see TelnetDisconnectedEvent
     * @see Telnet#disconnect
     */
    public void disconnected(TelnetDisconnectedEvent event) {
    }

    /**
     * Invoked when a DO OPTION (request client to use option) command is received from the Telnet server. Upon receiving
     * DoOptionEvent invoke the Telnet#sendDontOption to refuse the option or Telnet#sentWillOption
     * to accept the option.
     *
     * @param event a <code>DoOptionEvent</code>
     *
     * @see DoOptionEvent
     * @see TelnetOption
     * @see Telnet#sendDontOption
     * @see Telnet#sendWillOption
     */
    public void doOption(DoOptionEvent event) {
    }

    /**
     * Invoked when a DONT OPTION (refuse client request to use option) command is received from the Telnet server.
     *
     * @param event a <code>DontOptionEvent</code>
     *
     * @see DontOptionEvent
     * @see TelnetOption
     */
    public void dontOption(DontOptionEvent event) {
    }

    /**
     * Invoked when a WILL OPTION (offer client to use option) command is received from the Telnet server. Upon receiving
     * WillOptionEvent invoke the Telnet#sendDontOption method to refuse the option or
     * Telnet#sendDoOption method to accept the option.
     *
     * @param event a <code>WillOptionEvent</code>
     *
     * @see WillOptionEvent
     * @see TelnetOption
     * @see Telnet#sendDoOption
     * @see Telnet#sendDontOption
     */
    public void willOption(WillOptionEvent event) {
    }

    /**
     * Invoked when a WONT OPTION (refuse clients offer to use option) command is received from the Telnet server.
     *
     * @param event a <code>WontOptionEvent</code>
     *
     * @see WontOptionEvent
     * @see TelnetOption
     */
    public void wontOption(WontOptionEvent event) {
    }

    /**
     * Invoked when SB OPTION (subnegotiation) command is received from Telnet server, typically
     * after accepting a WILL OPTION (offer client to use option) command from Telnet server.
     * Upon receiving DoSupOptionEvent invoke the Telnet#sendOptionSubnegotiation to perform
     * subnegotiation for the requested option.
     *
     * @param event a DoSubOptionEvent
     *
     * @see DoSubOptionEvent
     * @see Telnet#sendOptionSubnegotiation
     */
    public void doSubOption(DoSubOptionEvent event) {
    }


    /**
     * Invoked when data is received from Telnet server.
     *
     * @param event a <code>TelnetDataReceivedEvent</code>
     *
     * @see TelnetDataReceivedEvent
     */
    public void dataReceived(TelnetDataReceivedEvent event) {
    }

}
