Each bundle in the framework is represented as a standalone functional item. The bundle item, which represents the bundle as a functional item, has:
The Bundle Factory extends FunctionalItemFactroy and it is responsible for registering/unregistering bundle functional items. The Bundle Factory has operation install which is responsible to install the bundle with given location. This operation has a parameter autoStart. If the value is true, the bundle get also started. The Bundle Factory has property filter which value is LDAP filter. The Bundle Factory registers those bundle items, which match the filter. The default value of the property filter is an empty string, meaning that no bundle items will be registered.
The Bundle Factory is registered when the com.prosyst.mbs.things.agent.items.osgi.bundles.jar is started. The bundle UID is Bundle:{bundle_symbolic_name}.
Every registered bundle item, that matches the provided filter, is a feature of a thing with id "{namespace}:{gatewayId}:edge:services:bundles". The following code shows how a bundle item is represented as a feature of an OSGi thing. The bundle item properties "state", "version" and "symbolicName" are represented as status properties of the feature:
{
"Bundle:com.prosyst.mbs.webservices.jsonrpc.event.websocket": {
"definition": ["com.bosch.iot.suite.edge.services:Bundle:2.0.0"],
"properties": {"status": {
"symbolicName": "com.prosyst.mbs.webservices.jsonrpc.event.websocket",
"state": "ACTIVE",
"version": "1.5.3000.SNAPSHOT-202102151621"
}
},
}
The Bundle Factory is represented as a feature of a thing with ID: "{namespace}:{gatewayId}:edge:services:bundles". The following code shows how the BundleFactory looks like as an OSGi Thing feature.
{
"BundleFactory":{
"definition":[
"com.bosch.iot.suite.edge.services:BundleFactory:2.0.0",
"com.bosch.iot.suite.edge.services.fim:FunctionalItemFactory:1.0.0",
"com.bosch.iot.suite.edge.services.fim:FunctionalItem:1.1.0"
],
"properties":{
"configuration":{
"filter":"",
"tags":[
]
},
"attributes":{
"supportedClasses":[
"com.prosyst.mbs.services.things.agent.items.osgi.bundle.Bundle"
]
},
"status":{
}
}
}
}
The implementation of the Bundle Factory and its property filter is bound to an OSGi configuration named "Things Agent Bundle Factory" with PID com.prosyst.mbs.things.agent.items.osgi.bundle.pid. A change of the filter property value through its setter method reflects on 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 Bundle Factory functional item.
The filter is interpreted as follows: