/***************************************************************************
                            SshProcess.java -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

package org.kde.koala;

import org.kde.qt.*;
import java.util.*;
import java.lang.Error;

/**

 Executes a remote command, using ssh.
 
 @short 
 Executes a remote command, using ssh.
*/
public class SshProcess extends StubProcess  {
	protected SshProcess(Class dummy){super((Class) null);}

	private native void newSshProcess( String host, String user, String command);
	public SshProcess( String host, String user, String command) {
		super((Class) null);
		newSshProcess( host, user, command);
	}
	private native void newSshProcess();
	public SshProcess() {
		super((Class) null);
		newSshProcess();
	}
	protected native void finalize() throws InternalError;
	public native void dispose();
	public native boolean isDisposed();

/**  Sets the target host. 
*/
	public native void setHost( String host);

/**  Sets the localtion of the remote stub. 
*/
	public native void setStub( String stub);

/**  
 Checks if the current user@host needs a password. 

*/
	public native int checkNeedPassword();

/** 
 Checks if the stub is installed and if the password is correct.

*/
	public native int checkInstall( String password);

/**  Executes the command. 
*/
	public native int exec( String password, int check);
	public native int exec( String password);
	public native String prompt();
	public native String error();
	protected native String display();
	protected native String displayAuth();
	protected native String dcopServer();
	public static final int SshNotFound = 1;
	public static final int SshNeedsPassword = 0;
	public static final int SshIncorrectPassword = 1;
}
