james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [02/21] james-project git commit: JAMES-2272 Allow adding details to tasks
Date Thu, 04 Jan 2018 08:13:17 GMT
JAMES-2272 Allow adding details to tasks

A default impelmentation is provided to keep lambda instanciation possible.


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/97cf4305
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/97cf4305
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/97cf4305

Branch: refs/heads/master
Commit: 97cf4305ba50e9b549086e157f7fe9e00aeb8da5
Parents: 1f6f9be
Author: benwa <btellier@linagora.com>
Authored: Wed Dec 27 11:42:10 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Thu Jan 4 15:00:43 2018 +0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/james/task/Task.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/97cf4305/server/task/src/main/java/org/apache/james/task/Task.java
----------------------------------------------------------------------
diff --git a/server/task/src/main/java/org/apache/james/task/Task.java b/server/task/src/main/java/org/apache/james/task/Task.java
index fdb6878..fcfc8af 100644
--- a/server/task/src/main/java/org/apache/james/task/Task.java
+++ b/server/task/src/main/java/org/apache/james/task/Task.java
@@ -20,6 +20,7 @@
 package org.apache.james.task;
 
 import java.util.Arrays;
+import java.util.Optional;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -75,4 +76,18 @@ public interface Task {
      */
     Result run();
 
+
+    default String type() {
+        return UNKNOWN;
+    }
+
+    default Optional<Object> details() {
+        return Optional.empty();
+    }
+
+    String TASK_ID = "taskId";
+    String TASK_TYPE = "taskType";
+    String TASK_DETAILS = "taskDetails";
+
+    String UNKNOWN = "unknown";
 }


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


Mime
View raw message