Fix netconf-connector-config groupId
[netconf.git] / opendaylight / netconf / mdsal-netconf-notification / src / main / java / org / opendaylight / netconf / mdsal / notification / NetconfNotificationOperationServiceFactory.java
1 /*
2  * Copyright (c) 2015 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.netconf.mdsal.notification;
10
11 import java.util.Collections;
12 import java.util.Set;
13 import org.opendaylight.controller.config.util.capability.Capability;
14 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
15 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
16 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
17 import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
18
19 public class NetconfNotificationOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
20
21     private final NetconfNotificationRegistry netconfNotificationRegistry;
22
23     private static final AutoCloseable AUTO_CLOSEABLE = new AutoCloseable() {
24         @Override
25         public void close() throws Exception {
26             // NOOP
27         }
28     };
29
30     public NetconfNotificationOperationServiceFactory(NetconfNotificationRegistry netconfNotificationRegistry) {
31         this.netconfNotificationRegistry = netconfNotificationRegistry;
32     }
33
34     @Override
35     public Set<Capability> getCapabilities() {
36         // TODO
37         // No capabilities exposed to prevent clashes with schemas from config-netconf-connector (it exposes all the schemas)
38         // If the schemas exposed by config-netconf-connector are filtered, this class would expose monitoring related models
39         return Collections.emptySet();
40     }
41
42     @Override
43     public NetconfOperationService createService(String netconfSessionIdForReporting) {
44         return new NetconfNotificationOperationService(netconfSessionIdForReporting, netconfNotificationRegistry);
45     }
46
47     @Override
48     public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
49         return AUTO_CLOSEABLE;
50     }
51
52     @Override
53     public void close() {
54     }
55 }