You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2022/07/11 16:16:41 UTC
[sling-org-apache-sling-api] branch master updated: SLING-11448 : Provide a mode option for resource providers
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git
The following commit(s) were added to refs/heads/master by this push:
new 7fc5850 SLING-11448 : Provide a mode option for resource providers
7fc5850 is described below
commit 7fc5850c3ef6bc240a6e12ec012c7edc01fed26e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 11 18:16:36 2022 +0200
SLING-11448 : Provide a mode option for resource providers
---
pom.xml | 2 +-
.../spi/resource/provider/ResourceProvider.java | 24 ++++++++++++++++++++++
.../sling/spi/resource/provider/package-info.java | 2 +-
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3264b61..09879a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>org.apache.sling.api</artifactId>
- <version>2.25.5-SNAPSHOT</version>
+ <version>2.26.0-SNAPSHOT</version>
<name>Apache Sling API</name>
<description>
diff --git a/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java b/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
index 72dec90..d7c94bd 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
@@ -229,6 +229,30 @@ public abstract class ResourceProvider<T> {
*/
public static final String RESOURCE_TYPE_SYNTHETIC = "sling:syntheticResourceProviderResource";
+ /**
+ * Mode for the resource provide
+ * The value is either {@link #MODE_OVERLAY} (default) or {@link #MODE_PASSTHROUGH}.
+ * When a provider specifies the passthrough mode, the resource resolver will fall back
+ * to the parent resource provider including allowing all events and queries from the parent
+ * provider.
+ * @since 1.4
+ */
+ public static final String PROPERTY_MODE = "provider.mode";
+
+ /**
+ * Default mode.
+ * The resource provider overlays everything from the parent provider.
+ * @since 1.4
+ */
+ public static final String MODE_OVERLAY = "overlay";
+
+ /**
+ * Passthrough mode.
+ * The implementation passes certain functionality through to the parent resource provider.
+ * @since 1.4
+ */
+ public static final String MODE_PASSTHROUGH = "passthrough";
+
/** The context for this provider. */
private volatile ProviderContext ctx;
diff --git a/src/main/java/org/apache/sling/spi/resource/provider/package-info.java b/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
index a225263..f0f196d 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.3.0")
+@Version("1.4.0")
package org.apache.sling.spi.resource.provider;
import org.osgi.annotation.versioning.Version;