Logpresso Architecture

The Logpresso platform runs on an OSGi application server. The Open Service Gateway Initiative (OSGi) is a Java-based standard framework for dynamic modular systems. OSGi provides the ability to develop, deploy, and manage applications by partitioning them into modules.

The Logpresso platform uses the Apache Felix framework as a base among OSGi framework implementations. Logpresso apps are defined as OSGi bundles, so they can be installed or removed from the Logpresso platform at runtime. A Logpresso app is a Java Archive(JAR) file that contains static resources and Java bytecode. When you install a Logpresso app, the Logpresso platform installs the static resources embedded in the bundle and starts the OSGi service.

The Logpresso platform provides shells over SSH (7022/tcp) and Telnet (7004/tcp) protocols. By logging into the Logpresso shell and typing bundle.list, you can see hundreds of OSGi bundles, as shown below.

logpresso> bundle.list
[ ID] Symbolic Name                             Version   Status
------------------------------------------------------------------
[  0] org.apache.felix.framework                6.0.5     ACTIVE
[  1] org.araqne.ipojo                          1.2.1     ACTIVE
[  2] org.apache.felix.ipojo                    1.12.1.asm8       ACTIVE
[  3] org.araqne.msgbus                         1.13.1    ACTIVE
...

Like the out-of-the-box bundle, the Logpresso app is a single OSGi bundle. Below is an example of querying the list of files included in the sample app bundle.

logpresso> bundle.resources 141
Bundle Resources
-------------------
META-INF/
com/

The META-INF/MANIFEST.MF file contains the OSGi manifest. Below is a selection of important OSGi manifest entries.

logpresso> bundle.manifest 141
Bnd-LastModified: 1686382446996
Bundle-Name: Logpresso Sample App
Bundle-SymbolicName: com.logpresso.sonar.sample
Bundle-Version: 1.0.2306.0

The name displayed in the bundle list is the value of the Bundle-SymbolicName item. The version of the bundle is defined by the Bundle-Version entry. The name and version of an OSGi bundle must be unique on the Logpresso platform.

Below is an example of the Java bytecode included in the OSGi bundle.

bundle.resources 141 com/logpresso/sonar/sample/query
Bundle Resources
-------------------
com/logpresso/sonar/sample/query/SampleCreateSubnetGroupCommand.class
com/logpresso/sonar/sample/query/SampleCreateSubnetGroupCommandParser.class
com/logpresso/sonar/sample/query/SampleDriverQueryCommand.class
com/logpresso/sonar/sample/query/SampleParams.class
com/logpresso/sonar/sample/query/SampleQueryCommandParser.class
com/logpresso/sonar/sample/query/SampleSubnetGroupsCommand.class
com/logpresso/sonar/sample/query/SampleSubnetGroupsCommandParser.class

Logpresso apps can call OSGi services provided by the Logpresso platform to use existing functionality or extend the capabilities of the Logpresso platform.

The following sections describe how to extend the query commands to call the REST API with the real-world app example.