net.sf.commons.ssh
Class Connection

java.lang.Object
  extended by net.sf.commons.ssh.Connection

public abstract class Connection
extends java.lang.Object

Common interface for SSH connections.

Since:
1.0
Author:
Sergey Vidyuk (svidyuk at gmail dot com)

Constructor Summary
Connection()
           
 
Method Summary
abstract  void close()
          Closes this connection
abstract  boolean isClosed()
          Returns true if connection is closed, false otherwise
 ExecSession openExecSession(ExecSessionOptions execSessionOptions)
          Opens new command execution session from this connection
 SftpSession openSftpSession(SftpSessionOptions sftpSessionOptions)
          Opens new sftp session from this connection
 ShellSession openShellSession(ShellSessionOptions shellSessionOptions)
          Opens new shell session from this connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection()
Method Detail

close

public abstract void close()
                    throws java.io.IOException
Closes this connection

Throws:
java.io.IOException - if an I/O exception occurs

isClosed

public abstract boolean isClosed()
Returns true if connection is closed, false otherwise

Returns:
true if connection is closed, false otherwise

openExecSession

public ExecSession openExecSession(ExecSessionOptions execSessionOptions)
                            throws java.io.IOException
Opens new command execution session from this connection

Parameters:
execSessionOptions - command execution session options
Returns:
new session
Throws:
java.io.IOException - if I/O occurs

openSftpSession

public SftpSession openSftpSession(SftpSessionOptions sftpSessionOptions)
                            throws java.io.IOException
Opens new sftp session from this connection

Parameters:
sftpSessionOptions - sftp session options
Returns:
new session
Throws:
java.io.IOException - if I/O occurs
Since:
1.2

openShellSession

public ShellSession openShellSession(ShellSessionOptions shellSessionOptions)
                              throws java.io.IOException
Opens new shell session from this connection

Parameters:
shellSessionOptions - shell session options
Returns:
new session
Throws:
java.io.IOException - if I/O occurs


Copyright © 2009. All Rights Reserved.