org.opennms.netmgt.protocols.ssh
Class Ssh

java.lang.Object
  extended by org.opennms.netmgt.protocols.ssh.Ssh
Direct Known Subclasses:
Poll

public class Ssh
extends Object

Author:
Benjamin Reed

Field Summary
static int DEFAULT_PORT
           
static int DEFAULT_TIMEOUT
           
 
Constructor Summary
Ssh()
           
 
Method Summary
protected  boolean connect()
          Attempt to connect, based on the parameters which have been set in the object.
 InetAddress getAddress()
          Get the address to connect to.
protected  Throwable getError()
           
 File getKeyDirectory()
          Get the directory to search for SSH keys.
 String getPassword()
          Get the password to connect with.
 int getPort()
          Get the port to connect to.
 String getServerVersion()
          Get the SSH server version banner.
protected  com.jcraft.jsch.Session getSession()
          Get the Jsch session object.
 int getTimeout()
          Get the timeout in milliseconds.
 String getUsername()
          Get the username to connect as.
 void setAddress(InetAddress address)
          Set the address to connect to.
 void setKeyDirectory(File directory)
          Set the directory to search for SSH keys.
 void setPassword(String password)
          Set the password to connect with.
 void setPort(int port)
          Set the port to connect to.
 void setTimeout(int milliseconds)
          Set the timeout in milliseconds.
 void setUsername(String username)
          Set the username to connect as.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

Ssh

public Ssh()
Method Detail

setAddress

public void setAddress(InetAddress address)
Set the address to connect to.

Parameters:
address - the address

getAddress

public InetAddress getAddress()
Get the address to connect to.

Returns:
the address

setPort

public void setPort(int port)
Set the port to connect to.

Parameters:
port - the port

getPort

public int getPort()
Get the port to connect to.

Returns:
the port

setTimeout

public void setTimeout(int milliseconds)
Set the timeout in milliseconds.

Parameters:
milliseconds - the timeout

getTimeout

public int getTimeout()
Get the timeout in milliseconds.

Returns:
the timeout

setKeyDirectory

public void setKeyDirectory(File directory)
Set the directory to search for SSH keys.

Parameters:
directory - the directory

getKeyDirectory

public File getKeyDirectory()
Get the directory to search for SSH keys.

Returns:
the directory

setUsername

public void setUsername(String username)
Set the username to connect as.

Parameters:
username - the username

getUsername

public String getUsername()
Get the username to connect as.

Returns:
the username

setPassword

public void setPassword(String password)
Set the password to connect with.

Parameters:
password - the password

getPassword

public String getPassword()
Get the password to connect with.

Returns:
the password

getServerVersion

public String getServerVersion()
Get the SSH server version banner.

Returns:
the version string

getSession

protected com.jcraft.jsch.Session getSession()
Get the Jsch session object.

Returns:
the session

connect

protected boolean connect()
                   throws InsufficientParametersException
Attempt to connect, based on the parameters which have been set in the object.

Returns:
true if it is able to connect
Throws:
InsufficientParametersException

getError

protected Throwable getError()


Copyright ? 2008. All Rights Reserved.