]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fix ConfigurableService deprecations (#8526)
authorWouter Born <github@maindrain.net>
Tue, 22 Sep 2020 06:48:05 +0000 (08:48 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 06:48:05 +0000 (08:48 +0200)
Signed-off-by: Wouter Born <github@maindrain.net>
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java
bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java
bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java
bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java
bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java
bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java
bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java

index 144d120da5c1fec56f04b0241419105db7013d5c..42229ff3ac544a62d7fc2488feef5d0633ed4475 100644 (file)
@@ -51,10 +51,8 @@ import io.github.hapjava.server.impl.HomekitServer;
  * @author Andy Lintner - Initial contribution
  */
 @Component(immediate = true, service = { Homekit.class }, configurationPid = "org.openhab.homekit", property = {
-        Constants.SERVICE_PID + "=org.openhab.homekit",
-        ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=io:homekit",
-        ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=io",
-        ConfigurableService.SERVICE_PROPERTY_LABEL + "=HomeKit Integration", "port:Integer=9123" })
+        Constants.SERVICE_PID + "=org.openhab.homekit", "port:Integer=9123" })
+@ConfigurableService(category = "io", label = "HomeKit Integration", description_uri = "io:homekit")
 @NonNullByDefault
 public class HomekitImpl implements Homekit {
     private final Logger logger = LoggerFactory.getLogger(HomekitImpl.class);
index d846c1204641ef26ba0722720d9f4044a25e23f3..a10e7f79934d648f2107cdb8ab75e3d1ba754483 100644 (file)
@@ -27,9 +27,9 @@ import java.util.stream.Stream;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.core.common.ThreadPoolManager;
 import org.openhab.core.config.core.ConfigurableService;
 import org.openhab.core.config.core.Configuration;
-import org.openhab.core.common.ThreadPoolManager;
 import org.openhab.core.items.Item;
 import org.openhab.core.items.Metadata;
 import org.openhab.core.items.MetadataKey;
@@ -72,10 +72,8 @@ import com.google.gson.GsonBuilder;
  * @author David Graeff - Initial contribution
  */
 @Component(immediate = false, service = { ConfigStore.class }, configurationPid = {
-        HueEmulationService.CONFIG_PID }, property = { "com.eclipsesource.jaxrs.publish=false",
-                ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=io:hueemulation",
-                ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=io",
-                ConfigurableService.SERVICE_PROPERTY_LABEL + "=Hue Emulation" })
+        HueEmulationService.CONFIG_PID }, property = "com.eclipsesource.jaxrs.publish=false")
+@ConfigurableService(category = "io", label = "Hue Emulation", description_uri = "io:hueemulation")
 @NonNullByDefault
 public class ConfigStore {
 
index 938b6f2ce3081a57eff50eae902e69c1822fa80a..335aec753d1d85b495650871087f4b5b7ac433dd 100644 (file)
@@ -61,11 +61,9 @@ import com.google.gson.GsonBuilder;
  *
  * @author Pepijn de Geus - Initial contribution
  */
-@Component(immediate = true, service = HttpServlet.class, configurationPid = "org.openhab.imperihome", property = {
-        Constants.SERVICE_PID + "=org.openhab.imperihome",
-        ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=io:imperihome",
-        ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=io",
-        ConfigurableService.SERVICE_PROPERTY_LABEL + "=ImperiHome Integration" })
+@Component(immediate = true, service = HttpServlet.class, configurationPid = "org.openhab.imperihome", //
+        property = Constants.SERVICE_PID + "=org.openhab.imperihome")
+@ConfigurableService(category = "io", label = "ImperiHome Integration", description_uri = "io:imperihome")
 public class ImperiHomeApiServlet extends HttpServlet {
 
     private static final long serialVersionUID = -1966364789075448441L;
index f7b15583a49cd47822acce784070209185a17380..bbdc533206fe3d86999ee2b57ed0e52c4ae7d023 100644 (file)
@@ -79,11 +79,9 @@ import io.netty.handler.ssl.SslContextBuilder;
  *
  * @author David Graeff - Initial contribution
  */
-@Component(immediate = true, service = EmbeddedBrokerService.class, configurationPid = "org.openhab.core.mqttembeddedbroker", property = {
-        org.osgi.framework.Constants.SERVICE_PID + "=org.openhab.core.mqttembeddedbroker",
-        ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=mqtt:mqttembeddedbroker",
-        ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=MQTT",
-        ConfigurableService.SERVICE_PROPERTY_LABEL + "=MQTT Embedded Broker" })
+@Component(immediate = true, service = EmbeddedBrokerService.class, configurationPid = "org.openhab.core.mqttembeddedbroker", //
+        property = org.osgi.framework.Constants.SERVICE_PID + "=org.openhab.core.mqttembeddedbroker")
+@ConfigurableService(category = "MQTT", label = "MQTT Embedded Broker", description_uri = "mqtt:mqttembeddedbroker")
 @NonNullByDefault
 public class EmbeddedBrokerService
         implements MqttConnectionObserver, MqttServiceObserver, MqttEmbeddedBrokerStartedListener {
index e2f7137c362af230d0ea956177d22b717a3a0b1c..e7fce5abfe3bb0824af10c493ee7e29af2ceb2fb 100644 (file)
@@ -71,11 +71,9 @@ import org.slf4j.LoggerFactory;
  * @author Kai Kreuzer - migrated code to new Jetty client and ESH APIs
  */
 @Component(immediate = true, service = { EventSubscriber.class,
-        ActionService.class }, configurationPid = "org.openhab.openhabcloud", property = {
-                Constants.SERVICE_PID + "=org.openhab.openhabcloud",
-                ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=io:openhabcloud",
-                ConfigurableService.SERVICE_PROPERTY_LABEL + "=openHAB Cloud",
-                ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=io" })
+        ActionService.class }, configurationPid = "org.openhab.openhabcloud", property = Constants.SERVICE_PID
+                + "=org.openhab.openhabcloud")
+@ConfigurableService(category = "io", label = "openHAB Cloud", description_uri = "io:openhabcloud")
 public class CloudService implements ActionService, CloudClientListener, EventSubscriber {
 
     private static final String CFG_EXPOSE = "expose";
index 42f336377dfd8216c480e47cc5d56b2b7de6664f..4ca023f012b837fb273e9a0c7cc7ccf605a2ff6e 100644 (file)
@@ -46,10 +46,9 @@ import org.slf4j.LoggerFactory;
  *
  * @author Robert Hillman - Initial contribution
  */
-@Component(configurationPid = SERVICE_PID, property = { Constants.SERVICE_PID + "=" + SERVICE_PID,
-        ConfigurableService.SERVICE_PROPERTY_LABEL + "=" + SERVICE_NAME + " Text-to-Speech",
-        ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=" + SERVICE_CATEGORY + ":" + SERVICE_ID,
-        ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=" + SERVICE_CATEGORY })
+@Component(configurationPid = SERVICE_PID, property = Constants.SERVICE_PID + "=" + SERVICE_PID)
+@ConfigurableService(category = SERVICE_CATEGORY, label = SERVICE_NAME
+        + " Text-to-Speech", description_uri = SERVICE_CATEGORY + ":" + SERVICE_ID)
 public class PollyTTSService implements TTSService {
 
     /**
index 8a627aa32f6ea8483cc7513142ac3ac4c5c33c8d..639d21490cb9276e1fffcbc5f2a47428b7f978a0 100644 (file)
@@ -41,10 +41,8 @@ import org.slf4j.LoggerFactory;
  * @author Jochen Hiller - Initial contribution and API
  * @author Laurent Garnier - add support for OGG and AAC audio formats
  */
-@Component(configurationPid = "org.openhab.voicerss", property = { Constants.SERVICE_PID + "=org.openhab.voicerss",
-        ConfigurableService.SERVICE_PROPERTY_DESCRIPTION_URI + "=voice:voicerss",
-        ConfigurableService.SERVICE_PROPERTY_LABEL + "=VoiceRSS Text-to-Speech",
-        ConfigurableService.SERVICE_PROPERTY_CATEGORY + "=voice" })
+@Component(configurationPid = "org.openhab.voicerss", property = Constants.SERVICE_PID + "=org.openhab.voicerss")
+@ConfigurableService(category = "voice", label = "VoiceRSS Text-to-Speech", description_uri = "voice:voicerss")
 public class VoiceRSSTTSService implements TTSService {
 
     /** Cache folder name is below userdata/voicerss/cache. */