sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpet...@apache.org
Subject svn commit: r1641561 [2/3] - in /sling/trunk/contrib/extensions/distribution: api/src/main/java/org/apache/sling/distribution/agent/ api/src/main/java/org/apache/sling/distribution/component/ api/src/main/java/org/apache/sling/distribution/packaging/ a...
Date Tue, 25 Nov 2014 10:16:10 GMT
Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java Tue Nov 25 10:16:08 2014
@@ -19,8 +19,6 @@
 package org.apache.sling.distribution.packaging.impl.exporter;
 
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -31,19 +29,16 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.PropertyOption;
 import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.distribution.communication.DistributionRequest;
-import org.apache.sling.distribution.component.DistributionComponent;
-import org.apache.sling.distribution.component.DistributionComponentProvider;
-import org.apache.sling.distribution.component.impl.DefaultDistributionComponentFactoryConstants;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
 import org.apache.sling.distribution.component.impl.DistributionComponentManager;
-import org.apache.sling.distribution.component.impl.SettingsUtils;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageExportException;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
 import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,30 +50,30 @@ import org.slf4j.LoggerFactory;
         metatype = true,
         configurationFactory = true,
         specVersion = "1.1",
-        policy = ConfigurationPolicy.REQUIRE)
+        policy = ConfigurationPolicy.REQUIRE,
+        immediate = true
+)
 @Service(value = DistributionPackageExporter.class)
-public class RemoteDistributionPackageExporterFactory implements DistributionPackageExporter, DistributionComponentProvider {
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DefaultDistributionComponentFactoryConstants.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
+public class RemoteDistributionPackageExporterFactory implements DistributionPackageExporter {
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(value = DefaultDistributionComponentFactoryConstants.PACKAGE_EXPORTER_REMOTE, propertyPrivate = true)
-    private static final String TYPE = DefaultDistributionComponentFactoryConstants.COMPONENT_TYPE;
-
+    /**
+     * name of this component.
+     */
     @Property
-    private static final String NAME = DefaultDistributionComponentFactoryConstants.COMPONENT_NAME;
-
-    @Property(name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
-    @Reference(name = "TransportAuthenticationProvider", policy = ReferencePolicy.STATIC)
-    private volatile TransportAuthenticationProvider transportAuthenticationProvider;
-
-    @Property(cardinality = 100)
-    public static final String ENDPOINTS = DefaultDistributionComponentFactoryConstants.PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS;
-
-    @Property(name = "pull items", description = "number of subsequent pull requests to make", intValue = 1)
-    public static final String PULL_ITEMS = "pull.items";
+    public static final String NAME = DistributionComponentUtils.NAME;
 
+    /**
+     * endpoints property
+     */
+    @Property(cardinality = -1)
+    public static final String ENDPOINTS = "endpoints";
+
+    /**
+     * endpoint strategy property
+     */
     @Property(options = {
             @PropertyOption(name = "All",
                     value = "all endpoints"
@@ -88,11 +83,21 @@ public class RemoteDistributionPackageEx
             )},
             value = "One"
     )
-    private static final String ENDPOINT_STRATEGY = DefaultDistributionComponentFactoryConstants.PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY;
+    public static final String ENDPOINTS_STRATEGY = "endpoints.strategy";
 
+    /**
+     * no. of items to poll property
+     */
+    @Property(name = "pull items", description = "number of subsequent pull requests to make", intValue = 1)
+    public static final String PULL_ITEMS = "pull.items";
 
-    @Property(label = "Package Builder Properties", cardinality = 100)
-    public static final String PACKAGE_BUILDER = DefaultDistributionComponentFactoryConstants.COMPONENT_PACKAGE_BUILDER;
+    @Property(name = "packageBuilder.target")
+    @Reference(name = "packageBuilder")
+    DistributionPackageBuilder packageBuilder;
+
+    @Property(name = "transportAuthenticationProvider.target")
+    @Reference(name = "transportAuthenticationProvider")
+    TransportAuthenticationProvider transportAuthenticationProvider;
 
     @Reference
     private DistributionComponentManager componentManager;
@@ -101,12 +106,13 @@ public class RemoteDistributionPackageEx
 
     @Activate
     protected void activate(Map<String, Object> config) throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
-        properties.putAll(config);
-        String[] packageBuilderProperties = PropertiesUtil.toStringArray(config.get(PACKAGE_BUILDER));
-        properties.put(PACKAGE_BUILDER, SettingsUtils.parseLines(packageBuilderProperties));
 
-        exporter = componentManager.createComponent(DistributionPackageExporter.class, properties, this);
+
+        String[] endpoints = PropertiesUtil.toStringArray(config.get(ENDPOINTS), new String[0]);
+        String endpointStrategyName = PropertiesUtil.toString(config.get(ENDPOINTS_STRATEGY), "One");
+        int pollItems = PropertiesUtil.toInteger(config.get(PULL_ITEMS), Integer.MAX_VALUE);
+
+        exporter = new RemoteDistributionPackageExporter(packageBuilder, transportAuthenticationProvider, endpoints, endpointStrategyName, pollItems);
     }
 
 
@@ -124,12 +130,5 @@ public class RemoteDistributionPackageEx
         return exporter.getPackage(resourceResolver, distributionPackageId);
     }
 
-    public <ComponentType extends DistributionComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
-                                                                                   @Nullable String componentName) {
-        if (type.isAssignableFrom(TransportAuthenticationProvider.class)) {
-            return (ComponentType) transportAuthenticationProvider;
-        }
 
-        return null;
-    }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java Tue Nov 25 10:16:08 2014
@@ -34,7 +34,6 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.distribution.component.impl.DefaultDistributionComponentFactoryConstants;
 import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageImportException;
