2 * Copyright (c) 2013 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.controller.netconf.impl;
11 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
12 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouterImpl;
13 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
14 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot;
15 import org.opendaylight.protocol.framework.SessionListenerFactory;
17 public class NetconfServerSessionListenerFactory implements SessionListenerFactory<NetconfServerSessionListener> {
19 private final NetconfOperationServiceFactoryListener factoriesListener;
21 private final DefaultCommitNotificationProducer commitNotifier;
23 private final SessionIdProvider idProvider;
25 public NetconfServerSessionListenerFactory(NetconfOperationServiceFactoryListener factoriesListener,
26 DefaultCommitNotificationProducer commitNotifier,
27 SessionIdProvider idProvider) {
28 this.factoriesListener = factoriesListener;
29 this.commitNotifier = commitNotifier;
30 this.idProvider = idProvider;
34 public NetconfServerSessionListener getSessionListener() {
35 NetconfOperationServiceSnapshot netconfOperationServiceSnapshot = factoriesListener.getSnapshot(idProvider
36 .getCurrentSessionId());
38 CapabilityProvider capabilityProvider = new CapabilityProviderImpl(netconfOperationServiceSnapshot);
40 NetconfOperationRouterImpl operationRouter = new NetconfOperationRouterImpl(
41 netconfOperationServiceSnapshot, capabilityProvider,
44 return new NetconfServerSessionListener(operationRouter);