sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpet...@apache.org
Subject svn commit: r1650034 [2/2] - in /sling/trunk/contrib/extensions/distribution: core/src/main/java/org/apache/sling/distribution/agent/impl/ core/src/main/java/org/apache/sling/distribution/component/impl/ core/src/main/java/org/apache/sling/distribution...
Date Wed, 07 Jan 2015 11:02:34 GMT
Added: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProviderFactory.java?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProviderFactory.java
(added)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProviderFactory.java
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sling.distribution.resources.impl;
+
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.distribution.component.impl.DistributionComponentProvider;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@Component(label = "Distribution Service Resource Provider Factory",
+        description = "Distribution Service Resource Provider Factory",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE,
+        metatype = true)
+@Service(value = ResourceProviderFactory.class)
+@Properties({
+        @Property(name = ResourceProvider.ROOTS),
+        @Property(name = ResourceProvider.OWNS_ROOTS, boolValue = true, propertyPrivate =
true)
+})
+public class DistributionServiceResourceProviderFactory implements ResourceProviderFactory
{
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+
+    @Property
+    public final static String KIND = DistributionComponentUtils.PN_KIND;
+
+    /**
+     * resourceProperties contains the list of properties returned by this provider.
+     * Properties can be configured for the main resource, for the root resource and for
child resources.
+     * Root resource properties are static and can be configured as follows:
+     * ../rootResourcePropertyName = rootResourcePropertyValue
+     * <p/>
+     * Main resource properties can be static or dynamic (depending on the underlying resource)
are configured as follows:
+     * mainResourceStaticPropertyName = mainResourceStaticPropertyValue
+     * mainResourceDynamicPropertyName = {mainResourceSourcePropertyName}
+     * <p/>
+     * Child resource properties are static an can be configured as follows:
+     * childResourceName/childResourcePropertyName=childResourcePropertyValue
+     */
+    @Property(cardinality = Integer.MAX_VALUE)
+    public final static String RESOURCE_PROPERTIES = "resourceProperties";
+
+    @Reference
+    DistributionComponentProvider componentProvider;
+
+    private ResourceProvider resourceProvider;
+
+    @Activate
+    public void activate(BundleContext context, Map<String, Object> properties) {
+
+        log.debug("activating resource provider with config {}", properties);
+
+        String kind = PropertiesUtil.toString(properties.get(KIND), null);
+        String resourceRoot = PropertiesUtil.toString(properties.get(ResourceProvider.ROOTS),
null);
+
+
+        Map<String, String> additionalResourceProperties = PropertiesUtil.toMap(properties.get(RESOURCE_PROPERTIES),
new String[0]);
+
+        resourceProvider = new DistributionServiceResourceProvider(kind,
+                componentProvider,
+                resourceRoot,
+                additionalResourceProperties);
+
+        log.debug("created resource provider {}", resourceProvider);
+    }
+
+    @Deactivate
+    public void deactivate(BundleContext context) {
+
+    }
+
+    public ResourceProvider getResourceProvider(Map<String, Object> authenticationInfo)
throws LoginException {
+        return resourceProvider;
+    }
+
+    public ResourceProvider getAdministrativeResourceProvider(Map<String, Object> authenticationInfo)
throws LoginException {
+        return getResourceProvider(authenticationInfo);
+    }
+}

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiUtils.java?rev=1650034&r1=1650033&r2=1650034&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiUtils.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiUtils.java
Wed Jan  7 11:02:33 2015
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.distribution.resources.impl;
 
+import java.util.Arrays;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -142,15 +143,23 @@ public class OsgiUtils {
             }
 
             Class valueClass = entry.getValue().getClass();
+            Object value = entry.getValue();
             if (valueClass.isArray()) {
                 valueClass = valueClass.getComponentType();
+
+                // fix string arrays that come as Object[]
+                if (valueClass.equals(Object.class)) {
+                    Object[] array = (Object[]) value;
+                    value = Arrays.asList(array).toArray(new String[array.length]);
+                    valueClass = String.class;
+                }
             }
 
             if (valueClass.isPrimitive()
                     || valueClass.equals(String.class)
                     || valueClass.equals(Boolean.class)
                     || valueClass.equals(Integer.class)) {
-                result.put(entry.getKey(), entry.getValue());
+                result.put(entry.getKey(), value);
             }
         }
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java?rev=1650034&r1=1650033&r2=1650034&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java
Wed Jan  7 11:02:33 2015
@@ -131,8 +131,6 @@ public abstract class AbstractModifyingR
             properties.putAll(existingResource);
         }
 
