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/11/07 09:29:34 UTC

[sling-org-apache-sling-distribution-api] annotated tag org.apache.sling.distribution.api-0.3.0 created (now 7c4ecbe)

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

rombert pushed a change to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git.


      at 7c4ecbe  (tag)
 tagging d9a47eec0fb97969359c3ca3526718b63004c498 (commit)
      by Marius Petria
      on Tue Dec 15 11:46:26 2015 +0000

- Log -----------------------------------------------------------------
org.apache.sling.distribution.api-0.3.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new bd3ed77  SLING-4144 - split distribution api and core bundles
     new 4d345fa  SLING-3553 - varius minor fixes (final modifiers, visibility issues, etc.)
     new 27aaeb8  SLING-3891 - moved readme under contrib/extensions/distribution, minor javadoc fix
     new bb4d86d  SLING-4145 - removing DistributionEvent subclass of Event, moving getTopic to DistributionEventType
     new a1bf08f  SLING-4153 - removed serializable, made request constructors consistent, adjusted jsr305 annotations
     new 59123d0  SLING-4149: renaming factory to resource based & adding defaults
     new be563e4  SLING-4153 - ManagedDC extending from DC, renaming DQueueDistributionStrategy to DQueueDispatchingStrategy
     new 4005ce5  Ignore Eclipse .settings folder
     new 398a774  SLING-4153: Cleaning DistributionComponentFactory of all constants and making it a ConsumerType
     new 88a73b7  SLING-4153: Making DistributionComponentFactory delegate creation of subcomponents
     new 7b41092  SLING-4145, SLING-4190 - dispatching strategy returning item states instead of boolean, removed explicit time from request, status in response is now a message
     new 51130fd  SLING-4153 - improve javadoc, added distribution request state, minor fixes
     new af544d5  SLING-4153 - moved paths and request type into package's packageinfo
     new 8af85bb  SLING-4153 - Queue#remove returns the removed item, Importer#importPackage returns void
     new da0dfb5  SLING-4514: Generating OSGI configs from content and starting services using osgi services
     new 12388d5  SLING-4153: hiding authorization strategy and request time
     new 7e0fede  SLING-4153 - fixed transport API to just expose the secret
     new 0dbbaae  SLING-4153 - fixed transport API to just expose the secret
     new 40c4804  SLING-3836: adding shallow distribution option to requests
     new 446a23a  SLING-4153: changing events to be controlled by agent + some name changes for settings
     new 02ce703  SLING-4060: creating dedicated factories for sync and queue agents
     new 8d4cc3d  SLING-4146 - queueprovider/processor should be providertypes
     new 57644a4  SLING-4146 - queue should be a providertype too
     new 635f789  SLING-4153 - improved queue's javadoc
     new a805a68  SLING-4153 - renamed QueueItemState to QueueItemStatus
     new 8456fe0  SLING-4153: adding distributor type and making DistributionRequest and interface
     new c2e9e7a  SLING-4153: changing distribution response to a provider interface
     new 6e70271  SLING-4153: moving all extensions API from api package to core
     new 65a5114  SLING-4153: changing distribution topic names
     new 9cbb70e  SLING-4153 - fixed request states, removed useless asStream method in transport secret
     new 6e96d9d  SLING-4153 - moved communication to root distribution package
     new c67e19c  SLING-4153 - moved communication to root distribution package
     new e41b72e  SLING-4153 - moved communication to root distribution package
     new 13faa96  Update svn:ignore property
     new a6e0208  SLING-3553 - fixed trivial issue in log statement
     new fd8d109  SLING-4367: trigger package imported event after succesful import
     new 02f05de  SLING-4368: transport secret providers should receive the transport uri
     new ddb2630  SLING-4389: Adding a trivial request type TEST for testing connectivity of a distribution agent
     new 7a998eb  SLING-4391: changing distribution event api to contain constants
     new 716565b  [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.1.0
     new 6cfbcd3  [maven-release-plugin] prepare for next development iteration
     new 8f736e1  Use latest parent pom
     new 9f43e3e  Update contrib modules to Parent 23
     new 4d1a2a2  set parent version to 24 and add empty relativePath where missing
     new 0b9af7d  SLING-5046: allow distribution requests with deep paths subset
     new 4559f3a  SLING-5047: specific request state for failed executions vs non existing agents
     new 00388a2  SLING-5046: adding provider type to all types outside transport
     new 5603526  [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.1.1
     new 0e21e21  Undo previous release attempt
     new be1aa04  [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.1.2
     new 2e1890d  [maven-release-plugin] prepare for next development iteration
     new 3e10199  SLING-5056: fix distribution response isSuccessful method
     new a6b5b69  Update the contrib reactor to parent 25
     new 8b4f90a  [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.2.0
     new 7c3cee2  [maven-release-plugin] prepare for next development iteration
     new 7216c22  SLING-5179 - expose package (builder) API
     new 5591037  SLING-5180: cleaned DistributionPackageInfo
     new 292b0df  SLING-5179: move package package api to core to ease release of new core version
     new d0b3cec  SLING-5367: allow distribution request filters
     new d4b88cc  [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.3.0
     new d9a47ee  [maven-release-plugin] copy for tag org.apache.sling.distribution.api-0.3.0

The 61 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-distribution-api] 06/07: [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.3.0

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit d4b88cca54bb7614ade46981d5a08fe11a72ea0e
Author: Marius Petria <mp...@apache.org>
AuthorDate: Tue Dec 15 11:46:11 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.distribution.api-0.3.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1720124 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0298ad2..07b5ecd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     <!-- P R O J E C T                                                           -->
     <!-- ======================================================================= -->
     <artifactId>org.apache.sling.distribution.api</artifactId>
-    <version>0.2.1-SNAPSHOT</version>
+    <version>0.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Distribution API</name>
@@ -42,10 +42,10 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.distribution.api-0.3.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.distribution.api-0.3.0
         </developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api</url>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.distribution.api-0.3.0</url>
     </scm>
 
     <!-- ======================================================================= -->

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

[sling-org-apache-sling-distribution-api] 01/07: [maven-release-plugin] prepare for next development iteration

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit 7c3cee25c8f06f5020964be7a1d9d51695dee012
Author: Marius Petria <mp...@apache.org>
AuthorDate: Mon Oct 5 14:54:21 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1706842 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index f3dbd16..0298ad2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     <!-- P R O J E C T                                                           -->
     <!-- ======================================================================= -->
     <artifactId>org.apache.sling.distribution.api</artifactId>
-    <version>0.2.0</version>
+    <version>0.2.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Distribution API</name>
@@ -42,10 +42,10 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.distribution.api-0.2.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.distribution.api-0.2.0
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api
         </developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.distribution.api-0.2.0</url>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api</url>
     </scm>
 
     <!-- ======================================================================= -->

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

[sling-org-apache-sling-distribution-api] 07/07: [maven-release-plugin] copy for tag org.apache.sling.distribution.api-0.3.0

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit d9a47eec0fb97969359c3ca3526718b63004c498
Author: Marius Petria <mp...@apache.org>
AuthorDate: Tue Dec 15 11:46:26 2015 +0000

    [maven-release-plugin] copy for tag org.apache.sling.distribution.api-0.3.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.distribution.api-0.3.0@1720125 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-org-apache-sling-distribution-api] 03/07: SLING-5180: cleaned DistributionPackageInfo

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit 55910373cfa82bf1289fff03771c5fc3098ae036
Author: Marius Petria <mp...@apache.org>
AuthorDate: Thu Oct 22 12:44:36 2015 +0000

    SLING-5180: cleaned DistributionPackageInfo
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1710007 13f79535-47bb-0310-9956-ffa450edef68
---
 .../serialization/DistributionPackage.java         |  4 +-
 .../serialization/DistributionPackageBuilder.java  |  2 +
 .../serialization/DistributionPackageInfo.java     | 62 ++++++----------------
 3 files changed, 19 insertions(+), 49 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
index ecbd5ab..f5fb65f 100644
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
@@ -22,12 +22,12 @@ import javax.annotation.Nonnull;
 import java.io.IOException;
 import java.io.InputStream;
 
-import aQute.bnd.annotation.ConsumerType;
+import aQute.bnd.annotation.ProviderType;
 
 /**
  * A distribution package
  */
-@ConsumerType
+@ProviderType
 public interface DistributionPackage {
 
     /**
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
index b782e30..4f54a41 100644
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
@@ -22,6 +22,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import java.io.InputStream;
 
+import aQute.bnd.annotation.ProviderType;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.distribution.DistributionException;
 import org.apache.sling.distribution.DistributionRequest;
@@ -29,6 +30,7 @@ import org.apache.sling.distribution.DistributionRequest;
 /**
  * A builder for {@link DistributionPackage}s
  */
+@ProviderType
 public interface DistributionPackageBuilder {
 
     /**
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
index fcdc0a0..dd03abf 100644
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
@@ -25,6 +25,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
+import aQute.bnd.annotation.ProviderType;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 import org.apache.sling.distribution.DistributionRequestType;
@@ -33,6 +34,7 @@ import org.apache.sling.distribution.DistributionRequestType;
  * Additional information about a package.
  * Additional information is optional and components should expect every piece of it to be null.
  */
+@ProviderType
 public final class DistributionPackageInfo extends ValueMapDecorator implements ValueMap {
 
     /**
@@ -50,49 +52,31 @@ public final class DistributionPackageInfo extends ValueMapDecorator implements
      */
     public static String PROPERTY_REQUEST_TYPE = "request.type";
 
-    /**
-     * distribution package origin uri
-     */
-    public static String PROPERTY_ORIGIN_URI = "package.origin.uri";
-
-    /**
-     * distribution package origin queue
-     */
-    public static String PROPERTY_ORIGIN_QUEUE = "origin.queue";
-
 
     /**
      * Creates a new wrapper around a given map.
      *
      * @param base wrapped object
      */
-    public DistributionPackageInfo(Map<String, Object> base) {
-        super(init(null, base));
+    public DistributionPackageInfo(String packageType, Map<String, Object> base) {
+        super(base);
+        if (packageType == null) {
+            throw new IllegalArgumentException("package type cannot be null");
+        }
+
+        put(PROPERTY_PACKAGE_TYPE, packageType);
     }
 
+
     /**
-     * Creates a new wrapper around a given map.
+     * Creates a new wrapper around an empty map.
      *
      */
-    public DistributionPackageInfo(String type) {
-        super(init(type, null));
+    public DistributionPackageInfo(String packageType) {
+        this(packageType, new HashMap<String, Object>());
     }
 
 
-    private static Map<String, Object> init(String type, Map<String, Object> base) {
-        Map<String, Object> result = new HashMap<String, Object>();
-
-        if (base != null) {
-            type = (String) base.get(PROPERTY_PACKAGE_TYPE);
-
-            result = new HashMap<String, Object>(base);
-        }
-
-        result.put(PROPERTY_PACKAGE_TYPE, type);
-
-        return result;
-    }
-
     @Nonnull
     public String getType() {
         return get(PROPERTY_PACKAGE_TYPE, String.class);
@@ -118,27 +102,11 @@ public final class DistributionPackageInfo extends ValueMapDecorator implements
         return get(PROPERTY_REQUEST_TYPE, DistributionRequestType.class);
     }
 
-    /**
-     * retrieves the origin of the package holding this info
-     *
-     * @return the package origin
-     */
-    @CheckForNull
-    public URI getOrigin() {
-        return get(PROPERTY_ORIGIN_URI, URI.class);
-    }
-
-    @CheckForNull
-    public String getQueue() {
-        return get(PROPERTY_ORIGIN_QUEUE, String.class);
-    }
-
-
     @Override
     public String toString() {
         return "DistributionPackageInfo{" +
-                " requestType=" + getRequestType() +
-                ", paths=" + Arrays.toString(getPaths()) +
+                " request.type=" + getRequestType() +
+                ", request.paths=" + Arrays.toString(getPaths()) +
                 '}';
     }
 }

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

[sling-org-apache-sling-distribution-api] 04/07: SLING-5179: move package package api to core to ease release of new core version

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit 292b0df5c8f7bf15aceb9cee502242c4e94d8c49
Author: Marius Petria <mp...@apache.org>
AuthorDate: Tue Nov 10 14:46:08 2015 +0000

    SLING-5179: move package package api to core to ease release of new core version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1713652 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/distribution/DistributionException.java  |  37 -------
 .../serialization/DistributionPackage.java         |  79 ---------------
 .../serialization/DistributionPackageBuilder.java  |  85 ----------------
 .../serialization/DistributionPackageInfo.java     | 112 ---------------------
 .../distribution/serialization/package-info.java   |  24 -----
 5 files changed, 337 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/DistributionException.java b/src/main/java/org/apache/sling/distribution/DistributionException.java
deleted file mode 100644
index 5b599ad..0000000
--- a/src/main/java/org/apache/sling/distribution/DistributionException.java
+++ /dev/null
@@ -1,37 +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.distribution;
-
-/**
- * Generic checked exception for distribution
- */
-public class DistributionException extends Exception {
-    public DistributionException(Throwable e) {
-        super(e);
-    }
-
-    public DistributionException(String string) {
-        super(string);
-    }
-
-    public DistributionException(String string, Throwable cause) {
-        super(string, cause);
-    }
-}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
deleted file mode 100644
index f5fb65f..0000000
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
+++ /dev/null
@@ -1,79 +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.distribution.serialization;
-
-import javax.annotation.Nonnull;
-import java.io.IOException;
-import java.io.InputStream;
-
-import aQute.bnd.annotation.ProviderType;
-
-/**
- * A distribution package
- */
-@ProviderType
-public interface DistributionPackage {
-
-    /**
-     * get package id. the id is a unique string that can be used to identify the package
-     *
-     * @return the package id
-     */
-    @Nonnull
-    String getId();
-
-    /**
-     * get the type of package
-     *
-     * @return the package type
-     */
-    @Nonnull
-    String getType();
-
-    /**
-     * creates a package stream.
-     * a new stream is created for each call and it is the caller's obligation to close the stream.
-     *
-     * @return an {@link InputStream}
-     * @throws IOException
-     */
-    @Nonnull
-    InputStream createInputStream() throws IOException;
-
-    /**
-     * closes all resources associated with this instance
-     */
-    void close();
-
-    /**
-     * releases all resources associated with this package
-     */
-    void delete();
-
-    /**
-     * gets an additional info holder for this package.
-     * The additional info object contains control information rather than content information.
-     * For example info.origin can be used to skip distributing back to the originating endpoint.
-     *
-     * @return the associated metadata to this package
-     */
-    @Nonnull
-    DistributionPackageInfo getInfo();
-
-}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
deleted file mode 100644
index 4f54a41..0000000
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
+++ /dev/null
@@ -1,85 +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.distribution.serialization;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import java.io.InputStream;
-
-import aQute.bnd.annotation.ProviderType;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.distribution.DistributionException;
-import org.apache.sling.distribution.DistributionRequest;
-
-/**
- * A builder for {@link DistributionPackage}s
- */
-@ProviderType
-public interface DistributionPackageBuilder {
-
-    /**
-     * returns the type of a package. Only packages of this type will be accepted by the package builder.
-     * @return the package type.
-     */
-    String getType();
-
-    /**
-     * creates a {@link DistributionPackage} for a specific {@link org.apache.sling.distribution.DistributionRequest}
-     *
-     * @param resourceResolver the resource resolver used to access the resources to be packaged
-     * @param request          the {@link org.apache.sling.distribution.DistributionRequest} to create the package for
-     * @return a {@link DistributionPackage} or <code>null</code> if it could not be created
-     * @throws DistributionException if any error occurs while creating the package, or if the resource resolver is not authorized to do that
-     */
-    @Nonnull
-    DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionException;
-
-    /**
-     * reads a stream and tries to convert it to a {@link DistributionPackage} this provider can read and install
-     *
-     * @param resourceResolver resource resolver used to store the eventually created package
-     * @param stream           the {@link InputStream} of the package to read
-     * @return a {@link DistributionPackage} if it can read it from the stream
-     * @throws DistributionException when the stream cannot be read as a {@link DistributionPackage}
-     */
-    @Nonnull
-    DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionException;
-
-    /**
-     * get an already created (and saved into the repository) {@link DistributionPackage} by its id
-     *
-     * @param resourceResolver resource resolver used to access the package with the given id
-     * @param id               the unique identifier of an already created {@link DistributionPackage}
-     * @return a {@link DistributionPackage} if one with such an id exists, <code>null</code> otherwise
-     * @throws DistributionException when the stream the package with that id cannot be retrieved
-     */
-    @CheckForNull
-    DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) throws DistributionException;
-
-    /**
-     * Installs the given distributionPackage into the repository
-     *
-     * @param resourceResolver   the resource resolver used to install the packaged resources
-     * @param distributionPackage the distribution package to install
-     * @return <code>true</code> if the package was installed successfully
-     * @throws DistributionException
-     */
-    boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionException;
-
-}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
deleted file mode 100644
index dd03abf..0000000
--- a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
+++ /dev/null
@@ -1,112 +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.distribution.serialization;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import java.net.URI;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import aQute.bnd.annotation.ProviderType;
-import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.api.wrappers.ValueMapDecorator;
-import org.apache.sling.distribution.DistributionRequestType;
-
-/**
- * Additional information about a package.
- * Additional information is optional and components should expect every piece of it to be null.
- */
-@ProviderType
-public final class DistributionPackageInfo extends ValueMapDecorator implements ValueMap {
-
-    /**
-     * distribution package type
-     */
-    public static String PROPERTY_PACKAGE_TYPE = "package.type";
-
-    /**
-     * distribution request paths
-     */
-    public static String PROPERTY_REQUEST_PATHS = "request.paths";
-
-    /**
-     * distribution request type
-     */
-    public static String PROPERTY_REQUEST_TYPE = "request.type";
-
-
-    /**
-     * Creates a new wrapper around a given map.
-     *
-     * @param base wrapped object
-     */
-    public DistributionPackageInfo(String packageType, Map<String, Object> base) {
-        super(base);
-        if (packageType == null) {
-            throw new IllegalArgumentException("package type cannot be null");
-        }
-
-        put(PROPERTY_PACKAGE_TYPE, packageType);
-    }
-
-
-    /**
-     * Creates a new wrapper around an empty map.
-     *
-     */
-    public DistributionPackageInfo(String packageType) {
-        this(packageType, new HashMap<String, Object>());
-    }
-
-
-    @Nonnull
-    public String getType() {
-        return get(PROPERTY_PACKAGE_TYPE, String.class);
-    }
-
-    /**
-     * get the paths covered by the package holding this info
-     *
-     * @return an array of paths
-     */
-    @CheckForNull
-    public String[] getPaths() {
-        return get(PROPERTY_REQUEST_PATHS, String[].class);
-    }
-
-    /**
-     * get the request type associated to the package holding this info
-     *
-     * @return the request type
-     */
-    @CheckForNull
-    public DistributionRequestType getRequestType() {
-        return get(PROPERTY_REQUEST_TYPE, DistributionRequestType.class);
-    }
-
-    @Override
-    public String toString() {
-        return "DistributionPackageInfo{" +
-                " request.type=" + getRequestType() +
-                ", request.paths=" + Arrays.toString(getPaths()) +
-                '}';
-    }
-}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/package-info.java b/src/main/java/org/apache/sling/distribution/serialization/package-info.java
deleted file mode 100644
index 8759b0e..0000000
--- a/src/main/java/org/apache/sling/distribution/serialization/package-info.java
+++ /dev/null
@@ -1,24 +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.
- */
-
-@Version("0.1.0")
-package org.apache.sling.distribution.serialization;
-
-import aQute.bnd.annotation.Version;
-

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

[sling-org-apache-sling-distribution-api] 02/07: SLING-5179 - expose package (builder) API

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit 7216c227c886e84b3416977e6f72b61d240f98a4
Author: Tommaso Teofili <to...@apache.org>
AuthorDate: Thu Oct 22 10:00:55 2015 +0000

    SLING-5179 - expose package (builder) API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1709974 13f79535-47bb-0310-9956-ffa450edef68
---
 ...ackage-info.java => DistributionException.java} |  17 ++-
 .../apache/sling/distribution/package-info.java    |   2 +-
 .../serialization/DistributionPackage.java         |  79 +++++++++++
 .../serialization/DistributionPackageBuilder.java  |  83 ++++++++++++
 .../serialization/DistributionPackageInfo.java     | 144 +++++++++++++++++++++
 .../{ => serialization}/package-info.java          |   4 +-
 6 files changed, 324 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/package-info.java b/src/main/java/org/apache/sling/distribution/DistributionException.java
similarity index 69%
copy from src/main/java/org/apache/sling/distribution/package-info.java
copy to src/main/java/org/apache/sling/distribution/DistributionException.java
index a7da64d..5b599ad 100644
--- a/src/main/java/org/apache/sling/distribution/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/DistributionException.java
@@ -17,8 +17,21 @@
  * under the License.
  */
 
-@Version("0.2.0")
 package org.apache.sling.distribution;
 
-import aQute.bnd.annotation.Version;
+/**
+ * Generic checked exception for distribution
+ */
+public class DistributionException extends Exception {
+    public DistributionException(Throwable e) {
+        super(e);
+    }
+
+    public DistributionException(String string) {
+        super(string);
+    }
 
+    public DistributionException(String string, Throwable cause) {
+        super(string, cause);
+    }
+}
diff --git a/src/main/java/org/apache/sling/distribution/package-info.java b/src/main/java/org/apache/sling/distribution/package-info.java
index a7da64d..f91d309 100644
--- a/src/main/java/org/apache/sling/distribution/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("0.2.0")
+@Version("0.3.0")
 package org.apache.sling.distribution;
 
 import aQute.bnd.annotation.Version;
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
new file mode 100644
index 0000000..ecbd5ab
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackage.java
@@ -0,0 +1,79 @@
+/*
+ * 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.distribution.serialization;
+
+import javax.annotation.Nonnull;
+import java.io.IOException;
+import java.io.InputStream;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * A distribution package
+ */
+@ConsumerType
+public interface DistributionPackage {
+
+    /**
+     * get package id. the id is a unique string that can be used to identify the package
+     *
+     * @return the package id
+     */
+    @Nonnull
+    String getId();
+
+    /**
+     * get the type of package
+     *
+     * @return the package type
+     */
+    @Nonnull
+    String getType();
+
+    /**
+     * creates a package stream.
+     * a new stream is created for each call and it is the caller's obligation to close the stream.
+     *
+     * @return an {@link InputStream}
+     * @throws IOException
+     */
+    @Nonnull
+    InputStream createInputStream() throws IOException;
+
+    /**
+     * closes all resources associated with this instance
+     */
+    void close();
+
+    /**
+     * releases all resources associated with this package
+     */
+    void delete();
+
+    /**
+     * gets an additional info holder for this package.
+     * The additional info object contains control information rather than content information.
+     * For example info.origin can be used to skip distributing back to the originating endpoint.
+     *
+     * @return the associated metadata to this package
+     */
+    @Nonnull
+    DistributionPackageInfo getInfo();
+
+}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
new file mode 100644
index 0000000..b782e30
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java
@@ -0,0 +1,83 @@
+/*
+ * 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.distribution.serialization;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import java.io.InputStream;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.distribution.DistributionException;
+import org.apache.sling.distribution.DistributionRequest;
+
+/**
+ * A builder for {@link DistributionPackage}s
+ */
+public interface DistributionPackageBuilder {
+
+    /**
+     * returns the type of a package. Only packages of this type will be accepted by the package builder.
+     * @return the package type.
+     */
+    String getType();
+
+    /**
+     * creates a {@link DistributionPackage} for a specific {@link org.apache.sling.distribution.DistributionRequest}
+     *
+     * @param resourceResolver the resource resolver used to access the resources to be packaged
+     * @param request          the {@link org.apache.sling.distribution.DistributionRequest} to create the package for
+     * @return a {@link DistributionPackage} or <code>null</code> if it could not be created
+     * @throws DistributionException if any error occurs while creating the package, or if the resource resolver is not authorized to do that
+     */
+    @Nonnull
+    DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionException;
+
+    /**
+     * reads a stream and tries to convert it to a {@link DistributionPackage} this provider can read and install
+     *
+     * @param resourceResolver resource resolver used to store the eventually created package
+     * @param stream           the {@link InputStream} of the package to read
+     * @return a {@link DistributionPackage} if it can read it from the stream
+     * @throws DistributionException when the stream cannot be read as a {@link DistributionPackage}
+     */
+    @Nonnull
+    DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionException;
+
+    /**
+     * get an already created (and saved into the repository) {@link DistributionPackage} by its id
+     *
+     * @param resourceResolver resource resolver used to access the package with the given id
+     * @param id               the unique identifier of an already created {@link DistributionPackage}
+     * @return a {@link DistributionPackage} if one with such an id exists, <code>null</code> otherwise
+     * @throws DistributionException when the stream the package with that id cannot be retrieved
+     */
+    @CheckForNull
+    DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) throws DistributionException;
+
+    /**
+     * Installs the given distributionPackage into the repository
+     *
+     * @param resourceResolver   the resource resolver used to install the packaged resources
+     * @param distributionPackage the distribution package to install
+     * @return <code>true</code> if the package was installed successfully
+     * @throws DistributionException
+     */
+    boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionException;
+
+}
diff --git a/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
new file mode 100644
index 0000000..fcdc0a0
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageInfo.java
@@ -0,0 +1,144 @@
+/*
+ * 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.distribution.serialization;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.wrappers.ValueMapDecorator;
+import org.apache.sling.distribution.DistributionRequestType;
+
+/**
+ * Additional information about a package.
+ * Additional information is optional and components should expect every piece of it to be null.
+ */
+public final class DistributionPackageInfo extends ValueMapDecorator implements ValueMap {
+
+    /**
+     * distribution package type
+     */
+    public static String PROPERTY_PACKAGE_TYPE = "package.type";
+
+    /**
+     * distribution request paths
+     */
+    public static String PROPERTY_REQUEST_PATHS = "request.paths";
+
+    /**
+     * distribution request type
+     */
+    public static String PROPERTY_REQUEST_TYPE = "request.type";
+
+    /**
+     * distribution package origin uri
+     */
+    public static String PROPERTY_ORIGIN_URI = "package.origin.uri";
+
+    /**
+     * distribution package origin queue
+     */
+    public static String PROPERTY_ORIGIN_QUEUE = "origin.queue";
+
+
+    /**
+     * Creates a new wrapper around a given map.
+     *
+     * @param base wrapped object
+     */
+    public DistributionPackageInfo(Map<String, Object> base) {
+        super(init(null, base));
+    }
+
+    /**
+     * Creates a new wrapper around a given map.
+     *
+     */
+    public DistributionPackageInfo(String type) {
+        super(init(type, null));
+    }
+
+
+    private static Map<String, Object> init(String type, Map<String, Object> base) {
+        Map<String, Object> result = new HashMap<String, Object>();
+
+        if (base != null) {
+            type = (String) base.get(PROPERTY_PACKAGE_TYPE);
+
+            result = new HashMap<String, Object>(base);
+        }
+
+        result.put(PROPERTY_PACKAGE_TYPE, type);
+
+        return result;
+    }
+
+    @Nonnull
+    public String getType() {
+        return get(PROPERTY_PACKAGE_TYPE, String.class);
+    }
+
+    /**
+     * get the paths covered by the package holding this info
+     *
+     * @return an array of paths
+     */
+    @CheckForNull
+    public String[] getPaths() {
+        return get(PROPERTY_REQUEST_PATHS, String[].class);
+    }
+
+    /**
+     * get the request type associated to the package holding this info
+     *
+     * @return the request type
+     */
+    @CheckForNull
+    public DistributionRequestType getRequestType() {
+        return get(PROPERTY_REQUEST_TYPE, DistributionRequestType.class);
+    }
+
+    /**
+     * retrieves the origin of the package holding this info
+     *
+     * @return the package origin
+     */
+    @CheckForNull
+    public URI getOrigin() {
+        return get(PROPERTY_ORIGIN_URI, URI.class);
+    }
+
+    @CheckForNull
+    public String getQueue() {
+        return get(PROPERTY_ORIGIN_QUEUE, String.class);
+    }
+
+
+    @Override
+    public String toString() {
+        return "DistributionPackageInfo{" +
+                " requestType=" + getRequestType() +
+                ", paths=" + Arrays.toString(getPaths()) +
+                '}';
+    }
+}
diff --git a/src/main/java/org/apache/sling/distribution/package-info.java b/src/main/java/org/apache/sling/distribution/serialization/package-info.java
similarity index 92%
copy from src/main/java/org/apache/sling/distribution/package-info.java
copy to src/main/java/org/apache/sling/distribution/serialization/package-info.java
index a7da64d..8759b0e 100644
--- a/src/main/java/org/apache/sling/distribution/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/serialization/package-info.java
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-@Version("0.2.0")
-package org.apache.sling.distribution;
+@Version("0.1.0")
+package org.apache.sling.distribution.serialization;
 
 import aQute.bnd.annotation.Version;
 

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

[sling-org-apache-sling-distribution-api] 05/07: SLING-5367: allow distribution request filters

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit d0b3cec8f85be6f565579ab76070abb744bc0836
Author: Marius Petria <mp...@apache.org>
AuthorDate: Wed Dec 9 15:47:02 2015 +0000

    SLING-5367: allow distribution request filters
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1718890 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/distribution/DistributionRequest.java    | 20 +++++++++++++----
 .../distribution/SimpleDistributionRequest.java    | 25 ++++++++++++++++++++--
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/DistributionRequest.java b/src/main/java/org/apache/sling/distribution/DistributionRequest.java
index 72edf92..1da5fd1 100644
--- a/src/main/java/org/apache/sling/distribution/DistributionRequest.java
+++ b/src/main/java/org/apache/sling/distribution/DistributionRequest.java
@@ -23,6 +23,7 @@ import aQute.bnd.annotation.ProviderType;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import java.util.Arrays;
+import java.util.Set;
 
 /**
  * A {@link org.apache.sling.distribution.DistributionRequest} represents the need from the caller to have
@@ -33,7 +34,7 @@ public interface DistributionRequest {
 
 
     /**
-     * get the {@link DistributionRequestType} associated with this request
+     * Get the {@link DistributionRequestType} associated with this request
      *
      * @return the type of the request as a {@link DistributionRequestType}
      */
@@ -41,14 +42,13 @@ public interface DistributionRequest {
     public DistributionRequestType getRequestType();
 
     /**
-     * get the paths for this distribution request
+     * Get the root paths for this distribution request
      *
      * @return an array of paths
      */
-    @CheckForNull
+    @Nonnull
     public String[] getPaths();
 
-
     /**
      * Returns whether the paths are covering the entire subtree (deep) or just the specified nodes (shallow)
      *
@@ -58,4 +58,16 @@ public interface DistributionRequest {
     public boolean isDeep(@Nonnull String path);
 
 
+
+    /**
+     * Get the filters applicable for a specific path
+     * +/foo/.* - include all content under /foo
+     * -/foo - exclude /foo node
+     *
+     * filters are checked in order and the last matched filter determines inclusion/exclusion
+     *
+     * @return an array of filters
+     */
+    @Nonnull
+    public String[] getFilters(String path);
 }
diff --git a/src/main/java/org/apache/sling/distribution/SimpleDistributionRequest.java b/src/main/java/org/apache/sling/distribution/SimpleDistributionRequest.java
index e2a98d2..c5cce14 100644
--- a/src/main/java/org/apache/sling/distribution/SimpleDistributionRequest.java
+++ b/src/main/java/org/apache/sling/distribution/SimpleDistributionRequest.java
@@ -22,7 +22,9 @@ import aQute.bnd.annotation.ProviderType;
 
 import javax.annotation.Nonnull;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -34,6 +36,7 @@ public final class SimpleDistributionRequest implements DistributionRequest {
 
     private final DistributionRequestType requestType;
     private final Set<String> deepPaths;
+    private final Map<String, String[]> pathFilters;
     private final String[] paths;
 
     /**
@@ -57,15 +60,28 @@ public final class SimpleDistributionRequest implements DistributionRequest {
 
 
     /**
-     * Creates a distribution request with "shallow" paths.
+     * Creates a distribution request with additional "deep" paths.
      * @param requestType the request type
      * @param paths the array of paths to be distributed
      * @param deepPaths the set of paths that are to be distributed in depth (with all their children)
      */
     public SimpleDistributionRequest(@Nonnull DistributionRequestType requestType, @Nonnull String[] paths, @Nonnull Set<String> deepPaths) {
+        this(requestType, paths, deepPaths, new HashMap<String, String[]>());
+    }
+
+
+    /**
+     * Creates a distribution request with "deep" paths and filters.
+     * @param requestType the request type
+     * @param paths the array of paths to be distributed
+     * @param deepPaths the set of paths that are to be distributed in depth (with all their children)
+     * @param pathFilters the filters applicable for each path
+     */
+    public SimpleDistributionRequest(@Nonnull DistributionRequestType requestType, @Nonnull String[] paths, @Nonnull Set<String> deepPaths, @Nonnull Map<String, String[]> pathFilters) {
         this.requestType = requestType;
         this.paths = paths;
         this.deepPaths = deepPaths;
+        this.pathFilters = pathFilters;
     }
 
     /**
@@ -96,12 +112,17 @@ public final class SimpleDistributionRequest implements DistributionRequest {
         return deepPaths.contains(path);
     }
 
+    @Nonnull
+    public String[] getFilters(String path) {
+        String[] filters = pathFilters.get(path);
+        return filters != null ? filters : new String[0];
+    }
+
     @Override
     public String toString() {
         return "SimpleDistributionRequest{" +
                 "requestType=" + requestType +
                 ", paths=" + Arrays.toString(paths) +
-                ", deep=" + Arrays.toString(deepPaths.toArray(new String[0])) +
                 '}';
     }
 

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