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

rombert pushed a commit to annotated tag org.apache.sling.caconfig.spi-1.2.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-caconfig-spi.git

commit 01df4f37d2b6bf39e99d4826af23cb9f3ad504cb
Author: Stefan Seifert <[email protected]>
AuthorDate: Sat Nov 19 11:37:44 2016 +0000

    SLING-6303 Context-Aware Config: Persisting configuration resource 
collections with names
    
    (!) this breaks backward compatibility of both 
org.apache.sling.caconfig.spi and org.apache.sling.caconfig.management
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/contextaware-config/spi@1770484
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../spi/ConfigurationPersistenceStrategy.java      | 14 +++++---
 ...ckage-info.java => ResourceCollectionItem.java} | 40 ++++++++++++++++++++--
 .../apache/sling/caconfig/spi/package-info.java    |  2 +-
 3 files changed, 47 insertions(+), 9 deletions(-)

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 6dfca6f..b9522c9 100644
--- 
a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
+++ 
b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceStrategy.java
@@ -49,7 +49,8 @@ public interface ConfigurationPersistenceStrategy {
      * @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 properties Configuration properties
-     * @return true if the data was persisted. false if persisting the data 
was not accepted by this persistence strategy (but in case of error throw an 
exception).
+     * @return true if the data was persisted. false if persisting the data 
was not accepted by this persistence strategy
+     *      (but in case of error throw an exception).
      */
     boolean persist(@Nonnull ResourceResolver resourceResolver,
             @Nonnull String configResourcePath, @Nonnull Map<String,Object> 
properties);
@@ -58,11 +59,14 @@ public interface ConfigurationPersistenceStrategy {
      * 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 propertiesCollection Configuration properties
-     * @return true if the data was persisted. false if persisting the data 
was not accepted by this persistence strategy (but in case of error throw an 
exception).
+     * @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 resourceCollectionItems Resource collection items to be stored.
+     *      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
+     *      (but in case of error throw an exception).
      */
     boolean persistCollection(@Nonnull ResourceResolver resourceResolver,
-            @Nonnull String configResourceCollectionParentPath, @Nonnull 
Collection<Map<String,Object>> propertiesCollection);
+            @Nonnull String configResourceCollectionParentPath, @Nonnull 
Collection<ResourceCollectionItem> resourceCollectionItems);
     
 }
diff --git a/src/main/java/org/apache/sling/caconfig/spi/package-info.java 
b/src/main/java/org/apache/sling/caconfig/spi/ResourceCollectionItem.java
similarity index 50%
copy from src/main/java/org/apache/sling/caconfig/spi/package-info.java
copy to src/main/java/org/apache/sling/caconfig/spi/ResourceCollectionItem.java
index 69d6ad1..ca6f37e 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/package-info.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ResourceCollectionItem.java
@@ -16,8 +16,42 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.sling.caconfig.spi;
+
+import java.util.Map;
+
+import org.osgi.annotation.versioning.ProviderType;
+
 /**
- * SPI for applications hooking into the configuration infrastructure for 
parameterizing and customizing.
+ * Name and values for persisting resource collection items.
  */
[email protected]("1.1.0")
-package org.apache.sling.caconfig.spi;
+@ProviderType
+public final class ResourceCollectionItem {
+    
+    private final String collectionItemName;
+    private final Map<String,Object> values;
+    
+    /**
+     * @param collectionItemName Resource collection item name
+     * @param values Values
+     */
+    public ResourceCollectionItem(String collectionItemName, Map<String, 
Object> values) {
+        this.collectionItemName = collectionItemName;
+        this.values = values;
+    }
+
+    /**
+     * @return Resource collection item name
+     */
+    public String getCollectionItemName() {
+        return collectionItemName;
+    }
+
+    /**
+     * @return Values
+     */
+    public Map<String, Object> getValues() {
+        return values;
+    }
+
+}
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 69d6ad1..8637a08 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.
  */
[email protected]("1.1.0")
[email protected]("2.0.0")
 package org.apache.sling.caconfig.spi;

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to