BUG 6396 ios-xe-renderer migration to blueprint 84/43484/5
authorMatej Perina <mperina@cisco.com>
Thu, 18 Aug 2016 15:44:50 +0000 (17:44 +0200)
committerMatej Perina <mperina@cisco.com>
Tue, 23 Aug 2016 11:32:25 +0000 (11:32 +0000)
Change-Id: I659ce1afe123f8184717fc90238f2b868ece12f3
Signed-off-by: Matej Perina <mperina@cisco.com>
renderers/ios-xe/src/main/config/default-config.xml
renderers/ios-xe/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ios_xe_provider/impl/config/IosXeProviderInstance.java [new file with mode: 0644]
renderers/ios-xe/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ios_xe_provider/impl/config/IosXeProviderModule.java
renderers/ios-xe/src/main/resources/org/opendaylight/blueprint/ios-xe-renderer.xml [new file with mode: 0644]
renderers/ios-xe/src/main/yang/ios-xe-provider-impl.yang

index a22f5c7ab02b84c7006ffc1912d981f6d0ff96b7..6d901c70044febcab089135b7cc13ca6f9a176ba 100755 (executable)
                         iosxe:ios-xe-provider-impl
                     </type>
                     <name>ios-xe-provider-impl</name>
-
-                    <data-broker>
-                      <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                      <name>binding-data-broker</name>
-                    </data-broker>
-
-                    <broker>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-                        <name>binding-osgi-broker</name>
-                    </broker>
-
-                    <policy-validator-registry>
-                        <type xmlns:gbp="urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy">gbp:policy-validator-registry</type>
-                        <name>policy-validator-registry</name>
-                    </policy-validator-registry>
                 </module>
             </modules>
         </data>
diff --git a/renderers/ios-xe/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ios_xe_provider/impl/config/IosXeProviderInstance.java b/renderers/ios-xe/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ios_xe_provider/impl/config/IosXeProviderInstance.java
new file mode 100644 (file)
index 0000000..6cacbf3
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. 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.groupbasedpolicy.renderer.ios_xe_provider.impl.config;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.IosXeRendererProviderImpl;
+
+public class IosXeProviderInstance implements AutoCloseable{
+
+    private IosXeRendererProviderImpl renderer;
+
+    public IosXeProviderInstance(DataBroker dataBroker, BindingAwareBroker broker) {
+        renderer = new IosXeRendererProviderImpl(dataBroker, broker);
+    }
+
+    @Override
+    public void close() throws Exception {
+        renderer.close();
+    }
+
+}
index b49b0dc0f8e22af3b2d4435a74d3cc8c3330aa36..b64968dfcd885114acbd50a98ddd923a339a5573 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.config;
 
-import org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.IosXeRendererProviderImpl;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 
 public class IosXeProviderModule extends org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.config.AbstractIosXeProviderModule {
     public IosXeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@@ -26,7 +26,7 @@ public class IosXeProviderModule extends org.opendaylight.groupbasedpolicy.rende
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        return new IosXeRendererProviderImpl(getDataBrokerDependency(), getBrokerDependency());
+        return NoopAutoCloseable.INSTANCE;
     }
 
 }
diff --git a/renderers/ios-xe/src/main/resources/org/opendaylight/blueprint/ios-xe-renderer.xml b/renderers/ios-xe/src/main/resources/org/opendaylight/blueprint/ios-xe-renderer.xml
new file mode 100644 (file)
index 0000000..06db22f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+    <reference id="broker" interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"/>
+
+    <bean id="iosXeRenderer" class="org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.config.IosXeProviderInstance"
+        destroy-method="close">
+        <argument ref="dataBroker"/>
+        <argument ref="broker"/>
+    </bean>
+</blueprint>
\ No newline at end of file
index 423d8feeda1b3aec30950dbbd477b4bc4b33c135..a27719fe40ffa6137a1585671ab17de3321aaf1f 100755 (executable)
@@ -34,34 +34,6 @@ module ios-xe-provider-impl {
     augment "/config:modules/config:module/config:configuration" {
         case ios-xe-provider-impl {
             when "/config:modules/config:module/config:type = 'ios-xe-provider-impl'";
-
-            // Wires in the data-broker service
-            container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-async-data-broker;
-                    }
-                }
-            }
-            // binding aware broker
-            container broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-broker-osgi-registry;
-                    }
-                }
-            }
-            // PolicyProviderRegistry service
-            container policy-validator-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity gbpcfg:policy-validator-registry;
-                    }
-                }
-            }
         }
     }
 }