Class AbstractSshServer

java.lang.Object
com.sshtools.server.AbstractSshServer
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
CallbackServer, SshServer

public abstract class AbstractSshServer extends Object implements Closeable
  • Field Details

    • fileFactory

      protected com.sshtools.common.policy.FileFactory fileFactory
  • Constructor Details

  • Method Details

    • getDefaultContextFactory

      public abstract com.sshtools.synergy.nio.ProtocolContextFactory<?> getDefaultContextFactory()
    • setConfigFolder

      public void setConfigFolder(File confFolder)
    • start

      public void start() throws IOException
      Throws:
      IOException
    • setSecurityLevel

      public void setSecurityLevel(com.sshtools.common.ssh.SecurityLevel securityLevel)
    • getSecurityLevel

      public com.sshtools.common.ssh.SecurityLevel getSecurityLevel()
    • addInterface

      public void addInterface(String addressToBind, int portToBind) throws IOException
      Throws:
      IOException
    • addInterface

      public void addInterface(String addressToBind, int portToBind, com.sshtools.synergy.nio.ProtocolContextFactory<?> contextFactory) throws IOException
      Throws:
      IOException
    • removeInterface

      public void removeInterface(String addressToBind, int portToBind) throws UnknownHostException
      Throws:
      UnknownHostException
    • addGlobalRequestHandler

      public void addGlobalRequestHandler(com.sshtools.synergy.ssh.GlobalRequestHandler<SshServerContext> handler)
    • start

      public void start(boolean requireListeningInterface) throws IOException
      Throws:
      IOException
    • isRunning

      public boolean isRunning()
    • stop

      public void stop()
    • addHostKeys

      public void addHostKeys(Collection<com.sshtools.common.ssh.components.SshKeyPair> hostKeys)
    • 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

      public Collection<com.sshtools.common.ssh.components.SshKeyPair> 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

      protected com.sshtools.synergy.ssh.ChannelFactory<SshServerContext> 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getForwardingPolicy

      public com.sshtools.common.forwarding.ForwardingPolicy getForwardingPolicy()