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:19:21 UTC

[sling-org-apache-sling-caconfig-spi] branch master created (now 226d8bb)

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-caconfig-spi.git.


      at 226d8bb  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new b1854a8  SLING-6427 Move Sling Context-Aware Config out of contrib - move in svn - update all SCM URLs - update jenkins build jobs
     new eb6a25d  use Sling Parent 30
     new 4b01b8f  SLING-6669 introduce new SPI ConfigurationPersistenceStrategy2, deprecate ConfigurationPersistenceStrategy export ConfigurationPersistenceStrategyMultiplexer as part of the management API
     new 6e63048  SLING-6674 Context-Aware Config: Separate exception when persist failes due to missing access rights
     new 4566ab7  SLING-6669 use resource path instead of resource object for getConfigName* methods in ConfigurationPersistenceStrategy2 SPI
     new dbb4da3  [maven-release-plugin] prepare release org.apache.sling.caconfig.spi-1.3.0
     new 5d72e1d  [maven-release-plugin] prepare for next development iteration
     new 87bc578  update dependencies
     new 8840fd7  update sling-mock dependency
     new b53d410  SLING-6883 allow to pass in service ranking for context resource
     new 6682215  [maven-release-plugin] prepare release org.apache.sling.caconfig.spi-1.3.2
     new cd9e762  [maven-release-plugin] prepare for next development iteration
     new 6e1eb6e  SLING-7167 Adjust READMEs
     new b8cfa9d  SLING-7167 Adjust READMEs
     new 226d8bb  SLING-7167 Adjust READMEs

The 15 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-caconfig-spi] 01/15: SLING-6427 Move Sling Context-Aware Config out of contrib - move in svn - update all SCM URLs - update jenkins build jobs

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-caconfig-spi.git

