diff --git a/bundles/org.openhab.binding.tr064/.classpath b/bundles/org.openhab.binding.tr064/.classpath deleted file mode 100644 index ae5ae0074cba1..0000000000000 --- a/bundles/org.openhab.binding.tr064/.classpath +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bundles/org.openhab.binding.tr064/.project b/bundles/org.openhab.binding.tr064/.project deleted file mode 100644 index 18fdb7e712187..0000000000000 --- a/bundles/org.openhab.binding.tr064/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - org.openhab.binding.tr064 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/bundles/org.openhab.binding.tr064/pom.xml b/bundles/org.openhab.binding.tr064/pom.xml index 6968e3d3b1a0a..4229a662dc795 100644 --- a/bundles/org.openhab.binding.tr064/pom.xml +++ b/bundles/org.openhab.binding.tr064/pom.xml @@ -7,7 +7,7 @@ org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.7-SNAPSHOT + 3.0.0-SNAPSHOT org.openhab.binding.tr064 @@ -16,16 +16,6 @@ - - org.apache.karaf.tooling - karaf-maven-plugin - - - karaf-feature-verification - none - - - org.jvnet.jaxb2.maven2 maven-jaxb2-plugin diff --git a/bundles/org.openhab.binding.tr064/src/main/feature/feature.xml b/bundles/org.openhab.binding.tr064/src/main/feature/feature.xml index ebdb9e8300401..ccf0c61b9ff15 100644 --- a/bundles/org.openhab.binding.tr064/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tr064/src/main/feature/feature.xml @@ -1,5 +1,5 @@ - + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/AvmFritzTlsTrustManagerProvider.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/AvmFritzTlsTrustManagerProvider.java index 9adfae4da5ec5..e39179b7714c3 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/AvmFritzTlsTrustManagerProvider.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/AvmFritzTlsTrustManagerProvider.java @@ -15,8 +15,8 @@ import javax.net.ssl.X509ExtendedTrustManager; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.io.net.http.TlsTrustManagerProvider; -import org.eclipse.smarthome.io.net.http.TrustAllTrustMananger; +import org.openhab.core.io.net.http.TlsTrustManagerProvider; +import org.openhab.core.io.net.http.TrustAllTrustMananger; import org.osgi.service.component.annotations.Component; /** diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPConnector.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPConnector.java index 616ed846f8715..2d922fb6442a5 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPConnector.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPConnector.java @@ -34,17 +34,17 @@ import org.eclipse.jetty.client.util.BytesContentProvider; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpStatus; -import org.eclipse.smarthome.core.cache.ExpiringCacheMap; -import org.eclipse.smarthome.core.library.types.OnOffType; -import org.eclipse.smarthome.core.library.types.StringType; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.tr064.internal.config.Tr064ChannelConfig; import org.openhab.binding.tr064.internal.dto.config.ChannelTypeDescription; import org.openhab.binding.tr064.internal.dto.scpd.root.SCPDServiceType; import org.openhab.binding.tr064.internal.dto.scpd.service.SCPDActionType; +import org.openhab.core.cache.ExpiringCacheMap; +import org.openhab.core.library.types.OnOffType; +import org.openhab.core.library.types.StringType; +import org.openhab.core.thing.ChannelUID; +import org.openhab.core.types.Command; +import org.openhab.core.types.State; +import org.openhab.core.types.UnDefType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPValueConverter.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPValueConverter.java index 47a6656bbfd30..03266935f3b01 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPValueConverter.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/SOAPValueConverter.java @@ -28,13 +28,13 @@ import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; -import org.eclipse.smarthome.core.library.types.DecimalType; -import org.eclipse.smarthome.core.library.types.OnOffType; -import org.eclipse.smarthome.core.library.types.QuantityType; -import org.eclipse.smarthome.core.library.types.StringType; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.State; import org.openhab.binding.tr064.internal.config.Tr064ChannelConfig; +import org.openhab.core.library.types.DecimalType; +import org.openhab.core.library.types.OnOffType; +import org.openhab.core.library.types.QuantityType; +import org.openhab.core.library.types.StringType; +import org.openhab.core.types.Command; +import org.openhab.core.types.State; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064BindingConstants.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064BindingConstants.java index cd633640c813d..3d57bc1f04ebf 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064BindingConstants.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064BindingConstants.java @@ -16,9 +16,9 @@ import java.util.List; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.openhab.binding.tr064.internal.dto.config.ChannelTypeDescription; import org.openhab.binding.tr064.internal.util.Util; +import org.openhab.core.thing.ThingTypeUID; /** * The {@link Tr064BindingConstants} class defines common constants, which are diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064ChannelTypeProvider.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064ChannelTypeProvider.java index cf48e3992fd61..fe6ef46a56107 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064ChannelTypeProvider.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064ChannelTypeProvider.java @@ -21,12 +21,12 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.type.ChannelType; -import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; -import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; -import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.types.StateDescription; -import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; +import org.openhab.core.thing.type.ChannelType; +import org.openhab.core.thing.type.ChannelTypeBuilder; +import org.openhab.core.thing.type.ChannelTypeProvider; +import org.openhab.core.thing.type.ChannelTypeUID; +import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DiscoveryService.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DiscoveryService.java index aed4070597fcb..c2e813ff70b8f 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DiscoveryService.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DiscoveryService.java @@ -18,13 +18,16 @@ import java.util.*; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; -import org.eclipse.smarthome.config.discovery.DiscoveryResult; -import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; -import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.util.UIDUtils; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.tr064.internal.dto.scpd.root.SCPDDeviceType; +import org.openhab.core.config.discovery.AbstractDiscoveryService; +import org.openhab.core.config.discovery.DiscoveryResult; +import org.openhab.core.config.discovery.DiscoveryResultBuilder; +import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.thing.ThingUID; +import org.openhab.core.thing.binding.ThingHandler; +import org.openhab.core.thing.binding.ThingHandlerService; +import org.openhab.core.util.UIDUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,17 +37,27 @@ * @author Jan N. Klug - Initial contribution */ @NonNullByDefault -public class Tr064DiscoveryService extends AbstractDiscoveryService { +public class Tr064DiscoveryService extends AbstractDiscoveryService implements ThingHandlerService { private static final int SEARCH_TIME = 5; public static final Set SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_SUBDEVICE); private final Logger logger = LoggerFactory.getLogger(Tr064DiscoveryService.class); + private @Nullable Tr064RootHandler bridgeHandler; - private final Tr064RootHandler bridgeHandler; - - public Tr064DiscoveryService(Tr064RootHandler bridgeHandler) { + public Tr064DiscoveryService() { super(SEARCH_TIME); - this.bridgeHandler = bridgeHandler; + } + + @Override + public void setThingHandler(ThingHandler thingHandler) { + if (thingHandler instanceof Tr064RootHandler) { + this.bridgeHandler = (Tr064RootHandler) thingHandler; + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return bridgeHandler; } @Override @@ -59,6 +72,11 @@ public Set getSupportedThingTypes() { @Override public void startScan() { + Tr064RootHandler bridgeHandler = this.bridgeHandler; + if (bridgeHandler == null) { + logger.warn("Could not start discovery, bridge handler not set"); + return; + } List devices = bridgeHandler.getAllSubDevices(); ThingUID bridgeUID = bridgeHandler.getThing().getUID(); devices.forEach(device -> { @@ -66,12 +84,10 @@ public void startScan() { String udn = device.getUDN(); if (udn != null) { ThingTypeUID thingTypeUID; - switch (device.getDeviceType()) { - case "urn:dslforum-org:device:LANDevice:1": - thingTypeUID = THING_TYPE_SUBDEVICE_LAN; - break; - default: - thingTypeUID = THING_TYPE_SUBDEVICE; + if ("urn:dslforum-org:device:LANDevice:1".equals(device.getDeviceType())) { + thingTypeUID = THING_TYPE_SUBDEVICE_LAN; + } else { + thingTypeUID = THING_TYPE_SUBDEVICE; } ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, UIDUtils.encode(udn)); diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DynamicStateDescriptionProvider.java index 6660444824b18..cb71263ae0aba 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064DynamicStateDescriptionProvider.java @@ -18,11 +18,11 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.Channel; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider; -import org.eclipse.smarthome.core.types.StateDescription; +import org.openhab.core.thing.Channel; +import org.openhab.core.thing.ChannelUID; +import org.openhab.core.thing.ThingUID; +import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.openhab.core.types.StateDescription; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064HandlerFactory.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064HandlerFactory.java index bbc0d21c0054c..5bbdb0e47fdd2 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064HandlerFactory.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064HandlerFactory.java @@ -20,18 +20,16 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.smarthome.config.discovery.DiscoveryService; -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; -import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; -import org.eclipse.smarthome.io.net.http.HttpClientFactory; -import org.openhab.binding.tr064.profile.phonebook.PhonebookProvider; import org.openhab.binding.tr064.profile.phonebook.PhonebookProfileFactory; -import org.osgi.framework.ServiceRegistration; +import org.openhab.binding.tr064.profile.phonebook.PhonebookProvider; +import org.openhab.core.io.net.http.HttpClientFactory; +import org.openhab.core.thing.Bridge; +import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.thing.ThingUID; +import org.openhab.core.thing.binding.BaseThingHandlerFactory; +import org.openhab.core.thing.binding.ThingHandler; +import org.openhab.core.thing.binding.ThingHandlerFactory; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -58,7 +56,6 @@ public class Tr064HandlerFactory extends BaseThingHandlerFactory { private @Nullable PhonebookProfileFactory phonebookProfileFactory = null; private final Set phonebookProviders = ConcurrentHashMap.newKeySet(); - private final Map> discoveryServiceRegs = new ConcurrentHashMap<>(); @Activate public Tr064HandlerFactory(@Reference HttpClientFactory httpClientFactory, @@ -68,14 +65,12 @@ public Tr064HandlerFactory(@Reference HttpClientFactory httpClientFactory, } @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC) - public void setPhonebookTransformationProfileFactory( - PhonebookProfileFactory phonebookProfileFactory) { + public void setPhonebookTransformationProfileFactory(PhonebookProfileFactory phonebookProfileFactory) { this.phonebookProfileFactory = phonebookProfileFactory; phonebookProviders.forEach(phonebookProfileFactory::registerPhonebookProvider); } - public void unsetPhonebookTransformationProfileFactory( - PhonebookProfileFactory phonebookProfileFactory) { + public void unsetPhonebookTransformationProfileFactory(PhonebookProfileFactory phonebookProfileFactory) { this.phonebookProfileFactory = null; } @@ -90,7 +85,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { if (Tr064RootHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { Tr064RootHandler handler = new Tr064RootHandler((Bridge) thing, httpClient); - registerDeviceDiscoveryService(handler); phonebookProviders.add(handler); PhonebookProfileFactory phonebookProfileFactory = this.phonebookProfileFactory; if (phonebookProfileFactory != null) { @@ -109,10 +103,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { protected void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof Tr064RootHandler) { final ThingUID thingUID = thingHandler.getThing().getUID(); - final ServiceRegistration serviceReg = discoveryServiceRegs.remove(thingUID); - if (serviceReg != null) { - serviceReg.unregister(); - } phonebookProviders.remove(thingHandler); PhonebookProfileFactory phonebookProfileFactory = this.phonebookProfileFactory; if (phonebookProfileFactory != null) { @@ -120,15 +110,4 @@ protected void removeHandler(ThingHandler thingHandler) { } } } - - /** - * create and register a new discovery service for the given bridge handler - * - * @param bridgeHandler the bridgehandler (root device) - */ - private void registerDeviceDiscoveryService(Tr064RootHandler bridgeHandler) { - Tr064DiscoveryService discoveryService = new Tr064DiscoveryService(bridgeHandler); - discoveryServiceRegs.put(bridgeHandler.getThing().getUID(), bundleContext - .registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable())); - } } diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064RootHandler.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064RootHandler.java index 7567aaf40904f..86e3061079553 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064RootHandler.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064RootHandler.java @@ -32,13 +32,6 @@ import org.eclipse.jetty.client.api.Authentication; import org.eclipse.jetty.client.api.AuthenticationStore; import org.eclipse.jetty.client.util.DigestAuthentication; -import org.eclipse.smarthome.core.cache.ExpiringCacheMap; -import org.eclipse.smarthome.core.thing.*; -import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; -import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.eclipse.smarthome.core.types.State; import org.openhab.binding.tr064.internal.config.Tr064ChannelConfig; import org.openhab.binding.tr064.internal.config.Tr064RootConfiguration; import org.openhab.binding.tr064.internal.dto.scpd.root.SCPDDeviceType; @@ -48,6 +41,14 @@ import org.openhab.binding.tr064.internal.util.Util; import org.openhab.binding.tr064.profile.phonebook.Phonebook; import org.openhab.binding.tr064.profile.phonebook.PhonebookProvider; +import org.openhab.core.cache.ExpiringCacheMap; +import org.openhab.core.thing.*; +import org.openhab.core.thing.binding.BaseBridgeHandler; +import org.openhab.core.thing.binding.ThingHandlerService; +import org.openhab.core.thing.binding.builder.ThingBuilder; +import org.openhab.core.types.Command; +import org.openhab.core.types.RefreshType; +import org.openhab.core.types.State; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -375,4 +376,9 @@ public Collection getPhonebooks() { public ThingUID getUID() { return thing.getUID(); } + + @Override + public Collection> getServices() { + return Set.of(Tr064DiscoveryService.class); + } } diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064SubHandler.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064SubHandler.java index 31601140384c5..1f791d0a6519a 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064SubHandler.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/Tr064SubHandler.java @@ -24,19 +24,19 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.cache.ExpiringCacheMap; -import org.eclipse.smarthome.core.thing.*; -import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; -import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.tr064.internal.config.Tr064ChannelConfig; import org.openhab.binding.tr064.internal.config.Tr064SubConfiguration; import org.openhab.binding.tr064.internal.dto.scpd.root.SCPDDeviceType; import org.openhab.binding.tr064.internal.util.SCPDUtil; import org.openhab.binding.tr064.internal.util.Util; +import org.openhab.core.cache.ExpiringCacheMap; +import org.openhab.core.thing.*; +import org.openhab.core.thing.binding.BaseThingHandler; +import org.openhab.core.thing.binding.builder.ThingBuilder; +import org.openhab.core.types.Command; +import org.openhab.core.types.RefreshType; +import org.openhab.core.types.State; +import org.openhab.core.types.UnDefType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/util/Util.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/util/Util.java index da9d845cf413f..99c3590769512 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/util/Util.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/util/Util.java @@ -29,12 +29,6 @@ import javax.xml.transform.stream.StreamSource; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.binding.builder.ChannelBuilder; -import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; -import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.util.UIDUtils; import org.openhab.binding.tr064.internal.ChannelConfigException; import org.openhab.binding.tr064.internal.config.Tr064BaseThingConfiguration; import org.openhab.binding.tr064.internal.config.Tr064ChannelConfig; @@ -49,6 +43,12 @@ import org.openhab.binding.tr064.internal.dto.scpd.service.SCPDArgumentType; import org.openhab.binding.tr064.internal.dto.scpd.service.SCPDScpdType; import org.openhab.binding.tr064.internal.dto.scpd.service.SCPDStateVariableType; +import org.openhab.core.thing.ChannelUID; +import org.openhab.core.thing.Thing; +import org.openhab.core.thing.binding.builder.ChannelBuilder; +import org.openhab.core.thing.binding.builder.ThingBuilder; +import org.openhab.core.thing.type.ChannelTypeUID; +import org.openhab.core.util.UIDUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.NodeList; diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProfileFactory.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProfileFactory.java index 2f90e7e5b3f2d..ae9a33de81057 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProfileFactory.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProfileFactory.java @@ -20,16 +20,16 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.thing.profiles.Profile; -import org.eclipse.smarthome.core.thing.profiles.ProfileCallback; -import org.eclipse.smarthome.core.thing.profiles.ProfileContext; -import org.eclipse.smarthome.core.thing.profiles.ProfileFactory; -import org.eclipse.smarthome.core.thing.profiles.ProfileType; -import org.eclipse.smarthome.core.thing.profiles.ProfileTypeBuilder; -import org.eclipse.smarthome.core.thing.profiles.ProfileTypeProvider; -import org.eclipse.smarthome.core.thing.profiles.ProfileTypeUID; import org.openhab.binding.tr064.profile.phonebook.internal.PhonebookProfile; +import org.openhab.core.thing.ThingUID; +import org.openhab.core.thing.profiles.Profile; +import org.openhab.core.thing.profiles.ProfileCallback; +import org.openhab.core.thing.profiles.ProfileContext; +import org.openhab.core.thing.profiles.ProfileFactory; +import org.openhab.core.thing.profiles.ProfileType; +import org.openhab.core.thing.profiles.ProfileTypeBuilder; +import org.openhab.core.thing.profiles.ProfileTypeProvider; +import org.openhab.core.thing.profiles.ProfileTypeUID; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,9 +59,8 @@ public Collection getSupportedProfileTypeUIDs() { @Override public Collection getProfileTypes(@Nullable Locale locale) { - return Collections - .singleton(ProfileTypeBuilder.newState(PhonebookProfile.PHONEBOOK_PROFILE_TYPE_UID, - PhonebookProfile.PHONEBOOK_PROFILE_TYPE_UID.getId()).build()); + return Collections.singleton(ProfileTypeBuilder.newState(PhonebookProfile.PHONEBOOK_PROFILE_TYPE_UID, + PhonebookProfile.PHONEBOOK_PROFILE_TYPE_UID.getId()).build()); } /** diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProvider.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProvider.java index a4fa4fd57a77f..9857b98f715a3 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProvider.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/PhonebookProvider.java @@ -16,7 +16,7 @@ import java.util.Optional; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ThingUID; +import org.openhab.core.thing.ThingUID; /** * The {@link PhonebookProvider} interface provides methods to lookup a phone number from a phonebook diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/internal/PhonebookProfile.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/internal/PhonebookProfile.java index fbc492800687b..00bad6cd24b99 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/internal/PhonebookProfile.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/profile/phonebook/internal/PhonebookProfile.java @@ -17,17 +17,17 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.config.core.Configuration; -import org.eclipse.smarthome.core.library.types.StringType; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.thing.profiles.ProfileCallback; -import org.eclipse.smarthome.core.thing.profiles.ProfileContext; -import org.eclipse.smarthome.core.thing.profiles.ProfileTypeUID; -import org.eclipse.smarthome.core.thing.profiles.StateProfile; -import org.eclipse.smarthome.core.transform.TransformationService; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.State; import org.openhab.binding.tr064.profile.phonebook.PhonebookProvider; +import org.openhab.core.config.core.Configuration; +import org.openhab.core.library.types.StringType; +import org.openhab.core.thing.ThingUID; +import org.openhab.core.thing.profiles.ProfileCallback; +import org.openhab.core.thing.profiles.ProfileContext; +import org.openhab.core.thing.profiles.ProfileTypeUID; +import org.openhab.core.thing.profiles.StateProfile; +import org.openhab.core.transform.TransformationService; +import org.openhab.core.types.Command; +import org.openhab.core.types.State; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF.config/phonebookProfile.xml b/bundles/org.openhab.binding.tr064/src/main/resources/OH-INF.config/phonebookProfile.xml similarity index 100% rename from bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF.config/phonebookProfile.xml rename to bundles/org.openhab.binding.tr064/src/main/resources/OH-INF.config/phonebookProfile.xml diff --git a/bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.tr064/src/main/resources/OH-INF/binding/binding.xml similarity index 100% rename from bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF/binding/binding.xml rename to bundles/org.openhab.binding.tr064/src/main/resources/OH-INF/binding/binding.xml diff --git a/bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.tr064/src/main/resources/OH-INF/thing/thing-types.xml similarity index 100% rename from bundles/org.openhab.binding.tr064/src/main/resources/ESH-INF/thing/thing-types.xml rename to bundles/org.openhab.binding.tr064/src/main/resources/OH-INF/thing/thing-types.xml diff --git a/bundles/org.openhab.binding.tr064/src/test/java/org/openhab/binding/tr064/ChannelListUtilTest.java b/bundles/org.openhab.binding.tr064/src/test/java/org/openhab/binding/tr064/ChannelListUtilTest.java index cc7468c71bc47..d3267cad1edc1 100644 --- a/bundles/org.openhab.binding.tr064/src/test/java/org/openhab/binding/tr064/ChannelListUtilTest.java +++ b/bundles/org.openhab.binding.tr064/src/test/java/org/openhab/binding/tr064/ChannelListUtilTest.java @@ -20,8 +20,8 @@ import java.util.Comparator; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openhab.binding.tr064.internal.Tr064BindingConstants; import org.openhab.binding.tr064.internal.dto.config.ChannelTypeDescription; @@ -48,13 +48,13 @@ public void createChannelListTest() { try { writer.write(channelString); } catch (IOException e) { - Assert.fail(e.getMessage()); + Assertions.fail(e.getMessage()); } }); writer.close(); } catch (IOException e) { - Assert.fail(e.getMessage()); + Assertions.fail(e.getMessage()); } } }