Add workaround for SSH connection issue related to SSHD-1028
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / sshd1028 / NetconfNio2ServiceFactoryFactory.java
1 /*
2  * Copyright (c) 2020 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.sshd1028;
9
10 import org.opendaylight.netconf.shaded.sshd.common.FactoryManager;
11 import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceFactory;
12 import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2ServiceFactoryFactory;
13
14 /**
15  * Custom Nio2ServiceFactoryFactory which creates instances of NetconfNio2ServiceFactory instead of Nio2ServiceFactory.
16  * Should be removed when SSHD-1028 is fixed.
17  */
18 public class NetconfNio2ServiceFactoryFactory extends Nio2ServiceFactoryFactory {
19
20     public NetconfNio2ServiceFactoryFactory() {
21         super(null);
22     }
23
24     @Override
25     public IoServiceFactory create(final FactoryManager manager) {
26         return new NetconfNio2ServiceFactory(manager, newExecutor());
27     }
28 }