Class AsyncSshHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler

    public class AsyncSshHandler
    extends io.netty.channel.ChannelOutboundHandlerAdapter
    Netty SSH handler class. Acts as interface between Netty and SSH library.
    • Field Detail

      • SSH_DEFAULT_NIO_WORKERS

        public static final int SSH_DEFAULT_NIO_WORKERS
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT

        public static final org.apache.sshd.client.SshClient DEFAULT_CLIENT
    • Constructor Detail

      • AsyncSshHandler

        public AsyncSshHandler​(AuthenticationHandler authenticationHandler,
                               org.apache.sshd.client.SshClient sshClient,
                               io.netty.util.concurrent.Future<?> negotiationFuture)
      • AsyncSshHandler

        public AsyncSshHandler​(AuthenticationHandler authenticationHandler,
                               org.apache.sshd.client.SshClient sshClient)
        Constructor of AsyncSshHandler.
        Parameters:
        authenticationHandler - authentication handler
        sshClient - started SshClient
    • Method Detail

      • createForNetconfSubsystem

        public static AsyncSshHandler createForNetconfSubsystem​(AuthenticationHandler authenticationHandler,
                                                                io.netty.util.concurrent.Future<?> negotiationFuture,
                                                                @Nullable org.apache.sshd.client.SshClient sshClient)
        Create AsyncSshHandler for netconf subsystem. Negotiation future has to be set to success after successful netconf negotiation.
        Parameters:
        authenticationHandler - authentication handler
        negotiationFuture - negotiation future
        Returns:
        AsyncSshHandler
      • write

        public void write​(io.netty.channel.ChannelHandlerContext ctx,
                          Object msg,
                          io.netty.channel.ChannelPromise promise)
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        write in class io.netty.channel.ChannelOutboundHandlerAdapter
      • connect

        public void connect​(io.netty.channel.ChannelHandlerContext ctx,
                            SocketAddress remoteAddress,
                            SocketAddress localAddress,
                            io.netty.channel.ChannelPromise promise)
                     throws Exception
        Specified by:
        connect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        connect in class io.netty.channel.ChannelOutboundHandlerAdapter
        Throws:
        Exception
      • close

        public void close​(io.netty.channel.ChannelHandlerContext ctx,
                          io.netty.channel.ChannelPromise promise)
        Specified by:
        close in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        close in class io.netty.channel.ChannelOutboundHandlerAdapter
      • disconnect

        public void disconnect​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
        Specified by:
        disconnect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        disconnect in class io.netty.channel.ChannelOutboundHandlerAdapter