Previous Topic

Next Topic

Book Contents

Book Index

OSGi configuration mapping

The OSGi configurations are represented as functional items. The Configuration item, which represents the OSGi configuration as a functional item, has:

The Configuration Factory extends the Functional Item Factory. It is responsible for registering/unregistering Configuration items. The Configuration Factory has a filter property, which value is LDAP filter. The Configuration Factory registers those Configuration items with OSGi configuration properties matching the filter. The default value of the property filter is empty string that means that no Configuration items will be registered.

The Configuration Factory is registered when the com.prosyst.mbs.things.agent.items.osgi.cm.jar bundle is started. The Configuration Factory UID is edge:services:configurations. The Configuration Item UID is Configuration:{configuration_pid}.

{

   "Configuration:WebSockets":{

      "definition":[

         "com.bosch.iot.suite.edge.services:Configuration:2.0.0"

      ],

      "properties":{

         "status":{

            "properties":{

               "cleanerTime":"7",

               "maxConnection":"50",

               "pingWaitingTime":"30",

               "httpContext":"policyadmin.http.websockets",

               "maxConnectionPerWebApplication":"20",

               "lastRemovedCount":"20",

               "service.pid":"WebSockets"

            }

         }

      }

   }

}

The Configuration Factory is represented as a feature of the thing with id {namespace}:{gatewayId}:edge:services:configurations. The following code shows how the ConfigurationFactory feature looks like:

{

      "Configuration:mbs.log.FileLogAppender.Default":{

         "definition":[

            "com.bosch.iot.suite.edge.services:Configuration:2.0.0"

         ],

         "properties":{

            "status":{

               "properties":{

                  "customFormatter":"",

                  "logsDir":"logs",

                  "timeThreshold":"10000",

                  "mdcEnabled":"false",

                  "maxFileSize":"32768",

                  "maxBackupCount":"4",

                  "service.factoryPid":"com.prosyst.mbs.impl.services.log.FileLogAppender",

                  "enabled":"false",

                  "entriesThreshold":"100",

                  "service.pid":"mbs.log.FileLogAppender.Default"

               }

            }

         }

      }

}

The implementation of the Configurtion Factory and its property filter is bound to an OSGi configuration named "Things Agent Configuration Factory" with PID com.prosyst.mbs.things.agent.items.osgi.cm.pid. A change of the filter property value through its setter method reflects the filter property of the OSGi configuration; and vice versa - a change in filter property of the OSGi configuration affects the filter property of the Configuration Factory functional item.

The filter is interpreted as follows: