Fix DefaultMapBodyOrder body sorting
[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.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;
17
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);
24     }
25
26     @Override
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));
30     }
31
32     @Override
33     protected void handleMessage(final HelloMessage netconfHelloMessage) {
34         // No-op
35     }
36 }