+++ /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.api;
-
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
-
-/**
- * The only input for the start of a NETCONF session is hello-message.
- */
-public final class NetconfServerSessionPreferences extends NetconfSessionPreferences {
-
- private final long sessionId;
-
- public NetconfServerSessionPreferences(final NetconfHelloMessage helloMessage, long sessionId) {
- super(helloMessage);
- this.sessionId = sessionId;
- }
-
- public long getSessionId() {
- return sessionId;
- }
-}
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.Map;
import org.opendaylight.netconf.api.NetconfDocumentedException;
-import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
private final long sessionId;
- protected NetconfServerSessionNegotiator(final NetconfServerSessionPreferences sessionPreferences,
+ protected NetconfServerSessionNegotiator(final NetconfHelloMessage hello, final long sessionId,
final Promise<NetconfServerSession> promise, final Channel channel, final Timer timer,
final NetconfServerSessionListener sessionListener, final long connectionTimeoutMillis) {
- super(sessionPreferences.getHelloMessage(), promise, channel, timer, sessionListener, connectionTimeoutMillis);
- sessionId = sessionPreferences.getSessionId();
+ super(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis);
+ this.sessionId = sessionId;
}
@Override
import io.netty.util.concurrent.Promise;
import java.net.SocketAddress;
import java.util.Set;
-import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
import org.opendaylight.netconf.api.NetconfSessionListenerFactory;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
final NetconfMonitoringService monitoringService,
final Set<String> baseCapabilities) {
this.timer = timer;
- this.aggregatedOpService = netconfOperationProvider;
+ aggregatedOpService = netconfOperationProvider;
this.idProvider = idProvider;
this.connectionTimeoutMillis = connectionTimeoutMillis;
this.monitoringService = monitoringService;
final Channel channel, final Promise<NetconfServerSession> promise) {
final long sessionId = idProvider.getNextSessionId();
- NetconfServerSessionPreferences proposal =
- new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
-
- return new NetconfServerSessionNegotiator(proposal, promise, channel, timer,
- getListener(Long.toString(sessionId), channel.parent().localAddress()), connectionTimeoutMillis);
+ return new NetconfServerSessionNegotiator(createHelloMessage(sessionId, monitoringService), sessionId, promise,
+ channel, timer, getListener(Long.toString(sessionId), channel.parent().localAddress()),
+ connectionTimeoutMillis);
}
private NetconfServerSessionListener getListener(final String netconfSessionIdForReporting,
protected NetconfOperationService getOperationServiceForAddress(final String netconfSessionIdForReporting,
final SocketAddress socketAddress) {
- return this.aggregatedOpService.createService(netconfSessionIdForReporting);
+ return aggregatedOpService.createService(netconfSessionIdForReporting);
}
protected final NetconfOperationServiceFactory getOperationServiceFactory() {