-        newProperties = unbindMainResourceProperties(newProperties);
-
         if (newProperties != null) {
             properties.putAll(newProperties);
         }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java?rev=1650034&r1=1650033&r2=1650034&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java
Wed Jan  7 11:02:33 2015
@@ -104,11 +104,14 @@ public abstract class AbstractReadableRe
         } else if (pathInfo.isMain()) {
             Map<String, Object> properties = getMainResourceProperties(pathInfo.getMainResourceName());
 
+            Map<String, String> additionalProperties = additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
+            if (!properties.containsKey("sling:resourceType") && additionalProperties.containsKey("sling:resourceType"))
{
+                properties.put("sling:resourceType", additionalProperties.get("sling:resourceType"));
+            }
+
             if (properties != null) {
                 Object adaptable = properties.remove(ADAPTABLE_PROPERTY_NAME);
 
-                properties = bindMainResourceProperties(properties);
-
                 resource = buildMainResource(resourceResolver, pathInfo, properties, adaptable);
             }
         } else if (pathInfo.isChild()) {
@@ -131,68 +134,6 @@ public abstract class AbstractReadableRe
         return getResourceProperties(resourceName);
     }
 
-    /**
-     * Binds the variables in the resource property templates to the properties.
-     * Template: resourcePropertyName = "{osgiPropertyName}"
-     * Property: osgiPropertyName = osgiPropertyValue
-     * Result: resourcePropertyName = osgiPropertyValue
-     *
-     * @param properties the properties to bind
-     * @return
-     */
-    Map<String, Object> bindMainResourceProperties(Map<String, Object> properties)
{
-        Map<String, Object> result = new HashMap<String, Object>();
-
-        Map<String, String> resourcePropertyTemplates = additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
-
-        for (Map.Entry<String, String> propertyTemplateEntry : resourcePropertyTemplates.entrySet())
{
-            String templateName = propertyTemplateEntry.getKey();
-            String templateValue = propertyTemplateEntry.getValue();
-
-            Object propertyValue = templateValue;
-            if (templateValue.startsWith("{") && templateValue.endsWith("}")) {
-                String propertyName = templateValue.substring(1, templateValue.length() -
1);
-                propertyValue = properties.get(propertyName);
-            }
-
-            if (propertyValue != null) {
-                result.put(templateName, propertyValue);
-            }
-
-
-        }
-        return fixMap(result);
-    }
-
-    /**
-     * Unbinds the variables in the resource property templates to the properties.
-     * Template: resourcePropertyName = "{osgiPropertyName}"
-     * Property: resourcePropertyName = osgiPropertyValue
-     * Result: osgiPropertyName = osgiPropertyValue
-     *
-     * @param properties the properties to unbind
-     * @return
-     */
-    Map<String, Object> unbindMainResourceProperties(Map<String, Object> properties)
{
-        Map<String, Object> result = new HashMap<String, Object>();
-
-        Map<String, String> resourcePropertyTemplates = additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
-
-        for (Map.Entry<String, String> propertyTemplateEntry : resourcePropertyTemplates.entrySet())
{
-            String templateName = propertyTemplateEntry.getKey();
-            String templateValue = propertyTemplateEntry.getValue();
-
-            if (templateValue.startsWith("{") && templateValue.endsWith("}")) {
-                String propertyName = templateValue.substring(1, templateValue.length() -
1);
-                Object propertyValue = properties.get(templateName);
-                if (propertyValue != null) {
-                    result.put(propertyName, propertyValue);
-                }
-            }
-        }
-        return fixMap(result);
-    }
-
     Resource buildMainResource(ResourceResolver resourceResolver,
                                SimplePathInfo pathInfo,
                                Map<String, Object> properties,
@@ -221,45 +162,6 @@ public abstract class AbstractReadableRe
     }
 
 
-    private static <K, V> Map<String, Object> fixMap(Map<K, V> map) {
-        Map<String, Object> result = new HashMap<String, Object>();
-        for (Map.Entry<K, V> entry : map.entrySet()) {
-            K key = entry.getKey();
-            V value = entry.getValue();
-
-            if (!(key instanceof String)) continue;
-            if (!isAcceptedType(value.getClass())) continue;
-
-            String fixedKey = (String) key;
-            Object fixedValue = value;
-            if (fixedValue.getClass().isArray()) {
-                Class componentType = fixedValue.getClass().getComponentType();
-
-                if (!isAcceptedType(componentType)) {
-                    Object[] array = (Object[]) value;
-                    if (array == null || array.length == 0) {
-                        continue;
-                    }
-                    fixedValue = Arrays.asList(array).toArray(new String[array.length]);
-                }
-            }
-
-            if (fixedKey == null || fixedValue == null) {
-                continue;
-            }
-
-
-            result.put(fixedKey, fixedValue);
-        }
-
-        return result;
-    }
-
-    private static <T> boolean isAcceptedType(Class<T> clazz) {
-        return clazz.isPrimitive() || clazz == String.class || clazz.isArray();
-    }
-
-
     protected abstract Map<String, Object> getResourceProperties(String resourceName);
 
     protected abstract Map<String, Object> getResourceRootProperties();

