Merge "Initial message bus implementation"
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / NetconfServerSessionListenerFactory.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.netconf.impl;
10
11 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
12 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
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;
17
18 public class NetconfServerSessionListenerFactory implements SessionListenerFactory<NetconfServerSessionListener> {
19
20     private final CommitNotifier commitNotifier;
21     private final SessionMonitoringService monitor;
22     private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
23     private final CapabilityProvider capabilityProvider;
24
25     public NetconfServerSessionListenerFactory(final CommitNotifier commitNotifier,
26                                                final SessionMonitoringService monitor,
27                                                final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot,
28                                                final CapabilityProvider capabilityProvider) {
29
30         this.commitNotifier = commitNotifier;
31         this.monitor = monitor;
32         this.netconfOperationServiceSnapshot = netconfOperationServiceSnapshot;
33         this.capabilityProvider = capabilityProvider;
34     }
35
36     @Override
37     public NetconfServerSessionListener getSessionListener() {
38         NetconfOperationRouter operationRouter = new NetconfOperationRouterImpl(netconfOperationServiceSnapshot, capabilityProvider, commitNotifier);
39         return new NetconfServerSessionListener(operationRouter, monitor, netconfOperationServiceSnapshot);
40     }
41 }