public abstract class AbstractClient extends java.lang.Object implements SshClient
SshClient. All provider client
implementations will probably want to extend this as it provides some basic
common services.| Constructor and Description |
|---|
AbstractClient(SshConfiguration configuration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChannelHandler(SshChannelHandler channelFactory)
Adds a channel handler to those invoked when custom channel creation
requests are received.
|
void |
addPortForwardListener(SshPortForwardListener listener)
Add a listener that is notified when channels are opened on this port
forward.
|
boolean |
authenticate(SshAuthenticator authenticator)
Authenticate using a single authenticator.
|
protected java.util.Map |
createAuthenticatorMap(SshAuthenticator[] authenticators) |
SshPublicKeySubsystem |
createPublicKeySubsystem()
Create an instance of a
SshPublicKeySubsystem, if the provider
supports it. |
protected void |
firePortForwardChannelClosed(int type,
SshPortForwardTunnel channel) |
protected void |
firePortForwardChannelOpened(int type,
SshPortForwardTunnel channel) |
SshConfiguration |
getConfiguration()
Get the configuration this client is using
|
SshProvider |
getProvider()
Get the provider that created this client.
|
int |
getTimeout()
Get the timeout on the underlying transport (usually a Socket, if
supported).
|
void |
init(SshProvider provider)
Called after instantiation to initialise the client and supply the
provider that created it.
|
void |
removeChannelHandler(SshChannelHandler channelFactory)
Remove a channel handler from the list of those invoked when custom channel creation
requests are received.
|
void |
removePortForwardListener(SshPortForwardListener listener)
Remove a listener that is notified when channels are opened on this port
forward.
|
void |
setTimeout(int timeout)
Set the timeout on the underlying transport (usually a Socket, if
supported).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitauthenticate, connect, createCommand, createLocalForward, createRemoteForward, createSCPClient, createSftpClient, createShell, createTunneledSocketFactory, disconnect, getChannelCount, getRemoteIdentification, getRemoteProtocolVersion, getUsername, isAuthenticated, isConnectedpublic AbstractClient(SshConfiguration configuration)
configuration - configurationpublic void addPortForwardListener(SshPortForwardListener listener)
SshClientaddPortForwardListener in interface SshClientlistener - listener to addpublic void removePortForwardListener(SshPortForwardListener listener)
SshClientremovePortForwardListener in interface SshClientlistener - listener to removepublic SshConfiguration getConfiguration()
SshClientgetConfiguration in interface SshClientpublic final void init(SshProvider provider)
SshClientpublic final SshProvider getProvider()
SshClientgetProvider in interface SshClientpublic final boolean authenticate(SshAuthenticator authenticator) throws SshException
SshClientSshClient.authenticate(SshAuthenticator[]).authenticate in interface SshClientauthenticator - authenticator.SshException#authenticate(SshAuthenticator[])}public void addChannelHandler(SshChannelHandler channelFactory) throws SshException
SshClientaddChannelHandler in interface SshClientchannelFactory - channel handler to addSshExceptionpublic void removeChannelHandler(SshChannelHandler channelFactory) throws SshException
SshClientremoveChannelHandler in interface SshClientchannelFactory - channel handler to removeSshExceptionprotected java.util.Map createAuthenticatorMap(SshAuthenticator[] authenticators)
protected void firePortForwardChannelOpened(int type,
SshPortForwardTunnel channel)
protected void firePortForwardChannelClosed(int type,
SshPortForwardTunnel channel)
public SshPublicKeySubsystem createPublicKeySubsystem() throws SshException
SshClientSshPublicKeySubsystem, if the provider
supports it.
Note, this method does not actually start the subsystems, you must call
SshLifecycleComponent.open() to do that.
Remember to close the subsystem when you are finished with it using
SshLifecycleComponent.close().
createPublicKeySubsystem in interface SshClientSshExceptionpublic void setTimeout(int timeout)
throws java.io.IOException
SshClientsetTimeout in interface SshClienttimeout - timeoutjava.io.IOExceptionpublic int getTimeout()
throws java.io.IOException
SshClientgetTimeout in interface SshClientjava.io.IOExceptionCopyright © 2018. All rights reserved.