* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.test.tool.monitoring;
-import java.util.Collections;
+import static java.util.Objects.requireNonNull;
+
import java.util.Set;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.netconf.api.capability.Capability;
-import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.mapping.api.NetconfOperationService;
-import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
-
-public class NetconfMonitoringOperationServiceFactory implements NetconfOperationServiceFactory,
- AutoCloseable {
-
- private final NetconfMonitoringOperationService operationService;
+import org.opendaylight.netconf.server.api.monitoring.CapabilityListener;
+import org.opendaylight.netconf.server.api.operations.NetconfOperationService;
+import org.opendaylight.netconf.server.api.operations.NetconfOperationServiceFactory;
+import org.opendaylight.yangtools.concepts.Registration;
- private static final AutoCloseable AUTO_CLOSEABLE = () -> {
- // NOOP
- };
+public class NetconfMonitoringOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
+ private final @NonNull NetconfMonitoringOperationService operationService;
public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) {
- this.operationService = operationService;
+ this.operationService = requireNonNull(operationService);
}
@Override
@Override
public Set<Capability> getCapabilities() {
- return Collections.emptySet();
+ return Set.of();
}
@Override
- public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
- return AUTO_CLOSEABLE;
+ public Registration registerCapabilityListener(final CapabilityListener listener) {
+ return () -> { };
}
@Override
public void close() {
+ // No-op
}
}