com.maverick.ssh
Interface SshContext

All Known Implementing Classes:
Ssh1Context, Ssh2Context

public interface SshContext

This interface defines the general configuration items available to both SSH1 and SSH2. Each new instance of SshConnector is initialized with a configuration context for each protocol version. When the user connects to a remote SSH server using the SshConnector the returned SshClient is configured with the context according to the protocol version. Multiple connections can be made from the SshConnector with the same context, and with different instances of SshConnector having different contexts.

Author:
Lee David Painter
See Also:
SshConnector, Ssh1Context, Ssh2Context

Method Summary
 int getChannelLimit()
          Get the maximum number of channels that are allowed open at any one time.
 HostKeyVerification getHostKeyVerification()
          Get the host key verification implementation.
 java.lang.String getSFTPProvider()
          Get the path to the SFTP provider.
 byte[] getX11AuthenticationCookie()
          Get a fake random cookie for X11 authentication
 java.lang.String getX11Display()
          Get the currently configured XDisplay setting which will be null if no display is currently set.
 byte[] getX11RealCookie()
          Get the real X11 authentication cookie, if not cookie has been set the fake cookie will be returned.
 ForwardingRequestListener getX11RequestListener()
          Get the X11 forwarding request listener.
 void setChannelLimit(int max)
          Set the maximum number of channels that are allowed open at any one time.
 void setHostKeyVerification(HostKeyVerification verify)
          Set the host key verification implementation.
 void setSFTPProvider(java.lang.String sftpProvider)
          Set the path to the SFTP provider.
 void setX11Display(java.lang.String xDisplay)
          Set the DISPLAY variable for the SSH connection.
 void setX11RealCookie(byte[] x11RealCookie)
          Sets the real X11 authentication cookie which can be obtained from the users $HOME/.Xauthority file.
 void setX11RequestListener(ForwardingRequestListener listener)
          Set the listener to which X11 forwarding requests will be processed.
 

Method Detail

setChannelLimit

public void setChannelLimit(int max)
Set the maximum number of channels that are allowed open at any one time.

Parameters:
max -

getChannelLimit

public int getChannelLimit()
Get the maximum number of channels that are allowed open at any one time.

Returns:
the maximum number of channels

setHostKeyVerification

public void setHostKeyVerification(HostKeyVerification verify)
Set the host key verification implementation.

Parameters:
verify -

getHostKeyVerification

public HostKeyVerification getHostKeyVerification()
Get the host key verification implementation.

Returns:
the current host key verification implementation

setSFTPProvider

public void setSFTPProvider(java.lang.String sftpProvider)
Set the path to the SFTP provider. For SSH1 connections an attempt to execute this provider will be made as SSH1 does not support subsystems. For SSH2 connections an attempt will be made to execute this provider if the subsystem cannot be started.

Parameters:
sftpProvider -

getSFTPProvider

public java.lang.String getSFTPProvider()
Get the path to the SFTP provider. For SSH1 connections an attempt to execute this provider will be made as SSH1 does not support subsystems. For SSH2 connections an attempt will be made to execute this provider if the subsystem cannot be started. The default is '/usr/libexec/sftp-server'

Returns:

setX11Display

public void setX11Display(java.lang.String xDisplay)
Set the DISPLAY variable for the SSH connection. If this is set the SSH sessions will have their DISPLAY variable set and X sessions will be forwarded over the SSH connection to the display specified.

Parameters:
xDisplay - the display in the form localhost:1

getX11Display

public java.lang.String getX11Display()
Get the currently configured XDisplay setting which will be null if no display is currently set.

Returns:

getX11AuthenticationCookie

public byte[] getX11AuthenticationCookie()
Get a fake random cookie for X11 authentication

Returns:

setX11RealCookie

public void setX11RealCookie(byte[] x11RealCookie)
Sets the real X11 authentication cookie which can be obtained from the users $HOME/.Xauthority file.

Parameters:
x11RealCookie -

getX11RealCookie

public byte[] getX11RealCookie()
Get the real X11 authentication cookie, if not cookie has been set the fake cookie will be returned.

Returns:

setX11RequestListener

public void setX11RequestListener(ForwardingRequestListener listener)
Set the listener to which X11 forwarding requests will be processed.

Parameters:
listener -

getX11RequestListener

public ForwardingRequestListener getX11RequestListener()
Get the X11 forwarding request listener.

Returns:


Copyright © 2003 3SP LTD. All Rights Reserved.