You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/18 23:18:54 UTC

[sling-org-apache-sling-commons-messaging] branch master created (now 758d800)

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

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-messaging.git.


      at 758d800  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new fa4a478  SLING-5643 Provide a simple messaging API
     new 4ae7ce1  SLING-5643 Provide a simple messaging API
     new aa2c989  use Sling parent 28
     new 367fe1b  Update to parent pom 29
     new b5a4d25  use Sling Parent 30
     new 758d800  SLING-7167 Adjust READMEs

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-commons-messaging] 02/06: SLING-5643 Provide a simple messaging API

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4ae7ce15c88d0575605cbc27e5167a552ad130ca
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Apr 8 09:43:50 2016 +0000

    SLING-5643 Provide a simple messaging API
    
    * use CompletableFuture instead of Future
    * remove Failure
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1738225 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                                          |  8 ----
 .../apache/sling/commons/messaging/Failure.java    | 43 ----------------------
 .../sling/commons/messaging/MessageService.java    |  6 +--
 .../org/apache/sling/commons/messaging/Result.java | 12 ------
 4 files changed, 3 insertions(+), 66 deletions(-)

diff --git a/README.md b/README.md
index 929c3a7..ab8e26b 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,3 @@ Simple API for sending *message*​s to *recipient*​s.
 `Result<T>`
 -----------
   * `getMessage():T` - should return a serialized form of the sent *message*
