/*
 * @(#)TelnetScriptListener.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 TelnetScript class.
 * <p/>
 * Typicaly your application will implement this interface to capture the
 * following events :
 * <p/>
 * <code>TelnetTaskStartEvent</code><br>
 * <code>TelnetTaskEndEvent</code><br>
 * <code>TelnetTaskFailedEvent</code><br>
 * <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 TelnetScriptListener
 * {
 *  ...
 *  public ... initMethod(...)
 *  {
 *    Telnet telnet = new Telnet("10.0.0.1");
 *    TelnetScript script = new TelnetScript(telnet);
 *    script.addTelnetScriptListener(this);
 *  }
 *  ...
 * }
 * </pre>
 */
public interface TelnetScriptListener {
    /**
     * Invoked when command for a TelnetTask begins execution.
     *
     * @param event a <code>TelnetTaskStartEvent</code>
     *
     * @see TelnetTaskStartEvent
     */
    void taskStart(TelnetTaskStartEvent event);

    /**
     * Invoked when command for a TelnetTask completes execution.
     *
     * @param event a <code>TelnetTaskEndEvent</code>
     *
     * @see TelnetTaskEndEvent
     */
    void taskEnd(TelnetTaskEndEvent event);

    /**
     * Invoked when command for a TelnetTask fails execution.
     *
     * @param event a <code>TelnetTaskFailedEvent</code>
     *
     * @see TelnetTaskFailedEvent
     */
    void taskFailed(TelnetTaskFailedEvent event);

    /**
     * Invoked when a TelnetTask exceeds timeout waiting for end prompt.
     *
     * @param event a <code>TelnetTaskTimeoutEvent</code>
     *
     * @see TelnetTaskTimeoutEvent
     */
    void taskTimeout(TelnetTaskTimeoutEvent event);
}
