Hide Netty(Pipeline)AwareChannelSubsystem
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / client / NettyAwareClientSession.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.nettyutil.handler.ssh.client;
9
10 import com.google.common.annotations.Beta;
11 import io.netty.channel.ChannelHandlerContext;
12 import io.netty.channel.ChannelPipeline;
13 import java.io.IOException;
14 import org.opendaylight.netconf.shaded.sshd.client.channel.ChannelSubsystem;
15 import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
16
17 /**
18  * A {@link ClientSession} which additionally allows subsystem channels which are forwarded to a particular Netty
19  * channel context.
20  */
21 @Beta
22 public interface NettyAwareClientSession extends ClientSession {
23     /**
24      * Allocate a channel to the specified subsystem. Incoming data on the channel will be routed to the
25      * specified {@link ChannelHandlerContext}.
26      *
27      * @param subsystem The subsystem name
28      * @param ctx Context to which to route data to
29      * @return The created {@link ChannelSubsystem}
30      * @throws IOException If failed to create the requested channel
31      */
32     ChannelSubsystem createSubsystemChannel(String subsystem, ChannelHandlerContext ctx) throws IOException;
33
34     /**
35      * Allocate a channel to the specified subsystem. Incoming data on the channel will be routed to the
36      * specified {@link ChannelPipeline}.
37      *
38      * @param subsystem The subsystem name
39      * @param pipeline ChannelPipeline to which to route data to
40      * @return The created {@link ChannelSubsystem}
41      * @throws IOException If failed to create the requested channel
42      */
43     ChannelSubsystem createSubsystemChannel(String subsystem, ChannelPipeline pipeline) throws IOException;
44 }