61be232134df2b8fba5de6958b688403470afae9
[netconf.git] / netconf / netconf-netty-util / src / test / java / org / opendaylight / netconf / nettyutil / TestSessionNegotiator.java
1 /*
2  * Copyright (c) 2018 Cisco Systems, Inc. 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;
9
10 import io.netty.channel.Channel;
11 import io.netty.util.Timer;
12 import io.netty.util.concurrent.Promise;
13 import org.opendaylight.netconf.api.NetconfSessionListener;
14 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
15
16 final class TestSessionNegotiator
17         extends AbstractNetconfSessionNegotiator<TestingNetconfSession, NetconfSessionListener<TestingNetconfSession>> {
18     TestSessionNegotiator(final NetconfHelloMessage hello, final Promise<TestingNetconfSession> promise,
19             final Channel channel, final Timer timer,
20             final NetconfSessionListener<TestingNetconfSession> sessionListener, final long connectionTimeoutMillis) {
21         super(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis);
22     }
23
24     @Override
25     protected TestingNetconfSession getSession(final NetconfSessionListener<TestingNetconfSession> sessionListener,
26             final Channel channel, final NetconfHelloMessage message) {
27         return new TestingNetconfSession(sessionListener, channel, 0L);
28     }
29
30     @Override
31     protected void handleMessage(final NetconfHelloMessage netconfHelloMessage) {
32         // No-op
33     }
34 }