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:19:46 UTC
[sling-org-apache-sling-caconfig-spi] 15/23: SLING-6373
Context-Aware Config: Allow alternative configuration bucket names
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.caconfig.spi-1.2.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-caconfig-spi.git
commit 393d233ef9a99830b048d6696107ffc646eb198a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Dec 7 18:03:16 2016 +0000
SLING-6373 Context-Aware Config: Allow alternative configuration bucket names
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/contextaware-config/spi@1773130 13f79535-47bb-0310-9956-ffa450edef68
---
.../ConfigurationResourceResolvingStrategy.java | 29 +++++++++-------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationResourceResolvingStrategy.java b/src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationResourceResolvingStrategy.java
index e161a36..7b96f80 100644
--- a/src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationResourceResolvingStrategy.java
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationResourceResolvingStrategy.java
@@ -43,48 +43,43 @@ public interface ConfigurationResourceResolvingStrategy {
/**
* Get a context-aware singleton configuration resource defined by the given configuration name.
* @param resource Context resource to fetch configuration for
- * @param bucketName Configuration "bucket" name. Each high-level configuration resolver should store
- * it's configuration data grouped in a child resource of the configuration resource. This is what
- * we call a "bucket", and the resource name is specified with this parameter.
- * @param configName Configuration name or relative path.
+ * @param bucketNames Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first
+ * one that has a result is included.
* @return Configuration resource or {@code null} if this strategy did not found matching resources.
*/
- @CheckForNull Resource getResource(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+ @CheckForNull Resource getResource(@Nonnull Resource resource, @Nonnull Collection<String> bucketNames, @Nonnull String configName);
/**
* Get a collection of context-aware configuration resources defined by the given configuration name.
* @param resource Context resource to fetch configuration for
- * @param bucketName Configuration "bucket" name. Each high-level configuration resolver should store
- * it's configuration data grouped in a child resource of the configuration resource. This is what
- * we call a "bucket", and the resource name is specified with this parameter.
+ * @param bucketNames Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first
+ * one that has a result is included.
* @param configName Configuration name or relative path.
* @return Collection of configuration resources or {@code null} if this strategy did not found matching resources.
*/
- @CheckForNull Collection<Resource> getResourceCollection(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+ @CheckForNull Collection<Resource> getResourceCollection(@Nonnull Resource resource, @Nonnull Collection<String> bucketNames, @Nonnull String configName);
/**
* Get a context-aware singleton configuration resource inheritance chain defined by the given configuration name.
* The first item of the inheritance chain it the same resource returned by {@link #getResource(Resource, String, String)}.
* @param resource Context resource to fetch configuration for
- * @param bucketName Configuration "bucket" name. Each high-level configuration resolver should store
- * it's configuration data grouped in a child resource of the configuration resource. This is what
- * we call a "bucket", and the resource name is specified with this parameter.
+ * @param bucketNames Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first
+ * one that has a result is included.
* @param configName Configuration name or relative path.
* @return Configuration resource inheritance chain or {@code null} if this strategy did not found matching resources.
*/
- @CheckForNull Iterator<Resource> getResourceInheritanceChain(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+ @CheckForNull Iterator<Resource> getResourceInheritanceChain(@Nonnull Resource resource, @Nonnull Collection<String> bucketNames, @Nonnull String configName);
/**
* Get a collection of context-aware configuration resource inheritance chains defined by the given configuration name.
* The first item of each inheritance chain is the same item returned by {@link #getResourceCollection(Resource, String, String)}.
* @param resource Context resource to fetch configuration for
- * @param bucketName Configuration "bucket" name. Each high-level configuration resolver should store
- * it's configuration data grouped in a child resource of the configuration resource. This is what
- * we call a "bucket", and the resource name is specified with this parameter.
+ * @param bucketNames Configuration "bucket" names. For each inheritance level all bucket names are tried, and the first
+ * one that has a result is included.
* @param configName Configuration name or relative path.
* @return Collection of configuration resource inheritance chains or {@code null} if this strategy did not found matching resources.
*/
- @CheckForNull Collection<Iterator<Resource>> getResourceCollectionInheritanceChain(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+ @CheckForNull Collection<Iterator<Resource>> getResourceCollectionInheritanceChain(@Nonnull Resource resource, @Nonnull Collection<String> bucketNames, @Nonnull String configName);
/**
* Get the configuration resource path for storing configuration data for the given context resource and configuration name.
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.