<scope>provided</scope>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </dependency>
<dependency>
<groupId>org.xmlunit</groupId>
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.sal.connect.impl;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.netconf.sal.connect.api.SchemaResourceManager;
+import org.opendaylight.netconf.sal.connect.netconf.NetconfDevice.SchemaResourcesDTO;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Beta
+@Component(immediate = true)
+public final class OSGiSchemaResourceManager implements SchemaResourceManager {
+ private static final Logger LOG = LoggerFactory.getLogger(OSGiSchemaResourceManager.class);
+
+ @Reference
+ YangParserFactory parserFactory;
+
+ private DefaultSchemaResourceManager delegate;
+
+ @Override
+ public SchemaResourcesDTO getSchemaResources(final NetconfNode node, final Object nodeId) {
+ return delegate.getSchemaResources(node, nodeId);
+ }
+
+ @Activate
+ void activate() {
+ delegate = new DefaultSchemaResourceManager(parserFactory);
+ LOG.info("Schema Resource Manager started");
+ }
+
+ @Deactivate
+ void deactivate() {
+ delegate = null;
+ LOG.info("Schema Resource Manager stopped");
+ }
+}
* 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.sal.connect.netconf;
import static java.util.Objects.requireNonNull;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
+import javax.inject.Singleton;
import org.opendaylight.mdsal.dom.api.DOMActionResult;
import org.opendaylight.mdsal.dom.api.DOMActionService;
import org.opendaylight.mdsal.dom.api.DOMActionServiceExtension;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* transforms replied NETCONF message to action result, and using {@link RemoteDeviceCommunicator} that is responsible
* for sending of built RPCs to NETCONF client.
*/
+@Singleton
+@Component(immediate = true, property = "type=default")
public class DeviceActionFactoryImpl implements DeviceActionFactory {
-
private static final Logger LOG = LoggerFactory.getLogger(DeviceActionFactoryImpl.class);
@Override
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.sal.connect.netconf.schema.mapping;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Beta
+@Component(immediate = true)
+public final class OSGiBaseNetconfSchemas implements BaseNetconfSchemas {
+ private static final Logger LOG = LoggerFactory.getLogger(OSGiBaseNetconfSchemas.class);
+
+ @Reference
+ YangParserFactory parserFactory;
+
+ private DefaultBaseNetconfSchemas delegate;
+
+ @Override
+ public BaseSchema getBaseSchema() {
+ return delegate.getBaseSchema();
+ }
+
+ @Override
+ public BaseSchema getBaseSchemaWithNotifications() {
+ return delegate.getBaseSchemaWithNotifications();
+ }
+
+ @Activate
+ void activate() {
+ delegate = new DefaultBaseNetconfSchemas(parserFactory);
+ LOG.info("Base NETCONF Schemas started");
+ }
+
+ @Deactivate
+ void deactivate() {
+ delegate = null;
+ LOG.info("Base NETCONF Schemas stopped");
+ }
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2019 FRINX s.r.o. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <reference id="parserFactory"
- interface="org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory"/>
-
- <bean id="deviceActionFactory"
- class="org.opendaylight.netconf.sal.connect.netconf.DeviceActionFactoryImpl">
- </bean>
-
- <service ref="deviceActionFactory"
- interface="org.opendaylight.netconf.sal.connect.api.DeviceActionFactory"
- odl:type="default"/>
-
- <bean id="schemaResourceManager"
- class="org.opendaylight.netconf.sal.connect.impl.DefaultSchemaResourceManager">
- <argument ref="parserFactory"/>
- </bean>
-
- <service ref="schemaResourceManager"
- interface="org.opendaylight.netconf.sal.connect.api.SchemaResourceManager"/>
-
- <bean id="baseNetconfSchemas"
- class="org.opendaylight.netconf.sal.connect.netconf.schema.mapping.DefaultBaseNetconfSchemas">
- <argument ref="parserFactory"/>
- </bean>
-
- <service ref="baseNetconfSchemas"
- interface="org.opendaylight.netconf.sal.connect.netconf.schema.mapping.BaseNetconfSchemas"/>
-</blueprint>