Package com.sshtools.server
Class AbstractSshServer
java.lang.Object
com.sshtools.server.AbstractSshServer
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
CallbackServer
,SshServer
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractSshServer
(int port) AbstractSshServer
(String addressToBind, int port) AbstractSshServer
(InetAddress addressToBind, int port) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthenticator
(com.sshtools.common.auth.Authenticator provider) void
addGlobalRequestHandler
(com.sshtools.synergy.ssh.GlobalRequestHandler<SshServerContext> handler) void
addHostKey
(com.sshtools.common.ssh.components.SshKeyPair key) void
addHostKeys
(com.sshtools.common.ssh.components.SshKeyPair... hostKeys) void
addHostKeys
(Collection<com.sshtools.common.ssh.components.SshKeyPair> hostKeys) void
addInterface
(String addressToBind, int portToBind) void
addInterface
(String addressToBind, int portToBind, com.sshtools.synergy.nio.ProtocolContextFactory<?> contextFactory) protected void
protected void
void
close()
void
configure
(SshServerContext sshContext, SocketChannel sc) protected void
configureAuthentication
(SshServerContext sshContext, SocketChannel sc) protected void
configureChannels
(SshServerContext sshContext, SocketChannel sc) protected void
configureFilesystem
(SshServerContext sshContext, SocketChannel sc) protected void
configureForwarding
(SshServerContext sshContext, SocketChannel sc) protected void
configureHostKeys
(SshServerContext sshContext, SocketChannel sc) createServerContext
(com.sshtools.synergy.nio.SshEngineContext daemonContext, SocketChannel sc) void
void
protected com.sshtools.synergy.ssh.ChannelFactory<SshServerContext>
abstract com.sshtools.synergy.nio.ProtocolContextFactory<?>
com.sshtools.synergy.nio.SshEngine
com.sshtools.common.policy.FileFactory
com.sshtools.common.forwarding.ForwardingPolicy
Collection<com.sshtools.common.ssh.components.SshKeyPair>
com.sshtools.common.permissions.IPPolicy
int
getPort()
com.sshtools.common.ssh.SecurityLevel
com.sshtools.common.ssh.AbstractRequestFuture
boolean
void
removeInterface
(String addressToBind, int portToBind) void
setChannelFactory
(com.sshtools.synergy.ssh.ChannelFactory<SshServerContext> channelFactory) void
setConfigFolder
(File confFolder) void
setFileFactory
(com.sshtools.common.policy.FileFactory fileFactory) void
setIPPolicy
(com.sshtools.common.permissions.IPPolicy ipPolicy) void
setSecurityLevel
(com.sshtools.common.ssh.SecurityLevel securityLevel) void
start()
void
start
(boolean requireListeningInterface) void
stop()
-
Field Details
-
fileFactory
protected com.sshtools.common.policy.FileFactory fileFactory
-
-
Constructor Details
-
AbstractSshServer
protected AbstractSshServer() -
AbstractSshServer
- Throws:
UnknownHostException
-
AbstractSshServer
- Throws:
UnknownHostException
-
AbstractSshServer
-
-
Method Details
-
getDefaultContextFactory
public abstract com.sshtools.synergy.nio.ProtocolContextFactory<?> getDefaultContextFactory() -
setConfigFolder
-
start
- Throws:
IOException
-
setSecurityLevel
public void setSecurityLevel(com.sshtools.common.ssh.SecurityLevel securityLevel) -
getSecurityLevel
public com.sshtools.common.ssh.SecurityLevel getSecurityLevel() -
addInterface
- Throws:
IOException
-
addInterface
public void addInterface(String addressToBind, int portToBind, com.sshtools.synergy.nio.ProtocolContextFactory<?> contextFactory) throws IOException - Throws:
IOException
-
removeInterface
- Throws:
UnknownHostException
-
addGlobalRequestHandler
public void addGlobalRequestHandler(com.sshtools.synergy.ssh.GlobalRequestHandler<SshServerContext> handler) -
start
- Throws:
IOException
-
isRunning
public boolean isRunning() -
stop
public void stop() -
addHostKeys
-
addHostKeys
public void addHostKeys(com.sshtools.common.ssh.components.SshKeyPair... hostKeys) -
addHostKey
public void addHostKey(com.sshtools.common.ssh.components.SshKeyPair key) -
addAuthenticator
public void addAuthenticator(com.sshtools.common.auth.Authenticator provider) -
setFileFactory
public void setFileFactory(com.sshtools.common.policy.FileFactory fileFactory) -
getFileFactory
public com.sshtools.common.policy.FileFactory getFileFactory() -
setChannelFactory
public void setChannelFactory(com.sshtools.synergy.ssh.ChannelFactory<SshServerContext> channelFactory) -
getIPPolicy
public com.sshtools.common.permissions.IPPolicy getIPPolicy() -
setIPPolicy
public void setIPPolicy(com.sshtools.common.permissions.IPPolicy ipPolicy) -
enableSCP
public void enableSCP() -
disableSCP
public void disableSCP() -
getPort
public int getPort() -
beforeStart
protected void beforeStart() -
afterStart
protected void afterStart() -
getShutdownFuture
public com.sshtools.common.ssh.AbstractRequestFuture getShutdownFuture() -
configureHostKeys
protected void configureHostKeys(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
getHostKeys
-
configureFilesystem
protected void configureFilesystem(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
configureAuthentication
protected void configureAuthentication(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
getChannelFactory
-
configureChannels
protected void configureChannels(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
configureForwarding
protected void configureForwarding(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
createServerContext
public SshServerContext createServerContext(com.sshtools.synergy.nio.SshEngineContext daemonContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
configure
public void configure(SshServerContext sshContext, SocketChannel sc) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
getEngine
public com.sshtools.synergy.nio.SshEngine getEngine() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getForwardingPolicy
public com.sshtools.common.forwarding.ForwardingPolicy getForwardingPolicy()
-