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.controller.netconf.monitoring;
11 import java.util.Collections;
13 import org.opendaylight.controller.config.util.capability.Capability;
14 import org.opendaylight.controller.netconf.api.monitoring.CapabilityListener;
15 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
16 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
18 public class NetconfMonitoringOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
20 private final NetconfMonitoringOperationService operationService;
22 private static final AutoCloseable AUTO_CLOSEABLE = new AutoCloseable() {
24 public void close() throws Exception {
29 public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) {
30 this.operationService = operationService;
34 public NetconfOperationService createService(final String netconfSessionIdForReporting) {
35 return operationService;
39 public Set<Capability> getCapabilities() {
41 // No capabilities exposed to prevent clashes with schemas from config-netconf-connector (it exposes all the schemas)
42 // If the schemas exposed by config-netconf-connector are filtered, this class would expose monitoring related models
43 return Collections.emptySet();
47 public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
48 return AUTO_CLOSEABLE;
52 public void close() {}