You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cs...@apache.org on 2021/01/21 16:36:11 UTC

[sling-whiteboard] branch master updated: SLING-10067 - Allow any query type

This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 9829b80  SLING-10067 - Allow any query type
9829b80 is described below

commit 9829b80a0c06b88eb2764f21055645a0309fce16
Author: Christian Schneider <cs...@adobe.com>
AuthorDate: Thu Jan 21 17:34:23 2021 +0100

    SLING-10067 - Allow any query type
---
 .../sling/distribution/chunked/ChunkedDistributionServlet.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/chunked-distribution/src/main/java/org/apache/sling/distribution/chunked/ChunkedDistributionServlet.java b/chunked-distribution/src/main/java/org/apache/sling/distribution/chunked/ChunkedDistributionServlet.java
index b5e6918..3225a2a 100644
--- a/chunked-distribution/src/main/java/org/apache/sling/distribution/chunked/ChunkedDistributionServlet.java
+++ b/chunked-distribution/src/main/java/org/apache/sling/distribution/chunked/ChunkedDistributionServlet.java
@@ -63,12 +63,13 @@ public class ChunkedDistributionServlet extends SlingAllMethodsServlet {
     @Override
     protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
-        String history = request.getParameter("history");
+        String type = request.getParameter("type");
+        QueryType queryType = type !=null ? QueryType.valueOf(type) : QueryType.ALL;
         TimeZone tz = TimeZone.getTimeZone("UTC");
         DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); // Quoted "Z" to indicate UTC, no timezone offset
         df.setTimeZone(tz);
         PrintWriter wr = response.getWriter();
-        Collection<Job> jobs = jobMananger.findJobs(history != null ? QueryType.HISTORY : QueryType.ALL, ChunkedDistribution.TOPIC, 10, (Map<String, Object>[]) null);
+        Collection<Job> jobs = jobMananger.findJobs(queryType, ChunkedDistribution.TOPIC, 10, (Map<String, Object>[]) null);
         wr.println("Jobs");
         printJobs(df, wr, jobs);
     }