Class AsyncSshHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelOutboundHandlerAdapter
-
- org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelOutboundHandler
public class AsyncSshHandler extends io.netty.channel.ChannelOutboundHandlerAdapterNetty SSH handler class. Acts as interface between Netty and SSH library.
-
-
Field Summary
Fields Modifier and Type Field Description static NetconfSshClientDEFAULT_CLIENTstatic intSSH_DEFAULT_NIO_WORKERSstatic StringSUBSYSTEM
-
Constructor Summary
Constructors Constructor Description AsyncSshHandler(AuthenticationHandler authenticationHandler, NetconfSshClient sshClient)Constructor ofAsyncSshHandler.AsyncSshHandler(AuthenticationHandler authenticationHandler, NetconfSshClient sshClient, io.netty.util.concurrent.Future<?> negotiationFuture)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voidconnect(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)static AsyncSshHandlercreateForNetconfSubsystem(AuthenticationHandler authenticationHandler)static AsyncSshHandlercreateForNetconfSubsystem(AuthenticationHandler authenticationHandler, io.netty.util.concurrent.Future<?> negotiationFuture, @Nullable NetconfSshClient sshClient)Create AsyncSshHandler for netconf subsystem.voiddisconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)-
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, deregister, flush, read
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
SUBSYSTEM
public static final String SUBSYSTEM
- See Also:
- Constant Field Values
-
SSH_DEFAULT_NIO_WORKERS
public static final int SSH_DEFAULT_NIO_WORKERS
- See Also:
- Constant Field Values
-
DEFAULT_CLIENT
public static final NetconfSshClient DEFAULT_CLIENT
-
-
Constructor Detail
-
AsyncSshHandler
public AsyncSshHandler(AuthenticationHandler authenticationHandler, NetconfSshClient sshClient, io.netty.util.concurrent.Future<?> negotiationFuture)
-
AsyncSshHandler
public AsyncSshHandler(AuthenticationHandler authenticationHandler, NetconfSshClient sshClient)
Constructor ofAsyncSshHandler.- Parameters:
authenticationHandler- authentication handlersshClient- started SshClient
-
-
Method Detail
-
createForNetconfSubsystem
public static AsyncSshHandler createForNetconfSubsystem(AuthenticationHandler authenticationHandler)
-
createForNetconfSubsystem
public static AsyncSshHandler createForNetconfSubsystem(AuthenticationHandler authenticationHandler, io.netty.util.concurrent.Future<?> negotiationFuture, @Nullable NetconfSshClient sshClient)
Create AsyncSshHandler for netconf subsystem. Negotiation future has to be set to success after successful netconf negotiation.- Parameters:
authenticationHandler- authentication handlernegotiationFuture- negotiation future- Returns:
AsyncSshHandler
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)- Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.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:
connectin interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
connectin classio.netty.channel.ChannelOutboundHandlerAdapter- Throws:
Exception
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
closein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
closein classio.netty.channel.ChannelOutboundHandlerAdapter
-
disconnect
public void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
disconnectin interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
disconnectin classio.netty.channel.ChannelOutboundHandlerAdapter
-
-