@@ -58,13 +57,12 @@ import org.slf4j.LoggerFactory;
         policy = ConfigurationPolicy.REQUIRE)
 @Service(value = DistributionPackageImporter.class)
 public class AdvancedRemoteDistributionPackageImporter implements DistributionPackageImporter {
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DefaultDistributionComponentFactoryConstants.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
-    @Reference(name = "TransportAuthenticationProvider", policy = ReferencePolicy.DYNAMIC)
+    @Property(name = "transportAuthenticationProvider.target")
+    @Reference(name = "transportAuthenticationProvider")
     private volatile TransportAuthenticationProvider transportAuthenticationProvider;
 
     @Property(cardinality = 100)

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java Tue Nov 25 10:16:08 2014
@@ -20,7 +20,6 @@ package org.apache.sling.distribution.pa
 
 import javax.annotation.Nonnull;
 import java.io.InputStream;
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.felix.scr.annotations.Activate;
@@ -30,13 +29,12 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.distribution.component.impl.DefaultDistributionComponentFactoryConstants;
-import org.apache.sling.distribution.component.impl.DistributionComponentManager;
-import org.apache.sling.distribution.component.impl.SettingsUtils;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageImportException;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,30 +51,26 @@ import org.slf4j.LoggerFactory;
 public class LocalDistributionPackageImporterFactory implements DistributionPackageImporter {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(value = DefaultDistributionComponentFactoryConstants.PACKAGE_IMPORTER_LOCAL, propertyPrivate = true)
-    private static final String TYPE = DefaultDistributionComponentFactoryConstants.COMPONENT_TYPE;
-
+    /**
+     * name of this component.
+     */
     @Property
-    private static final String NAME = DefaultDistributionComponentFactoryConstants.COMPONENT_NAME;
-
+    public static final String NAME = DistributionComponentUtils.NAME;
 
-    @Property(label = "Package Builder Properties", cardinality = 100)
-    public static final String PACKAGE_BUILDER = DefaultDistributionComponentFactoryConstants.COMPONENT_PACKAGE_BUILDER;
+    @Property(name = "packageBuilder.target")
+    @Reference(name = "packageBuilder")
+    DistributionPackageBuilder packageBuilder;
 
     @Reference
-    private DistributionComponentManager componentManager;
+    DistributionEventFactory distributionEventFactory;
 
 
     private DistributionPackageImporter importer;
 
     @Activate
     public void activate(Map<String, Object> config) {
-        Map<String, Object> properties = new HashMap<String, Object>();
-        properties.putAll(config);
-        String[] packageBuilderProperties = PropertiesUtil.toStringArray(config.get(PACKAGE_BUILDER));
-        properties.put(PACKAGE_BUILDER, SettingsUtils.parseLines(packageBuilderProperties));
 
-        importer = componentManager.createComponent(DistributionPackageImporter.class, properties);
+        importer = new LocalDistributionPackageImporter(packageBuilder, distributionEventFactory);
     }
 
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java Tue Nov 25 10:16:08 2014
@@ -19,9 +19,7 @@
 package org.apache.sling.distribution.packaging.impl.importer;
 
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.io.InputStream;
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.felix.scr.annotations.Activate;
@@ -30,12 +28,10 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.PropertyOption;
 import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.distribution.component.DistributionComponent;
-import org.apache.sling.distribution.component.DistributionComponentProvider;
-import org.apache.sling.distribution.component.impl.DefaultDistributionComponentFactoryConstants;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
 import org.apache.sling.distribution.component.impl.DistributionComponentManager;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageImportException;
@@ -53,25 +49,25 @@ import org.slf4j.LoggerFactory;
         specVersion = "1.1",
         policy = ConfigurationPolicy.REQUIRE)
 @Service(value = DistributionPackageImporter.class)
-public class RemoteDistributionPackageImporterFactory implements DistributionPackageImporter, DistributionComponentProvider {
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DefaultDistributionComponentFactoryConstants.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
-
+public class RemoteDistributionPackageImporterFactory implements DistributionPackageImporter {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(value = DefaultDistributionComponentFactoryConstants.PACKAGE_IMPORTER_REMOTE, propertyPrivate = true)
-    private static final String TYPE = DefaultDistributionComponentFactoryConstants.COMPONENT_TYPE;
-
+    /**
+     * name of this component.
+     */
     @Property
-    private static final String NAME = DefaultDistributionComponentFactoryConstants.COMPONENT_NAME;
-
-    @Property(name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
-    @Reference(name = "TransportAuthenticationProvider", policy = ReferencePolicy.STATIC)
-    private volatile TransportAuthenticationProvider transportAuthenticationProvider;
-
-    @Property(cardinality = 100)
-    public static final String ENDPOINTS = DefaultDistributionComponentFactoryConstants.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS;
+    public static final String NAME = DistributionComponentUtils.NAME;
 
+    /**
+     * endpoints property
+     */
+    @Property(cardinality = -1)
+    public static final String ENDPOINTS = "endpoints";
+
+    /**
+     * endpoint strategy property
+     */
     @Property(options = {
             @PropertyOption(name = "All",
                     value = "all endpoints"
@@ -81,8 +77,12 @@ public class RemoteDistributionPackageIm
             )},
             value = "One"
     )
-    private static final String ENDPOINT_STRATEGY = DefaultDistributionComponentFactoryConstants.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY;
+    public static final String ENDPOINTS_STRATEGY = "endpoints.strategy";
+
 
+    @Property(name = "transportAuthenticationProvider.target")
+    @Reference(name = "transportAuthenticationProvider")
+    TransportAuthenticationProvider transportAuthenticationProvider;
     private DistributionPackageImporter importer;
 
     @Reference
@@ -92,10 +92,11 @@ public class RemoteDistributionPackageIm
     @Activate
     protected void activate(Map<String, Object> config) {
 
-        Map<String, Object> properties = new HashMap<String, Object>();
-        properties.putAll(config);
+        String[] endpoints = PropertiesUtil.toStringArray(config.get(ENDPOINTS), new String[0]);
+        String endpointStrategyName = PropertiesUtil.toString(config.get(ENDPOINTS_STRATEGY), "One");
 
-        importer = componentManager.createComponent(DistributionPackageImporter.class, properties, this);
+
+        importer =  new RemoteDistributionPackageImporter(transportAuthenticationProvider, endpoints, endpointStrategyName);
 
     }
 
@@ -106,13 +107,4 @@ public class RemoteDistributionPackageIm
     public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException {
         return importer.importStream(resourceResolver, stream);
     }
-
-    public <ComponentType extends DistributionComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
-                                                                                   @Nullable String componentName) {
-        if (type.isAssignableFrom(TransportAuthenticationProvider.class)) {
-            return (ComponentType) transportAuthenticationProvider;
-        }
-
-        return null;
-    }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java Tue Nov 25 10:16:08 2014
@@ -35,4 +35,6 @@ public class DistributionConstants {
     public static final String IMPORTER_RESOURCE_TYPE = "sling/distribution/service/importer";
     public static final String EXPORTER_RESOURCE_TYPE = "sling/distribution/service/exporter";
 
+    public static final String PN_IS_RESOURCE = "isResource";
+
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java Tue Nov 25 10:16:08 2014
@@ -177,14 +177,9 @@ public class OsgiConfigurationResourcePr
     }
 
     String getFilter(String configName) {
-        if (configName != null) {
-            return "(&(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + OsgiUtils.escape(configFactory) + ")("
-                    + friendlyNameProperty + "=" + OsgiUtils.escape(configName) + "))";
-        } else if (configFactory != null) {
-            return "(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + OsgiUtils.escape(configFactory) + ")";
-        }
 
-        return null;
+        return OsgiUtils.getFilter(configFactory, friendlyNameProperty, configName);
+
     }
 
 
@@ -194,28 +189,11 @@ public class OsgiConfigurationResourcePr
 
 
     private static <K, V> Map<K, V> fromDictionary(Dictionary<K, V> dictionary) {
-        if (dictionary == null) {
-            return null;
-        }
-        Map<K, V> map = new HashMap<K, V>(dictionary.size());
-        Enumeration<K> keys = dictionary.keys();
-        while (keys.hasMoreElements()) {
-            K key = keys.nextElement();
-            map.put(key, dictionary.get(key));
-        }
-        return map;
+        return OsgiUtils.fromDictionary(dictionary);
     }
 
     private static <K, V> Dictionary<K, V> toDictionary(Map<K, V> map) {
-        if (map == null) {
-            return null;
-        }
-        Dictionary<K, V> dictionary = new Hashtable<K, V>(map.size());
-        for (Map.Entry<K, V> entry : map.entrySet()) {
-            dictionary.put(entry.getKey(), entry.getValue());
-        }
-
-        return dictionary;
+        return OsgiUtils.toDictionary(map);
     }
 
     private Map<String, Object> filterBeforeSave(Map<String, Object> properties) {

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java Tue Nov 25 10:16:08 2014
@@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.distribution.resources.DistributionConstants;
 import org.apache.sling.distribution.resources.impl.common.AbstractReadableResourceProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -93,7 +94,15 @@ public class OsgiServicePropertiesResour
     public Object addingService(ServiceReference serviceReference) {
         String serviceName = PropertiesUtil.toString(serviceReference.getProperty(friendlyNameProperty), null);
 
-        if (serviceName == null) return null;
+        if (serviceName == null)  {
+            return null;
+        }
+
+        boolean isResource = PropertiesUtil.toBoolean(serviceReference.getProperty(DistributionConstants.PN_IS_RESOURCE), false);
+
+        if (!isResource) {
+            return null;
+        }
 
         Map<String, Object> properties = new HashMap<String, Object>();
 
@@ -121,7 +130,15 @@ public class OsgiServicePropertiesResour
     public void removedService(ServiceReference serviceReference, Object o) {
         String serviceName = PropertiesUtil.toString(serviceReference.getProperty(friendlyNameProperty), null);
 
-        if (serviceName == null) return;
+        if (serviceName == null)  {
+            return;
+        }
+
+        boolean isResource = PropertiesUtil.toBoolean(serviceReference.getProperty(DistributionConstants.PN_IS_RESOURCE), false);
+
+        if (!isResource) {
+            return;
+        }
 
         services.remove(serviceName);
         serviceProperties.remove(serviceName);

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=1641561&r1=1641560&r2=1641561&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 Tue Nov 25 10:16:08 2014
@@ -18,7 +18,9 @@
  */
 package org.apache.sling.distribution.resources.impl;
 
-import java.util.Map;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+import java.util.*;
 
 public class OsgiUtils {
     /**
@@ -62,4 +64,75 @@ public class OsgiUtils {
     private static String safeString(Object obj) {
         return obj == null? "null" : obj.toString();
     }
+
+
+    public static String getFilter(String configFactory, String propertyName, String propertyValue) {
+        if (propertyName!= null && propertyValue != null) {
+            return "(&(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + OsgiUtils.escape(configFactory) + ")("
+                    + OsgiUtils.escape(propertyName) + "=" + OsgiUtils.escape(propertyValue) + "))";
+        } else if (configFactory != null) {
+            return "(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + OsgiUtils.escape(configFactory) + ")";
+        }
+
+        return null;
+    }
+
+
+    public static <K, V> Map<K, V> fromDictionary(Dictionary<K, V> dictionary) {
+        if (dictionary == null) {
+            return null;
+        }
+        Map<K, V> map = new HashMap<K, V>(dictionary.size());
+        Enumeration<K> keys = dictionary.keys();
+        while (keys.hasMoreElements()) {
+            K key = keys.nextElement();
+            map.put(key, dictionary.get(key));
+        }
+        return map;
+    }
+
+    public static <K, V> Dictionary<K, V> toDictionary(Map<K, V> map) {
+        if (map == null) {
+            return null;
+        }
+        Dictionary<K, V> dictionary = new Hashtable<K, V>(map.size());
+        for (Map.Entry<K, V> entry : map.entrySet()) {
+            dictionary.put(entry.getKey(), entry.getValue());
+        }
+
+        return dictionary;
+    }
+
+    public static Map<String, Object> sanitize(Map<String, Object> map) {
+        Map<String, Object> result = new HashMap<String, Object>();
+        if (map == null) {
+            return result;
+        }
+
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            if (entry.getValue() == null) {
+                continue;
+            }
+
+            // skip jcr: stuff
+            if (entry.getKey().contains(":")) {
+                continue;
+            }
+
+            Class valueClass = entry.getValue().getClass();
+            if (valueClass.isArray()) {
+                valueClass = valueClass.getComponentType();
+            }
+
+            if (valueClass.isPrimitive()
+                    || valueClass.equals(String.class)
+                    || valueClass.equals(Boolean.class)
+                    || valueClass.equals(Integer.class)) {
+                result.put(entry.getKey(), entry.getValue());
+            }
+        }
+
+        return result;
+
+    }
 }

Added: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilderFactory.java?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilderFactory.java (added)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilderFactory.java Tue Nov 25 10:16:08 2014
@@ -0,0 +1,88 @@
+package org.apache.sling.distribution.serialization.impl.vlt;
+
+import org.apache.felix.scr.annotations.*;
+import org.apache.jackrabbit.vault.packaging.Packaging;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
+import org.apache.sling.distribution.serialization.DistributionPackageBuildingException;
+import org.apache.sling.distribution.serialization.DistributionPackageReadingException;
+import org.apache.sling.distribution.serialization.impl.ResourceSharedDistributionPackageBuilder;
+import org.osgi.framework.BundleContext;
+
+import javax.annotation.Nonnull;
+import java.io.InputStream;
+import java.util.Map;
+
+@Component(metatype = true,
+        label = "Sling Distribution - File Vault Package Builder Factory",
+        description = "OSGi configuration for file vault package builders",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE
+)
+@Service(DistributionPackageBuilder.class)
+public class FileVaultDistributionPackageBuilderFactory implements DistributionPackageBuilder {
+
+
+    /**
+     * name of this component.
+     */
+    @Property
+    public static final String NAME = DistributionComponentUtils.NAME;
+
+    /**
+     * import mode property for file vault package builder
+     */
+    @Property
+    public static final String PACKAGE_BUILDER_FILEVLT_IMPORT_MODE = "importMode";
+
+    /**
+     * ACL handling property for file vault package builder
+     */
+    @Property
+    public static final String PACKAGE_BUILDER_FILEVLT_ACLHANDLING = "aclHandling";
+
+    DistributionPackageBuilder packageBuilder;
+
+    @Reference
+    private DistributionEventFactory distributionEventFactory;
+
+    @Reference
+    private Packaging packaging;
+
+
+
+    @Activate
+    public void activate(BundleContext context, Map<String, Object> config) {
+
+        String importMode = PropertiesUtil.toString(config.get(PACKAGE_BUILDER_FILEVLT_IMPORT_MODE), null);
+        String aclHandling = PropertiesUtil.toString(config.get(PACKAGE_BUILDER_FILEVLT_ACLHANDLING), null);
+        if (importMode != null && aclHandling != null) {
+            packageBuilder = new ResourceSharedDistributionPackageBuilder(new FileVaultDistributionPackageBuilder(packaging, distributionEventFactory, importMode, aclHandling));
+        } else {
+            packageBuilder = new ResourceSharedDistributionPackageBuilder(new FileVaultDistributionPackageBuilder(packaging, distributionEventFactory));
+        }
+    }
+
+
+    public DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionPackageBuildingException {
+        return packageBuilder.createPackage(resourceResolver, request);
+    }
+
+    public DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageReadingException {
+        return packageBuilder.readPackage(resourceResolver, stream);
+    }
+
+    public DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) {
+        return packageBuilder.getPackage(resourceResolver, id);
+    }
+
+    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageReadingException {
+        return packageBuilder.installPackage(resourceResolver, distributionPackage);
+    }
+}

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java Tue Nov 25 10:16:08 2014
@@ -20,13 +20,9 @@ package org.apache.sling.distribution.tr
 
 import java.util.Map;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-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.distribution.component.impl.DefaultDistributionComponentFactoryConstants;
-import org.apache.sling.distribution.component.impl.DistributionComponentManager;
+import org.apache.felix.scr.annotations.*;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
 import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
 import org.apache.sling.distribution.transport.authentication.TransportAuthenticationException;
 import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
@@ -41,27 +37,30 @@ import org.slf4j.LoggerFactory;
 public class UserCredentialsTransportAuthenticationProviderFactory implements
         TransportAuthenticationProvider {
 
-    @Property(value = DefaultDistributionComponentFactoryConstants.TRANSPORT_AUTHENTICATION_PROVIDER_USER, propertyPrivate = true)
-    private static final String TYPE = DefaultDistributionComponentFactoryConstants.COMPONENT_TYPE;
 
+    /**
+     * name of this component.
+     */
     @Property
-    public final static String USERNAME = DefaultDistributionComponentFactoryConstants.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_USERNAME;
+    public static final String NAME = DistributionComponentUtils.NAME;
 
     @Property
-    public final static String PASSWORD = DefaultDistributionComponentFactoryConstants.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_PASSWORD;
-
-    private final Logger log = LoggerFactory.getLogger(getClass());
+    public final static String USERNAME = "username";
 
+    @Property
+    public final static String PASSWORD = "password";
 
-    @Reference
-    private DistributionComponentManager componentManager;
+    private final Logger log = LoggerFactory.getLogger(getClass());
 
 
     private TransportAuthenticationProvider transportAuthenticationProvider;
 
 
+    @Activate
     public void activate(Map<String, Object> config) {
-        transportAuthenticationProvider = componentManager.createComponent(TransportAuthenticationProvider.class, config, null);
+        String username = PropertiesUtil.toString(config.get(USERNAME), "").trim();
+        String password = PropertiesUtil.toString(config.get(PASSWORD), "").trim();
+        transportAuthenticationProvider = new UserCredentialsTransportAuthenticationProvider(username, password);
     }
 
     public Object authenticate(Object authenticable, TransportAuthenticationContext context)

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java Tue Nov 25 10:16:08 2014
@@ -28,7 +28,6 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.sling.distribution.communication.DistributionRequest;
-import org.apache.sling.distribution.component.ManagedDistributionComponent;
 import org.apache.sling.distribution.trigger.DistributionRequestHandler;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.apache.sling.distribution.trigger.DistributionTriggerException;
@@ -41,7 +40,7 @@ import org.slf4j.LoggerFactory;
  * Abstract implementation of a {@link org.apache.sling.distribution.trigger.DistributionTrigger} that listens for 'safe'
  * events and triggers a {@link org.apache.sling.distribution.communication.DistributionRequest} from that.
  */
-public abstract class AbstractJcrEventTrigger implements DistributionTrigger, ManagedDistributionComponent {
+public abstract class AbstractJcrEventTrigger implements DistributionTrigger {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java Tue Nov 25 10:16:08 2014
@@ -26,7 +26,6 @@ import java.util.concurrent.ConcurrentHa
 
 import org.apache.sling.distribution.communication.DistributionRequestType;
 import org.apache.sling.distribution.communication.DistributionRequest;
-import org.apache.sling.distribution.component.ManagedDistributionComponent;
 import org.apache.sling.distribution.event.DistributionEventType;
 import org.apache.sling.distribution.trigger.DistributionRequestHandler;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
@@ -42,7 +41,7 @@ import org.slf4j.LoggerFactory;
 /**
  * {@link org.apache.sling.distribution.trigger.DistributionTrigger} for chain distribution upon a certain {@link org.apache.sling.distribution.event.DistributionEventType}
  */
-public class ChainDistributeDistributionTrigger implements DistributionTrigger, ManagedDistributionComponent {
+public class ChainDistributeDistributionTrigger implements DistributionTrigger {
 
     public static final String PATH = "path";
 

Added: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/LocalDistributionTriggerFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/LocalDistributionTriggerFactory.java?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/LocalDistributionTriggerFactory.java (added)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/LocalDistributionTriggerFactory.java Tue Nov 25 10:16:08 2014
@@ -0,0 +1,162 @@
+package org.apache.sling.distribution.trigger.impl;
+
+import org.apache.felix.scr.annotations.*;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.commons.scheduler.Scheduler;
+import org.apache.sling.distribution.communication.DistributionRequestType;
+import org.apache.sling.distribution.component.impl.DistributionComponentUtils;
+import org.apache.sling.distribution.trigger.DistributionRequestHandler;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.DistributionTriggerException;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.osgi.framework.BundleContext;
+
+import javax.annotation.Nonnull;
+import java.util.Map;
+
+@Component(metatype = true,
+        label = "Sling Distribution - Generic Local Triggers Factory",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE
+)
+@Service(DistributionTrigger.class)
+public class LocalDistributionTriggerFactory implements DistributionTrigger {
+
+
+    /**
+     * remote event trigger type
+     */
+    public static final String TRIGGER_REMOTE_EVENT = "remoteEvent";
+
+    /**
+     * remote event endpoint property
+     */
+    public static final String TRIGGER_REMOTE_EVENT_PROPERTY_ENDPOINT = "endpoint";
+
+    /**
+     * resource event trigger type
+     */
+    public static final String TRIGGER_RESOURCE_EVENT = "resourceEvent";
+
+    /**
+     * resource event path property
+     */
+    public static final String TRIGGER_RESOURCE_EVENT_PROPERTY_PATH = "path";
+
+    /**
+     * scheduled trigger type
+     */
+    public static final String TRIGGER_SCHEDULED_EVENT = "scheduledEvent";
+
+    /**
+     * scheduled trigger action property
+     */
+    public static final String TRIGGER_SCHEDULED_EVENT_PROPERTY_ACTION = "action";
+
+    /**
+     * scheduled trigger path property
+     */
+    public static final String TRIGGER_SCHEDULED_EVENT_PROPERTY_PATH = "path";
+
+    /**
+     * scheduled trigger seconds property
+     */
+    public static final String TRIGGER_SCHEDULED_EVENT_PROPERTY_SECONDS = "seconds";
+
+    /**
+     * chain distribution trigger type
+     */
+    public static final String TRIGGER_DISTRIBUTION_EVENT = "distributionEvent";
+
+    /**
+     * chain distribution path property
+     */
+    public static final String TRIGGER_DISTRIBUTION_EVENT_PROPERTY_PATH = "path";
+
+    /**
+     * jcr event trigger type
+     */
+    public static final String TRIGGER_JCR_EVENT = "jcrEvent";
+
+    /**
+     * jcr event trigger path property
+     */
+    public static final String TRIGGER_JCR_EVENT_PROPERTY_PATH = "path";
+
+    /**
+     * jcr event trigger service user property
+     */
+    public static final String TRIGGER_JCR_EVENT_PROPERTY_SERVICE_NAME = "servicename";
+
+    /**
+     * jcr persisting event trigger type
+     */
+    public static final String TRIGGER_PERSISTED_JCR_EVENT = "persistedJcrEvent";
+
+    /**
+     * jcr persisting event trigger path property
+     */
+    public static final String TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_PATH = "path";
+
+    /**
+     * jcr persisting event trigger service user property
+     */
+    public static final String TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_SERVICE_NAME = "servicename";
+
+    /**
+     * jcr persisting event trigger nuggets path property
+     */
+    public static final String TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_NUGGETS_PATH = "nuggetsPath";
+
+
+
+    DistributionTrigger trigger;
+
+    @Reference
+    private SlingRepository repository;
+
+    @Reference
+    private Scheduler scheduler;
+
+
+    @Activate
+    public void activate(BundleContext bundleContext, Map<String, Object> config) {
+        String factory = PropertiesUtil.toString(config.get(DistributionComponentUtils.TYPE), null);
+
+        if (TRIGGER_RESOURCE_EVENT.equals(factory)) {
+            String path = PropertiesUtil.toString(config.get(TRIGGER_RESOURCE_EVENT_PROPERTY_PATH), null);
+
+            trigger = new ResourceEventDistributionTrigger(path, bundleContext);
+        } else if (TRIGGER_SCHEDULED_EVENT.equals(factory)) {
+            String action = PropertiesUtil.toString(config.get(TRIGGER_SCHEDULED_EVENT_PROPERTY_ACTION), DistributionRequestType.PULL.name());
+            String path = PropertiesUtil.toString(config.get(TRIGGER_SCHEDULED_EVENT_PROPERTY_PATH), "/");
+            int interval = PropertiesUtil.toInteger(config.get(TRIGGER_SCHEDULED_EVENT_PROPERTY_SECONDS), 30);
+
+            trigger =  new ScheduledDistributionTrigger(action, path, interval, scheduler);
+        } else if (TRIGGER_DISTRIBUTION_EVENT.equals(factory)) {
+            String path = PropertiesUtil.toString(config.get(TRIGGER_DISTRIBUTION_EVENT_PROPERTY_PATH), null);
+
+            trigger =  new ChainDistributeDistributionTrigger(path, bundleContext);
+        } else if (TRIGGER_JCR_EVENT.equals(factory)) {
+            String path = PropertiesUtil.toString(config.get(TRIGGER_JCR_EVENT_PROPERTY_PATH), null);
+            String serviceName = PropertiesUtil.toString(config.get(TRIGGER_JCR_EVENT_PROPERTY_SERVICE_NAME), null);
+
+            trigger =  new JcrEventDistributionTrigger(repository, path, serviceName);
+        } else if (TRIGGER_PERSISTED_JCR_EVENT.equals(factory)) {
+            String path = PropertiesUtil.toString(config.get(TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_PATH), null);
+            String serviceName = PropertiesUtil.toString(config.get(TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_SERVICE_NAME), null);
+            String nuggetsPath = PropertiesUtil.toString(config.get(TRIGGER_PERSISTED_JCR_EVENT_PROPERTY_NUGGETS_PATH), null);
+
+            trigger =  new PersistingJcrEventDistributionTrigger(repository, path, serviceName, nuggetsPath);
+        }
+    }
+
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
+        trigger.register(requestHandler);
+    }
+
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
+        trigger.unregister(requestHandler);
+    }
+}

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java Tue Nov 25 10:16:08 2014
@@ -29,7 +29,6 @@ import java.util.Set;
 
 import org.apache.sling.distribution.communication.DistributionRequestType;
 import org.apache.sling.distribution.communication.DistributionRequest;
-import org.apache.sling.distribution.component.ManagedDistributionComponent;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.slf4j.Logger;
@@ -39,7 +38,7 @@ import org.slf4j.LoggerFactory;
  * {@link org.apache.sling.distribution.trigger.DistributionTrigger} that listens for certain events and persists them
  * under a specific path in the repo
  */
-public class PersistingJcrEventDistributionTrigger extends AbstractJcrEventTrigger implements DistributionTrigger, ManagedDistributionComponent {
+public class PersistingJcrEventDistributionTrigger extends AbstractJcrEventTrigger implements DistributionTrigger {
 
     private static final String DEFAULT_NUGGETS_PATH = "/var/nuggets";
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java Tue Nov 25 10:16:08 2014
@@ -27,7 +27,6 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.distribution.communication.DistributionRequestType;
 import org.apache.sling.distribution.communication.DistributionRequest;
-import org.apache.sling.distribution.component.ManagedDistributionComponent;
 import org.apache.sling.distribution.trigger.DistributionRequestHandler;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.apache.sling.distribution.trigger.DistributionTriggerException;
@@ -43,7 +42,7 @@ import org.slf4j.LoggerFactory;
  * {@link org.apache.sling.distribution.trigger.DistributionTrigger} for triggering a specific handler (e.g. agent) upon
  * node / properties being changed under a certain path
  */
-public class ResourceEventDistributionTrigger implements DistributionTrigger, ManagedDistributionComponent {
+public class ResourceEventDistributionTrigger implements DistributionTrigger {
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());

Added: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DistributionComponentUtilsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DistributionComponentUtilsTest.java?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DistributionComponentUtilsTest.java (added)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DistributionComponentUtilsTest.java Tue Nov 25 10:16:08 2014
@@ -0,0 +1,115 @@
+package org.apache.sling.distribution.component.impl;
+
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+public class DistributionComponentUtilsTest {
+
+    @Test
+    public void testEmptySettingsTransform() {
+        Map<String, Object> settings = new HashMap<String, Object>();
+
+        DistributionComponentUtils utils = new DistributionComponentUtils();
+        Map<String, Map<String, Object>> result = utils.transformToOsgi(settings);
+
+        assertEquals(0, result.size());
+    }
+
+    @Test
+    public void testFirstLevelTransform() {
+        Map<String, Object> settings = new HashMap<String, Object>();
+        settings.put("kind", "agent");
+        settings.put("name", "publish");
+        settings.put("type", "simple");
+
+        settings.put("packageExporter", new HashMap<String, Object>());
+
+        DistributionComponentUtils utils = new DistributionComponentUtils();
+        Map<String, Map<String, Object>> result = utils.transformToOsgi(settings);
+
+        assertEquals(1, result.size());
+        String resultKey = "agent|simple|publish";
+        assertTrue(result.containsKey(resultKey));
+        assertEquals(4, result.get(resultKey).size());
+        assertTrue(result.get(resultKey).containsKey("name"));
+        assertTrue(result.get(resultKey).containsKey("type"));
+        assertTrue(result.get(resultKey).containsKey("packageExporter.target"));
+        assertEquals("(parent.name=publish)", result.get(resultKey).get("packageExporter.target"));
+    }
+
+    @Test
+    public void testTwoLevelTransform() {
+        Map<String, Object> settings = new HashMap<String, Object>();
+        settings.put("kind", "agent");
+        settings.put("name", "publish");
+        settings.put("type", "simple");
+        settings.put("packageExporter", new HashMap<String, Object>());
+        ((Map) settings.get("packageExporter")).put("kind", "exporter");
+        ((Map) settings.get("packageExporter")).put("type", "remote");
+
+        DistributionComponentUtils utils = new DistributionComponentUtils();
+        Map<String, Map<String, Object>> result = utils.transformToOsgi(settings);
+
+        assertEquals(2, result.size());
+
+        {
+            String resultKey = "agent|simple|publish";
+            assertTrue(result.containsKey(resultKey));
+            assertEquals(4, result.get(resultKey).size());
+            assertTrue(result.get(resultKey).containsKey("kind"));
+            assertTrue(result.get(resultKey).containsKey("name"));
+            assertTrue(result.get(resultKey).containsKey("type"));
+            assertTrue(result.get(resultKey).containsKey("packageExporter.target"));
+            assertEquals("(parent.name=publish)", result.get(resultKey).get("packageExporter.target"));
+        }
+
+        {
+            String resultKey = "exporter|remote|publish/packageExporter";
+            assertTrue(result.containsKey(resultKey));
+            assertEquals(4, result.get(resultKey).size());
+        }
+    }
+
+    @Test
+    public void testMultipleTargetTransform() {
+        Map<String, Object> settings = new HashMap<String, Object>();
+        settings.put("kind", "agent");
+        settings.put("name", "publish");
+        settings.put("type", "simple");
+        settings.put("triggers", new HashMap<String, Object>());
+        ((Map) settings.get("triggers")).put("type", "list");
+        ((Map) settings.get("triggers")).put("kind", "trigger");
+
+
+        Map trigger1Properties = new HashMap<String, Object>();
+        trigger1Properties.put("type", "event");
+        ((Map) settings.get("triggers")).put("trigger1", trigger1Properties);
+
+
+        Map trigger2Properties = new HashMap<String, Object>();
+        trigger2Properties.put("type", "event");
+        ((Map) settings.get("triggers")).put("trigger2", trigger2Properties);
+
+
+
+        DistributionComponentUtils utils = new DistributionComponentUtils();
+        Map<String, Map<String, Object>> result = utils.transformToOsgi(settings);
+
+        assertEquals(3, result.size());
+        {
+            String resultKey = "agent|simple|publish";
+            assertTrue(result.containsKey(resultKey));
+            assertEquals(4, result.get(resultKey).size());
+            assertTrue(result.get(resultKey).containsKey("name"));
+            assertTrue(result.get(resultKey).containsKey("type"));
+            assertTrue(result.get(resultKey).containsKey("triggers.target"));
+            assertEquals("(parent.name=publish)", result.get(resultKey).get("triggers.target"));
+        }
+    }
+}

Modified: sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionAgentResourcesIntegrationTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionAgentResourcesIntegrationTest.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionAgentResourcesIntegrationTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/DistributionAgentResourcesIntegrationTest.java Tue Nov 25 10:16:08 2014
@@ -20,16 +20,10 @@ package org.apache.sling.distribution.it
 
 import java.util.UUID;
 
+import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.apache.sling.distribution.it.DistributionUtils.agentConfigUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.agentRootUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.agentUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.assertExists;
-import static org.apache.sling.distribution.it.DistributionUtils.assertNotExists;
-import static org.apache.sling.distribution.it.DistributionUtils.assertResponseContains;
-import static org.apache.sling.distribution.it.DistributionUtils.deleteNode;
-import static org.apache.sling.distribution.it.DistributionUtils.queueUrl;
+import static org.apache.sling.distribution.it.DistributionUtils.*;
 
 /**
  * Integration test for {@link org.apache.sling.distribution.agent.DistributionAgent} resources
@@ -43,7 +37,7 @@ public class DistributionAgentResourcesI
                 "publish-reverse"
         };
         for (String agentName : defaultAgentNames) {
-            assertExists(authorClient, agentConfigUrl(agentName));
+            assertExists(authorClient, authorAgentConfigUrl(agentName));
         }
 
     }
@@ -53,10 +47,9 @@ public class DistributionAgentResourcesI
     public void testDefaultAgentConfigurationResourcesOnPublish() throws Exception {
         String[] defaultAgentNames = new String[]{
                 "reverse",
-                "cache-flush"
         };
         for (String agentName : defaultAgentNames) {
-            assertExists(publishClient, agentConfigUrl(agentName));
+            assertExists(publishClient, publishAgentConfigUrl(agentName));
         }
 
     }
@@ -65,9 +58,7 @@ public class DistributionAgentResourcesI
     public void testDefaultPublishAgentResources() throws Exception {
         // these agents do not exist as they are bundled to publish runMode
         String[] defaultPublishAgentNames = new String[]{
-                "reverse",
-                "cache-flush"
-        };
+                "reverse"        };
         for (String agentName : defaultPublishAgentNames) {
             assertNotExists(authorClient, agentUrl(agentName));
         }
@@ -89,9 +80,7 @@ public class DistributionAgentResourcesI
     public void testDefaultPublishAgentQueueResources() throws Exception {
         // these agent queues do not exist as they are bundled to publish runMode
         String[] defaultPublishAgentNames = new String[]{
-                "reverse",
-                "cache-flush"
-        };
+                "reverse"        };
         for (String agentName : defaultPublishAgentNames) {
             assertNotExists(authorClient, queueUrl(agentName));
         }
@@ -118,9 +107,10 @@ public class DistributionAgentResourcesI
     }
 
     @Test
+    @Ignore
     public void testAgentConfigurationResourceCreate() throws Exception {
         String agentName = "sample-create-config" + UUID.randomUUID();
-        String newConfigResource = agentConfigUrl(agentName);
+        String newConfigResource = authorAgentConfigUrl(agentName);
 
         authorClient.createNode(newConfigResource, "name", agentName);
         assertExists(authorClient, newConfigResource);
@@ -130,9 +120,10 @@ public class DistributionAgentResourcesI
     }
 
     @Test
+    @Ignore
     public void testAgentConfigurationResourceDelete() throws Exception {
         String agentName = "sample-delete-config" + UUID.randomUUID();
-        String newConfigResource = agentConfigUrl(agentName);
+        String newConfigResource = authorAgentConfigUrl(agentName);
         authorClient.createNode(newConfigResource, "name", agentName);
         assertExists(authorClient, newConfigResource);
 
@@ -142,9 +133,10 @@ public class DistributionAgentResourcesI
 
 
     @Test
+    @Ignore
     public void testAgentConfigurationResourceUpdate() throws Exception {
         String agentName = "sample-create-config" + UUID.randomUUID();
-        String newConfigResource = agentConfigUrl(agentName);
+        String newConfigResource = authorAgentConfigUrl(agentName);
 
         authorClient.createNode(newConfigResource, "name", agentName);
         assertExists(authorClient, newConfigResource);

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=1641561&r1=1641560&r2=1641561&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 Tue Nov 25 10:16:08 2014
@@ -23,12 +23,9 @@ import org.apache.sling.testing.tools.sl
 import org.apache.sling.testing.tools.sling.SlingInstanceManager;
 import org.junit.BeforeClass;
 
-import static org.apache.sling.distribution.it.DistributionUtils.agentConfigUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.agentUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.assertExists;
-import static org.apache.sling.distribution.it.DistributionUtils.exporterUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.importerUrl;
-import static org.apache.sling.distribution.it.DistributionUtils.setAgentProperties;
+import java.io.IOException;
+
+import static org.apache.sling.distribution.it.DistributionUtils.*;
 
 /**
  * Integration test base class for distribution
@@ -51,29 +48,26 @@ public abstract class DistributionIntegr
         publishClient = new SlingClient(publish.getServerBaseUrl(), publish.getServerUsername(), publish.getServerPassword());
 
         try {
-            assertExists(authorClient, agentConfigUrl("publish"));
-            assertExists(authorClient, agentConfigUrl("publish-reverse"));
+            assertExists(authorClient, authorAgentConfigUrl("publish"));
 
             // change the url for publish agent and wait for it to start
             String remoteImporterUrl = publish.getServerBaseUrl() + importerUrl("default");
 
-            setAgentProperties(author, "publish",
-                    "packageImporter", "type=remote",
-                    "packageImporter", "endpoints[0]=" + remoteImporterUrl,
-                    "packageImporter", "packageBuilder/type=vlt");
+
+            authorClient.setProperties(authorAgentConfigUrl("publish") + "/packageImporter",
+                    "endpoints", remoteImporterUrl);
+
 
             Thread.sleep(3000);
 
             assertExists(authorClient, agentUrl("publish"));
 
-            assertExists(authorClient, agentConfigUrl("publish-reverse"));
+            assertExists(authorClient, authorAgentConfigUrl("publish-reverse"));
 
             String remoteExporterUrl = publish.getServerBaseUrl() + exporterUrl("reverse");
-            setAgentProperties(author, "publish-reverse",
-                    "packageExporter", "type=remote",
-                    "packageExporter", "endpoints[0]=" + remoteExporterUrl,
 
-                    "packageExporter", "packageBuilder/type=vlt");
+            authorClient.setProperties(authorAgentConfigUrl("publish-reverse") + "/packageExporter",
+                    "endpoints", remoteExporterUrl);
 
             Thread.sleep(3000);
             assertExists(authorClient, agentUrl("publish-reverse"));
@@ -84,4 +78,9 @@ public abstract class DistributionIntegr
 
     }
 
+    public static void setAuthorAgentProperties(String agentName, String... properties) throws IOException {
+        assertPostResourceWithParameters(author, 200, authorAgentConfigUrl(agentName),
+                properties);
+    }
+
 }

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=1641561&r1=1641560&r2=1641561&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 Tue Nov 25 10:16:08 2014
@@ -46,7 +46,7 @@ public class DistributionUtils {
     private static final String JSON_SELECTOR = ".json";
     private static final String DISTRIBUTION_ROOT_PATH = "/libs/sling/distribution";
 
-    private static String assertPostResourceWithParameters(SlingInstance slingInstance,
+    public static String assertPostResourceWithParameters(SlingInstance slingInstance,
                                                            int status, String path, String... parameters) throws IOException {
         Request request = slingInstance.getRequestBuilder().buildPostRequest(path);
 
@@ -82,11 +82,6 @@ public class DistributionUtils {
     }
 
 
-    public static void setAgentProperties(SlingInstance slingInstance, String agentName, String... properties) throws IOException {
-        assertPostResourceWithParameters(slingInstance, 200, agentConfigUrl(agentName),
-                properties);
-    }
-
 
     public static void assertResponseContains(SlingInstance slingInstance,
                                               String resource, String... parameters) throws IOException {
@@ -182,8 +177,12 @@ public class DistributionUtils {
         return agentUrl(agentName) + "/queue";
     }
 
-    public static String agentConfigUrl(String agentName) {
-        return DISTRIBUTION_ROOT_PATH + "/settings/agents/" + agentName;
+    public static String authorAgentConfigUrl(String agentName) {
+        return DISTRIBUTION_ROOT_PATH + "/settings.author/agents/" + agentName;
+    }
+
+    public static String publishAgentConfigUrl(String agentName) {
+        return DISTRIBUTION_ROOT_PATH + "/settings.publish/agents/" + agentName;
     }
 
 

Modified: sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/DistributionTriggerResourcesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/DistributionTriggerResourcesTest.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/DistributionTriggerResourcesTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/DistributionTriggerResourcesTest.java Tue Nov 25 10:16:08 2014
@@ -21,11 +21,13 @@ package org.apache.sling.distribution.it
 
 
 import org.apache.sling.distribution.it.DistributionIntegrationTestBase;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.sling.distribution.it.DistributionUtils.assertExists;
 import static org.apache.sling.distribution.it.DistributionUtils.triggerUrl;
 
+@Ignore
 public class DistributionTriggerResourcesTest extends DistributionIntegrationTestBase {
 
     @Test

Modified: sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/ScheduledDistributionTriggerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/ScheduledDistributionTriggerTest.java?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/ScheduledDistributionTriggerTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/it/src/test/java/org/apache/sling/distribution/it/triggers/ScheduledDistributionTriggerTest.java Tue Nov 25 10:16:08 2014
@@ -20,11 +20,14 @@
 package org.apache.sling.distribution.it.triggers;
 
 import org.apache.sling.distribution.it.DistributionIntegrationTestBase;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.sling.distribution.it.DistributionUtils.assertResponseContains;
 import static org.apache.sling.distribution.it.DistributionUtils.triggerEventUrl;
 
+@Ignore
+
 public class ScheduledDistributionTriggerTest extends DistributionIntegrationTestBase {
 
     @Test

Modified: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/org.apache.sling.distribution.component.impl.ResourceBasedDistributionComponentFactory-agents.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/org.apache.sling.distribution.component.impl.ResourceBasedDistributionComponentFactory-agents.json?rev=1641561&r1=1641560&r2=1641561&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/org.apache.sling.distribution.component.impl.ResourceBasedDistributionComponentFactory-agents.json (original)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/org.apache.sling.distribution.component.impl.ResourceBasedDistributionComponentFactory-agents.json Tue Nov 25 10:16:08 2014
@@ -3,6 +3,6 @@
     "name": "agents",
 
     "kind": "agent",
-    "path": "/libs/sling/distribution/jcrsettings/agents",
-    "defaults.path" : "/libs/sling/distribution/jcrsettings/defaults/agents/global"
+    "path": "/libs/sling/distribution/settings.author/agents",
+    "defaults.path" : "/libs/sling/distribution/settings.author/defaults/agents/global"
 }
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/org.apache.sling.distribution.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory-publishAdmin.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/org.apache.sling.distribution.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory-publishAdmin.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/org.apache.sling.distribution.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory-publishAdmin.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/org.apache.sling.distribution.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory-publishAdmin.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,6 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publishAdmin",
+    "username": "admin",
+    "password": "admin"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish-reverse.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish-reverse.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish-reverse.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,16 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publish-reverse",
+
+    "enabled" : false,
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageExporter.target": "(parent.name=publish-reverse)",
+
+    "packageImporter.target": "(parent.name=publish-reverse)",
+
+    "triggers.target": "(parent.name=publish-reverse)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-publish-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-publish-reverse.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-publish-reverse.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-publish-reverse.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,12 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publish-reverse/exporter",
+    "parent.name": "publish-reverse",
+    "type": "remote",
+
+    "endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/exporters/reverse"
+    ],
+    "packageBuilder.target" : "(name=vlt)",
+    "transportAuthenticationProvider.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.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-publish-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-publish-reverse.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-publish-reverse.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish-reverse/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-publish-reverse.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,7 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publish-reverse/importer",
+    "parent.name": "publish-reverse",
+    "type": "local",
+    "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.osgi.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.osgi.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.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.osgi.author/publish-reverse/org.apache.sling.distribution.trigger.impl.LocalDistributionTriggerFactory-publish-reverse-scheduled.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,11 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish-reverse/triggers/scheduled",
+    "parent.name": "publish-reverse",
+
+    "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.osgi.author/publish/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-publish.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,15 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+
+    "name": "publish",
+
+    "enabled" : false,
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageExporter.target": "(parent.name=publish)",
+
+    "packageImporter.target": "(parent.name=publish)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-publish.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-publish.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-publish.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporterFactory-publish.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,7 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publish/exporter",
+    "parent.name": "publish",
+    "type": "local",
+    "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.osgi.author/publish/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-publish.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-publish.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-publish.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/publish/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-publish.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,12 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "publish/importer",
+    "parent.name": "publish",
+    "type": "remote",
+
+    "endpoints": [
+        "http://localhost:4503/libs/sling/distribution/services/importers/default"
+    ],
+    "packageBuilder.target" : "(name=vlt)",
+    "transportAuthenticationProvider.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.osgi.author/pubsync/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-pubsync.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-pubsync.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-pubsync.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.agent.impl.SimpleDistributionAgentFactory-pubsync.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,14 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "pubsync",
+
+    "enabled" : false,
+
+    "serviceName" : "distributionService",
+
+    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",
+
+    "packageExporter.target": "(parent.name=pubsync)",
+
+    "packageImporter.target": "(parent.name=pubsync)"
+}
\ No newline at end of file

Added: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-pubsync.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-pubsync.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-pubsync.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory-pubsync.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,19 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "pubsync/exporter",
+    "parent.name": "pubsync",
+    "type": "remote",
+
+    "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",
+    ],
+
+    "endpoints.strategy": "All",
+
+    "packageBuilder.target" : "(name=vlt)",
+    "transportAuthenticationProvider.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.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-pubsync.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-pubsync.json?rev=1641561&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-pubsync.json (added)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.osgi.author/pubsync/org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory-pubsync.json Tue Nov 25 10:16:08 2014
@@ -0,0 +1,19 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "name": "pubsync/importer",
+    "parent.name": "pubsync",
+    "type": "remote",
+
+    "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"
+
+    ],
+
+    "endpoints.strategy": "All",
+
+
+    "packageBuilder.target" : "(name=vlt)",
+    "transportAuthenticationProvider.target" : "(name=publishAdmin)"
+}
\ No newline at end of file



Mime
View raw message