<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:12 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[MDSAL-598] Add support for datastore configuration OSGi DS injection</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-598</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;Controller&apos;s blueprint component has &quot;clustered-app-config&quot; stanza, which allows injection of root component from the configuration datastore into projects.&lt;/p&gt;

&lt;p&gt;This also supports inline value definition via CDATA, which is interpreted as an XML fragment, or an explicit XML file to be loaded up if the data does not exist in the datastore. See org.opendaylight.controller.blueprint.ext.DataStoreAppConfigMetadata for the gory details.&lt;/p&gt;

&lt;p&gt;Since we are moving away from Blueprint, we need a replacement component, one which will hopefully play nicely with OSGi DS.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="33410">MDSAL-598</key>
            <summary>Add support for datastore configuration OSGi DS injection</summary>
                <type id="10103" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.opendaylight.org/images/icons/priorities/minor.svg">Low</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Oct 2020 17:39:52 +0000</created>
                <updated>Fri, 16 Oct 2020 19:56:19 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="68705" author="rovarga" created="Fri, 16 Oct 2020 18:05:10 +0000"  >&lt;p&gt;Most components should be fine with just injecting the appropriate interface, as that way they are in charge of how the change is propagated &#8211; i.e. via normal service bind/unbind. There are a few components, which ignore updates &#8211; which is really not what should be done and therefore we will ignore them for now.&lt;/p&gt;

&lt;p&gt;Hence the basic mode of operation should be something like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
@Component
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SomeComponent &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; ComponentService {
    @Reference
    ComponentDataObject config;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which will bind ComponentDataObject as a service in OSGi DS. Now we are faced with a slight problem: there is no provider for that service, as it is usually no provider. For that part we need to provide some amount of substrate, so that applications can easily create their component to provide the service, something like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
@Component
&lt;span class=&quot;code-comment&quot;&gt;// Well, a bit more complicated, as it ends up being a factory component
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; OSGiComponentDataObject &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AbstractDatastoreConfiguration&amp;lt;ComponentDataObject&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; ComponentDataObject {
    @Reference
    void bindDataBroker(DataBroker dataBroker) {
        &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;.setDataBroker(dataBroker);
    }

    @Activate
    void activate() {
        &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;.start();
    }

    @Deactivate
    void deactivate() {
        &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;.stop();
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Once we have that working and have unblocked migration, we should take it a bit further and do:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
@Component
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SomeComponent &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; ComponentService {
     @Reference
     @DatastoreConfiguration
     ComponentDataObject config;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;i.e. define our specific annotation, and create an annotation processor which will generate OSGiComponentDataObject into the current project.&lt;/p&gt;</comment>
                            <comment id="68706" author="rovarga" created="Fri, 16 Oct 2020 19:43:33 +0000"  >&lt;p&gt;Based on a prototype in AAA&apos;s password service, this is probably going to be quite involved. See &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/aaa/+/93104&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/aaa/+/93104&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;The problem is that it is quite a bit of code, which has a dependency on mdsal-binding-api, there is an unneeded proxy, etc.&lt;/p&gt;

&lt;p&gt;There is also the tiny issue of the bundle having a Require-Capability for a the config being exposed as a service &#8211; and that gets checked statically before the bundle is ever installed. We essentially would need to insert a runtime component which will provide the binding (very much like BluePrint extension, except at feature:install time!)&lt;/p&gt;

&lt;p&gt;This might not be feasible &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03van:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>