Modified: sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionIntegrationTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionIntegrationTestBase.java?rev=1650034&r1=1650033&r2=1650034&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionIntegrationTestBase.java
(original)
+++ sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionIntegrationTestBase.java
Wed Jan  7 11:02:33 2015
@@ -72,10 +72,15 @@ public abstract class DistributionIntegr
             assertExists(authorClient, authorAgentConfigUrl("publish-multiple"));
             setArrayProperties(author, authorAgentConfigUrl("publish-multiple"),
                     "packageImporter.endpoints", remoteImporterUrl, remoteImporterUrl + "badaddress");
+
+
+            Thread.sleep(3000);
+
             assertExists(authorClient, agentUrl("publish-multiple"));
 
 
 
+
             assertExists(authorClient, authorAgentConfigUrl("publish-reverse"));
 
             String remoteExporterUrl = publish.getServerBaseUrl() + exporterUrl("reverse");

Modified: sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionUtils.java?rev=1650034&r1=1650033&r2=1650034&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionUtils.java
(original)
+++ sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionUtils.java
Wed Jan  7 11:02:33 2015
@@ -197,11 +197,11 @@ public class DistributionUtils {
     }
 
     public static String authorAgentConfigUrl(String agentName) {
-        return DISTRIBUTION_ROOT_PATH + "/settings.author/agents/" + agentName;
+        return DISTRIBUTION_ROOT_PATH + "/settings/agents/" + agentName;
     }
 
     public static String publishAgentConfigUrl(String agentName) {
-        return DISTRIBUTION_ROOT_PATH + "/settings.publish/agents/" + agentName;
+        return DISTRIBUTION_ROOT_PATH + "/settings/agents/" + agentName;
     }
 
 

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-multiple/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish-multiple.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-multiple/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish-multiple.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-multiple/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish-multiple.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-multiple/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish-multiple.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,18 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish-multiple",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageBuilder.target": "(name=vlt)",
+
+    "transportSecretProvider.target" : "(name=publishAdmin)",
+
+    "packageImporter.endpoints" : [
+        "endpoint1=http://localhost:4503/libs/sling/distribution/services/importers/default",
+        "endpoint2=http://localhost:4503/libs/sling/distribution/services/importers/defaultbadaddress"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-publish-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-publish-reverse.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-publish-reverse.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-publish-reverse.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,19 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish-reverse",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageBuilder.target": "(name=vlt)",
+
+    "transportSecretProvider.target" : "(name=publishAdmin)",
+
+    "packageExporter.endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/exporters/reverse"
+    ],
+
+    "triggers.target": "(name=publish-reverse-scheduled)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,10 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish-reverse-scheduled",
+
+    "type": "scheduledEvent",
+    "action": "pull",
+    "seconds": "30"
+
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/publish/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,17 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageBuilder.target": "(name=vlt)",
+
+    "transportSecretProvider.target" : "(name=publishAdmin)",
+
+    "packageImporter.endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/importers/default"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-pubsync.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-pubsync.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-pubsync.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-pubsync.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,25 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "pubsync",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageExporter.endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/exporters/reverse-pubsync",
+        "http://localhost:4504/libs/sling/distribution/services/exporters/reverse-pubsync",
+        "http://localhost:4505/libs/sling/distribution/services/exporters/reverse-pubsync"
+    ],
+
+    "packageImporter.endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/importers/default",
+        "http://localhost:4504/libs/sling/distribution/services/importers/default",
+        "http://localhost:4505/libs/sling/distribution/services/importers/default"
+
+    ],
+
+    "packageBuilder.target" : "(name=vlt)",
+    "transportSecretProvider.target" : "(name=publishAdmin)",
+
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-pubsync-scheduled-trigger.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-pubsync-scheduled-trigger.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-pubsync-scheduled-trigger.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/pubsync/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-pubsync-scheduled-trigger.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,10 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "pubsync-scheduled-trigger",
+
+    "type": "scheduledEvent",
+    "action": "poll",
+    "seconds": "30"
+
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-cache-flush.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-cache-flush.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-cache-flush.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-cache-flush.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,9 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "cache-flush",
+
+    "enabled" : false,
+
+    "requestAuthorizationStrategy.target" : "privilegeRead"
+
+}

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.packaging.impl.importer.AdvancedRemoteDistributionPackageImporter-cache-flush.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.packaging.impl.importer.AdvancedRemoteDistributionPackageImporter-cache-flush.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.packaging.impl.importer.AdvancedRemoteDistributionPackageImporter-cache-flush.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/cache-flush/org.apache.sling.distribution.packaging.impl.importer.AdvancedRemoteDistributionPackageImporter-cache-flush.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,13 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "cache-flush",
+    "parent.name": "cache-flush",
+    "useCustomHeaders": true,
+    "customHeaders": [
+        "Path: {path}",
+        "add -> Action : REFRESH",
+        "delete -> Change : REMOVE" ],
+    "useCustomBody": true,
+    "customBody": "",
+    "endpoints": [ "http://localhost:8000/invalidatecache" ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,8 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "reverse",
+
+    "packageBuilder.target" : "(name=vlt)",
+
+    "agent.target": "(name=reverse)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-default.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-default.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-default.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-default.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,6 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "default",
+
+    "packageBuilder.target" : "(name=vlt)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,6 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "default",
+
+    "packageBuilder.target" : "(name=vlt)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse-pubsync/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse-pubsync.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse-pubsync/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse-pubsync.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse-pubsync/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse-pubsync.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse-pubsync/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse-pubsync.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,10 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "reverse-pubsync",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageBuilder.target" : "(name=vlt)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,13 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "reverse",
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageBuilder.target" : "(name=vlt)",
+
+    "triggers.target": "(name=reverse-userGeneratedContent)"
+
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-reverse-userGeneratedContent.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-reverse-userGeneratedContent.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-reverse-userGeneratedContent.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-reverse-userGeneratedContent.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,10 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "reverse-userGeneratedContent",
+
+    "type" : "jcrEvent",
+    "path" : "/content/usergenerated",
+    "servicename" : "distributionService"
+
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-agents.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-agents.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-agents.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-agents.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,11 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "provider.roots": [ "/libs/sling/distribution/services/agents" ],
+    "kind" : "agent",
+    "resourceProperties": [
+        "sling:resourceType=sling/distribution/service/agent",
+        "sling:resourceSuperType=sling/distribution/service",
+
+        "queue/sling:resourceType=sling/distribution/service/agent/queue"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-exporters.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-exporters.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-exporters.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-exporters.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,9 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "provider.roots": [ "/libs/sling/distribution/services/exporters" ],
+    "kind" : "exporter",
+    "resourceProperties": [
+        "sling:resourceType=sling/distribution/service/exporter",
+        "sling:resourceSuperType=sling/distribution/service"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-importers.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-importers.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-importers.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-importers.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,10 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "distributionImporters",
+    "provider.roots": [ "/libs/sling/distribution/services/importers" ],
+    "kind" : "importer",
+    "resourceProperties": [
+        "sling:resourceType=sling/distribution/service/importer",
+        "sling:resourceSuperType=sling/distribution/service"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-triggers.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-triggers.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-triggers.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/services/org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory-triggers.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,9 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "provider.roots": [ "/libs/sling/distribution/services/triggers" ],
+    "kind" : "trigger",
+    "resourceProperties": [
+        "sling:resourceType=sling/distribution/service/trigger",
+        "sling:resourceSuperType=sling/distribution/service"
+    ]
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/settings/org.apache.sling.distribution.resources.impl.DistributionConfigurationResourceProviderFactory-agents.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/settings/org.apache.sling.distribution.resources.impl.DistributionConfigurationResourceProviderFactory-agents.json?rev=1650034&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/settings/org.apache.sling.distribution.resources.impl.DistributionConfigurationResourceProviderFactory-agents.json
(added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install/resources/settings/org.apache.sling.distribution.resources.impl.DistributionConfigurationResourceProviderFactory-agents.json
Wed Jan  7 11:02:33 2015
@@ -0,0 +1,9 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "provider.roots": [ "/libs/sling/distribution/settings/agents" ],
+    "kind" : "agent",
+    "resourceProperties": [
+        "sling:resourceType=sling/distribution/setting/agent",
+        "sling:resourceSuperType=sling/distribution/setting"
+    ]
+}
\ No newline at end of file



Mime
View raw message