diff --git a/bundles/org.openhab.persistence.gcal/src/main/java/org/openhab/persistence/gcal/internal/GCalPersistenceService.java b/bundles/org.openhab.persistence.gcal/src/main/java/org/openhab/persistence/gcal/internal/GCalPersistenceService.java index 911695abe0cca..e22a60a5721c2 100644 --- a/bundles/org.openhab.persistence.gcal/src/main/java/org/openhab/persistence/gcal/internal/GCalPersistenceService.java +++ b/bundles/org.openhab.persistence.gcal/src/main/java/org/openhab/persistence/gcal/internal/GCalPersistenceService.java @@ -22,6 +22,9 @@ import java.util.concurrent.ConcurrentLinkedQueue; import org.apache.commons.lang.StringUtils; +import org.eclipse.jetty.server.HttpTransport; +import org.eclipse.jetty.util.security.Credential; +import org.joda.time.DateTime; import org.openhab.core.items.Item; import org.openhab.core.persistence.PersistenceService; import org.openhab.io.gcal.auth.GCalGoogleOAuth; @@ -39,23 +42,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.client.json.JsonFactory; import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.util.DateTime; -import com.google.api.services.calendar.Calendar; import com.google.api.services.calendar.model.CalendarListEntry; -import com.google.api.services.calendar.model.Event; import com.google.api.services.calendar.model.EventDateTime; /** * This implementation of the {@link PersistenceService} provides Presence * Simulation features based on the Google Calendar Service. * - * @author Thomas.Eichstaedt-Engelen - * @since 1.0.0 + * @author Thomas.Eichstaedt-Engelen - Initial contribution + * @author Kai Kreuzer - Migration to 2.x */ public class GCalPersistenceService implements PersistenceService { diff --git a/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/InfluxDBPersistenceService.java b/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/InfluxDBPersistenceService.java index 105357a63dbce..db9e8e7908374 100644 --- a/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/InfluxDBPersistenceService.java +++ b/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/InfluxDBPersistenceService.java @@ -59,6 +59,10 @@ import org.openhab.core.persistence.PersistenceService; import org.openhab.core.persistence.QueryablePersistenceService; import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,8 +80,9 @@ * * @author Theo Weiss - Initial Contribution, rewrite of org.openhab.persistence.influxdb > 0.9 * support - * @since 1.8.0 + * @author Kai Kreuzer - Migration to 2.x */ +@Component public class InfluxDBPersistenceService implements QueryablePersistenceService { private static final String DEFAULT_URL = "http://127.0.0.1:8086"; @@ -100,6 +105,7 @@ public class InfluxDBPersistenceService implements QueryablePersistenceService { private boolean isProperlyConfigured; private boolean connected; + @Reference public void setItemRegistry(ItemRegistry itemRegistry) { this.itemRegistry = itemRegistry; } @@ -108,6 +114,7 @@ public void unsetItemRegistry(ItemRegistry itemRegistry) { this.itemRegistry = null; } + @Activate public void activate(final BundleContext bundleContext, final Map config) { logger.debug("influxdb persistence service activated"); disconnect(); @@ -152,6 +159,7 @@ public void activate(final BundleContext bundleContext, final Map configuration) { logger.debug("JDBC::activate: persistence service activated"); this.bundleContext = bundleContext; @@ -81,6 +88,7 @@ public void activate(BundleContext bundleContext, Map configurat *
  • 6 – The bundle was stopped * */ + @Deactivate public void deactivate(final int reason) { logger.debug("JDBC::deactivate: persistence bundle stopping. Disconnecting from database. reason={}", reason); // closeConnection(); @@ -88,6 +96,7 @@ public void deactivate(final int reason) { initialized = false; } + @Reference public void setItemRegistry(ItemRegistry itemRegistry) { logger.debug("JDBC::setItemRegistry"); this.itemRegistry = itemRegistry; diff --git a/features/karaf/openhab-addons/src/main/feature/feature.xml b/features/karaf/openhab-addons/src/main/feature/feature.xml index 6576e1ab9a5f3..7d4cc98bc2cdf 100644 --- a/features/karaf/openhab-addons/src/main/feature/feature.xml +++ b/features/karaf/openhab-addons/src/main/feature/feature.xml @@ -985,12 +985,14 @@ openhab-runtime-base mvn:org.openhab.persistence/org.openhab.persistence.mysql/${project.version} + mvn:mysql/mysql-connector-java/8.0.13 mvn:${project.groupId}/openhab-addons-external/${project.version}/cfg/mysql openhab-runtime-base mvn:org.openhab.persistence/org.openhab.persistence.rrd4j/${project.version} + mvn:org.rrd4j/rrd4j/3.3.1 mvn:${project.groupId}/openhab-addons-external/${project.version}/cfg/rrd4j