2 * Copyright (c) 2018 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netconf.nettyutil;
10 import io.netty.channel.Channel;
11 import io.netty.util.concurrent.Promise;
12 import org.opendaylight.netconf.api.NetconfSessionListener;
13 import org.opendaylight.netconf.api.messages.HelloMessage;
14 import org.opendaylight.netconf.common.NetconfTimer;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.SessionIdType;
16 import org.opendaylight.yangtools.yang.common.Uint32;
18 final class TestSessionNegotiator
19 extends NetconfSessionNegotiator<TestingNetconfSession, NetconfSessionListener<TestingNetconfSession>> {
20 TestSessionNegotiator(final HelloMessage hello, final Promise<TestingNetconfSession> promise,
21 final Channel channel, final NetconfTimer timer,
22 final NetconfSessionListener<TestingNetconfSession> sessionListener, final long connectionTimeoutMillis) {
23 super(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis, 16384);
27 protected TestingNetconfSession getSession(final NetconfSessionListener<TestingNetconfSession> sessionListener,
28 final Channel channel, final HelloMessage message) {
29 return new TestingNetconfSession(sessionListener, channel, new SessionIdType(Uint32.ONE));
33 protected void handleMessage(final HelloMessage netconfHelloMessage) {