* Initializes channel by specifying the handlers in its pipeline. Handlers are protocol specific, therefore
* this method needs to be implemented in protocol specific Dispatchers.
*
- * @param channel whose pipeline should be defined, also to be passed to {@link NetconfSessionNegotiatorFactory}
- * @param promise to be passed to {@link NetconfSessionNegotiatorFactory}
+ * @param channel whose pipeline should be defined, also to be passed to {@link NetconfSessionNegotiator}
+ * @param promise to be passed to {@link NetconfSessionNegotiator}
*/
void initializeChannel(C channel, Promise<S> promise);
}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.nettyutil;
-
-import io.netty.channel.Channel;
-import io.netty.util.concurrent.Promise;
-import org.opendaylight.netconf.api.NetconfSession;
-import org.opendaylight.netconf.api.NetconfSessionListener;
-import org.opendaylight.netconf.api.NetconfSessionListenerFactory;
-
-/**
- * A factory class creating SessionNegotiators.
- *
- * @param <S> session type
- */
-@Deprecated
-public interface NetconfSessionNegotiatorFactory<S extends NetconfSession,
- L extends NetconfSessionListener<? super S>> {
- /**
- * Create a new negotiator attached to a channel, which will notify
- * a promise once the negotiation completes.
- *
- * @param channel Underlying channel
- * @param promise Promise to be notified
- * @return new negotiator instance
- */
- NetconfSessionNegotiator<S> getSessionNegotiator(NetconfSessionListenerFactory<L> factory, Channel channel,
- Promise<S> promise);
-}
import org.opendaylight.netconf.api.messages.HelloMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
-import org.opendaylight.netconf.nettyutil.NetconfSessionNegotiatorFactory;
import org.opendaylight.netconf.nettyutil.handler.exi.EXIParameters;
import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessageProvider;
import org.opendaylight.netconf.shaded.exificient.core.CodingMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class NetconfClientSessionNegotiatorFactory
- implements NetconfSessionNegotiatorFactory<NetconfClientSession, NetconfClientSessionListener> {
-
+public final class NetconfClientSessionNegotiatorFactory {
public static final Set<String> EXI_CLIENT_CAPABILITIES = ImmutableSet.of(
CapabilityURN.BASE,
CapabilityURN.BASE_1_1,
return connectionTimeoutMillis;
}
- @Override
+ /**
+ * Create a new negotiator attached to a channel, which will notify
+ * a promise once the negotiation completes.
+ *
+ * @param channel Underlying channel
+ * @param promise Promise to be notified
+ * @return new negotiator instance
+ */
public NetconfClientSessionNegotiator getSessionNegotiator(
final NetconfSessionListenerFactory<NetconfClientSessionListener> sessionListenerFactory,
final Channel channel, final Promise<NetconfClientSession> promise) {
import java.util.Set;
import org.checkerframework.checker.index.qual.NonNegative;
import org.opendaylight.netconf.api.CapabilityURN;
-import org.opendaylight.netconf.api.NetconfSessionListenerFactory;
import org.opendaylight.netconf.api.messages.HelloMessage;
import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
-import org.opendaylight.netconf.nettyutil.NetconfSessionNegotiatorFactory;
import org.opendaylight.netconf.server.api.SessionIdProvider;
import org.opendaylight.netconf.server.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.server.api.operations.NetconfOperationService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
-public class NetconfServerSessionNegotiatorFactory
- implements NetconfSessionNegotiatorFactory<NetconfServerSession, NetconfServerSessionListener> {
-
+// FIXME: Non-final for testtool. Why exactly?
+public class NetconfServerSessionNegotiatorFactory {
public static final Set<String> DEFAULT_BASE_CAPABILITIES = ImmutableSet.of(
CapabilityURN.BASE,
CapabilityURN.BASE_1_1,
/**
* Get session negotiator.
*
- * @param defunctSessionListenerFactory will not be taken into account as session listener factory can
- * only be created after snapshot is opened, thus this method constructs
- * proper session listener factory.
* @param channel Underlying channel
* @param promise Promise to be notified
* @return session negotiator
*/
- @Deprecated
- @Override
- public NetconfServerSessionNegotiator getSessionNegotiator(
- final NetconfSessionListenerFactory<NetconfServerSessionListener> defunctSessionListenerFactory,
- final Channel channel, final Promise<NetconfServerSession> promise) {
+ public NetconfServerSessionNegotiator getSessionNegotiator(final Channel channel,
+ final Promise<NetconfServerSession> promise) {
final var sessionId = idProvider.getNextSessionId();
final var socketAddress = channel.parent() == null ? null : channel.parent().localAddress();
final var service = getOperationServiceForAddress(sessionId, socketAddress);
@Override
protected void initializeSessionNegotiator(final Channel ch, final Promise<NetconfServerSession> promise) {
ch.pipeline().addAfter(DESERIALIZER_EX_HANDLER_KEY, NETCONF_SESSION_NEGOTIATOR,
- negotiatorFactory.getSessionNegotiator(null, ch, promise));
+ negotiatorFactory.getSessionNegotiator(ch, promise));
}
}