-  * `hasFailures():boolean` - should return `true` in case of failures, `false` otherwise
-  * `getFailures():Collection<Failure>` - should return the failures occurred when processing or sending the message
-
-`Failure`
----------
- * `getCode():String` - should return a failure code when available, e.g. an [SMTP Status Code](https://tools.ietf.org/html/rfc5248)
- * `getType():String` - should return a failure type when available, e.g. invalid input (message too big) or transport failure (host unavailable)
- * `getMessage():String` - should return a human readable failure message
diff --git a/src/main/java/org/apache/sling/commons/messaging/Failure.java b/src/main/java/org/apache/sling/commons/messaging/Failure.java
deleted file mode 100644
index 9a5997b..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/Failure.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.sling.commons.messaging;
-
-import javax.annotation.CheckForNull;
-
-import org.osgi.annotation.versioning.ProviderType;
-
-@ProviderType
-public interface Failure {
-
-    /**
-     * @return a failure code when available
-     */
-    @CheckForNull String getCode();
-
-    /**
-     * @return a failure type when available
-     */
-    @CheckForNull String getType();
-
-    /**
-     * @return a human readable failure message
-     */
-    @CheckForNull String getMessage();
-
-}
diff --git a/src/main/java/org/apache/sling/commons/messaging/MessageService.java b/src/main/java/org/apache/sling/commons/messaging/MessageService.java
index 22e9763..820005d 100644
--- a/src/main/java/org/apache/sling/commons/messaging/MessageService.java
+++ b/src/main/java/org/apache/sling/commons/messaging/MessageService.java
@@ -19,7 +19,7 @@
 package org.apache.sling.commons.messaging;
 
 import java.util.Map;
-import java.util.concurrent.Future;
+import java.util.concurrent.CompletableFuture;
 
 import javax.annotation.Nonnull;
 
@@ -33,7 +33,7 @@ public interface MessageService {
      * @param recipient the recipient of the message
      * @return result of sending the message
      */
-    Future<Result> send(@Nonnull final String message, @Nonnull final String recipient);
+    CompletableFuture<Result> send(@Nonnull final String message, @Nonnull final String recipient);
 
     /**
      * @param message   the message to send
@@ -41,6 +41,6 @@ public interface MessageService {
      * @param data      additional information (e.g. attachments) and/or parameters (e.g. sender) for the message
      * @return result of sending the message
      */
-    Future<Result> send(@Nonnull final String message, @Nonnull final String recipient, @Nonnull final Map data);
+    CompletableFuture<Result> send(@Nonnull final String message, @Nonnull final String recipient, @Nonnull final Map data);
 
 }
diff --git a/src/main/java/org/apache/sling/commons/messaging/Result.java b/src/main/java/org/apache/sling/commons/messaging/Result.java
index d335124..9abbcaa 100644
--- a/src/main/java/org/apache/sling/commons/messaging/Result.java
+++ b/src/main/java/org/apache/sling/commons/messaging/Result.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.commons.messaging;
 
-import java.util.Collection;
-
 import javax.annotation.CheckForNull;
 
 import org.osgi.annotation.versioning.ProviderType;
@@ -32,14 +30,4 @@ public interface Result<T> {
      */
     @CheckForNull T getMessage();
 
-    /**
-     * @return <code>true</code> in case of failures, <code>false</code> otherwise
-     */
-    boolean hasFailures();
-
-    /**
-     * @return the failures occurred when processing or sending the message
-     */
-    @CheckForNull Collection<Failure> getFailures();
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-commons-messaging] 01/06: SLING-5643 Provide a simple messaging API

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fa4a478a76328c3d0febbbff43c883c8e8728810
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Apr 7 09:17:29 2016 +0000

    SLING-5643 Provide a simple messaging API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1738113 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                                          | 23 +++++++
 pom.xml                                            | 76 ++++++++++++++++++++++
 .../apache/sling/commons/messaging/Failure.java    | 43 ++++++++++++
 .../sling/commons/messaging/MessageService.java    | 46 +++++++++++++
 .../org/apache/sling/commons/messaging/Result.java | 45 +++++++++++++
 .../sling/commons/messaging/package-info.java      | 22 +++++++
 6 files changed, 255 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..929c3a7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+Apache Sling Commons Messaging
+==============================
+
+Simple API for sending *message*​s to *recipient*​s.
+
+`MessageService`
+----------------
+  * `send(String, String)` - takes a *message*​ and a *recipient*, e.g.
+    * send("A Message to You, Rudy", "rudy@ghosttown") - send a mail to Rudy in Ghost Town
+    * send("Hello Apache!", "+1.919.573.9199") - send a fax to the ASF
+  * `send(String, String, Map)` - takes a *message*, a *recipient* and additional *data* useful for the underlying implementation to process and/or send the message
+
+`Result<T>`
+-----------
+  * `getMessage():T` - should return a serialized form of the sent *message*
+  * `hasFailures():boolean` - should return `true` in case of failures, `false` otherwise
+  * `getFailures():Collection<Failure>` - should return the failures occurred when processing or sending the message
+
+`Failure`
+---------
+ * `getCode():String` - should return a failure code when available, e.g. an [SMTP Status Code](https://tools.ietf.org/html/rfc5248)
+ * `getType():String` - should return a failure type when available, e.g. invalid input (message too big) or transport failure (host unavailable)
+ * `getMessage():String` - should return a human readable failure message
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..7e456da
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.sling</groupId>
+    <artifactId>sling</artifactId>
+    <version>27-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <artifactId>org.apache.sling.commons.messaging</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <name>Apache Sling Commons Messaging</name>
+  <description>Apache Sling Commons Messaging</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    <sling.java.version>8</sling.java.version>
+  </properties>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/org.apache.sling.commons.messaging</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/org.apache.sling.commons.messaging</developerConnection>
+    <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/org.apache.sling.commons.messaging</url>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <!-- OSGi -->
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>osgi.annotation</artifactId>
+      <version>6.0.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- JSR 305-->
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/src/main/java/org/apache/sling/commons/messaging/Failure.java b/src/main/java/org/apache/sling/commons/messaging/Failure.java
new file mode 100644
index 0000000..9a5997b
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/messaging/Failure.java
@@ -0,0 +1,43 @@
+/*
+ * 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.sling.commons.messaging;
+
+import javax.annotation.CheckForNull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+@ProviderType
+public interface Failure {
+
+    /**
+     * @return a failure code when available
+     */
+    @CheckForNull String getCode();
+
+    /**
+     * @return a failure type when available
+     */
+    @CheckForNull String getType();
+
+    /**
+     * @return a human readable failure message
+     */
+    @CheckForNull String getMessage();
+
+}
diff --git a/src/main/java/org/apache/sling/commons/messaging/MessageService.java b/src/main/java/org/apache/sling/commons/messaging/MessageService.java
new file mode 100644
index 0000000..22e9763
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/messaging/MessageService.java
@@ -0,0 +1,46 @@
+/*
+ * 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.sling.commons.messaging;
+
+import java.util.Map;
+import java.util.concurrent.Future;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+@ProviderType
+public interface MessageService {
+
+    /**
+     * @param message   the message to send
+     * @param recipient the recipient of the message
+     * @return result of sending the message
+     */
+    Future<Result> send(@Nonnull final String message, @Nonnull final String recipient);
+
+    /**
+     * @param message   the message to send
+     * @param recipient the recipient of the message
+     * @param data      additional information (e.g. attachments) and/or parameters (e.g. sender) for the message
+     * @return result of sending the message
+     */
+    Future<Result> send(@Nonnull final String message, @Nonnull final String recipient, @Nonnull final Map data);
+
+}
diff --git a/src/main/java/org/apache/sling/commons/messaging/Result.java b/src/main/java/org/apache/sling/commons/messaging/Result.java
new file mode 100644
index 0000000..d335124
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/messaging/Result.java
@@ -0,0 +1,45 @@
+/*
+ * 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.sling.commons.messaging;
+
+import java.util.Collection;
+
+import javax.annotation.CheckForNull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+@ProviderType
+public interface Result<T> {
+
+    /**
+     * @return serialized form of the sent message
+     */
+    @CheckForNull T getMessage();
+
+    /**
+     * @return <code>true</code> in case of failures, <code>false</code> otherwise
+     */
+    boolean hasFailures();
+
+    /**
+     * @return the failures occurred when processing or sending the message
+     */
+    @CheckForNull Collection<Failure> getFailures();
+
+}
diff --git a/src/main/java/org/apache/sling/commons/messaging/package-info.java b/src/main/java/org/apache/sling/commons/messaging/package-info.java
new file mode 100644
index 0000000..dee8a62
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/messaging/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("1.0.0")
+package org.apache.sling.commons.messaging;
+
+import org.osgi.annotation.versioning.Version;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-commons-messaging] 05/06: use Sling Parent 30

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b5a4d2591726d51406b6d070cc6f984499bc8abc
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Mar 6 10:22:30 2017 +0000

    use Sling Parent 30
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1785621 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 99f4a8e..00c00ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
-    <version>29</version>
+    <version>30</version>
     <relativePath/>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-commons-messaging] 04/06: Update to parent pom 29

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 367fe1bdd8d974996166990a177b04b75ee5a357
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Oct 21 06:10:37 2016 +0000

    Update to parent pom 29
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1765922 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 996b6d8..99f4a8e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
-    <version>28</version>
+    <version>29</version>
     <relativePath/>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-commons-messaging] 03/06: use Sling parent 28

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit aa2c9892aad5a131720b6c80f0f9877b7e03686b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Aug 31 23:25:09 2016 +0000

    use Sling parent 28
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1758690 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7e456da..996b6d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
-    <version>27-SNAPSHOT</version>
+    <version>28</version>
     <relativePath/>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-commons-messaging] 06/06: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 758d8004e70abfd6059e859adadbcfdff3200176
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 09:50:08 2017 +0000

    SLING-7167 Adjust READMEs
    
    add uniform header linking to Sling project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810822 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index ab8e26b..82bb4ca 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
-Apache Sling Commons Messaging
-==============================
+# Apache Sling Commons Messaging
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 Simple API for sending *message*​s to *recipient*​s.
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.