commit b1854a87c4c4d0d8ad33b63483661c2a1b60fd7c
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Dec 22 09:52:16 2016 +0000

    SLING-6427 Move Sling Context-Aware Config out of contrib
    - move in svn
    - update all SCM URLs
    - update jenkins build jobs
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1775601 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                                         |  25 +++
 pom.xml                                            | 116 ++++++++++++
 .../resource/spi/CollectionInheritanceDecider.java |  48 +++++
 .../ConfigurationResourceResolvingStrategy.java    | 111 ++++++++++++
 .../caconfig/resource/spi/ContextPathStrategy.java |  46 +++++
 .../caconfig/resource/spi/ContextResource.java     |  78 ++++++++
 .../caconfig/resource/spi/InheritanceDecision.java |  31 ++++
 .../sling/caconfig/resource/spi/package-info.java  |  23 +++
 .../spi/ConfigurationCollectionPersistData.java    |  92 ++++++++++
 .../spi/ConfigurationInheritanceStrategy.java      |  44 +++++
 .../spi/ConfigurationMetadataProvider.java         |  48 +++++
 .../spi/ConfigurationOverrideProvider.java         |  45 +++++
 .../caconfig/spi/ConfigurationPersistData.java     |  67 +++++++
 .../spi/ConfigurationPersistenceException.java     |  38 ++++
 .../spi/ConfigurationPersistenceStrategy.java      |  85 +++++++++
 .../caconfig/spi/metadata/AbstractMetadata.java    | 105 +++++++++++
 .../spi/metadata/ConfigurationMetadata.java        |  83 +++++++++
 .../caconfig/spi/metadata/PropertyMetadata.java    | 200 +++++++++++++++++++++
 .../sling/caconfig/spi/metadata/package-info.java  |  23 +++
 .../apache/sling/caconfig/spi/package-info.java    |  23 +++
 .../caconfig/resource/spi/ContextResourceTest.java |  65 +++++++
 .../ConfigurationCollectionPersistDataTest.java    |  84 +++++++++
 .../caconfig/spi/ConfigurationPersistDataTest.java |  46 +++++
 .../spi/metadata/ConfigurationMetadataTest.java    |  76 ++++++++
 .../spi/metadata/PropertyMetadataTest.java         | 107 +++++++++++
 25 files changed, 1709 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..44b35b9
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,25 @@
+Apache Sling Context-Aware Configuration SPI
+
+
+Getting Started
+===============
+
+This component uses a Maven 3 (http://maven.apache.org/) build
+environment. It requires a Java 7 JDK (or higher) and Maven (http://maven.apache.org/)
+3.3.9 or later. We recommend to use the latest Maven version.
+
+If you have Maven 3 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 3 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/contextaware-config/spi
+
+See the Subversion documentation for other source control features.
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..7feb182
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,116 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>29</version>
+        <relativePath />
+    </parent>
+    
+    <artifactId>org.apache.sling.caconfig.spi</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.2.1-SNAPSHOT</version>
+    <name>Apache Sling Context-Aware Configuration SPI</name>
+    <description>Apache Sling Context-Aware Configuration SPI</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/caconfig/spi</url>
+    </scm>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.caconfig.api</artifactId>
+            <version>1.1.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.9.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.3.2</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+            <version>2.2.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.9.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <version>2.4.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>2.0.87-beta</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/CollectionInheritanceDecider.java b/src/main/java/org/apache/sling/caconfig/resource/spi/CollectionInheritanceDecider.java
new file mode 100644
index 0000000..ca46715
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/CollectionInheritanceDecider.java
@@ -0,0 +1,48 @@
+/*
+ * 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.caconfig.resource.spi;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * The {@code CollectionInheritanceDecider} is an SPI which should be used by
+ * all {@link ConfigurationResourceResolvingStrategy} implementations if they
+ * support inheritance for collections.
+ *
+ * @since 1.1
+ */
+@ConsumerType
+public interface CollectionInheritanceDecider {
+
+    /**
+     * Decide whether the provided resource should be included in the collection.
+     * The provided resource can either be included, excluded or blocked.
+     * If the decider can't decide it must return {@code null}.
+     *
+     * @param bucketName The bucket name
+     * @param resource The resource
+     * @return The decision or {@code null}
+     */
+    @CheckForNull InheritanceDecision decide(@Nonnull Resource resource, @Nonnull String bucketName);
+
+}
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
new file mode 100644
index 0000000..3b96ae2
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/ConfigurationResourceResolvingStrategy.java
@@ -0,0 +1,111 @@
+/*
+ * 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.caconfig.resource.spi;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Defines how and where the configuration resources are looked up.
+ * This SPI allows application to define their own configuration storage and inheritance strategies.
+ *
+ * If this strategy supports inheritance for collections, it should use the optional
+ * {@link CollectionInheritanceDecider} SPI interface. If such services are available,
+ * they should be called in order of there service ranking, starting with the highest
+ * ranking. The first decider service providing a non null return value is used
+ * for the decision.
+ */
+@ConsumerType
+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 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 or {@code null} if this strategy did not found matching resources.
+     */
+    @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 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 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, Collection, String)}.
+     * @param resource Context resource to fetch configuration for
+     * @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 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, Collection, String)}.
+     * @param resource Context resource to fetch configuration for
+     * @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 Collection<String> bucketNames, @Nonnull String configName);
+
+    /**
+     * Get the configuration resource path for storing configuration data for the given context resource and configuration name.
+     * This path is used when no configuration resource exists yet, but new configuration data should be stored.
+     * So usually the returned path does not yet exist (and perhaps not even it's parents).
+     * @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.
+     * @return Resource path, or null if no matching configuration resource path can be determined
+     */
+    @CheckForNull String getResourcePath(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+
+    /**
+     * Get the configuration resource collection parent path for storing configuration data for the given context resource and configuration name.
+     * This path is used when no configuration resource collection exists yet, but new configuration data should be stored.
+     * So usually the returned path does not yet exist (and perhaps not even it's parents).
+     * @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.
+     * @return Resource path, or null if no matching configuration resource path can be determined
+     */
+    @CheckForNull String getResourceCollectionParentPath(@Nonnull Resource resource, @Nonnull String bucketName, @Nonnull String configName);
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/ContextPathStrategy.java b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextPathStrategy.java
new file mode 100644
index 0000000..f2d0423
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextPathStrategy.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.caconfig.resource.spi;
+
+import java.util.Iterator;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Allows application to define a strategy to find context paths and config references for content paths.
+ * A context paths is the root path of a "configuration context", which is a subtree in the resource hierarchy.
+ * Each context may have it's own context-aware configuration attached to.0
+ * If multiple context path strategy implementations are defined the results of them are merged.
+ */
+@ConsumerType
+public interface ContextPathStrategy {
+
+    /**
+     * Finds context paths for the given resource.
+     * @param resource Context resource
+     * @return Root resource and config reference for each context found (in order of closest matching first).
+     *      Only one of the parent resources or the resource itself may be included in the result.
+     *      If none are found an empty list is returned.
+     */
+    @Nonnull Iterator<ContextResource> findContextResources(@Nonnull Resource resource);
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java
new file mode 100644
index 0000000..313565e
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java
@@ -0,0 +1,78 @@
+/*
+ * 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.caconfig.resource.spi;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Holds reference to a context root resource and configuration reference path
+ * that was detected for the configuration context.
+ */
+@ProviderType
+public final class ContextResource {
+    
+    private final Resource resource;
+    private final String configRef;
+    private final String key;
+    
+    /**
+     * @param resource Context root resource
+     * @param configRef Config reference (normally a resource path).
+     *    May be null if the {@link ConfigurationResourceResolvingStrategy} has it's own concept of detecting the matching configuration.
+     */
+    public ContextResource(@Nonnull Resource resource, String configRef) {
+        this.resource = resource;
+        this.configRef = configRef;
+        this.key = resource.getPath() + "|" + configRef;
+    }
+
+    /**
+     * @return Context root resource
+     */
+    public @Nonnull Resource getResource() {
+        return resource;
+    }
+
+    /**
+     * @return Config reference (normally a resource path).
+     *    May be null if the {@link ConfigurationResourceResolvingStrategy} has it's own concept of detecting the matching configuration.
+     */
+    public @CheckForNull String getConfigRef() {
+        return configRef;
+    }
+
+    @Override
+    public int hashCode() {
+        return key.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof ContextResource) {
+            return StringUtils.equals(key, ((ContextResource)obj).key);
+        }
+        return false;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/InheritanceDecision.java b/src/main/java/org/apache/sling/caconfig/resource/spi/InheritanceDecision.java
new file mode 100644
index 0000000..ce60f5f
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/InheritanceDecision.java
@@ -0,0 +1,31 @@
+/*
+ * 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.caconfig.resource.spi;
+
+/**
+ * Return values for {@link CollectionInheritanceDecider}.
+ *
+ * @since 1.1
+ */
+public enum InheritanceDecision {
+
+    INCLUDE, // include the resource.
+    EXCLUDE, // exclude the resource, but allow others to provide it.
+    BLOCK    // exclude the resource, no one else can provide it.
+}
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java b/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java
new file mode 100644
index 0000000..28049c1
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java
@@ -0,0 +1,23 @@
+    /*
+ * 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.
+ */
+/**
+ * SPI for applications hooking into the configuration resource infrastructure for parameterizing and customizing.
+ */
+@org.osgi.annotation.versioning.Version("2.0.0")
+package org.apache.sling.caconfig.resource.spi;
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistData.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistData.java
new file mode 100644
index 0000000..00dfa57
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistData.java
@@ -0,0 +1,92 @@
+/*
+ * 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.caconfig.spi;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.commons.lang3.StringUtils;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Data for persisting configuration collections.
+ */
+@ProviderType
+public final class ConfigurationCollectionPersistData {
+    
+    private static final Pattern ITEM_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9_-]+$");
+
+    private final Collection<ConfigurationPersistData> items;
+    private Map<String,Object> properties;
+    
+    /**
+     * @param items Collection of configuration collection items
+     */
+    public ConfigurationCollectionPersistData(@Nonnull Collection<ConfigurationPersistData> items) {
+        validateItems(items);
+        this.items = items;
+    }
+    
+    private void validateItems(Collection<ConfigurationPersistData> items) {
+        // ensure unique and valid key names        
+        Set<String> keyNames = new HashSet<>();
+        for (ConfigurationPersistData item : items) {
+            if (StringUtils.isBlank(item.getCollectionItemName())) {
+                throw new ConfigurationPersistenceException("Collection item name is missing.");
+            }
+            if (!ITEM_NAME_PATTERN.matcher(item.getCollectionItemName()).matches()) {
+                throw new ConfigurationPersistenceException("Invalid collection item name: " + item.getCollectionItemName());
+            }
+            if (keyNames.contains(item.getCollectionItemName())) {
+                throw new ConfigurationPersistenceException("Duplicate collection item name: " + item.getCollectionItemName());
+            }
+            keyNames.add(item.getCollectionItemName());
+        }
+    }
+
+    /**
+     * @return Collection of configuration collection items
+     */
+    public @Nonnull Collection<ConfigurationPersistData> getItems() {
+        return items;
+    }
+    
+    /**
+     * @return Properties for the configuration collection itself. Does not contain configuration data, but control data e.g. for enabling collection inheritance.
+     */
+    public @CheckForNull Map<String, Object> getProperties() {
+        return properties;
+    }
+
+    /**
+     * @param value Properties for the configuration collection itself. Does not contain configuration data, but control data e.g. for enabling collection inheritance.
+     * @return this
+     */
+    public ConfigurationCollectionPersistData properties(Map<String, Object> value) {
+        this.properties = value;
+        return this;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationInheritanceStrategy.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationInheritanceStrategy.java
new file mode 100644
index 0000000..3ad58d7
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationInheritanceStrategy.java
@@ -0,0 +1,44 @@
+/*
+ * 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.caconfig.spi;
+
+import java.util.Iterator;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Defines how (and if) resources in a resource hierarchy should inherit form each other.
+ * Primary use case is property inheritance over the inheritance chain.
+ */
+@ConsumerType
+public interface ConfigurationInheritanceStrategy {
+
+    /**
+     * Pick or merge resources for inheritance.
+     * @param configResources Iterator of configuration resources that form the inheritance hierarchy.
+     *     First resource is the "closest" match, the other resources may be used to inherit from.
+     * @return Inherited resource or null if this strategy does not support the given resources
+     */
+    @CheckForNull Resource getResource(@Nonnull Iterator<Resource> configResources);
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationMetadataProvider.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationMetadataProvider.java
new file mode 100644
index 0000000..c3d04c5
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationMetadataProvider.java
@@ -0,0 +1,48 @@
+/*
+ * 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.caconfig.spi;
+
+import java.util.SortedSet;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.caconfig.spi.metadata.ConfigurationMetadata;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Allows applications to provide the necessary metadata for configurations.
+ */
+@ConsumerType
+public interface ConfigurationMetadataProvider {
+
+    /**
+     * Get all configuration names.
+     * @return Configuration names
+     */
+    @Nonnull SortedSet<String> getConfigurationNames();
+
+    /**
+     * Get configuration metadata.
+     * @param configName Configuration name
+     * @return Configuration metadata or null if none exists for the given name.
+     */
+    @CheckForNull ConfigurationMetadata getConfigurationMetadata(String configName);
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationOverrideProvider.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationOverrideProvider.java
new file mode 100644
index 0000000..290fa24
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationOverrideProvider.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.caconfig.spi;
+
+import java.util.Collection;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Provide information to override configuration data.
+ */
+@ConsumerType
+public interface ConfigurationOverrideProvider {
+
+    /**
+     * Get override strings. Syntax examples:
+     * <ul>
+     * <li><code>{configName}/{propertyName}={propertyJsonValue}</code></li>
+     * <li><code>{configName}={propertyJsonObject}</code></li>
+     * <li><code>[{contextPath}]{configName}/{propertyName}={propertyJsonValue}</code></li>
+     * <li><code>[{contextPath}]{configName}={propertyJsonObject}</code></li>
+     * </ul>
+     * @return Override strings
+     */
+    @Nonnull Collection<String> getOverrideStrings();
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistData.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistData.java
new file mode 100644
index 0000000..5a1f2fd
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistData.java
@@ -0,0 +1,67 @@
+/*
+ * 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.caconfig.spi;
+
+import java.util.Map;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Data for persisting configuration properties.
+ */
+@ProviderType
+public final class ConfigurationPersistData {
+
+    private final Map<String,Object> properties;
+    private String collectionItemName;
+    
+    /**
+     * @param properties Property values
+     */
+    public ConfigurationPersistData(@Nonnull Map<String, Object> properties) {
+        this.properties = properties;
+    }
+
+    /**
+     * @return Property values
+     */
+    public @Nonnull Map<String, Object> getProperties() {
+        return properties;
+    }
+
+    /**
+     * @return Resource collection item name. To be set only for resource collection items.
+     */
+    public @CheckForNull String getCollectionItemName() {
+        return collectionItemName;
+    }
+
+    /**
+     * @param value Resource collection item name.  To be set only for resource collection items.
+     * @return this
+     */
+    public ConfigurationPersistData collectionItemName(String value) {
+        this.collectionItemName = value;
+        return this;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
new file mode 100644
index 0000000..207162f
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
@@ -0,0 +1,38 @@
+/*
+ * 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.caconfig.spi;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Is thrown when configuration cannot be persisted.
+ */
+@ProviderType
+public final class ConfigurationPersistenceException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public ConfigurationPersistenceException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ConfigurationPersistenceException(String message) {
+        super(message);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
new file mode 100644
index 0000000..37f6de6
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
@@ -0,0 +1,85 @@
+/*
+ * 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.caconfig.spi;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Defines how configuration data is stored in the configuration resource.
+ * This SPI allows application to define their own content structure and node types to be used for configuration data storage.
+ */
+@ConsumerType
+public interface ConfigurationPersistenceStrategy {
+
+    /**
+     * Allows the strategy to transform the given configuration resource according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resource Configuration resource
+     * @return Transformed configuration resource. If null is returned this strategy does not support the given configuration resource.
+     */
+    @CheckForNull Resource getResource(@Nonnull Resource resource);
+    
+    /**
+     * Allows the strategy to transform the given configuration resource path according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resourcePath Configuration resource path or part of it (e.g. config name)
+     * @return Transformed configuration resource path. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getResourcePath(@Nonnull String resourcePath);
+    
+    /**
+     * Stores configuration data for a singleton configuration resource.
+     * The changes are written using the given resource resolver. They are not committed, this is left to the caller.
+     * @param resourceResolver Resource resolver
+     * @param configResourcePath Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created. 
+     * @param data Configuration data to be stored. All existing properties are erased and replaced with the new ones.
+     * @return true if the data was persisted. false if persisting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean persistConfiguration(@Nonnull ResourceResolver resourceResolver,
+            @Nonnull String configResourcePath, @Nonnull ConfigurationPersistData data);
+    
+    /**
+     * Stores configuration data for a configuration resource collection.
+     * The changes are written using the given resource resolver. They are not committed, this is left to the caller.
+     * @param resourceResolver Resource resolver
+     * @param configResourceCollectionParentPath Parent path to store configuration collection data to.
+     *      The resource (and it's parents) may not exist and may have to be created. 
+     * @param data Configuration collection data. All existing collection entries on this context path level are erased and replaced with the new ones.
+     * @return true if the data was persisted. false if persisting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean persistConfigurationCollection(@Nonnull ResourceResolver resourceResolver,
+            @Nonnull String configResourceCollectionParentPath, @Nonnull ConfigurationCollectionPersistData data);
+ 
+    /**
+     * Delete configuration or configuration collection data from repository using the inner-most context path as reference.
+     * @param resourceResolver Resource resolver
+     * @param configResourcePath Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created. 
+     * @return true if the data was delete. false if deleting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean deleteConfiguration(@Nonnull ResourceResolver resourceResolver, @Nonnull String configResourcePath);
+    
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/metadata/AbstractMetadata.java b/src/main/java/org/apache/sling/caconfig/spi/metadata/AbstractMetadata.java
new file mode 100644
index 0000000..dc69fb6
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/metadata/AbstractMetadata.java
@@ -0,0 +1,105 @@
+/*
+ * 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.caconfig.spi.metadata;
+
+import java.util.Map;
+
+import javax.annotation.Nonnull;
+
+/**
+ * Common properties for configuration and properties.
+ */
+abstract class AbstractMetadata<T> {
+
+    private final String name;
+    private String label;
+    private String description;
+    private Map<String,String> properties;
+
+    public AbstractMetadata(@Nonnull String name) {
+        if (name == null) {
+            throw new IllegalArgumentException("Invalid name: " + name);
+        }
+        this.name = name;
+    }
+    
+    /**
+     * @return Parameter name
+     */
+    public @Nonnull String getName() {
+        return this.name;
+    }
+    
+    /**
+     * @return Label
+     */
+    public String getLabel() {
+        return label;
+    }
+
+    /**
+     * @param label Label
+     * @return this;
+     */
+    @SuppressWarnings("unchecked")
+    public T label(String label) {
+        this.label = label;
+        return (T)this;
+    }
+
+    /**
+     * @return Description
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * @param description Description
+     * @return this;
+     */
+    @SuppressWarnings("unchecked")
+    public T description(String description) {
+        this.description = description;
+        return (T)this;
+    }
+
+    /**
+     * @return Further properties for documentation and configuration of behavior in configuration editor.
+     */
+    public Map<String,String> getProperties() {
+        return this.properties;
+    }
+    
+    /**
+     * @param properties Further properties for documentation and configuration of behavior in configuration editor.
+     * @return this;
+     */
+    @SuppressWarnings("unchecked")
+    public T properties(Map<String,String> properties) {
+        this.properties = properties;
+        return (T)this;
+    }
+    
+    @Override
+    public String toString() {
+        return this.name;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadata.java b/src/main/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadata.java
new file mode 100644
index 0000000..bc4ef43
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadata.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.caconfig.spi.metadata;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines a configuration.
+ */
+@ProviderType
+public final class ConfigurationMetadata extends AbstractMetadata<ConfigurationMetadata> {
+
+    private final Map<String,PropertyMetadata<?>> propertyMetadata;
+    private final boolean collection;
+
+    /**
+     * @param name Configuration name
+     * @param propertyMetadata Property metadata
+     * @param collection Collection
+     */
+    public ConfigurationMetadata(@Nonnull String name,
+            Collection<PropertyMetadata<?>> propertyMetadata,
+            boolean collection) {
+        super(name);
+        this.propertyMetadata = toMap(propertyMetadata);
+        this.collection = collection;
+    }
+    
+    private static Map<String,PropertyMetadata<?>> toMap(Collection<PropertyMetadata<?>> propertyMetadata) {
+        Map<String,PropertyMetadata<?>> map = new LinkedHashMap<>();
+        for (PropertyMetadata<?> item : propertyMetadata) {
+            if (map.containsKey(item.getName())) {
+                throw new IllegalArgumentException("Duplicate property name: " + item.getName());
+            }
+            map.put(item.getName(), item);
+        }
+        return map;
+    }
+    
+    /**
+     * @return true if configuration is singleton
+     */
+    public boolean isSingleton() {
+        return !collection;
+    }
+    
+    /**
+     * @return true if configuration is collection
+     */
+    public boolean isCollection() {
+        return collection;
+    }
+
+    /**
+     * @return Configuration properties
+     */
+    public Map<String,PropertyMetadata<?>> getPropertyMetadata() {
+        return this.propertyMetadata;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java b/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java
new file mode 100644
index 0000000..b2e56d0
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java
@@ -0,0 +1,200 @@
+/*
+ * 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.caconfig.spi.metadata;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+
+import org.apache.commons.lang3.ClassUtils;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines a configuration property.
+ * @param <T> Property value type
+ */
+@ProviderType
+public final class PropertyMetadata<T> extends AbstractMetadata<PropertyMetadata<T>> {
+
+    // these are all types supported for fields of annotation classes (plus class which indicates nested configurations)
+    private static final Class<?>[] SUPPORTED_TYPES_ARRAY = {
+        String.class,
+        int.class,
+        long.class,
+        double.class,
+        boolean.class
+    };
+    
+    /**
+     * Set with all types support for property metadata (not including nested configurations).
+     */
+    public static final Set<Class<?>> SUPPORTED_TYPES = Collections.unmodifiableSet(
+            new HashSet<>(Arrays.asList(SUPPORTED_TYPES_ARRAY)));
+    
+    private final Class<T> type;
+    private T defaultValue;
+    private ConfigurationMetadata configurationMetadata;
+    private int order;
+
+    /**
+     * @param name Property name
+     * @param type Property type
+     */
+    @SuppressWarnings("unchecked")
+    public PropertyMetadata(@Nonnull String name, @Nonnull Class<T> type) {
+        super(name);
+        Class<T> convertedType = (Class<T>)typeToPrimitive(type);
+        if (!isSupportedType(convertedType)) {
+            throw new IllegalArgumentException("Invalid type for property '" + name + "': " + type);
+        }
+        this.type = convertedType;
+    }
+
+    /**
+     * @param name Property name
+     * @param defaultValue Default value (also defines property type)
+     */
+    @SuppressWarnings("unchecked")
+    public PropertyMetadata(@Nonnull String name, @Nonnull T defaultValue) {
+        this(name, (Class<T>)defaultValue.getClass());
+        this.defaultValue = defaultValue;
+    }
+    
+    private static Class<?> typeToPrimitive(Class<?> clazz) {
+        if (clazz.isArray()) {
+            if (ClassUtils.isPrimitiveWrapper(clazz.getComponentType())) {
+                if (clazz == Integer[].class) {
+                    return int[].class;
+                }
+                if (clazz == Long[].class) {
+                    return long[].class;
+                }
+                if (clazz == Double[].class) {
+                    return double[].class;
+                }
+                if (clazz == Boolean[].class) {
+                    return boolean[].class;
+                }
+            }
+        }
+        else if (ClassUtils.isPrimitiveWrapper(clazz)) {
+            if (clazz == Integer.class) {
+                return int.class;
+            }
+            if (clazz == Long.class) {
+                return long.class;
+            }
+            if (clazz == Double.class) {
+                return double.class;
+            }
+            if (clazz == Boolean.class) {
+                return boolean.class;
+            }
+        }
+        return clazz;
+    }
+
+    private static boolean isSupportedType(Class<?> paramType) {
+        if (paramType.isArray()) {
+            return isSupportedType(paramType.getComponentType());
+        }
+        for (Class<?> type : SUPPORTED_TYPES) {
+            if (type.equals(paramType)) {
+                return true;
+            }
+        }
+        if (paramType == ConfigurationMetadata.class) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * @return Parameter type
+     */
+    public @Nonnull Class<T> getType() {
+        return this.type;
+    }
+
+    /**
+     * @return Default value if parameter is not set for configuration
+     */
+    public T getDefaultValue() {
+        return this.defaultValue;
+    }
+    
+    /**
+     * @param value Default value if parameter is not set for configuration
+     * @return this;
+     */
+    public PropertyMetadata<T> defaultValue(T value) {
+        this.defaultValue = value;
+        return this;
+    }
+    
+    /**
+     * @return Number to control property order in configuration editor.
+     */
+    public int getOrder() {
+        return order;
+    }
+
+    /**
+     * @param value Number to control property order in configuration editor.
+     * @return this
+     */
+    public PropertyMetadata<T> order(int value) {
+        this.order = value;
+        return this;
+    }
+
+    /**
+     * @return Metadata for nested configuration
+     */
+    public ConfigurationMetadata getConfigurationMetadata() {
+        return configurationMetadata;
+    }
+
+    /**
+     * @param configurationMetadata Metadata for nested configuration
+     * @return this;
+     */
+    public PropertyMetadata<T> configurationMetadata(ConfigurationMetadata configurationMetadata) {
+        this.configurationMetadata = configurationMetadata;
+        return this;
+    }
+    
+    /**
+     * @return true if this property describes a nested configuration.
+     *   In this case it is ensured configuration metadata is present, and the type is ConfigurationMetadata or ConfigurationMetadata[].
+     */
+    public boolean isNestedConfiguration() {
+        return configurationMetadata != null
+                && (this.type.equals(ConfigurationMetadata.class) || this.type.equals(ConfigurationMetadata[].class));
+    }
+    
+    @Override
+    public String toString() {
+        return getName() + "[" + this.type.getSimpleName() + "]";
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/metadata/package-info.java b/src/main/java/org/apache/sling/caconfig/spi/metadata/package-info.java
new file mode 100644
index 0000000..a3759e2
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/metadata/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * Defining configuration and parameter metadata for the SPI.
+ */
+@org.osgi.annotation.versioning.Version("2.0.0")
+package org.apache.sling.caconfig.spi.metadata;
diff --git a/src/main/java/org/apache/sling/caconfig/spi/package-info.java b/src/main/java/org/apache/sling/caconfig/spi/package-info.java
new file mode 100644
index 0000000..8637a08
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * SPI for applications hooking into the configuration infrastructure for parameterizing and customizing.
+ */
+@org.osgi.annotation.versioning.Version("2.0.0")
+package org.apache.sling.caconfig.spi;
diff --git a/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java b/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java
new file mode 100644
index 0000000..6ee7433
--- /dev/null
+++ b/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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.caconfig.resource.spi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class ContextResourceTest {
+    
+    @Rule
+    public SlingContext context = new SlingContext();
+    
+    private Resource resource1;
+    private Resource resource2;
+    
+    @Before
+    public void setUp() {
+        resource1 = context.create().resource("/content/test1");
+        resource2 = context.create().resource("/content/test2");
+    }
+
+    @Test
+    public void testGetter() {
+        ContextResource r1 = new ContextResource(resource1, "/conf/test");
+        assertEquals("/content/test1", r1.getResource().getPath());
+        assertEquals("/conf/test", r1.getConfigRef());
+    }
+
+    @Test
+    public void testEquals() {
+        assertTrue(new ContextResource(resource1, "/conf/test").equals(new ContextResource(resource1, "/conf/test")));
+        assertTrue(new ContextResource(resource1, null).equals(new ContextResource(resource1, null)));
+    }
+
+    @Test
+    public void testNotEquals() {
+        assertFalse(new ContextResource(resource1, "/conf/test").equals(new ContextResource(resource2, "/conf/test")));
+        assertFalse(new ContextResource(resource1, "/conf/test1").equals(new ContextResource(resource1, "/conf/test2")));
+        assertFalse(new ContextResource(resource1, null).equals(new ContextResource(resource1, "/conf/test")));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistDataTest.java b/src/test/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistDataTest.java
new file mode 100644
index 0000000..f62382a
--- /dev/null
+++ b/src/test/java/org/apache/sling/caconfig/spi/ConfigurationCollectionPersistDataTest.java
@@ -0,0 +1,84 @@
+/*
+ * 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.caconfig.spi;
+
+import static org.junit.Assert.assertSame;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ConfigurationCollectionPersistDataTest {
+
+    @Mock
+    private Map<String,Object> props;
+    
+    @Test
+    public void testProperties() {
+        Collection<ConfigurationPersistData> items = ImmutableList.of(
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item1"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item2"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item3"));
+
+        ConfigurationCollectionPersistData underTest = new ConfigurationCollectionPersistData(items)
+                .properties(props);
+        
+        assertSame(items, underTest.getItems());
+        assertSame(props, underTest.getProperties());
+    }
+
+    @Test(expected=ConfigurationPersistenceException.class)
+    public void testItemsDuplicateKeys() {
+        Collection<ConfigurationPersistData> itemList = ImmutableList.of(
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item1"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item2"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item1"));
+
+        new ConfigurationCollectionPersistData(itemList);
+    }
+
+    @Test(expected=ConfigurationPersistenceException.class)
+    public void testItemsMissingItemName() {
+        Collection<ConfigurationPersistData> itemList = ImmutableList.of(
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item1"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item2"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()));
+
+        new ConfigurationCollectionPersistData(itemList);
+    }
+
+    @Test(expected=ConfigurationPersistenceException.class)
+    public void testItemsInvalidItemNAme() {
+        Collection<ConfigurationPersistData> itemList = ImmutableList.of(
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item1"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item2"),
+                new ConfigurationPersistData(ImmutableMap.<String, Object>of()).collectionItemName("item #1"));
+
+        new ConfigurationCollectionPersistData(itemList);
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/caconfig/spi/ConfigurationPersistDataTest.java b/src/test/java/org/apache/sling/caconfig/spi/ConfigurationPersistDataTest.java
new file mode 100644
index 0000000..01ffa2b
--- /dev/null
+++ b/src/test/java/org/apache/sling/caconfig/spi/ConfigurationPersistDataTest.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.caconfig.spi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ConfigurationPersistDataTest {
+
+    @Mock
+    private Map<String,Object> props;
+
+    @Test
+    public void testGetProperties() {
+        ConfigurationPersistData underTest = new ConfigurationPersistData(props)
+                .collectionItemName("item1");
+        
+        assertSame(props, underTest.getProperties());
+        assertEquals("item1", underTest.getCollectionItemName());
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadataTest.java b/src/test/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadataTest.java
new file mode 100644
index 0000000..83bd8f5
--- /dev/null
+++ b/src/test/java/org/apache/sling/caconfig/spi/metadata/ConfigurationMetadataTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.caconfig.spi.metadata;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+public class ConfigurationMetadataTest {
+
+    @Test
+    public void testProps() {
+        ConfigurationMetadata underTest = new ConfigurationMetadata("name1", ImmutableList.<PropertyMetadata<?>>of(), false);
+        assertEquals("name1", underTest.getName());
+        assertTrue(underTest.isSingleton());
+        assertFalse(underTest.isCollection());
+        
+        Map<String,String> props = ImmutableMap.of("p1", "v1");
+        underTest.label("label1")
+            .description("desc1")
+            .properties(props);
+        
+        assertEquals("label1", underTest.getLabel());
+        assertEquals("desc1", underTest.getDescription());
+        assertEquals(props, underTest.getProperties());
+    }
+
+    @Test
+    public void testCollectionProps() {
+        ConfigurationMetadata underTest = new ConfigurationMetadata("name1", ImmutableList.<PropertyMetadata<?>>of(), true);
+        assertEquals("name1", underTest.getName());
+        assertFalse(underTest.isSingleton());
+        assertTrue(underTest.isCollection());
+    }
+
+    @Test
+    public void testPropertyMap() {
+        ConfigurationMetadata underTest = new ConfigurationMetadata("name1", ImmutableList.<PropertyMetadata<?>>of(
+                new PropertyMetadata<>("prop1", "devValue"),
+                new PropertyMetadata<>("prop2", 5)), false);
+        assertEquals(2, underTest.getPropertyMetadata().size());
+        assertTrue(underTest.getPropertyMetadata().containsKey("prop1"));
+        assertTrue(underTest.getPropertyMetadata().containsKey("prop2"));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testDuplicateKey() {
+        new ConfigurationMetadata("name1", ImmutableList.<PropertyMetadata<?>>of(
+                new PropertyMetadata<>("prop1", "devValue"),
+                new PropertyMetadata<>("prop1", 5)), false);
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadataTest.java b/src/test/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadataTest.java
new file mode 100644
index 0000000..e93fb8b
--- /dev/null
+++ b/src/test/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadataTest.java
@@ -0,0 +1,107 @@
+/*
+ * 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.caconfig.spi.metadata;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+public class PropertyMetadataTest {
+
+    @Test
+    public void testProps() {
+        PropertyMetadata<String> underTest = new PropertyMetadata<>("name1", String.class);
+        assertEquals("name1", underTest.getName());
+        assertEquals(String.class, underTest.getType());
+        
+        ConfigurationMetadata configMetadata = new ConfigurationMetadata("test", ImmutableList.<PropertyMetadata<?>>of(), false);
+        Map<String,String> props = ImmutableMap.of("p1", "v1");
+        underTest.label("label1")
+            .description("desc1")
+            .defaultValue("value1")
+            .properties(props)
+            .configurationMetadata(configMetadata);
+        
+        assertEquals("label1", underTest.getLabel());
+        assertEquals("desc1", underTest.getDescription());
+        assertEquals("value1", underTest.getDefaultValue());
+        assertEquals(props, underTest.getProperties());
+        assertSame(configMetadata, underTest.getConfigurationMetadata());
+    }
+
+    @Test
+    public void testAllowedTypes() {
+        new PropertyMetadata<>("name1", String.class);
+        new PropertyMetadata<>("name1", String[].class);
+        new PropertyMetadata<>("name1", int.class);
+        new PropertyMetadata<>("name1", int[].class);
+        new PropertyMetadata<>("name1", long.class);
+        new PropertyMetadata<>("name1", long[].class);
+        new PropertyMetadata<>("name1", double.class);
+        new PropertyMetadata<>("name1", double[].class);
+        new PropertyMetadata<>("name1", boolean.class);
+        new PropertyMetadata<>("name1", boolean[].class);
+    }
+
+    @Test
+    public void testAllowedTypesConverted() {
+        assertEquals(int.class, new PropertyMetadata<>("name1", Integer.class).getType());
+        assertEquals(int[].class, new PropertyMetadata<>("name1", Integer[].class).getType());
+        assertEquals(long.class, new PropertyMetadata<>("name1", Long.class).getType());
+        assertEquals(long[].class, new PropertyMetadata<>("name1", Long[].class).getType());
+        assertEquals(double.class, new PropertyMetadata<>("name1", Double.class).getType());
+        assertEquals(double[].class, new PropertyMetadata<>("name1", Double[].class).getType());
+        assertEquals(boolean.class, new PropertyMetadata<>("name1", Boolean.class).getType());
+        assertEquals(boolean[].class, new PropertyMetadata<>("name1", Boolean[].class).getType());
+    }
+
+    @Test
+    public void testNestedConfiguration() {
+        new PropertyMetadata<>("name1", ConfigurationMetadata.class);
+        new PropertyMetadata<>("name1", ConfigurationMetadata[].class);
+    }
+
+    @Test(expected=IllegalArgumentException.class)
+    public void testDisallowedType() {
+        new PropertyMetadata<>("name1", Object.class);
+    }
+
+    @Test(expected=IllegalArgumentException.class)
+    public void testNullNale() {
+        new PropertyMetadata<>(null, Object.class);
+    }
+
+    @Test
+    public void testDefaultValueConstructor() {
+        PropertyMetadata<String> stringProp = new PropertyMetadata<>("name1", "defValue");
+        assertEquals("defValue", stringProp.getDefaultValue());
+        assertEquals(String.class, stringProp.getType());
+        
+        PropertyMetadata<Integer> intProp = new PropertyMetadata<>("name1", 5);
+        assertEquals((Integer)5, intProp.getDefaultValue());
+        assertEquals(int.class, intProp.getType());
+    }
+    
+}

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

[sling-org-apache-sling-caconfig-spi] 08/15: update dependencies

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-caconfig-spi.git

commit 87bc578563ad3693bc952276d1f1000c7dc7df67
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Mar 23 15:13:09 2017 +0000

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

diff --git a/pom.xml b/pom.xml
index 9569db6..7ac027d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,7 +81,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.0</version>
+            <version>2.2.4</version>
             <scope>test</scope>
         </dependency>
         <dependency>

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

[sling-org-apache-sling-caconfig-spi] 14/15: 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-caconfig-spi.git

commit b8cfa9d86f13de45f5fed210437fb2fbdd033f55
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 16:12:27 2017 +0000

    SLING-7167 Adjust READMEs
    
    switch from plain text to Markdown
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810470 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt => README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/README.txt b/README.md
similarity index 100%
rename from README.txt
rename to README.md

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

[sling-org-apache-sling-caconfig-spi] 10/15: SLING-6883 allow to pass in service ranking for context resource

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-caconfig-spi.git

commit b53d4108fe2d665c324e567a5a73bf399e8b6a28
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed May 24 16:15:56 2017 +0000

    SLING-6883 allow to pass in service ranking for context resource
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1796078 13f79535-47bb-0310-9956-ffa450edef68
---
 .../caconfig/resource/spi/ContextResource.java     | 23 +++++++++++++++++++++-
 .../sling/caconfig/resource/spi/package-info.java  |  4 ++--
 .../caconfig/resource/spi/ContextResourceTest.java | 13 ++++++------
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java
index 313565e..60db4c1 100644
--- a/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/ContextResource.java
@@ -34,20 +34,34 @@ public final class ContextResource {
     
     private final Resource resource;
     private final String configRef;
+    private final int serviceRanking;
     private final String key;
     
     /**
      * @param resource Context root resource
      * @param configRef Config reference (normally a resource path).
      *    May be null if the {@link ConfigurationResourceResolvingStrategy} has it's own concept of detecting the matching configuration.
+     * @param serviceRanking Service ranking of the context path strategy implementation
      */
-    public ContextResource(@Nonnull Resource resource, String configRef) {
+    public ContextResource(@Nonnull Resource resource, String configRef, int serviceRanking) {
         this.resource = resource;
         this.configRef = configRef;
+        this.serviceRanking = serviceRanking;
         this.key = resource.getPath() + "|" + configRef;
     }
 
     /**
+     * @param resource Context root resource
+     * @param configRef Config reference (normally a resource path).
+     *    May be null if the {@link ConfigurationResourceResolvingStrategy} has it's own concept of detecting the matching configuration.
+     * @deprecated Use {@link #ContextResource(Resource, String, int)}
+     */
+    @Deprecated
+    public ContextResource(@Nonnull Resource resource, String configRef) {
+        this(resource, configRef, 0);
+    }
+
+    /**
      * @return Context root resource
      */
     public @Nonnull Resource getResource() {
@@ -61,6 +75,13 @@ public final class ContextResource {
     public @CheckForNull String getConfigRef() {
         return configRef;
     }
+    
+    /**
+     * @return Service ranking of the context path strategy implementation
+     */
+    public int getServiceRanking() {
+        return serviceRanking;
+    }
 
     @Override
     public int hashCode() {
diff --git a/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java b/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java
index 28049c1..f53dd1f 100644
--- a/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java
+++ b/src/main/java/org/apache/sling/caconfig/resource/spi/package-info.java
@@ -1,4 +1,4 @@
-    /*
+/*
  * 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
@@ -19,5 +19,5 @@
 /**
  * SPI for applications hooking into the configuration resource infrastructure for parameterizing and customizing.
  */
-@org.osgi.annotation.versioning.Version("2.0.0")
+@org.osgi.annotation.versioning.Version("2.1.0")
 package org.apache.sling.caconfig.resource.spi;
diff --git a/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java b/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java
index 6ee7433..5b95824 100644
--- a/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java
+++ b/src/test/java/org/apache/sling/caconfig/resource/spi/ContextResourceTest.java
@@ -44,22 +44,23 @@ public class ContextResourceTest {
 
     @Test
     public void testGetter() {
-        ContextResource r1 = new ContextResource(resource1, "/conf/test");
+        ContextResource r1 = new ContextResource(resource1, "/conf/test", 20);
         assertEquals("/content/test1", r1.getResource().getPath());
         assertEquals("/conf/test", r1.getConfigRef());
+        assertEquals(20, r1.getServiceRanking());
     }
 
     @Test
     public void testEquals() {
-        assertTrue(new ContextResource(resource1, "/conf/test").equals(new ContextResource(resource1, "/conf/test")));
-        assertTrue(new ContextResource(resource1, null).equals(new ContextResource(resource1, null)));
+        assertTrue(new ContextResource(resource1, "/conf/test", 0).equals(new ContextResource(resource1, "/conf/test", 10)));
+        assertTrue(new ContextResource(resource1, null, 0).equals(new ContextResource(resource1, null, 0)));
     }
 
     @Test
     public void testNotEquals() {
-        assertFalse(new ContextResource(resource1, "/conf/test").equals(new ContextResource(resource2, "/conf/test")));
-        assertFalse(new ContextResource(resource1, "/conf/test1").equals(new ContextResource(resource1, "/conf/test2")));
-        assertFalse(new ContextResource(resource1, null).equals(new ContextResource(resource1, "/conf/test")));
+        assertFalse(new ContextResource(resource1, "/conf/test", 0).equals(new ContextResource(resource2, "/conf/test", 0)));
+        assertFalse(new ContextResource(resource1, "/conf/test1", 0).equals(new ContextResource(resource1, "/conf/test2", 0)));
+        assertFalse(new ContextResource(resource1, null, 0).equals(new ContextResource(resource1, "/conf/test", 0)));
     }
 
 }

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

[sling-org-apache-sling-caconfig-spi] 07/15: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-caconfig-spi.git

commit 5d72e1d49801947d33d1b761696a5ac884959e69
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 20 22:35:45 2017 +0000

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

diff --git a/pom.xml b/pom.xml
index 2adb6a4..9569db6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,14 +29,14 @@
     
     <artifactId>org.apache.sling.caconfig.spi</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.0</version>
+    <version>1.3.1-SNAPSHOT</version>
     <name>Apache Sling Context-Aware Configuration SPI</name>
     <description>Apache Sling Context-Aware Configuration SPI</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.caconfig.spi-1.3.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/caconfig/spi</url>
     </scm>
     
     <build>

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

[sling-org-apache-sling-caconfig-spi] 03/15: SLING-6669 introduce new SPI ConfigurationPersistenceStrategy2, deprecate ConfigurationPersistenceStrategy export ConfigurationPersistenceStrategyMultiplexer as part of the management 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-caconfig-spi.git

commit 4b01b8f2126bdefd7c8303ee926fa8338aec4d58
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sun Mar 19 14:53:02 2017 +0000

    SLING-6669 introduce new SPI ConfigurationPersistenceStrategy2, deprecate ConfigurationPersistenceStrategy
    export ConfigurationPersistenceStrategyMultiplexer as part of the management API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1787626 13f79535-47bb-0310-9956-ffa450edef68
---
 .../spi/ConfigurationPersistenceStrategy.java      |   2 +
 .../spi/ConfigurationPersistenceStrategy2.java     | 147 +++++++++++++++++++++
 .../apache/sling/caconfig/spi/package-info.java    |   2 +-
 3 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
index 37f6de6..ff59784 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
@@ -28,8 +28,10 @@ import org.osgi.annotation.versioning.ConsumerType;
 /**
  * Defines how configuration data is stored in the configuration resource.
  * This SPI allows application to define their own content structure and node types to be used for configuration data storage.
+ * @deprecated Please use {@link ConfigurationPersistenceStrategy2} instead.
  */
 @ConsumerType
+@Deprecated
 public interface ConfigurationPersistenceStrategy {
 
     /**
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java
new file mode 100644
index 0000000..854fd5c
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java
@@ -0,0 +1,147 @@
+/*
+ * 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.caconfig.spi;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Defines how configuration data is stored in the configuration resource.
+ * This SPI allows application to define their own content structure and node types to be used for configuration data storage.
+ */
+@ConsumerType
+public interface ConfigurationPersistenceStrategy2 {
+
+    /**
+     * Allows the strategy to transform the given configuration resource according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resource Singleton configuration resource
+     * @return Transformed configuration resource. If null is returned this strategy does not support the given configuration resource.
+     */
+    @CheckForNull Resource getResource(@Nonnull Resource resource);
+
+    /**
+     * Allows the strategy to transform the given configuration resource according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resource Configuration collection parent resource
+     * @return Transformed configuration resource. If null is returned this strategy does not support the given configuration resource.
+     */
+    @CheckForNull Resource getCollectionParentResource(@Nonnull Resource resource);
+
+    /**
+     * Allows the strategy to transform the given configuration resource according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resource Configuration collection item resource
+     * @return Transformed configuration resource. If null is returned this strategy does not support the given configuration resource.
+     */
+    @CheckForNull Resource getCollectionItemResource(@Nonnull Resource resource);
+
+    /**
+     * Allows the strategy to transform the given configuration resource path according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resourcePath Configuration resource path (full path)
+     * @return Transformed configuration resource path. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getResourcePath(@Nonnull String resourcePath);
+    
+    /**
+     * Allows the strategy to transform the given configuration resource path according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resourcePath Configuration collection parent resource path (full path)
+     * @return Transformed configuration resource path. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getCollectionParentResourcePath(@Nonnull String resourcePath);
+
+    /**
+     * Allows the strategy to transform the given configuration resource path according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param resourcePath Configuration collection item resource path (full path)
+     * @return Transformed configuration resource path. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getCollectionItemResourcePath(@Nonnull String resourcePath);
+    
+    /**
+     * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param configName Configuration name
+     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
+     * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+    
+    /**
+     * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param configName Configuration name
+     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
+     * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getCollectionParentConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+
+    /**
+     * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
+     * e.g. fetching the data from a child resource instead of the given resource. 
+     * @param configName Configuration name
+     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
+     * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
+     */
+    @CheckForNull String getCollectionItemConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+    
+    /**
+     * Stores configuration data for a singleton configuration resource.
+     * The changes are written using the given resource resolver. They are not committed, this is left to the caller.
+     * @param resourceResolver Resource resolver
+     * @param configResourcePath Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created. 
+     * @param data Configuration data to be stored. All existing properties are erased and replaced with the new ones.
+     * @return true if the data was persisted. false if persisting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean persistConfiguration(@Nonnull ResourceResolver resourceResolver,
+            @Nonnull String configResourcePath, @Nonnull ConfigurationPersistData data);
+    
+    /**
+     * Stores configuration data for a configuration resource collection.
+     * The changes are written using the given resource resolver. They are not committed, this is left to the caller.
+     * @param resourceResolver Resource resolver
+     * @param configResourceCollectionParentPath Parent path to store configuration collection data to.
+     *      The resource (and it's parents) may not exist and may have to be created. 
+     * @param data Configuration collection data. All existing collection entries on this context path level are erased and replaced with the new ones.
+     * @return true if the data was persisted. false if persisting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean persistConfigurationCollection(@Nonnull ResourceResolver resourceResolver,
+            @Nonnull String configResourceCollectionParentPath, @Nonnull ConfigurationCollectionPersistData data);
+ 
+    /**
+     * Delete configuration or configuration collection data from repository using the inner-most context path as reference.
+     * @param resourceResolver Resource resolver
+     * @param configResourcePath Path to store configuration data to. The resource (and it's parents) may not exist and may have to be created. 
+     * @return true if the data was delete. false if deleting the data was not accepted by this persistence strategy
+     *      (in case of error throw an exception).
+     */
+    boolean deleteConfiguration(@Nonnull ResourceResolver resourceResolver, @Nonnull String configResourcePath);
+    
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/package-info.java b/src/main/java/org/apache/sling/caconfig/spi/package-info.java
index 8637a08..a2267d6 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/package-info.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/package-info.java
@@ -19,5 +19,5 @@
 /**
  * SPI for applications hooking into the configuration infrastructure for parameterizing and customizing.
  */
-@org.osgi.annotation.versioning.Version("2.0.0")
+@org.osgi.annotation.versioning.Version("2.1.0")
 package org.apache.sling.caconfig.spi;

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

[sling-org-apache-sling-caconfig-spi] 12/15: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-caconfig-spi.git

commit cd9e76293c8891a8c6a062a64fa60e0ebd9984be
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri May 26 07:27:44 2017 +0000

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

diff --git a/pom.xml b/pom.xml
index 40c0854..01a7afa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,14 +29,14 @@
     
     <artifactId>org.apache.sling.caconfig.spi</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.2</version>
+    <version>1.3.3-SNAPSHOT</version>
     <name>Apache Sling Context-Aware Configuration SPI</name>
     <description>Apache Sling Context-Aware Configuration SPI</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.caconfig.spi-1.3.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/caconfig/spi</url>
     </scm>
     
     <build>

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

[sling-org-apache-sling-caconfig-spi] 06/15: [maven-release-plugin] prepare release org.apache.sling.caconfig.spi-1.3.0

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-caconfig-spi.git

commit dbb4da3de9978f1f6171d013a55afc8d125ce1e7
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 20 22:35:29 2017 +0000

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

diff --git a/pom.xml b/pom.xml
index 18a8707..2adb6a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,14 +29,14 @@
     
     <artifactId>org.apache.sling.caconfig.spi</artifactId>
     <packaging>bundle</packaging>
-    <version>1.2.1-SNAPSHOT</version>
+    <version>1.3.0</version>
     <name>Apache Sling Context-Aware Configuration SPI</name>
     <description>Apache Sling Context-Aware Configuration SPI</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/caconfig/spi</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.caconfig.spi-1.3.0</url>
     </scm>
     
     <build>

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

[sling-org-apache-sling-caconfig-spi] 11/15: [maven-release-plugin] prepare release org.apache.sling.caconfig.spi-1.3.2

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-caconfig-spi.git

commit 66822154a2709fd667d36f923c28ffe8edb102c7
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri May 26 07:27:29 2017 +0000

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

diff --git a/pom.xml b/pom.xml
index 71e98bb..40c0854 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,14 +29,14 @@
     
     <artifactId>org.apache.sling.caconfig.spi</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.1-SNAPSHOT</version>
+    <version>1.3.2</version>
     <name>Apache Sling Context-Aware Configuration SPI</name>
     <description>Apache Sling Context-Aware Configuration SPI</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/caconfig/spi</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/caconfig/spi</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.caconfig.spi-1.3.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.caconfig.spi-1.3.2</url>
     </scm>
     
     <build>

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

[sling-org-apache-sling-caconfig-spi] 02/15: 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-caconfig-spi.git

commit eb6a25d5780b7296e549eb27e45a06cfe339e004
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 7feb182..18a8707 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,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-caconfig-spi] 04/15: SLING-6674 Context-Aware Config: Separate exception when persist failes due to missing access rights

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-caconfig-spi.git

commit 6e63048f647c5c7a113117632ec640dab0ee568c
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 20 14:12:17 2017 +0000

    SLING-6674 Context-Aware Config: Separate exception when persist failes due to missing access rights
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1787777 13f79535-47bb-0310-9956-ffa450edef68
---
 ...on.java => ConfigurationPersistenceAccessDeniedException.java} | 8 ++++----
 .../sling/caconfig/spi/ConfigurationPersistenceException.java     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java
similarity index 73%
copy from src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
copy to src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java
index 207162f..a152808 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java
@@ -21,17 +21,17 @@ package org.apache.sling.caconfig.spi;
 import org.osgi.annotation.versioning.ProviderType;
 
 /**
- * Is thrown when configuration cannot be persisted.
+ * Is thrown when configuration cannot be persisted because the user is not allowed to write to repository.
  */
 @ProviderType
-public final class ConfigurationPersistenceException extends RuntimeException {
+public final class ConfigurationPersistenceAccessDeniedException extends ConfigurationPersistenceException {
     private static final long serialVersionUID = 1L;
 
-    public ConfigurationPersistenceException(String message, Throwable cause) {
+    public ConfigurationPersistenceAccessDeniedException(String message, Throwable cause) {
         super(message, cause);
     }
 
-    public ConfigurationPersistenceException(String message) {
+    public ConfigurationPersistenceAccessDeniedException(String message) {
         super(message);
     }
 
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
index 207162f..c800e00 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
@@ -24,7 +24,7 @@ import org.osgi.annotation.versioning.ProviderType;
  * Is thrown when configuration cannot be persisted.
  */
 @ProviderType
-public final class ConfigurationPersistenceException extends RuntimeException {
+public class ConfigurationPersistenceException extends RuntimeException {
     private static final long serialVersionUID = 1L;
 
     public ConfigurationPersistenceException(String message, Throwable cause) {

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

[sling-org-apache-sling-caconfig-spi] 09/15: update sling-mock dependency

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-caconfig-spi.git

commit 8840fd775d8fa9176eb138f4880cf9bb92eed937
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Mar 30 19:40:58 2017 +0000

    update sling-mock dependency
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1789557 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7ac027d..71e98bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>1.9.0</version>
+            <version>1.9.6</version>
             <scope>test</scope>
         </dependency>
         <dependency>

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

[sling-org-apache-sling-caconfig-spi] 13/15: 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-caconfig-spi.git

commit 6e1eb6e2e05669d31df266b0ccb3f65a7ec7ed24
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 14:54:50 2017 +0000

    SLING-7167 Adjust READMEs
    
    remove outdated information
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810383 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/README.txt b/README.txt
index 44b35b9..6be0e8d 100644
--- a/README.txt
+++ b/README.txt
@@ -1,25 +1 @@
 Apache Sling Context-Aware Configuration SPI
-
-
-Getting Started
-===============
-
-This component uses a Maven 3 (http://maven.apache.org/) build
-environment. It requires a Java 7 JDK (or higher) and Maven (http://maven.apache.org/)
-3.3.9 or later. We recommend to use the latest Maven version.
-
-If you have Maven 3 installed, you can compile and
-package the jar using the following command:
-
-    mvn package
-
-See the Maven 3 documentation for other build features.
-
-The latest source code for this component is available in the
-Subversion (http://subversion.tigris.org/) source repository of
-the Apache Software Foundation. If you have Subversion installed,
-you can checkout the latest source using the following command:
-
-    svn checkout https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/contextaware-config/spi
-
-See the Subversion documentation for other source control features.

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

[sling-org-apache-sling-caconfig-spi] 15/15: 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-caconfig-spi.git

commit 226d8bbb1ae4a6e7e65f096504e4c0bc8392622c
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 09:53:52 2017 +0000

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

diff --git a/README.md b/README.md
index 6be0e8d..ef6a3de 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
-Apache Sling Context-Aware Configuration SPI
+# Apache Sling Context-Aware Configuration SPI
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.

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

[sling-org-apache-sling-caconfig-spi] 05/15: SLING-6669 use resource path instead of resource object for getConfigName* methods in ConfigurationPersistenceStrategy2 SPI

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-caconfig-spi.git

commit 4566ab73594db6653cb9b4518beed73ebe9f2573
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 20 17:16:46 2017 +0000

    SLING-6669 use resource path instead of resource object for getConfigName* methods in ConfigurationPersistenceStrategy2 SPI
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1787813 13f79535-47bb-0310-9956-ffa450edef68
---
 .../caconfig/spi/ConfigurationPersistenceStrategy2.java      | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java
index 854fd5c..d338103 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy2.java
@@ -84,31 +84,31 @@ public interface ConfigurationPersistenceStrategy2 {
      * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
      * e.g. fetching the data from a child resource instead of the given resource. 
      * @param configName Configuration name
-     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     * @param relatedConfigPath Path of a configuration resource that was resolved in context of this configuration name.
      *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
      * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
      */
-    @CheckForNull String getConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+    @CheckForNull String getConfigName(@Nonnull String configName, @CheckForNull String relatedConfigPath);
     
     /**
      * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
      * e.g. fetching the data from a child resource instead of the given resource. 
      * @param configName Configuration name
-     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     * @param relatedConfigPath Path of a configuration resource that was resolved in context of this configuration name.
      *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
      * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
      */
-    @CheckForNull String getCollectionParentConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+    @CheckForNull String getCollectionParentConfigName(@Nonnull String configName, @CheckForNull String relatedConfigPath);
 
     /**
      * Allows the strategy to transform the given configuration name for nested configurations according to it's persistent strategies,
      * e.g. fetching the data from a child resource instead of the given resource. 
      * @param configName Configuration name
-     * @param relatedConfigResource A configuration resource that was resolved in context of this configuration name.
+     * @param relatedConfigPath Path of a configuration resource that was resolved in context of this configuration name.
      *     This can be used to detect if the persistence strategy supports the configuration location. If null it should be assumed that it matches.
      * @return Transformed configuration name. If null is returned this strategy does not support the given configuration resource path.
      */
-    @CheckForNull String getCollectionItemConfigName(@Nonnull String configName, @CheckForNull Resource relatedConfigResource);
+    @CheckForNull String getCollectionItemConfigName(@Nonnull String configName, @CheckForNull String relatedConfigPath);
     
     /**
      * Stores configuration data for a singleton configuration resource.

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