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
9 package org.opendaylight.netconf.nettyutil;
11 import io.netty.channel.Channel;
12 import io.netty.util.Timer;
13 import io.netty.util.concurrent.Promise;
14 import org.opendaylight.netconf.api.NetconfDocumentedException;
15 import org.opendaylight.netconf.api.NetconfSessionListener;
16 import org.opendaylight.netconf.api.NetconfSessionPreferences;
17 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
19 final class TestSessionNegotiator extends
20 AbstractNetconfSessionNegotiator<NetconfSessionPreferences,
21 TestingNetconfSession, NetconfSessionListener<TestingNetconfSession>> {
24 TestSessionNegotiator(final NetconfSessionPreferences sessionPreferences,
25 final Promise<TestingNetconfSession> promise, final Channel channel,
27 final NetconfSessionListener<TestingNetconfSession> sessionListener,
28 final long connectionTimeoutMillis) {
29 super(sessionPreferences, promise, channel, timer, sessionListener, connectionTimeoutMillis);
33 protected TestingNetconfSession getSession(final NetconfSessionListener sessionListener, final Channel channel,
34 final NetconfHelloMessage message)
35 throws NetconfDocumentedException {
36 return new TestingNetconfSession(sessionListener, channel, 0L);
40 protected void handleMessage(final NetconfHelloMessage netconfHelloMessage) throws Exception {