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

import com.jscape.util.SuppressObfuscation;

/**
 * A subclass of TelnetException, this exception is thrown by a TelnetSession
 * instance when using the TelnetSession#send or TelnetSession#sendWait methods
 * and the TelnetTask exceeds the maximum defined timeout waiting for the end
 * prompt.
 */
@SuppressObfuscation
public class SshTaskTimeoutException
        extends SshException {

    private static final long serialVersionUID = 2159866950340366808L;

    private SshTask task;

    /**
     * Constructs a new SshTaskTimeoutException instance
     *
     * @param task the SshTask that timed out
     *
     * @see SshTask
     */
    public SshTaskTimeoutException(SshTask task) {
        super("Exceeded task timeout of " + task.getEndPromptTimeout() + "ms waiting for end prompt.");
        this.task = task;
    }

    /**
     * Gets the SshTask that timed out
     *
     * @return the SshTask
     *
     * @see SshTask
     */
    public SshTask getTask() {
        return this.task;
    }
}
