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

/**
 * Implements methods for capturing events sourced from SshScript class.
 * <p/>
 * Typicaly your application will implement this interface to capture the
 * following events :
 * <p/>
 * <code>SshTaskStartEvent</code><br>
 * <code>SshTaskEndEvent</code><br>
 * <code>SshTaskFailedEvent</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 SshScriptListener
 * {
 *  ...
 *  public ... initMethod(...)
 *  {
 *    Ssh ssh = new Ssh(hostname,username,password);
 *    SshScript script = new SshScript(ssh);
 *    script.addSshScriptListener(this);
 *  }
 *  ...
 * }
 * </pre>
 */
public interface SshScriptListener {

    /**
     * Invoked when command for a SshTask begins execution.
     *
     * @param event a <code>SshTaskStartEvent</code>
     *
     * @see SshTaskStartEvent
     */
    void taskStart(SshTaskStartEvent event);

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

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

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