Fix ConfigurableService deprecations (#8526)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2020-09-22 08:48:05 +02:00 committed by GitHub
parent c82f6c4e77
commit 1f7da6b669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 32 deletions

View 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);

View 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 {

View 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;

View 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 {

View 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";

View 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 {
/**

View 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. */