Class SshServer

All Implemented Interfaces:
Runnable, InitializingPhase, Named, ShutdownPhase, Endpoint, Server, ReferenceResolverAware

public class SshServer extends AbstractServer
SSH Server implemented with Apache SSHD (http://mina.apache.org/sshd/). It uses the same semantic as the Jetty Servers for HTTP and WS mocks and translates an incoming request into a message, for which a reply message gets translates to the SSH return value. The incoming message generated has the following format: <ssh-request> cat - This is the standard input sent </ssh-request> The reply message to be generated by a handler should have the following format <ssh-response> 0 This is the standard input sent warning: no tty </ssh-response>
Since:
04.09.12
Author:
Roland Huss
  • Constructor Details

    • SshServer

      public SshServer()
      Default constructor using default endpoint configuration.
    • SshServer

      public SshServer(SshEndpointConfiguration endpointConfiguration)
      Constructor using endpoint configuration.
      Parameters:
      endpointConfiguration -
  • Method Details

    • startup

      protected void startup()
      Specified by:
      startup in class AbstractServer
    • getScpTransferEventListener

      protected org.apache.sshd.scp.common.ScpTransferEventListener getScpTransferEventListener()
      Gets Scp trsanfer event listener. By default uses abstract implementation that use trace level logging of all operations.
      Returns:
    • getSftpEventListener

      protected org.apache.sshd.sftp.server.SftpEventListener getSftpEventListener()
      Gets Sftp event listener. By default uses abstract implementation that use trace level logging of all operations.
      Returns:
    • shutdown

      protected void shutdown()
      Specified by:
      shutdown in class AbstractServer
    • getEndpointConfiguration

      public AbstractPollableEndpointConfiguration getEndpointConfiguration()
      Specified by:
      getEndpointConfiguration in interface Endpoint
      Overrides:
      getEndpointConfiguration in class AbstractServer
    • getPort

      public int getPort()
      Gets the server port.
      Returns:
    • setPort

      public void setPort(int port)
      Sets the port.
      Parameters:
      port - the port to set
    • getUser

      public String getUser()
      Gets the username.
      Returns:
    • setUser

      public void setUser(String user)
      Sets the user.
      Parameters:
      user - the user to set
    • getPassword

      public String getPassword()
      Gets the user password.
      Returns:
    • setPassword

      public void setPassword(String password)
      Sets the password.
      Parameters:
      password - the password to set
    • getAllowedKeyPath

      public String getAllowedKeyPath()
      Gets the allowed key path.
      Returns:
    • setAllowedKeyPath

      public void setAllowedKeyPath(String allowedKeyPath)
      Sets the allowedKeyPath.
      Parameters:
      allowedKeyPath - the allowedKeyPath to set
    • getHostKeyPath

      public String getHostKeyPath()
      Gets the host key path.
      Returns:
    • setHostKeyPath

      public void setHostKeyPath(String hostKeyPath)
      Sets the hostKeyPath.
      Parameters:
      hostKeyPath - the hostKeyPath to set
    • getUserHomePath

      public String getUserHomePath()
      Gets the userHomePath.
      Returns:
    • setUserHomePath

      public void setUserHomePath(String userHomePath)
      Sets the userHomePath.
      Parameters:
      userHomePath -
    • getMessageConverter

      public SshMessageConverter getMessageConverter()
      Gets the message converter.
      Returns:
    • setMarshaller

      public void setMarshaller(SshMarshaller marshaller)
      Sets the marshaller.
      Parameters:
      marshaller -
    • setMessageConverter

      public void setMessageConverter(SshMessageConverter messageConverter)
      Sets the message converter.
      Parameters:
      messageConverter -