diff --git a/service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java b/service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java index c5efaaea89..50809a19b7 100644 --- a/service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java +++ b/service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2016, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -85,6 +85,8 @@ public abstract class AbstractHttpEndpoint ex /** * A function that tries to parse a string into an Optional boolean. + * The input string should be a valid boolean value as string (e.g. 'true', 'false' etc..). + * If string is null or empty, function returns Optional.empty() else an Optional object of boolean type. */ protected static final Function> CONVERTER_BOOLEAN = s -> { return Strings.isNullOrEmpty(s) ? Optional.empty() : Optional.of(Boolean.valueOf(s)); diff --git a/services/device-registry-base/src/main/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java b/services/device-registry-base/src/main/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java index 3bc927c71f..638df2ca88 100644 --- a/services/device-registry-base/src/main/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java +++ b/services/device-registry-base/src/main/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -226,6 +226,7 @@ protected Future> processDeleteDevicesOfTenant(final String tenantI * @param filters A list of filters. The filters are predicates that objects in the result set must match. * @param sortOptions A list of sort options. The sortOptions specify properties to sort the result set by. * @param isGateway Optional filter for searching all gateways or only devices. + * If the given parameter is Optional.empty(), then result will include both devices and gateways. * @param span The active OpenTracing span to use for tracking this operation. *

* Implementations must not invoke the {@link Span#finish()} nor the {@link Span#finish(long)} diff --git a/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java b/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java index 734d04a3ca..1192bfce72 100644 --- a/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java +++ b/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -193,7 +193,7 @@ private void doSearchDevices(final RoutingContext ctx) { CONVERTER_BOOLEAN, value -> true); - CompositeFuture.all(pageSize, pageOffset, filters, sortOptions) + CompositeFuture.all(pageSize, pageOffset, filters, sortOptions, isGateway) .onSuccess(ok -> TracingHelper.TAG_TENANT_ID.set(span, tenantId)) .compose(ok -> getService().searchDevices( tenantId, diff --git a/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DeviceManagementService.java b/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DeviceManagementService.java index fbdf79297b..2e242fc429 100644 --- a/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DeviceManagementService.java +++ b/services/device-registry-base/src/main/java/org/eclipse/hono/service/management/device/DeviceManagementService.java @@ -103,6 +103,7 @@ public interface DeviceManagementService { * methods. However,implementations may log (error) events on this span, set tags and use this span * as the parent for additional spans created as part of this method's execution. * @param isGateway Optional filter for searching all gateways or only devices. + * If the given parameter is Optional.empty(), then result will include both devices and gateways. * @return A future indicating the outcome of the operation. *

* The future will be succeeded with a result containing the matching devices. Otherwise, the future will diff --git a/services/device-registry-base/src/test/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpointTest.java b/services/device-registry-base/src/test/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpointTest.java index 72065d3bb8..ea4361c2a7 100644 --- a/services/device-registry-base/src/test/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpointTest.java +++ b/services/device-registry-base/src/test/java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpointTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. diff --git a/services/device-registry-jdbc/src/main/java/org/eclipse/hono/deviceregistry/jdbc/impl/DeviceManagementServiceImpl.java b/services/device-registry-jdbc/src/main/java/org/eclipse/hono/deviceregistry/jdbc/impl/DeviceManagementServiceImpl.java index da27caf8df..d8a569ffec 100644 --- a/services/device-registry-jdbc/src/main/java/org/eclipse/hono/deviceregistry/jdbc/impl/DeviceManagementServiceImpl.java +++ b/services/device-registry-jdbc/src/main/java/org/eclipse/hono/deviceregistry/jdbc/impl/DeviceManagementServiceImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. diff --git a/services/device-registry-mongodb/src/main/java/org/eclipse/hono/deviceregistry/mongodb/service/MongoDbBasedDeviceManagementService.java b/services/device-registry-mongodb/src/main/java/org/eclipse/hono/deviceregistry/mongodb/service/MongoDbBasedDeviceManagementService.java index f60c2ef05a..c2f074d47d 100644 --- a/services/device-registry-mongodb/src/main/java/org/eclipse/hono/deviceregistry/mongodb/service/MongoDbBasedDeviceManagementService.java +++ b/services/device-registry-mongodb/src/main/java/org/eclipse/hono/deviceregistry/mongodb/service/MongoDbBasedDeviceManagementService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership.