Skip to content
cnoelle edited this page Apr 8, 2018 · 5 revisions

Content

Use with OGEMA

The simplest way to get started is to download the available run configuration and to follow the run instructions. Alternatively, add the following bundles to your runtime (version 0.0.2 or higher):

org.smartrplace.logging:fendodb-core (fendoDB core)
org.smartrplace.logging:fendodb-recordeddata-wrapper (OPTIONAL, use fendoDB as OGEMA datalogger)
org.smartrplace.logging:fendodb-tools (OPTIONAL, tools, for creating a database dumb, etc)
org.apache.commons:commons-csv:1.5 (OPTIONAL, dependency of fendodb-tools)
org.smartrplace.logging:fendodb-rest (OPTIONAL, fendoDB REST interface)
org.smartrplace.logging:fendodb-ogema-tagging (OPTIONAL, automatically add tags/semantic info to time series)
org.smartrplace.logging:fendodb-viz (OPTIONAL, fendoDB visualization; requires OGEMA widgets)
org.smartrplace.logging:fendodb-ogema-admin (OPTIONAL, fragment; makes FendoDbPermission class available to OGEMA security shell commands)

The fendodb-recordeddata-wrapper replaces OGEMA's recordeddata-slotsdb-bundle, hence the latter should not be started if the FendoDB wrapper is used. If in addition the fendodb-ogema-tagging bundle is started, it will apply standard properties to all time series that result from logging an OGEMA resource. See Properties, tags.

In order to access FendoDB in your application, add the following dependency to your project's pom.xml:

<dependency>
	<groupId>org.smartrplace.logging</groupId>
	<artifactId>fendodb-api</artifactId>
	<version>0.0.2</version>
</dependency>
<!-- OPTIONAL -->
<dependency>
	<groupId>org.smartrplace.logging</groupId>
	<artifactId>fendodb-tools</artifactId>
        <version>0.0.2</version>
</dependency>

and retrieve the FendoDbFactory via a @Reference annotation:

@Reference
private FendoDbFactory factory;

See Java API for how to proceed.

Use with OSGi (but not with OGEMA)

The Maven dependency is the same as above, but at runtime you will need a few OGEMA API and tool bundles (version 2.1.3 or higher), as well as common dependencies:

org.osgi:org.osgi.service.useradmin:1.1.0
org.ogema.core:api
org.ogema.core:models
org.ogema.ref-impl:internal-api
org.ogema.tools:resource-utils
org.ogema.tools:memory-timeseries
org.slf4j:slf4j-api:1.7.25
org.slf4j:slf4j-simple:1.7.25
com.google.guava:guava:23
commons-io:commons-io:2.6
org.json:json:20170518
org.apache.felix:org.apache.felix.http.servlet-api:1.1.2
org.apache.felix:org.apache.felix.http.jetty:3.4.8
org.apache.felix:org.apache.felix.framework.security:2.6.0 (if running the Apache Felix system bundle)

The two OGEMA tools-bundles are only required if you install the fendodb-tools bundle. slf4j-simple can be replaced by any other implementation of the Slf4j logging API. The Jetty bundle could be replaced by another implementation of the OSGi Http service. Furthermore, the OSGi EventAdmin and ConfigurationAdmin services and the Service Component Runtime must be present, e.g.:

org.apache.felix:org.apache.felix.scr:2.0.14
org.apache.felix:org.apache.felix.eventadmin:1.4.10
org.apache.felix:org.apache.felix.configadmin:1.8.16

Not strictly required, but extremely useful: the Gogo shell (see Shell commands):

org.apache.felix:org.apache.felix.gogo.runtime:1.0.10
org.apache.felix:org.apache.felix.gogo.command:1.0.2
org.jline:jline:3.6.2
org.apache.felix:org.apache.felix.gogo.jline:1.0.10

Use in a standalone Java application

In this case, replace the Maven dependency for fendodb-api by

<dependency>
	<groupId>org.smartrplace.logging</groupId>
	<artifactId>fendodb-core</artifactId>
	<version>0.0.2</version>
</dependency>

and instantiate the FendoDbFactory implementation class:

final FendoDbFactory factory = new org.smartrplace.logging.fendodb.impl.SlotsDbFactoryImpl();
((org.smartrplace.logging.fendodb.impl.SlotsDbFactoryImpl) factory).activate(null);
try {
    // do something...
} finally {
    ((org.smartrplace.logging.fendodb.impl.SlotsDbFactoryImpl) factory).deactivate();
}

For an example, see the FendoDB Reader project.


Next