From 1f7da6b6698365c6bf7c5a3ee124463e84a116bb Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Tue, 22 Sep 2020 08:48:05 +0200 Subject: [PATCH] Fix ConfigurableService deprecations (#8526) Signed-off-by: Wouter Born --- .../java/org/openhab/io/homekit/internal/HomekitImpl.java | 6 ++---- .../org/openhab/io/hueemulation/internal/ConfigStore.java | 8 +++----- .../io/imperihome/internal/ImperiHomeApiServlet.java | 8 +++----- .../internal/EmbeddedBrokerService.java | 8 +++----- .../openhab/io/openhabcloud/internal/CloudService.java | 8 +++----- .../openhab/voice/pollytts/internal/PollyTTSService.java | 7 +++---- .../voice/voicerss/internal/VoiceRSSTTSService.java | 6 ++---- 7 files changed, 19 insertions(+), 32 deletions(-) diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java index 144d120da..42229ff3a 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java @@ -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); diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java index d846c1204..a10e7f799 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java @@ -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 { diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java index 938b6f2ce..335aec753 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java @@ -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; diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java index f7b15583a..bbdc53320 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java @@ -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 { diff --git a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java index e2f7137c3..e7fce5abf 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java +++ b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java @@ -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"; diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java index 42f336377..4ca023f01 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java @@ -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 { /** diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java index 8a627aa32..639d21490 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java @@ -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. */