Remove netconf-monitoring
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / monitoring / NetconfMonitoringOperationServiceFactory.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.netconf.test.tool.monitoring;
10
11 import java.util.Collections;
12 import java.util.Set;
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
18 public class NetconfMonitoringOperationServiceFactory implements NetconfOperationServiceFactory,
19         AutoCloseable {
20
21     private final NetconfMonitoringOperationService operationService;
22
23     private static final AutoCloseable AUTO_CLOSEABLE = () -> {
24         // NOOP
25     };
26
27     public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) {
28         this.operationService = operationService;
29     }
30
31     @Override
32     public NetconfOperationService createService(final String netconfSessionIdForReporting) {
33         return operationService;
34     }
35
36     @Override
37     public Set<Capability> getCapabilities() {
38         return Collections.emptySet();
39     }
40
41     @Override
42     public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
43         return AUTO_CLOSEABLE;
44     }
45
46     @Override
47     public void close() {
48     }
49 }
50