|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sshtools.virtualsession.ssh.AbstractSshProtocolTransport
An implementation of a VirtualSessionTransport that uses J2SSH
Maverick to make a connection to a remote host.
| Field Summary | |
static int |
AUTH_CANCELLED
|
static int |
AUTH_FAILED
|
static int |
AUTH_OK
|
protected int |
authAttempt
|
protected boolean |
connectionPending
|
protected ForwardingClient |
forwardingClient
|
protected HostKeyVerification |
hostKeyVerification
|
protected java.lang.String |
ident
|
protected SSHSchemeOptions |
opts
|
protected ResourceProfile |
profile
|
protected SshSession |
session
|
protected SshClient |
ssh
|
protected int |
version
|
protected VirtualSession |
virtualSession
|
| Constructor Summary | |
AbstractSshProtocolTransport()
|
|
AbstractSshProtocolTransport(HostKeyVerification hostKeyVerification)
|
|
| Method Summary | |
abstract int |
authenticate(ResourceProfile profile,
java.awt.Component parent)
|
protected boolean |
authImpl()
|
void |
configureForwardingClient(ForwardingClient fc)
|
boolean |
connect(ResourceProfile profile)
Connect to a host (or resource) using the URI provided in the ResourceProfile}. |
abstract BannerDisplay |
createBannerDisplay(java.awt.Component parent)
Create a banner display |
SshClient |
createClient(ResourceProfile profile,
java.awt.Component parent)
Create the client |
ForwardingClient |
createForwardingClient()
Create the forwarding client |
SshSession |
createSession(ResourceProfile profile,
SshClient client)
Create the session |
void |
disconnect()
Disconnect from the currently connected resource. |
SshClient |
getClient()
Return the client, or null if not connected. |
ForwardingClient |
getForwardingClient()
|
java.lang.String |
getHostDescription()
If the host has provided some information about itself, this method will return it. |
HostKeyVerification |
getHostKeyVerification()
|
java.awt.Component |
getParent()
|
ResourceProfile |
getProfile()
Get the profile that was used to connect this transport. |
java.lang.String |
getProtocolDescription()
Return a short description of the protocol, for example "Telnet" or "SSH2" |
java.lang.Object |
getProvider()
Return the underlying provider of the terminal. |
SshSession |
getSession()
Return the session, or null if there is no session connected |
java.lang.String |
getTransportDescription()
Return a short description of the transport, for example "Socket" or "SOCKS5" |
VirtualSession |
getVirtualSession()
Get the virtual session for this connection |
void |
init(VirtualSession virtualSession)
Initialise the transport. |
boolean |
isConnected()
Get if the transport is currently connected to a host |
boolean |
isConnectionPending()
Return true if a connection is due to be made |
abstract void |
postAuthenticate()
Invoked after the client has been authenticated |
abstract void |
postCreateClient()
Invoked after the client has been created |
abstract void |
postCreateSession()
Invoked after the session has been created |
void |
setHostKeyVerification(HostKeyVerification hostKeyVerification)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sshtools.profile.ProfileTransport |
cloneVirtualSession, isCloneVirtualSessionSupported |
| Field Detail |
public static final int AUTH_OK
public static final int AUTH_FAILED
public static final int AUTH_CANCELLED
protected SshClient ssh
protected SshSession session
protected VirtualSession virtualSession
protected ResourceProfile profile
protected int authAttempt
protected HostKeyVerification hostKeyVerification
protected boolean connectionPending
protected SSHSchemeOptions opts
protected java.lang.String ident
protected int version
protected ForwardingClient forwardingClient
| Constructor Detail |
public AbstractSshProtocolTransport()
public AbstractSshProtocolTransport(HostKeyVerification hostKeyVerification)
| Method Detail |
public java.awt.Component getParent()
public SshSession createSession(ResourceProfile profile,
SshClient client)
throws SshException,
ChannelOpenException
profile - profileclient - client
java.io.IOException - on any error
SshException
ChannelOpenException
public abstract int authenticate(ResourceProfile profile,
java.awt.Component parent)
throws AuthenticationException,
SshException
AuthenticationException
SshException
public ForwardingClient createForwardingClient()
throws SshException
SshException
public void configureForwardingClient(ForwardingClient fc)
throws SshException
SshException
public SshClient createClient(ResourceProfile profile,
java.awt.Component parent)
throws SshException
profile - profileparent - parent component
java.io.IOException - on any error
SshExceptionpublic abstract BannerDisplay createBannerDisplay(java.awt.Component parent)
parent - parent component
public SshClient getClient()
null if not connected.
public SshSession getSession()
null if there is no session connected
public void disconnect()
throws java.io.IOException
ProfileTransportIOException will
be thrown.
disconnect in interface ProfileTransportjava.io.IOException - on any disconnection errorpublic VirtualSession getVirtualSession()
VirtualSessionTransport
getVirtualSession in interface VirtualSessionTransportpublic java.lang.Object getProvider()
ProfileTransport
getProvider in interface ProfileTransport
public boolean connect(ResourceProfile profile)
throws ProfileException,
AuthenticationException
ProfileTransport
connect in interface ProfileTransportprofile - profile
true if connected OK
ProfileException - on any connection error
AuthenticationException - if authentication fails
protected boolean authImpl()
throws AuthenticationException,
SshException,
ProfileException
AuthenticationException
SshException
ProfileException
public abstract void postCreateClient()
throws SshException
java.io.IOException - on any error
SshException
public abstract void postAuthenticate()
throws SshException
java.io.IOException - on any error
SshException
public abstract void postCreateSession()
throws SshException
java.io.IOException - session
SshExceptionpublic ResourceProfile getProfile()
ProfileTransportnull if disconnected.
getProfile in interface ProfileTransportpublic boolean isConnected()
VirtualSessionTransport
isConnected in interface VirtualSessionTransportpublic void init(VirtualSession virtualSession)
VirtualSessionTransport
init in interface VirtualSessionTransportvirtualSession - virtual sessionpublic java.lang.String getHostDescription()
ProfileTransportnull will be returned.
getHostDescription in interface ProfileTransportpublic java.lang.String getProtocolDescription()
ProfileTransport
getProtocolDescription in interface ProfileTransportpublic java.lang.String getTransportDescription()
ProfileTransport
getTransportDescription in interface ProfileTransportpublic boolean isConnectionPending()
VirtualSessionTransporttrue if a connection is due to be made
isConnectionPending in interface VirtualSessionTransportpublic ForwardingClient getForwardingClient()
public HostKeyVerification getHostKeyVerification()
public void setHostKeyVerification(HostKeyVerification hostKeyVerification)
hostKeyVerification - The hostKeyVerification to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||