2 * Copyright (c) 2015 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.netconf.mdsal.notification.impl;
11 import java.util.Collections;
13 import org.opendaylight.netconf.api.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.mapping.api.NetconfOperationServiceFactoryListener;
18 import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
20 public class NetconfNotificationOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
22 private final NetconfNotificationRegistry netconfNotificationRegistry;
23 private final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener;
25 public NetconfNotificationOperationServiceFactory(
26 final NetconfNotificationRegistry netconfNotificationRegistry,
27 final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener) {
28 this.netconfNotificationRegistry = netconfNotificationRegistry;
29 this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
31 this.netconfOperationServiceFactoryListener.onAddNetconfOperationServiceFactory(this);
35 public Set<Capability> getCapabilities() {
37 // No capabilities exposed to prevent clashes with schemas from
38 // config-netconf-connector (it exposes all the schemas)
39 // If the schemas exposed by config-netconf-connector are filtered,
40 // this class would expose monitoring related models
41 return Collections.emptySet();
45 public NetconfOperationService createService(String netconfSessionIdForReporting) {
46 return new NetconfNotificationOperationService(netconfSessionIdForReporting, netconfNotificationRegistry);
50 public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
56 this.netconfOperationServiceFactoryListener.onRemoveNetconfOperationServiceFactory(this);