quantranhong1999 commented on code in PR #1092:
URL: https://github.com/apache/james-project/pull/1092#discussion_r935086939


##########
third-party/rspamd/src/main/java/org/apache/james/rspamd/route/FeedMessageRoute.java:
##########
@@ -0,0 +1,142 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.rspamd.route;
+
+import static 
org.apache.james.rspamd.task.FeedSpamToRSpamDTask.RunningOptions.DEFAULT_MESSAGES_PER_SECOND;
+import static 
org.apache.james.rspamd.task.FeedSpamToRSpamDTask.RunningOptions.DEFAULT_SAMPLING_PROBABILITY;
+
+import java.time.Clock;
+import java.time.temporal.ChronoUnit;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+import javax.inject.Inject;
+
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MessageIdManager;
+import org.apache.james.mailbox.store.mail.MessageMapper;
+import org.apache.james.rspamd.client.RSpamDHttpClient;
+import org.apache.james.rspamd.task.FeedSpamToRSpamDTask;
+import org.apache.james.task.Task;
+import org.apache.james.task.TaskManager;
+import org.apache.james.user.api.UsersRepository;
+import org.apache.james.util.DurationParser;
+import org.apache.james.webadmin.Routes;
+import org.apache.james.webadmin.tasks.TaskFromRequest;
+import org.apache.james.webadmin.utils.JsonTransformer;
+
+import com.google.common.base.Preconditions;
+
+import spark.Request;
+import spark.Service;
+
+public class FeedMessageRoute implements Routes {
+    public static final String BASE_PATH = "/rspamd";
+
+    private final TaskManager taskManager;
+    private final MailboxManager mailboxManager;
+    private final MessageIdManager messageIdManager;
+    private final MessageMapper messageMapper;
+    private final UsersRepository usersRepository;
+    private final RSpamDHttpClient rSpamDHttpClient;
+    private final JsonTransformer jsonTransformer;
+    private final Clock clock;
+
+    @Inject
+    public FeedMessageRoute(TaskManager taskManager, MailboxManager 
mailboxManager, UsersRepository usersRepository, RSpamDHttpClient 
rSpamDHttpClient,
+                            JsonTransformer jsonTransformer, Clock clock, 
MessageIdManager messageIdManager, MessageMapper messageMapper) {

Review Comment:
   
https://github.com/apache/james-project/pull/1092/commits/05257991d344401e8aca278e8d2637a692705f4b
 solves this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to