This is an automated email from the ASF dual-hosted git repository. jsinovassinnaik pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push: new d6ee5bd80 UNOMI-856: return all rules when calling /rules endpoints (#707) d6ee5bd80 is described below commit d6ee5bd804e17e728e94ffcdafa45d29c7cc2e0a Author: jsinovassin <58434978+jsinovas...@users.noreply.github.com> AuthorDate: Tue Nov 5 14:31:44 2024 +0100 UNOMI-856: return all rules when calling /rules endpoints (#707) * UNOMI-856: return all rules when calling /rules endpoints * UNOMI-856: add javadoc --- api/src/main/java/org/apache/unomi/api/services/RulesService.java | 2 +- .../main/java/org/apache/unomi/rest/endpoints/RulesServiceEndPoint.java | 2 +- .../java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/org/apache/unomi/api/services/RulesService.java b/api/src/main/java/org/apache/unomi/api/services/RulesService.java index 52a97ee34..dd5a44786 100644 --- a/api/src/main/java/org/apache/unomi/api/services/RulesService.java +++ b/api/src/main/java/org/apache/unomi/api/services/RulesService.java @@ -37,7 +37,7 @@ public interface RulesService { /** * Retrieves the metadata for all known rules. - * + * Note that it only includes the rules in memory, not those persisted in storage. * @return the Set of known metadata */ Set<Metadata> getRuleMetadatas(); diff --git a/rest/src/main/java/org/apache/unomi/rest/endpoints/RulesServiceEndPoint.java b/rest/src/main/java/org/apache/unomi/rest/endpoints/RulesServiceEndPoint.java index 3230e900c..f204a3929 100644 --- a/rest/src/main/java/org/apache/unomi/rest/endpoints/RulesServiceEndPoint.java +++ b/rest/src/main/java/org/apache/unomi/rest/endpoints/RulesServiceEndPoint.java @@ -66,7 +66,7 @@ public class RulesServiceEndPoint { /** * Retrieves the metadata for all known rules. - * + * Note that it only includes the rules in memory, not those persisted in storage. * @return the Set of known metadata */ @GET diff --git a/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java b/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java index 0861c53e3..6702f5689 100644 --- a/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java +++ b/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java @@ -355,7 +355,7 @@ public class RulesServiceImpl implements RulesService, EventListenerService, Syn public Set<Metadata> getRuleMetadatas() { Set<Metadata> metadatas = new HashSet<Metadata>(); - for (Rule rule : persistenceService.getAllItems(Rule.class, 0, 50, null).getList()) { + for (Rule rule : allRules) { metadatas.add(rule.getMetadata()); } return metadatas;