You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "vttranlina (via GitHub)" <gi...@apache.org> on 2023/05/24 04:22:01 UTC

[GitHub] [james-project] vttranlina opened a new pull request, #1572: DeletedMessagesVault API - support limit query

vttranlina opened a new pull request, #1572:
URL: https://github.com/apache/james-project/pull/1572

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa merged pull request #1572: DeletedMessagesVault API - support limit query

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa merged PR #1572:
URL: https://github.com/apache/james-project/pull/1572


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1204951996


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -65,6 +67,13 @@ public List<QueryElement> getCriteria() {
         return criteria;
     }
 
+
+    @JsonGetter("limit")
+    public Long getLimitAsLong() {
+        return limit.orElse(null);
+    }
+
+    @JsonIgnore

Review Comment:
   Can you explain more? 
   
   `@JsonIgnore` just for ignoring the `Optional limit` 
   
   > Add the JDK 8 Jackson Module 
   
   Your mean is `new ObjectMapper().registerModule(new Jdk8Module());` ? , the `QueryElementSerializer` already receives the `ObjectMapper` bean in constructors, I don't think we should modify the bean



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1204904552


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -65,6 +67,13 @@ public List<QueryElement> getCriteria() {
         return criteria;
     }
 
+
+    @JsonGetter("limit")
+    public Long getLimitAsLong() {
+        return limit.orElse(null);
+    }
+
+    @JsonIgnore

Review Comment:
   Add the JDK 8 Jackson Module to the serializer instead?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1204951996


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -65,6 +67,13 @@ public List<QueryElement> getCriteria() {
         return criteria;
     }
 
+
+    @JsonGetter("limit")
+    public Long getLimitAsLong() {
+        return limit.orElse(null);
+    }
+
+    @JsonIgnore

Review Comment:
   Can you explain more? 
   
   `@JsonIgnore` just for ignoring the `Optional limit` 
   
   > Add the JDK 8 Jackson Module 
   
   Your mean is `new ObjectMapper().registerModule(new Jdk8Module());` ? , the `QueryElementSerializer` already receives the `ObjectMapper` bean in constructors, I don't think we should modify the bean



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1203731458


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -36,22 +35,22 @@ public class QueryDTO implements QueryElement {
 
     @VisibleForTesting
     static QueryDTO and(QueryElement... queryElements) {
-        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), Optional.empty());
+        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), null);

Review Comment:
   Optionals are better than null for representing absence of something...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on pull request #1572: DeletedMessagesVault API - support limit query

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on PR #1572:
URL: https://github.com/apache/james-project/pull/1572#issuecomment-1560582761

   ![Screenshot from 2023-05-24 14-20-14](https://github.com/apache/james-project/assets/6928740/f960ff18-adde-449c-bfd8-f369f8f650f5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1203730943


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -36,22 +35,22 @@ public class QueryDTO implements QueryElement {
 
     @VisibleForTesting
     static QueryDTO and(QueryElement... queryElements) {
-        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), Optional.empty());
+        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), null);
     }
 
     @VisibleForTesting
     static QueryDTO and(Long limit, QueryElement... queryElements) {
-        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), Optional.ofNullable(limit));
+        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), limit);
     }
 
     private final String combinator;
     private final List<QueryElement> criteria;
-    private final Optional<Long> limit;
+    private final Long limit;

Review Comment:
   Why get rid of the optional? 
   
   Sounds like a "regression" to me...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

Posted by "quantranhong1999 (via GitHub)" <gi...@apache.org>.
quantranhong1999 commented on code in PR #1572:
URL: https://github.com/apache/james-project/pull/1572#discussion_r1205139815


##########
src/site/markdown/server/manage-webadmin.md:
##########
@@ -4183,6 +4183,15 @@ Messages in the Deleted Messages Vault of a specified user that are matched with
   "criteria": []
 }
 ```
+- For limiting the number of restored messages, you can use the `limit` query property:

Review Comment:
   Add this in `docs/modules/ROOT/pages/operate/webadmin.adoc` also?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org