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.api.NetconfOperationRouter;
12 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
13 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouterImpl;
14 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
15 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
16 import org.opendaylight.protocol.framework.SessionListenerFactory;
18 public class NetconfServerSessionListenerFactory implements SessionListenerFactory<NetconfServerSessionListener> {
20 private final DefaultCommitNotificationProducer commitNotifier;
21 private final SessionMonitoringService monitor;
22 private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
23 private final CapabilityProvider capabilityProvider;
25 public NetconfServerSessionListenerFactory(DefaultCommitNotificationProducer commitNotifier,
26 SessionMonitoringService monitor,
27 NetconfOperationServiceSnapshot netconfOperationServiceSnapshot,
28 CapabilityProvider capabilityProvider) {
30 this.commitNotifier = commitNotifier;
31 this.monitor = monitor;
32 this.netconfOperationServiceSnapshot = netconfOperationServiceSnapshot;
33 this.capabilityProvider = capabilityProvider;
37 public NetconfServerSessionListener getSessionListener() {
38 NetconfOperationRouter operationRouter = NetconfOperationRouterImpl.createOperationRouter(
39 netconfOperationServiceSnapshot, capabilityProvider, commitNotifier);
40 return new NetconfServerSessionListener(operationRouter, monitor, netconfOperationServiceSnapshot);