Remove common-blueprint.xml 53/104353/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 9 Feb 2023 17:06:23 +0000 (18:06 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Tue, 14 Feb 2023 15:15:09 +0000 (15:15 +0000)
Convert OpenRoadmInterfacesImpl into a Component, rendering the
blueprint empty.

Change-Id: I8c3274437352b63858c397a1004928f5b27c7106
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
common/src/main/resources/OSGI-INF/blueprint/common-blueprint.xml [deleted file]

index a32cc7d68cf81649e3102e04b9faef07bf06f1f3..5020fdbd22789fbad1b370a8a3caa9046ab6735c 100644 (file)
@@ -15,11 +15,15 @@ import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEV
 import java.util.Optional;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
+@Component
 public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfacesImpl.class);
@@ -29,6 +33,15 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
     OpenRoadmInterfacesImpl710 openRoadmInterfacesImpl710;
     MappingUtils mappingUtils;
 
+    @Activate
+    public OpenRoadmInterfacesImpl(@Reference DeviceTransactionManager deviceTransactionManager,
+                                   @Reference MappingUtils mappingUtils, @Reference PortMapping portMapping) {
+        this(deviceTransactionManager, mappingUtils,
+            new OpenRoadmInterfacesImpl121(deviceTransactionManager),
+            new OpenRoadmInterfacesImpl221(deviceTransactionManager, portMapping),
+            new OpenRoadmInterfacesImpl710(deviceTransactionManager, portMapping));
+    }
+
     public OpenRoadmInterfacesImpl(DeviceTransactionManager deviceTransactionManager, MappingUtils mappingUtils,
                                    OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121,
                                    OpenRoadmInterfacesImpl221 openRoadmInterfacesImpl221,
diff --git a/common/src/main/resources/OSGI-INF/blueprint/common-blueprint.xml b/common/src/main/resources/OSGI-INF/blueprint/common-blueprint.xml
deleted file mode 100644 (file)
index b57d2b5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2016 Orange 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
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
-    <reference id="deviceTransactionManager" interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
-    <reference id="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils" />
-    <reference id="portMapping" interface="org.opendaylight.transportpce.common.mapping.PortMapping" />
-
-    <bean id="openRoadmInterfaces121" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121" >
-        <argument ref="deviceTransactionManager" />
-    </bean>
-
-    <bean id="openRoadmInterfaces221" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl221" >
-        <argument ref="deviceTransactionManager" />
-        <argument ref="portMapping" />
-    </bean>
-
-    <bean id="openRoadmInterfaces710" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl710" >
-        <argument ref="deviceTransactionManager" />
-        <argument ref="portMapping" />
-    </bean>
-
-    <bean id="openRoadmInterfaces" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl" >
-        <argument ref="deviceTransactionManager" />
-        <argument ref="mappingUtils" />
-        <argument ref="openRoadmInterfaces121" />
-        <argument ref="openRoadmInterfaces221" />
-        <argument ref="openRoadmInterfaces710" />
-    </bean>
-
-    <service ref="openRoadmInterfaces" interface="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces" />
-
-</blueprint>