com.sshtools.j2ssh.configuration
Class SshConnectionProperties

java.lang.Object
  |
  +--com.sshtools.j2ssh.configuration.SshConnectionProperties

public class SshConnectionProperties
extends java.lang.Object

Represents an SSH connection. An instance of this class is passed to the connect methods of the transport protocol. It specifies all the preferred algorithms and methods

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )

Constructor Summary
SshConnectionProperties()
          Constructor for the SshConnectionProperties object
SshConnectionProperties(java.lang.String host, java.lang.String username)
          Constructor for the SshConnectionProperties object
 
Method Summary
 void addAuthenticationMethod(java.lang.String method)
          Adds and authentication method to the properties.
 java.util.List getAuthenticationMethods()
          Gets the list of authentication methods for this connection
 java.lang.String getHost()
          Gets the host name for the connection
 int getPort()
          Gets the port for this connection
 java.lang.String getPrefCSComp()
          Gets the preferred client->server compression
 java.lang.String getPrefCSEncryption()
          Gets the preferred client->server encryption method for the connection
 java.lang.String getPrefCSMac()
          Gets the preferred client->server message authentication
 java.lang.String getPrefKex()
          Gets the preferred key exchange method
 java.lang.String getPrefPublicKey()
          Gets the preferred public key mechanism
 java.lang.String getPrefSCComp()
          Gets the preferred server->client compression
 java.lang.String getPrefSCEncryption()
          Gets the preferred server->client encryption for the conneciton
 java.lang.String getPrefSCMac()
          Gets the preferred server->client message authentication
 java.lang.String getTerminalType()
          Gets the terminal type
 java.lang.String getUsername()
          Gets the username for the connection
 void open(java.lang.String file)
          Opens a connection file and loads the properties ready for connection
 void removeAuthenticaitonMethod(java.lang.String method)
          Removes an authentication method
 void save(java.lang.String file)
          Call this method to save the connection properties to file
 void setHost(java.lang.String host)
          Sets the host name for this connection
 void setPort(int port)
          Sets the port for the connection
 void setPrefCSComp(java.lang.String pref)
          Sets the preferred client->server compression
 void setPrefCSEncryption(java.lang.String pref)
          Sets the prefEncryption attribute of the SshConnectionProperties object
 void setPrefCSMac(java.lang.String pref)
          Sets the preferred client->server message authentication
 void setPrefKex(java.lang.String pref)
          Sets the preferred key exchange for the connection
 void setPrefPublicKey(java.lang.String pref)
          Sets the preferred public key mechanism
 void setPrefSCComp(java.lang.String pref)
          Sets the preferred server->client compression
 void setPrefSCEncryption(java.lang.String pref)
          Sets the preferred server->client encryption for the connection
 void setPrefSCMac(java.lang.String pref)
          Sets the preferred server->client message authentication
 void setTerminalType(java.lang.String term)
          Sets the terminal type
 void setUsername(java.lang.String username)
          Sets the username for the connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshConnectionProperties

public SshConnectionProperties(java.lang.String host,
                               java.lang.String username)
Constructor for the SshConnectionProperties object

Parameters:
host - The host to connect to
username - The name of the user

SshConnectionProperties

public SshConnectionProperties()
Constructor for the SshConnectionProperties object

Method Detail

open

public void open(java.lang.String file)
          throws InvalidConnectionFileException
Opens a connection file and loads the properties ready for connection

Parameters:
file - The full path to the file
Throws:
InvalidConnectionFileException - Thrown if the file is not a valid connection file

save

public void save(java.lang.String file)
          throws InvalidConnectionFileException
Call this method to save the connection properties to file

Parameters:
file - The file to save to
Throws:
InvalidConnectionFileException

addAuthenticationMethod

public void addAuthenticationMethod(java.lang.String method)
Adds and authentication method to the properties. When a connection is saved, these methods are attempted without the need for the user to specify them

Parameters:
method - The method name to add

removeAuthenticaitonMethod

public void removeAuthenticaitonMethod(java.lang.String method)
Removes an authentication method

Parameters:
method -

getAuthenticationMethods

public java.util.List getAuthenticationMethods()
Gets the list of authentication methods for this connection

Returns:

setTerminalType

public void setTerminalType(java.lang.String term)
Sets the terminal type

Parameters:
term -

getTerminalType

public java.lang.String getTerminalType()
Gets the terminal type

Returns:

getHost

public java.lang.String getHost()
Gets the host name for the connection

Returns:
The host name

getPort

public int getPort()
Gets the port for this connection

Returns:
The port value

setHost

public void setHost(java.lang.String host)
Sets the host name for this connection

Parameters:
host - The new host value

setUsername

public void setUsername(java.lang.String username)
Sets the username for the connection

Parameters:
username -

setPort

public void setPort(int port)
Sets the port for the connection

Parameters:
port - The new port value

getUsername

public java.lang.String getUsername()
Gets the username for the connection

Returns:
The username value

getPrefCSEncryption

public java.lang.String getPrefCSEncryption()
Gets the preferred client->server encryption method for the connection

Returns:
The prefEncryption value

setPrefKex

public void setPrefKex(java.lang.String pref)
Sets the preferred key exchange for the connection

Parameters:
pref -

setPrefCSEncryption

public void setPrefCSEncryption(java.lang.String pref)
Sets the prefEncryption attribute of the SshConnectionProperties object

Parameters:
pref - The method name

getPrefSCEncryption

public java.lang.String getPrefSCEncryption()
Gets the preferred server->client encryption for the conneciton

Returns:
The method name

setPrefSCEncryption

public void setPrefSCEncryption(java.lang.String pref)
Sets the preferred server->client encryption for the connection

Parameters:
pref - The method name

getPrefCSMac

public java.lang.String getPrefCSMac()
Gets the preferred client->server message authentication

Returns:
The method name

setPrefCSMac

public void setPrefCSMac(java.lang.String pref)
Sets the preferred client->server message authentication

Parameters:
pref - The new prefCSMac value

getPrefSCMac

public java.lang.String getPrefSCMac()
Gets the preferred server->client message authentication

Returns:
The method name

setPrefSCMac

public void setPrefSCMac(java.lang.String pref)
Sets the preferred server->client message authentication

Parameters:
pref - The new prefSCMac value

getPrefCSComp

public java.lang.String getPrefCSComp()
Gets the preferred client->server compression

Returns:
The method name

setPrefCSComp

public void setPrefCSComp(java.lang.String pref)
Sets the preferred client->server compression

Parameters:
pref - The new prefCSComp value

getPrefSCComp

public java.lang.String getPrefSCComp()
Gets the preferred server->client compression

Returns:
The method name

setPrefSCComp

public void setPrefSCComp(java.lang.String pref)
Sets the preferred server->client compression

Parameters:
pref - The new prefSCComp value

getPrefPublicKey

public java.lang.String getPrefPublicKey()
Gets the preferred public key mechanism

Returns:
The method name

setPrefPublicKey

public void setPrefPublicKey(java.lang.String pref)
Sets the preferred public key mechanism

Parameters:
pref - The method name

getPrefKex

public java.lang.String getPrefKex()
Gets the preferred key exchange method

Returns:
The method value


Copyright © 2002 Sshtools.com. All Rights Reserved.