null for simple properties) When
+ * applied, these filters are AND-gated.
+ *
+ */
+public class FilterParams {
+
+ Collectionnull this filter is disabled.
+ *
+ * @return {@link DistributionSet#getId()} to filter the result
+ */
+ public Long getFilterByDistributionId() {
+ return filterByDistributionId;
+ }
+
+ /**
+ * Sets {@link DistributionSet#getId()} to filter the result.
+ *
+ * @param filterByDistributionId
+ */
+ public void setFilterByDistributionId(Long filterByDistributionId) {
+ this.filterByDistributionId = filterByDistributionId;
+ }
+
+ /**
+ * Gets a collection of target states to filter for. null this filter is disabled.
+ *
+ * @return collection of target states to filter for
+ */
+ public Collectiontrue, the
+ * overdue filter is activated. Overdued targets a targets that did not
+ * respond during the configured intervals: poll_itvl + overdue_itvl. null this filter is disabled.
+ *
+ * @return flag for overdue filter activation
+ */
+ public Boolean getOverdueState() {
+ return overdueState;
+ }
+
+ /**
+ * Sets the flag for overdue filter; if set to true, the
+ * overdue filter is activated.
+ *
+ * @param overdueState
+ */
+ public void setOverdueState(Boolean overdueState) {
+ this.overdueState = overdueState;
+ }
+
+ /**
+ * Gets the search text to filter for. This is used to find targets having
+ * the text anywhere in name or description null this filter is disabled.
+ *
+ * @return the search text to filter for
+ */
+ public String getFilterBySearchText() {
+ return filterBySearchText;
+ }
+
+ /**
+ * Sets the search text to filter for.
+ *
+ * @param filterBySearchText
+ */
+ public void setFilterBySearchText(String filterBySearchText) {
+ this.filterBySearchText = filterBySearchText;
+ }
+
+ /**
+ * Gets the flag indicating if tagging filter is used. null this filter is disabled.
+ *
+ * @return the flag indicating if tagging filter is used
+ */
+ public Boolean getSelectTargetWithNoTag() {
+ return selectTargetWithNoTag;
+ }
+
+ /**
+ * Sets the flag indicating if tagging filter is used.
+ *
+ * @param selectTargetWithNoTag
+ */
+ public void setSelectTargetWithNoTag(Boolean selectTargetWithNoTag) {
+ this.selectTargetWithNoTag = selectTargetWithNoTag;
+ }
+
+ /**
+ * Gets the tags that are used to filter for. The activation of this filter
+ * is done by {@link #setSelectTargetWithNoTag(Boolean)}.
+ *
+ * @return the tags that are used to filter for
+ */
+ public String[] getFilterByTagNames() {
+ return filterByTagNames;
+ }
+
+ /**
+ * Sets the tags that are used to filter for.
+ *
+ * @param filterByTagNames
+ */
+ public void setFilterByTagNames(String[] filterByTagNames) {
+ this.filterByTagNames = filterByTagNames;
+ }
+}
diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
index 40fd7cc27..97cce6436 100644
--- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
+++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
@@ -480,36 +480,15 @@ public interface TargetManagement {
* the page request to page the result set
* @param orderByDistributionId
* {@link DistributionSet#getId()} to be ordered by
- * @param filterByDistributionId
- * {@link DistributionSet#getId()} to be filter the result. Set
- * to null in case this is not required.
- * @param filterByStatus
- * find targets having this {@link TargetUpdateStatus}s. Set to
- * null in case this is not required.
- * @param overdueState
- * find targets that are overdue (targets that did not respond
- * during the configured intervals: poll_itvl + overdue_itvl).
- * @param filterBySearchText
- * to find targets having the text anywhere in name or
- * description. Set null in case this is not
- * required.
- * @param installedOrAssignedDistributionSetId
- * to find targets having the {@link DistributionSet} as
- * installed or assigned. Set to null in case this
- * is not required.
- * @param filterByTagNames
- * to find targets which are having any one in this tag names.
- * Set null in case this is not required.
- * @param selectTargetWithNoTag
- * flag to select targets with no tag assigned
+ * @param filterParams
+ * the filters to apply; only filters are enabled that have
+ * non-null value; filters are AND-gated
* @return a paged result {@link Page} of the {@link Target}s in a defined
* order.
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
Slice
* This is used in context of string replacement.
*/
+@FunctionalInterface
public interface VirtualPropertyLookup {
/**
diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolver.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolver.java
index 39aed8786..c1e87c43a 100644
--- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolver.java
+++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolver.java
@@ -50,9 +50,9 @@ public class VirtualPropertyResolver implements VirtualPropertyLookup {
public String lookup(String rhs) {
String resolved = null;
- if ("now_ts".equals(rhs.toLowerCase())) {
+ if ("now_ts".equalsIgnoreCase(rhs)) {
resolved = String.valueOf(Instant.now().toEpochMilli());
- } else if ("overdue_ts".equals(rhs.toLowerCase())) {
+ } else if ("overdue_ts".equalsIgnoreCase(rhs)) {
resolved = String.valueOf(getTimestampCalculator().calculateOverdueTimestamp());
}
return resolved;
diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/TargetManagementSearchTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/TargetManagementSearchTest.java
index e4c6a15b9..5dee43411 100644
--- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/TargetManagementSearchTest.java
+++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/TargetManagementSearchTest.java
@@ -16,21 +16,16 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-import java.util.Map;
-import java.util.stream.Collector;
import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-import org.eclipse.hawkbit.ControllerPollProperties;
+import org.eclipse.hawkbit.repository.FilterParams;
import org.eclipse.hawkbit.repository.jpa.model.JpaAction;
import org.eclipse.hawkbit.repository.jpa.model.JpaActionStatus;
import org.eclipse.hawkbit.repository.jpa.model.JpaTarget;
import org.eclipse.hawkbit.repository.jpa.model.JpaTargetFilterQuery;
import org.eclipse.hawkbit.repository.jpa.model.JpaTargetTag;
-import org.eclipse.hawkbit.repository.jpa.model.helper.TenantConfigurationManagementHolder;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.Action.Status;
-import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
import org.eclipse.hawkbit.repository.model.ActionStatus;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
@@ -39,7 +34,6 @@ import org.eclipse.hawkbit.repository.model.TargetTag;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Slice;
import com.google.common.collect.Lists;
@@ -746,7 +740,7 @@ public class TargetManagementSearchTest extends AbstractJpaIntegrationTest {
targInstalled = sendUpdateActionStatusToTargets(ds, targInstalled, Status.FINISHED, "installed");
final Slice