2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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
8 package org.opendaylight.netconf.impl.mdsal;
10 import static java.util.Objects.requireNonNull;
13 import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
14 import org.opendaylight.netconf.server.api.monitoring.NetconfMonitoringService;
15 import org.opendaylight.netconf.server.api.operations.NetconfOperationServiceFactory;
16 import org.opendaylight.netconf.server.osgi.NetconfMonitoringServiceImpl;
17 import org.osgi.service.component.annotations.Activate;
18 import org.osgi.service.component.annotations.Component;
19 import org.osgi.service.component.annotations.Deactivate;
21 @Component(factory = DefaultNetconfMonitoringService.FACTORY_NAME, service = NetconfMonitoringService.class)
22 public final class DefaultNetconfMonitoringService extends NetconfMonitoringServiceImpl {
23 static final String FACTORY_NAME = "org.opendaylight.netconf.impl.mdsal.DefaultNetconfMonitoringService";
25 private static final String OP_PROVIDER_PROP = ".opProvider";
26 private static final String THREAD_POOL_PROP = ".threadPool";
27 private static final String UPDATE_INTERVAL_PROP = ".updateInterval";
30 public DefaultNetconfMonitoringService(final Map<String, ?> properties) {
31 super(OSGiNetconfServer.extractProp(properties, OP_PROVIDER_PROP, NetconfOperationServiceFactory.class),
32 OSGiNetconfServer.extractProp(properties, THREAD_POOL_PROP, ScheduledThreadPool.class),
33 OSGiNetconfServer.extractProp(properties, UPDATE_INTERVAL_PROP, Long.class));
42 static Map<String, ?> props(final NetconfOperationServiceFactory opProvider, final ScheduledThreadPool threadPool,
43 final long updateInterval) {
45 "type", "netconf-server-monitoring",
46 OP_PROVIDER_PROP, requireNonNull(opProvider),
47 THREAD_POOL_PROP, requireNonNull(threadPool),
48 UPDATE_INTERVAL_PROP, updateInterval);