Class SshDaemon

  • All Implemented Interfaces:
    LifecycleListener, SshInfo, Closeable, AutoCloseable, Channel, EventListener, org.apache.sshd.common.AttributeStore, org.apache.sshd.common.channel.ChannelListenerManager, org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolver, org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolverManager, org.apache.sshd.common.Closeable, org.apache.sshd.common.FactoryManager, org.apache.sshd.common.forward.PortForwardingEventListenerManager, org.apache.sshd.common.kex.KexFactoryManager, org.apache.sshd.common.keyprovider.KeyPairProviderHolder, org.apache.sshd.common.PropertyResolver, org.apache.sshd.common.session.ReservedSessionMessagesManager, org.apache.sshd.common.session.SessionListenerManager, org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager, org.apache.sshd.common.signature.SignatureFactoriesManager, org.apache.sshd.server.ServerAuthenticationManager, org.apache.sshd.server.ServerFactoryManager, org.apache.sshd.server.session.ServerProxyAcceptorHolder

    public class SshDaemon
    extends org.apache.sshd.server.SshServer
    implements SshInfo, LifecycleListener
    SSH daemon to communicate with Gerrit.

    Use a Git URL such as ssh://${email}@${host}:${port}/${path}, e.g. ssh://[email protected]@gerrit.com:8010/tools/gerrit.git to access the SSH daemon itself.

    Versions of Git before 1.5.3 may require setting the username and port properties in the user's ~/.ssh/config file, and using a host alias through a URL such as gerrit-alias:/tools/gerrit.git:

    
     Host gerrit-alias
      User [email protected]
      Hostname gerrit.com
      Port 8010
     
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SshDaemon.SshSessionBackend  
      • Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable

        org.apache.sshd.common.util.closeable.AbstractCloseable.State
      • Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeStore

        org.apache.sshd.common.AttributeStore.AttributeKey<T extends Object>
    • Field Summary

      • Fields inherited from class org.apache.sshd.server.SshServer

        acceptor, DEFAULT_SERVICE_FACTORIES, DEFAULT_SSH_SERVER_FACTORY, host, port
      • Fields inherited from class org.apache.sshd.common.helpers.AbstractFactoryManager

        agentFactory, channelFactories, channelListenerProxy, channelListeners, executor, fileSystemFactory, forwarderFactory, forwardingFilter, globalRequestHandlers, ioServiceFactory, ioServiceFactoryFactory, randomFactory, serviceFactories, sessionListenerProxy, sessionListeners, sessionTimeoutListener, shutdownExecutor, timeoutListenerFuture, tunnelListenerProxy, tunnelListeners
      • Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable

        closeFuture, lock, state
      • Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        log
      • Fields inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolver

        NONE
      • Fields inherited from interface org.apache.sshd.common.Closeable

        CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
      • Fields inherited from interface org.apache.sshd.common.FactoryManager

        AGENT_FORWARDING_TYPE, AGENT_FORWARDING_TYPE_IETF, AGENT_FORWARDING_TYPE_OPENSSH, AUTH_TIMEOUT, CHANNEL_CLOSE_TIMEOUT, DEFAULT_AUTH_TIMEOUT, DEFAULT_CHANNEL_CLOSE_TIMEOUT, DEFAULT_DISCONNECT_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_IGNORE_MESSAGE_FREQUENCY, DEFAULT_IGNORE_MESSAGE_SIZE, DEFAULT_IGNORE_MESSAGE_VARIANCE, DEFAULT_LIMIT_PACKET_SIZE, DEFAULT_MAX_IDENTIFICATION_SIZE, DEFAULT_MAX_PACKET_SIZE, DEFAULT_NIO_WORKERS, DEFAULT_NIO2_MIN_WRITE_TIMEOUT, DEFAULT_NIO2_READ_TIMEOUT, DEFAULT_REKEY_BYTES_LIMIT, DEFAULT_REKEY_PACKETS_LIMIT, DEFAULT_REKEY_TIME_LIMIT, DEFAULT_STOP_WAIT_TIME, DEFAULT_VERSION, DEFAULT_WINDOW_SIZE, DEFAULT_WINDOW_TIMEOUT, DISCONNECT_TIMEOUT, IDLE_TIMEOUT, IGNORE_MESSAGE_FREQUENCY, IGNORE_MESSAGE_SIZE, IGNORE_MESSAGE_VARIANCE, LIMIT_PACKET_SIZE, MAX_IDENTIFICATION_SIZE, MAX_PACKET_SIZE, NIO_WORKERS, NIO2_MIN_WRITE_TIMEOUT, NIO2_READ_BUFFER_SIZE, NIO2_READ_TIMEOUT, REKEY_BLOCKS_LIMIT, REKEY_BYTES_LIMIT, REKEY_PACKETS_LIMIT, REKEY_TIME_LIMIT, SOCKET_BACKLOG, SOCKET_KEEPALIVE, SOCKET_LINGER, SOCKET_RCVBUF, SOCKET_REUSEADDR, SOCKET_SNDBUF, STOP_WAIT_TIME, TCP_NODELAY, WINDOW_SIZE, WINDOW_TIMEOUT
      • Fields inherited from interface org.apache.sshd.common.PropertyResolver

        EMPTY
      • Fields inherited from interface org.apache.sshd.server.ServerAuthenticationManager

        AUTH_METHODS, AUTO_WELCOME_BANNER_VALUE, DEFAULT_BANNER_PHASE, DEFAULT_MAX_AUTH_REQUESTS, DEFAULT_USER_AUTH_GSS_FACTORY, DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY, DEFAULT_USER_AUTH_PASSWORD_FACTORY, DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY, DEFAULT_WELCOME_BANNER_LANGUAGE, MAX_AUTH_REQUESTS, WELCOME_BANNER, WELCOME_BANNER_CHARSET, WELCOME_BANNER_LANGUAGE, WELCOME_BANNER_PHASE
      • Fields inherited from interface org.apache.sshd.server.ServerFactoryManager

        COMMAND_EXIT_TIMEOUT, DEFAULT_COMMAND_EXIT_TIMEOUT, MAX_CONCURRENT_SESSIONS, MODULI_URL, SERVER_EXTRA_IDENT_LINES_SEPARATOR, SERVER_EXTRA_IDENTIFICATION_LINES, SERVER_IDENTIFICATION
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkConfig()  
      List<com.jcraft.jsch.HostKey> getHostKeys()  
      org.apache.sshd.common.io.IoAcceptor getIoAcceptor()  
      void start()
      Invoked when the server is starting.
      void stop()
      Invoked when the server is stopping.
      • Methods inherited from class org.apache.sshd.server.SshServer

        createAcceptor, createSessionFactory, getActiveSessions, getBoundAddresses, getCommandFactory, getGSSAuthenticator, getHost, getHostBasedAuthenticator, getInnerCloseable, getKeyboardInteractiveAuthenticator, getPasswordAuthenticator, getPort, getPublickeyAuthenticator, getServerProxyAcceptor, getSessionFactory, getShellFactory, getSubsystemFactories, getUserAuthFactories, isStarted, open, setCommandFactory, setGSSAuthenticator, setHost, setHostBasedAuthenticator, setKeyboardInteractiveAuthenticator, setPasswordAuthenticator, setPort, setPublickeyAuthenticator, setServerProxyAcceptor, setSessionFactory, setShellFactory, setSubsystemFactories, setUpDefaultServer, setUserAuthFactories, stop, toString
      • Methods inherited from class org.apache.sshd.common.helpers.AbstractFactoryManager

        addChannelListener, addPortForwardingEventListener, addSessionListener, createSessionTimeoutListener, getAgentFactory, getAttribute, getChannelFactories, getChannelListenerProxy, getChannelStreamPacketWriterResolver, getFileSystemFactory, getForwarderFactory, getForwardingFilter, getGlobalRequestHandlers, getIoServiceFactory, getIoServiceFactoryFactory, getNioWorkers, getParentPropertyResolver, getPortForwardingEventListenerProxy, getProperties, getRandomFactory, getReservedSessionMessagesHandler, getScheduledExecutorService, getServiceFactories, getSessionListenerProxy, getUnknownChannelReferenceHandler, getVersion, removeAttribute, removeChannelListener, removePortForwardingEventListener, removeSessionListener, removeSessionTimeout, resolveAttribute, resolveUnknownChannelReferenceHandler, setAgentFactory, setAttribute, setChannelFactories, setChannelStreamPacketWriterResolver, setFileSystemFactory, setForwarderFactory, setForwardingFilter, setGlobalRequestHandlers, setIoServiceFactoryFactory, setNioWorkers, setParentPropertyResolver, setRandomFactory, setReservedSessionMessagesHandler, setScheduledExecutorService, setScheduledExecutorService, setServiceFactories, setUnknownChannelReferenceHandler, setupSessionTimeout, stopSessionTimeoutListener
      • Methods inherited from class org.apache.sshd.common.kex.AbstractKexFactoryManager

        getCipherFactories, getCompressionFactories, getKeyExchangeFactories, getKeyPairProvider, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setKeyPairProvider, setMacFactories, setSignatureFactories
      • Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable

        doCloseGracefully, doCloseImmediately
      • Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable

        addCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListener
      • Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        getSimplifiedLogger
      • Methods inherited from interface org.apache.sshd.common.AttributeStore

        getAttribute, removeAttribute, resolveAttribute, setAttribute
      • Methods inherited from interface org.apache.sshd.common.channel.ChannelListenerManager

        addChannelListener, getChannelListenerProxy, removeChannelListener
      • Methods inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolverManager

        getChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolver
      • Methods inherited from interface org.apache.sshd.common.Closeable

        addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
      • Methods inherited from interface org.apache.sshd.common.FactoryManager

        getAgentFactory, getAgentForwardingFilter, getChannelFactories, getFileSystemFactory, getForwarderFactory, getForwardingFilter, getGlobalRequestHandlers, getIoServiceFactory, getRandomFactory, getScheduledExecutorService, getServiceFactories, getTcpForwardingFilter, getVersion, getX11ForwardingFilter
      • Methods inherited from interface org.apache.sshd.common.kex.KexFactoryManager

        getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
      • Methods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProviderHolder

        getKeyPairProvider, setKeyPairProvider
      • Methods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListenerManager

        addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListener
      • Methods inherited from interface org.apache.sshd.common.PropertyResolver

        getBoolean, getBooleanProperty, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty
      • Methods inherited from interface org.apache.sshd.common.session.ReservedSessionMessagesManager

        getReservedSessionMessagesHandler, setReservedSessionMessagesHandler
      • Methods inherited from interface org.apache.sshd.server.ServerAuthenticationManager

        getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNames, setUserAuthFactoriesNames
      • Methods inherited from interface org.apache.sshd.common.session.SessionListenerManager

        addSessionListener, getSessionListenerProxy, removeSessionListener
      • Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager

        getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
      • Methods inherited from interface org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager

        getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandler
    • Method Detail

      • getHostKeys

        public List<com.jcraft.jsch.HostKey> getHostKeys()
        Specified by:
        getHostKeys in interface SshInfo
      • getIoAcceptor

        public org.apache.sshd.common.io.IoAcceptor getIoAcceptor()
      • start

        public void start()
        Description copied from interface: LifecycleListener
        Invoked when the server is starting.
        Specified by:
        start in interface LifecycleListener
        Overrides:
        start in class org.apache.sshd.server.SshServer
      • stop

        public void stop()
        Description copied from interface: LifecycleListener
        Invoked when the server is stopping.
        Specified by:
        stop in interface LifecycleListener
        Overrides:
        stop in class org.apache.sshd.server.SshServer
      • checkConfig

        protected void checkConfig()
        Overrides:
        checkConfig in class org.apache.sshd.server.SshServer