You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stefan Feilmeier (Jira)" <ji...@apache.org> on 2021/09/09 09:35:00 UTC

[jira] [Commented] (FELIX-6436) Exclude default values (from metatype) in Configuration

    [ https://issues.apache.org/jira/browse/FELIX-6436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17412472#comment-17412472 ] 

Stefan Feilmeier commented on FELIX-6436:
-----------------------------------------

We are seeing a problem with this update in OpenEMS. As default values are not anymore set as properties, it is also not possible to query the property via ConfigurationAdmin `listConfigurations()` method. Our use-case:
 # All components have sensible default configurations set in their configuration interfaces. Example: [https://github.com/OpenEMS/openems/blob/develop/io.openems.edge.ess.generic/src/io/openems/edge/ess/generic/symmetric/Config.java#L14] sets the property `id` to `ess0` by default.
 # When this component needs to be reconfigured aside of Apache Felix WebConsole (e.g. via OpenEMS UI or OpenEMS REST-Api), we first try to find the `Configuration` object using this internal `id` identifier (see [https://github.com/OpenEMS/openems/blob/develop/io.openems.edge.core/src/io/openems/edge/core/componentmanager/ComponentManagerImpl.java#L439)] 
`cm.listConfigurations("(id=" + componentId + ")");`
 # As the `id` property had not changed from the default value, querying is not possible, so this command returns `null`

I can think of the following solutions:
 # Revert this feature in Webconsole.
 # Make ConfigurationAdmin `listConfigurations` smarter, so that it allows querying also for default values. This sounds like the best approach, but might introduce some unexpected side effects.
 # We use service PID instead of internal `id` to query the Configuration object. This would involve quite some refactoring and does not solve the underlying problem.
 # We implement our own `listConfigurations` method, that checks also for default values. This is most likely the way we will go.

What are your opinions?

> Exclude default values (from metatype) in Configuration
> -------------------------------------------------------
>
>                 Key: FELIX-6436
>                 URL: https://issues.apache.org/jira/browse/FELIX-6436
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>            Priority: Major
>             Fix For: webconsole-4.6.4
>
>
> When an OSGi configuration is changed through the web console, all properties are set in the created/updated configuration, including those which are actually not set in the web console - but where just the default value is transfered back.
> This prohibits those configurations from using any change in the default values.
> The implementation could be smarter and check metatype info (if available) and exclude all properties with default values.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)