sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [8/12] - in /sling/trunk/contrib/extensions: distribution/ distribution/core/ distribution/core/src/main/java/org/apache/sling/distribution/ distribution/core/src/main/java/org/apache/sling/distribution/agent/ distribution/core/src...
Date Fri, 07 Nov 2014 10:28:08 GMT
Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/MultipleEndpointDistributionTransportHandler.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/MultipleEndpointReplicationTransportHandler.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/MultipleEndpointDistributionTransportHandler.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/MultipleEndpointDistributionTransportHandler.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/MultipleEndpointReplicationTransportHandler.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/MultipleEndpointReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/MultipleEndpointDistributionTransportHandler.java Fri Nov  7 10:28:02 2014
@@ -16,35 +16,35 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.impl;
+package org.apache.sling.distribution.transport.impl;
 
 import javax.annotation.Nonnull;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.transport.ReplicationTransportException;
-import org.apache.sling.replication.transport.ReplicationTransportHandler;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.transport.DistributionTransportException;
+import org.apache.sling.distribution.transport.DistributionTransportHandler;
 
 /**
- * {@link org.apache.sling.replication.transport.ReplicationTransportHandler} supporting delivery / retrieval from multiple
+ * {@link org.apache.sling.distribution.transport.DistributionTransportHandler} supporting delivery / retrieval from multiple
  * endpoints.
  */
-public class MultipleEndpointReplicationTransportHandler implements ReplicationTransportHandler {
+public class MultipleEndpointDistributionTransportHandler implements DistributionTransportHandler {
 
-    private final List<ReplicationTransportHandler> transportHelpers;
+    private final List<DistributionTransportHandler> transportHelpers;
     private final TransportEndpointStrategyType endpointStrategyType;
     private int lastSuccessfulEnpointId = 0;
 
-    public MultipleEndpointReplicationTransportHandler(List<ReplicationTransportHandler> transportHelpers,
-                                                       TransportEndpointStrategyType endpointStrategyType) {
+    public MultipleEndpointDistributionTransportHandler(List<DistributionTransportHandler> transportHelpers,
+                                                        TransportEndpointStrategyType endpointStrategyType) {
         this.transportHelpers = transportHelpers;
         this.endpointStrategyType = endpointStrategyType;
     }
 
-    private List<ReplicationPackage> doTransport(ResourceResolver resourceResolver, ReplicationRequest replicationRequest, ReplicationPackage replicationPackage) throws ReplicationTransportException {
+    private List<DistributionPackage> doTransport(ResourceResolver resourceResolver, DistributionRequest distributionRequest, DistributionPackage distributionPackage) throws DistributionTransportException {
 
         int offset = 0;
         if (endpointStrategyType.equals(TransportEndpointStrategyType.One)) {
@@ -52,16 +52,16 @@ public class MultipleEndpointReplication
         }
 
         int length = transportHelpers.size();
-        List<ReplicationPackage> result = new ArrayList<ReplicationPackage>();
+        List<DistributionPackage> result = new ArrayList<DistributionPackage>();
 
         for (int i = 0; i < length; i++) {
             int currentId = (offset + i) % length;
 
-            ReplicationTransportHandler transportHelper = transportHelpers.get(currentId);
-            if (replicationPackage != null) {
-                transportHelper.deliverPackage(resourceResolver, replicationPackage);
-            } else if (replicationRequest != null) {
-                result.addAll(transportHelper.retrievePackages(resourceResolver, replicationRequest));
+            DistributionTransportHandler transportHelper = transportHelpers.get(currentId);
+            if (distributionPackage != null) {
+                transportHelper.deliverPackage(resourceResolver, distributionPackage);
+            } else if (distributionRequest != null) {
+                result.addAll(transportHelper.retrievePackages(resourceResolver, distributionRequest));
             }
 
             lastSuccessfulEnpointId = currentId;
@@ -72,13 +72,13 @@ public class MultipleEndpointReplication
         return result;
     }
 
-    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationTransportException {
-        doTransport(resourceResolver, null, replicationPackage);
+    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionTransportException {
+        doTransport(resourceResolver, null, distributionPackage);
     }
 
     @Nonnull
-    public List<ReplicationPackage> retrievePackages(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest) throws ReplicationTransportException {
-        return doTransport(resourceResolver, replicationRequest, null);
+    public List<DistributionPackage> retrievePackages(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionTransportException {
+        return doTransport(resourceResolver, distributionRequest, null);
     }
 
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransportHandler.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransportHandler.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransportHandler.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransportHandler.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.impl;
+package org.apache.sling.distribution.transport.impl;
 
 import javax.annotation.Nonnull;
 import java.io.IOException;
@@ -36,30 +36,29 @@ import org.apache.http.client.fluent.Res
 import org.apache.http.conn.HttpHostConnectException;
 import org.apache.http.entity.ContentType;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.transport.impl.ReplicationEndpoint;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
-import org.apache.sling.replication.transport.ReplicationTransportException;
-import org.apache.sling.replication.transport.ReplicationTransportHandler;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.util.RequestUtils;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
+import org.apache.sling.distribution.transport.DistributionTransportException;
+import org.apache.sling.distribution.transport.DistributionTransportHandler;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.util.RequestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class SimpleHttpReplicationTransportHandler implements ReplicationTransportHandler {
+public class SimpleHttpDistributionTransportHandler implements DistributionTransportHandler {
 
-    private static final Logger log = LoggerFactory.getLogger(SimpleHttpReplicationTransportHandler.class);
+    private static final Logger log = LoggerFactory.getLogger(SimpleHttpDistributionTransportHandler.class);
     private final TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider;
-    private final ReplicationEndpoint replicationEndpoint;
-    private final ReplicationPackageBuilder packageBuilder;
+    private final DistributionEndpoint distributionEndpoint;
+    private final DistributionPackageBuilder packageBuilder;
     private final int maxNumberOfPackages;
 
-    public SimpleHttpReplicationTransportHandler(TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider,
-                                                 ReplicationEndpoint replicationEndpoint,
-                                                 ReplicationPackageBuilder packageBuilder,
-                                                 int maxNumberOfPackages) {
+    public SimpleHttpDistributionTransportHandler(TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider,
+                                                  DistributionEndpoint distributionEndpoint,
+                                                  DistributionPackageBuilder packageBuilder,
+                                                  int maxNumberOfPackages) {
 
         if (transportAuthenticationProvider == null) {
             throw new IllegalArgumentException("The authentication provider is required");
@@ -70,23 +69,23 @@ public class SimpleHttpReplicationTransp
         }
 
         this.transportAuthenticationProvider = transportAuthenticationProvider;
-        this.replicationEndpoint = replicationEndpoint;
+        this.distributionEndpoint = distributionEndpoint;
         this.packageBuilder = packageBuilder;
         this.maxNumberOfPackages = maxNumberOfPackages;
     }
 
-    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationTransportException {
-        String hostAndPort = getHostAndPort(replicationEndpoint.getUri());
+    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionTransportException {
+        String hostAndPort = getHostAndPort(distributionEndpoint.getUri());
 
-        if (hostAndPort.equals(replicationPackage.getInfo().getOrigin())) {
-            log.info("skipping replication of package {} to same origin {}", replicationPackage.getId(), hostAndPort);
+        if (hostAndPort.equals(distributionPackage.getInfo().getOrigin())) {
+            log.info("skipping distribution of package {} to same origin {}", distributionPackage.getId(), hostAndPort);
             return;
         }
 
 
         log.info("delivering package {} to {} using auth {}", new Object[]{
-                        replicationPackage.getId(),
-                        replicationEndpoint.getUri(),
+                        distributionPackage.getId(),
+                        distributionEndpoint.getUri(),
                         transportAuthenticationProvider
         });
 
@@ -94,16 +93,16 @@ public class SimpleHttpReplicationTransp
             Executor executor = Executor.newInstance();
 
             TransportAuthenticationContext context = new TransportAuthenticationContext();
-            context.addAttribute("endpoint", replicationEndpoint);
+            context.addAttribute("endpoint", distributionEndpoint);
             executor = transportAuthenticationProvider.authenticate(executor, context);
 
-            Request req = Request.Post(replicationEndpoint.getUri()).useExpectContinue();
+            Request req = Request.Post(distributionEndpoint.getUri()).useExpectContinue();
 
             InputStream inputStream = null;
             Response response = null;
             try {
 
-                inputStream = replicationPackage.createInputStream();
+                inputStream = distributionPackage.createInputStream();
 
                 req = req.bodyStream(inputStream, ContentType.APPLICATION_OCTET_STREAM);
                 response = executor.execute(req);
@@ -113,36 +112,36 @@ public class SimpleHttpReplicationTransp
 
             if (response != null) {
                 Content content = response.returnContent();
-                log.info("Replication content of type {} for {} delivered: {}", new Object[]{
-                        replicationPackage.getType(),
-                        Arrays.toString(replicationPackage.getPaths()),
+                log.info("distribution content of type {} for {} delivered: {}", new Object[]{
+                        distributionPackage.getType(),
+                        Arrays.toString(distributionPackage.getPaths()),
                         content
                 });
             } else {
                 throw new IOException("response is empty");
             }
         } catch (Exception ex) {
-            throw new ReplicationTransportException(ex);
+            throw new DistributionTransportException(ex);
         }
 
     }
 
     @Nonnull
-    public List<ReplicationPackage> retrievePackages(@Nonnull final ResourceResolver resourceResolver, @Nonnull final ReplicationRequest replicationRequest) throws ReplicationTransportException {
-        log.debug("polling from {}", replicationEndpoint.getUri());
+    public List<DistributionPackage> retrievePackages(@Nonnull final ResourceResolver resourceResolver, @Nonnull final DistributionRequest distributionRequest) throws DistributionTransportException {
+        log.debug("polling from {}", distributionEndpoint.getUri());
 
         try {
-            URI replicationURI = RequestUtils.appendReplicationRequest(replicationEndpoint.getUri(), replicationRequest);
-            List<ReplicationPackage> result = new ArrayList<ReplicationPackage>();
+            URI distributionURI = RequestUtils.appenddistributionRequest(distributionEndpoint.getUri(), distributionRequest);
+            List<DistributionPackage> result = new ArrayList<DistributionPackage>();
 
             // TODO : executor should be cached and reused
 
             Executor executor = Executor.newInstance();
             TransportAuthenticationContext context = new TransportAuthenticationContext();
-            context.addAttribute("endpoint", replicationEndpoint);
+            context.addAttribute("endpoint", distributionEndpoint);
             executor = transportAuthenticationProvider.authenticate(executor, context);
 
-            Request req = Request.Post(replicationURI).useExpectContinue();
+            Request req = Request.Post(distributionURI).useExpectContinue();
 
             // TODO : add queue parameter
 
@@ -156,9 +155,9 @@ public class SimpleHttpReplicationTransp
                         && polls < maxNumberOfPackages) {
                     HttpEntity entity = httpResponse.getEntity();
                     if (entity != null) {
-                        final ReplicationPackage responsePackage = packageBuilder.readPackage(resourceResolver, entity.getContent());
+                        final DistributionPackage responsePackage = packageBuilder.readPackage(resourceResolver, entity.getContent());
                         if (responsePackage != null) {
-                            String origin = getHostAndPort(replicationURI);
+                            String origin = getHostAndPort(distributionURI);
                             responsePackage.getInfo().setOrigin(origin);
                             result.add(responsePackage);
                         }
@@ -173,16 +172,16 @@ public class SimpleHttpReplicationTransp
                     }
                 }
 
-                log.info("polled {} packages from {}", polls, replicationEndpoint.getUri());
+                log.info("polled {} packages from {}", polls, distributionEndpoint.getUri());
 
             } catch (HttpHostConnectException e) {
-                log.info("could not connect to {} - skipping", replicationEndpoint.getUri());
+                log.info("could not connect to {} - skipping", distributionEndpoint.getUri());
             }
 
             return result;
 
         } catch (Exception ex) {
-            throw new ReplicationTransportException(ex);
+            throw new DistributionTransportException(ex);
         }
 
     }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/TransportEndpointStrategyType.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/TransportEndpointStrategyType.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/TransportEndpointStrategyType.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/TransportEndpointStrategyType.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.impl;
+package org.apache.sling.distribution.transport.impl;
 
 public enum TransportEndpointStrategyType {
     One,

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationRequestHandler.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationRequestHandler.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationRequestHandler.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java Fri Nov  7 10:28:02 2014
@@ -16,25 +16,25 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger;
+package org.apache.sling.distribution.trigger;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.replication.communication.ReplicationRequest;
+import org.apache.sling.distribution.communication.DistributionRequest;
 
 /**
- * An handler for {@link org.apache.sling.replication.communication.ReplicationRequest}s passed to a
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger}
+ * An handler for {@link org.apache.sling.distribution.communication.DistributionRequest}s passed to a
+ * {@link DistributionTrigger}
  */
 @ConsumerType
-public interface ReplicationRequestHandler {
+public interface DistributionRequestHandler {
 
     /**
      * handle the request according to the trigger implementation.
      *
-     * @param request a replication request
+     * @param request a distribution request
      */
-    void handle(@Nonnull ReplicationRequest request);
+    void handle(@Nonnull DistributionRequest request);
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,36 +16,36 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger;
+package org.apache.sling.distribution.trigger;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.replication.component.ReplicationComponent;
+import org.apache.sling.distribution.component.DistributionComponent;
 
 /**
- * A {@link org.apache.sling.replication.trigger.ReplicationTrigger} is responsible to trigger
- * {@link org.apache.sling.replication.communication.ReplicationRequest}s upon certain 'events' (e.g. Sling / Jcr events,
+ * A {@link DistributionTrigger} is responsible to trigger
+ * {@link org.apache.sling.distribution.communication.DistributionRequest}s upon certain 'events' (e.g. Sling / Jcr events,
  * periodic polling, etc.).
- * A {@link org.apache.sling.replication.trigger.ReplicationTrigger} is meant to be stateless so that more than one
- * {@link org.apache.sling.replication.trigger.ReplicationRequestHandler} can be registered into the same trigger.
+ * A {@link DistributionTrigger} is meant to be stateless so that more than one
+ * {@link DistributionRequestHandler} can be registered into the same trigger.
  */
 @ConsumerType
-public interface ReplicationTrigger extends ReplicationComponent {
+public interface DistributionTrigger extends DistributionComponent {
 
     /**
      * register a request handler to be triggered and returns a corresponding registration id
      *
      * @param requestHandler handler
-     * @throws org.apache.sling.replication.trigger.ReplicationTriggerException if registration fails
+     * @throws DistributionTriggerException if registration fails
      */
-    void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException;
+    void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException;
 
     /**
      * unregister the given handler, if existing
      *
      * @param requestHandler handler to unregister
-     * @throws org.apache.sling.replication.trigger.ReplicationTriggerException if unregistration fails
+     * @throws DistributionTriggerException if unregistration fails
      */
-    void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException;
+    void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException;
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTriggerException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTriggerException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTriggerException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java Fri Nov  7 10:28:02 2014
@@ -16,18 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger;
+package org.apache.sling.distribution.trigger;
 
 /**
- * Exception representing errors during (un)registration of {@link org.apache.sling.replication.trigger.ReplicationTrigger}s
+ * Exception representing errors during (un)registration of {@link DistributionTrigger}s
  */
-public class ReplicationTriggerException extends Exception {
+public class DistributionTriggerException extends Exception {
 
-    public ReplicationTriggerException(String message, Throwable throwable) {
+    public DistributionTriggerException(String message, Throwable throwable) {
         super(message, throwable);
     }
 
-    public ReplicationTriggerException(String message) {
+    public DistributionTriggerException(String message) {
         super(message);
     }
 }

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=1637333&r1=1637123&r2=1637333&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 Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
@@ -28,23 +28,23 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
-import org.apache.sling.replication.util.ReplicationJcrUtils;
+import org.apache.sling.distribution.communication.DistributionRequest;
+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.distribution.util.DistributionJcrUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Abstract implementation of a {@link org.apache.sling.replication.trigger.ReplicationTrigger} that listens for 'safe'
- * events and triggers a {@link org.apache.sling.replication.communication.ReplicationRequest} from that.
+ * 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 ReplicationTrigger {
+public abstract class AbstractJcrEventTrigger implements DistributionTrigger {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final Map<String, JcrEventReplicationTriggerListener> registeredListeners = new ConcurrentHashMap<String, JcrEventReplicationTriggerListener>();
+    private final Map<String, JcrEventdistributionTriggerListener> registeredListeners = new ConcurrentHashMap<String, JcrEventdistributionTriggerListener>();
 
     private final String path;
     private final String serviceUser;
@@ -59,36 +59,36 @@ public abstract class AbstractJcrEventTr
         this.serviceUser = serviceUser;
     }
 
-    public void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         Session session;
         try {
             session = getSession();
-            JcrEventReplicationTriggerListener listener = new JcrEventReplicationTriggerListener(requestHandler);
+            JcrEventdistributionTriggerListener listener = new JcrEventdistributionTriggerListener(requestHandler);
             registeredListeners.put(requestHandler.toString(), listener);
             session.getWorkspace().getObservationManager().addEventListener(
                     listener, getEventTypes(), path, true, null, null, false);
         } catch (RepositoryException e) {
-            throw new ReplicationTriggerException("unable to register handler " + requestHandler, e);
+            throw new DistributionTriggerException("unable to register handler " + requestHandler, e);
         }
     }
 
-    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
-        JcrEventReplicationTriggerListener listener = registeredListeners.get(requestHandler.toString());
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
+        JcrEventdistributionTriggerListener listener = registeredListeners.get(requestHandler.toString());
         if (listener != null) {
             Session session;
             try {
                 session = getSession();
                 session.getWorkspace().getObservationManager().removeEventListener(listener);
             } catch (RepositoryException e) {
-                throw new ReplicationTriggerException("unable to unregister handler " + requestHandler, e);
+                throw new DistributionTriggerException("unable to unregister handler " + requestHandler, e);
             }
         }
     }
 
-    private class JcrEventReplicationTriggerListener implements EventListener {
-        private final ReplicationRequestHandler requestHandler;
+    private class JcrEventdistributionTriggerListener implements EventListener {
+        private final DistributionRequestHandler requestHandler;
 
-        public JcrEventReplicationTriggerListener(ReplicationRequestHandler requestHandler) {
+        public JcrEventdistributionTriggerListener(DistributionRequestHandler requestHandler) {
             this.requestHandler = requestHandler;
         }
 
@@ -97,8 +97,8 @@ public abstract class AbstractJcrEventTr
             while (eventIterator.hasNext()) {
                 Event event = eventIterator.nextEvent();
                 try {
-                    if (ReplicationJcrUtils.isSafe(event)) {
-                        ReplicationRequest request = processEvent(event);
+                    if (DistributionJcrUtils.isSafe(event)) {
+                        DistributionRequest request = processEvent(event);
                         if (request != null) {
                             requestHandler.handle(request);
                         }
@@ -111,14 +111,14 @@ public abstract class AbstractJcrEventTr
     }
 
     /**
-     * process the received event and generates a replication request
+     * process the received event and generates a distribution request
      *
      * @param event an {@link javax.jcr.observation.Event} to be processed
-     * @return the {@link org.apache.sling.replication.communication.ReplicationRequest} originated by processing the event,
+     * @return the {@link org.apache.sling.distribution.communication.DistributionRequest} originated by processing the event,
      * or <code>null</code> if no request could be generated
      * @throws RepositoryException
      */
-    protected abstract ReplicationRequest processEvent(Event event) throws RepositoryException;
+    protected abstract DistributionRequest processEvent(Event event) throws RepositoryException;
 
     /**
      * get the binary int event types to be handled by this JCR event listener

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ChainReplicateReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ChainReplicateReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ChainReplicateReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.annotation.Nonnull;
 import java.util.Dictionary;
@@ -24,14 +24,14 @@ import java.util.Hashtable;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.event.ReplicationEvent;
-import org.apache.sling.replication.event.ReplicationEventType;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.component.ManagedDistributionComponent;
+import org.apache.sling.distribution.event.DistributionEvent;
+import org.apache.sling.distribution.event.DistributionEventType;
+import org.apache.sling.distribution.trigger.DistributionRequestHandler;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.DistributionTriggerException;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
@@ -41,9 +41,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger} for chain replication upon a certain {@link org.apache.sling.replication.event.ReplicationEventType}
+ * {@link org.apache.sling.distribution.trigger.DistributionTrigger} for chain distribution upon a certain {@link org.apache.sling.distribution.event.DistributionEventType}
  */
-public class ChainReplicateReplicationTrigger implements ReplicationTrigger, ManagedReplicationComponent {
+public class ChainDistributeDistributionTrigger implements DistributionTrigger, ManagedDistributionComponent {
 
     public static final String PATH = "path";
 
@@ -54,17 +54,17 @@ public class ChainReplicateReplicationTr
     private final Map<String, ServiceRegistration> registrations = new ConcurrentHashMap<String, ServiceRegistration>();
 
 
-    public ChainReplicateReplicationTrigger(String pathPrefix, BundleContext bundleContext) {
+    public ChainDistributeDistributionTrigger(String pathPrefix, BundleContext bundleContext) {
         this.bundleContext = bundleContext;
         this.pathPrefix = pathPrefix;
     }
 
-    public void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
-        // register an event handler on replication package install (on a certain path) which triggers the chain replication of that same package
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
+        // register an event handler on distribution package install (on a certain path) which triggers the chain distribution of that same package
         Dictionary<String, Object> properties = new Hashtable<String, Object>();
 
         // TODO : make it possible to configure the type of event handled here, currently 'package-installed' is hardcoded
-        properties.put(EventConstants.EVENT_TOPIC, ReplicationEvent.getTopic(ReplicationEventType.PACKAGE_INSTALLED));
+        properties.put(EventConstants.EVENT_TOPIC, DistributionEvent.getTopic(DistributionEventType.PACKAGE_INSTALLED));
         log.info("handler {} will chain replicate on path '{}'", requestHandler, pathPrefix);
 
 //            properties.put(EventConstants.EVENT_FILTER, "(path=" + path + "/*)");
@@ -75,12 +75,12 @@ public class ChainReplicateReplicationTr
                 registrations.put(requestHandler.toString(), triggerPathEventRegistration);
             }
         } else {
-            throw new ReplicationTriggerException("cannot register trigger since bundle context is null");
+            throw new DistributionTriggerException("cannot register trigger since bundle context is null");
 
         }
     }
 
-    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
         if (serviceRegistration != null) {
             serviceRegistration.unregister();
@@ -102,25 +102,25 @@ public class ChainReplicateReplicationTr
 
     private class TriggerAgentEventListener implements EventHandler {
 
-        private final ReplicationRequestHandler requestHandler;
+        private final DistributionRequestHandler requestHandler;
         private final String path;
 
-        public TriggerAgentEventListener(ReplicationRequestHandler requestHandler, String path) {
+        public TriggerAgentEventListener(DistributionRequestHandler requestHandler, String path) {
             this.requestHandler = requestHandler;
             this.path = path;
         }
 
         public void handleEvent(Event event) {
-            Object actionProperty = event.getProperty("replication.action");
-            Object pathProperty = event.getProperty("replication.path");
+            Object actionProperty = event.getProperty("distribution.action");
+            Object pathProperty = event.getProperty("distribution.path");
             if (actionProperty != null && pathProperty != null) {
                 String[] paths = (String[]) pathProperty;
                 for (String p : paths) {
                     if (p.startsWith(path)) {
-                        log.info("triggering chain replication from event {}", event);
+                        log.info("triggering chain distribution from event {}", event);
 
-                        ReplicationActionType action = ReplicationActionType.valueOf(String.valueOf(actionProperty));
-                        requestHandler.handle(new ReplicationRequest(System.currentTimeMillis(), action, paths));
+                        DistributionActionType action = DistributionActionType.valueOf(String.valueOf(actionProperty));
+                        requestHandler.handle(new DistributionRequest(System.currentTimeMillis(), action, paths));
                         break;
                     }
                 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/JcrEventReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/JcrEventReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/JcrEventReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,33 +16,33 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.observation.Event;
 
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A JCR observation based {@link org.apache.sling.replication.trigger.ReplicationTrigger}.
+ * A JCR observation based {@link org.apache.sling.distribution.trigger.DistributionTrigger}.
  */
-public class JcrEventReplicationTrigger extends AbstractJcrEventTrigger implements ReplicationTrigger {
+public class JcrEventDistributionTrigger extends AbstractJcrEventTrigger implements DistributionTrigger {
 
     private final Logger log = LoggerFactory.getLogger(this.getClass());
 
-    public JcrEventReplicationTrigger(SlingRepository repository, String path, String serviceName) {
+    public JcrEventDistributionTrigger(SlingRepository repository, String path, String serviceName) {
         super(repository, path, serviceName);
     }
 
     @Override
-    protected ReplicationRequest processEvent(Event event) throws RepositoryException {
-        log.info("triggering replication from jcr event {}", event);
-        ReplicationRequest replicationRequest = null;
+    protected DistributionRequest processEvent(Event event) throws RepositoryException {
+        log.info("triggering distribution from jcr event {}", event);
+        DistributionRequest distributionRequest = null;
         Object pathProperty = event.getPath();
         if (pathProperty != null) {
             String replicatingPath = String.valueOf(pathProperty);
@@ -50,10 +50,10 @@ public class JcrEventReplicationTrigger 
             if (Event.PROPERTY_REMOVED == type || Event.PROPERTY_CHANGED == type || Event.PROPERTY_ADDED == type) {
                 replicatingPath = replicatingPath.substring(0, replicatingPath.lastIndexOf('/'));
             }
-            replicationRequest = new ReplicationRequest(System.currentTimeMillis(), Event.NODE_REMOVED ==
-                    type ? ReplicationActionType.DELETE : ReplicationActionType.ADD, replicatingPath);
-            log.info("replicating {}", replicationRequest);
+            distributionRequest = new DistributionRequest(System.currentTimeMillis(), Event.NODE_REMOVED ==
+                    type ? DistributionActionType.DELETE : DistributionActionType.ADD, replicatingPath);
+            log.info("replicating {}", distributionRequest);
         }
-        return replicationRequest;
+        return distributionRequest;
     }
 }
\ No newline at end of file

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/PersistingJcrEventReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/PersistingJcrEventReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/PersistingJcrEventReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
@@ -28,18 +28,18 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.component.ManagedDistributionComponent;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger} that listens for certain events and persists them
+ * {@link org.apache.sling.distribution.trigger.DistributionTrigger} that listens for certain events and persists them
  * under a specific path in the repo
  */
-public class PersistingJcrEventReplicationTrigger extends AbstractJcrEventTrigger implements ReplicationTrigger, ManagedReplicationComponent {
+public class PersistingJcrEventDistributionTrigger extends AbstractJcrEventTrigger implements DistributionTrigger, ManagedDistributionComponent {
 
     private static final String DEFAULT_NUGGETS_PATH = "/var/nuggets";
 
@@ -47,16 +47,16 @@ public class PersistingJcrEventReplicati
 
     private final String nuggetsPath;
 
-    public PersistingJcrEventReplicationTrigger(SlingRepository repository, String path, String servicename, String nuggetsPath) {
+    public PersistingJcrEventDistributionTrigger(SlingRepository repository, String path, String servicename, String nuggetsPath) {
         super(repository, path, servicename);
         this.nuggetsPath = nuggetsPath == null || nuggetsPath.length() == 0 ? DEFAULT_NUGGETS_PATH : nuggetsPath;
     }
 
     @Override
-    protected ReplicationRequest processEvent(Event event) throws RepositoryException {
+    protected DistributionRequest processEvent(Event event) throws RepositoryException {
         log.info("processing event {}", event);
 
-        ReplicationRequest replicationRequest = null;
+        DistributionRequest distributionRequest = null;
 
         Session session = getSession();
 
@@ -87,7 +87,7 @@ public class PersistingJcrEventReplicati
                     createdNode.setProperty("info", values.toArray(new String[values.size()]));
                     session.save();
                     log.info("event persisted at {}", path);
-                    replicationRequest = new ReplicationRequest(System.currentTimeMillis(), ReplicationActionType.ADD, path);
+                    distributionRequest = new DistributionRequest(System.currentTimeMillis(), DistributionActionType.ADD, path);
                 } else {
                     log.warn("could not create node {}", nuggetsPath + "/" + nodeName);
                 }
@@ -98,7 +98,7 @@ public class PersistingJcrEventReplicati
             log.warn("not enough privileges to persist the event {} under {}", event, nuggetsPath);
         }
 
-        return replicationRequest;
+        return distributionRequest;
     }
 
     private void initializeNuggetsPath(Session session) throws RepositoryException {

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/RemoteEventReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/RemoteEventReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/RemoteEventReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.annotation.Nonnull;
 import java.io.IOException;
@@ -40,34 +40,34 @@ import org.apache.http.nio.protocol.Basi
 import org.apache.http.nio.protocol.BasicAsyncResponseConsumer;
 import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.transport.impl.ReplicationEndpoint;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.transport.impl.DistributionEndpoint;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.trigger.DistributionRequestHandler;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.DistributionTriggerException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger} to trigger replication upon reception of server sent events
+ * {@link org.apache.sling.distribution.trigger.DistributionTrigger} to trigger distribution upon reception of server sent events
  * on a certain URL
  */
-public class RemoteEventReplicationTrigger implements ReplicationTrigger {
+public class RemoteEventDistributionTrigger implements DistributionTrigger {
     private final static String SCHEDULE_NAME = "remoteEventTrigger";
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final ReplicationEndpoint endpoint;
+    private final DistributionEndpoint endpoint;
     private final TransportAuthenticationProvider<CredentialsProvider, CredentialsProvider> authenticationProvider;
 
     private Scheduler scheduler;
 
     private Map<String, Future<HttpResponse>> requests = new ConcurrentHashMap<String, Future<HttpResponse>>();
 
-    public RemoteEventReplicationTrigger(String endpoint, TransportAuthenticationProvider<CredentialsProvider, CredentialsProvider> authenticationProvider, Scheduler scheduler) {
+    public RemoteEventDistributionTrigger(String endpoint, TransportAuthenticationProvider<CredentialsProvider, CredentialsProvider> authenticationProvider, Scheduler scheduler) {
         if (endpoint == null) {
             throw new IllegalArgumentException("Endpoint is required");
         }
@@ -81,23 +81,23 @@ public class RemoteEventReplicationTrigg
         }
 
         this.authenticationProvider = authenticationProvider;
-        this.endpoint = new ReplicationEndpoint(endpoint);
+        this.endpoint = new DistributionEndpoint(endpoint);
         this.scheduler = scheduler;
     }
 
-    public void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         try {
-            log.info("applying remote event replication trigger");
+            log.info("applying remote event distribution trigger");
 
             ScheduleOptions options = scheduler.NOW();
             options.name(getJobName(requestHandler));
-            scheduler.schedule(new EventBasedReplication(requestHandler), options);
+            scheduler.schedule(new EventBasedDistribution(requestHandler), options);
         } catch (Exception e) {
-            throw new ReplicationTriggerException("unable to register handler " + requestHandler, e);
+            throw new DistributionTriggerException("unable to register handler " + requestHandler, e);
         }
     }
 
-    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         Future<HttpResponse> httpResponseFuture = requests.remove(requestHandler.toString());
         if (httpResponseFuture != null) {
             httpResponseFuture.cancel(true);
@@ -105,15 +105,15 @@ public class RemoteEventReplicationTrigg
         scheduler.unschedule(getJobName(requestHandler));
     }
 
-    String getJobName(ReplicationRequestHandler requestHandler) {
+    String getJobName(DistributionRequestHandler requestHandler) {
         return SCHEDULE_NAME + requestHandler.toString();
     }
 
     private class SSEResponseConsumer extends BasicAsyncResponseConsumer {
 
-        private final ReplicationRequestHandler handler;
+        private final DistributionRequestHandler handler;
 
-        private SSEResponseConsumer(ReplicationRequestHandler handler) {
+        private SSEResponseConsumer(DistributionRequestHandler handler) {
             this.handler = handler;
         }
 
@@ -125,12 +125,12 @@ public class RemoteEventReplicationTrigg
             log.debug("content {} received {},{}", new Object[]{buffer, decoder, ioctrl});
 
             // TODO : currently it always triggers poll request on /, should this be configurable?
-            ReplicationRequest replicationRequest = new ReplicationRequest(System.currentTimeMillis(), ReplicationActionType.POLL, "/");
-            handler.handle(replicationRequest);
-            log.info("replication request to agent {} sent ({} {})", new Object[]{
+            DistributionRequest distributionRequest = new DistributionRequest(System.currentTimeMillis(), DistributionActionType.POLL, "/");
+            handler.handle(distributionRequest);
+            log.info("distribution request to agent {} sent ({} {})", new Object[]{
                     handler,
-                    replicationRequest.getAction(),
-                    replicationRequest.getPaths()});
+                    distributionRequest.getAction(),
+                    distributionRequest.getPaths()});
 
             super.onContentReceived(decoder, ioctrl);
         }
@@ -142,10 +142,10 @@ public class RemoteEventReplicationTrigg
         }
     }
 
-    private class EventBasedReplication implements Runnable {
-        private final ReplicationRequestHandler requestHandler;
+    private class EventBasedDistribution implements Runnable {
+        private final DistributionRequestHandler requestHandler;
 
-        public EventBasedReplication(ReplicationRequestHandler requestHandler) {
+        public EventBasedDistribution(DistributionRequestHandler requestHandler) {
             this.requestHandler = requestHandler;
         }
 
@@ -197,7 +197,7 @@ public class RemoteEventReplicationTrigg
                 httpClient.close();
                 log.debug("request finished");
             } catch (Exception e) {
-                log.error("cannot run event based replication {}", e);
+                log.error("cannot run event based distribution {}", e);
             }
         }
     }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ResourceEventReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ResourceEventReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ResourceEventReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.annotation.Nonnull;
 import java.util.Dictionary;
@@ -25,12 +25,12 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.sling.api.SlingConstants;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
+import org.apache.sling.distribution.communication.DistributionActionType;
+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;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
@@ -40,10 +40,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger} for triggering a specific handler (e.g. agent) upon
+ * {@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 ResourceEventReplicationTrigger implements ReplicationTrigger, ManagedReplicationComponent {
+public class ResourceEventDistributionTrigger implements DistributionTrigger, ManagedDistributionComponent {
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -53,7 +53,7 @@ public class ResourceEventReplicationTri
     private final Map<String, ServiceRegistration> registrations = new ConcurrentHashMap<String, ServiceRegistration>();
 
 
-    public ResourceEventReplicationTrigger(String path, BundleContext bundleContext) {
+    public ResourceEventDistributionTrigger(String path, BundleContext bundleContext) {
         if (bundleContext == null) {
             throw new IllegalArgumentException("Invalid bundle context");
         }
@@ -79,7 +79,7 @@ public class ResourceEventReplicationTri
         registrations.clear();
     }
 
-    public void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         // register an event handler on path which triggers the agent on node / property changes / addition / removals
         Dictionary<String, Object> properties = new Hashtable<String, Object>();
         properties.put(EventConstants.EVENT_TOPIC, new String[]{SlingConstants.TOPIC_RESOURCE_ADDED,
@@ -92,11 +92,11 @@ public class ResourceEventReplicationTri
         if (triggerPathEventRegistration != null) {
             registrations.put(requestHandler.toString(), triggerPathEventRegistration);
         } else {
-            throw new ReplicationTriggerException("cannot register event handler service for triggering agent");
+            throw new DistributionTriggerException("cannot register event handler service for triggering agent");
         }
     }
 
-    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
         if (serviceRegistration != null) {
             serviceRegistration.unregister();
@@ -105,21 +105,21 @@ public class ResourceEventReplicationTri
 
     private class TriggerAgentEventListener implements EventHandler {
 
-        private final ReplicationRequestHandler requestHandler;
+        private final DistributionRequestHandler requestHandler;
 
-        public TriggerAgentEventListener(ReplicationRequestHandler requestHandler) {
+        public TriggerAgentEventListener(DistributionRequestHandler requestHandler) {
             this.requestHandler = requestHandler;
         }
 
         public void handleEvent(Event event) {
-            ReplicationActionType action = SlingConstants.TOPIC_RESOURCE_REMOVED.equals(event.getTopic()) ?
-                    ReplicationActionType.DELETE : ReplicationActionType.ADD;
-            log.info("triggering replication from event {}", event);
+            DistributionActionType action = SlingConstants.TOPIC_RESOURCE_REMOVED.equals(event.getTopic()) ?
+                    DistributionActionType.DELETE : DistributionActionType.ADD;
+            log.info("triggering distribution from event {}", event);
 
             Object pathProperty = event.getProperty("path");
             if (pathProperty != null) {
                 String replicatingPath = String.valueOf(pathProperty);
-                requestHandler.handle(new ReplicationRequest(System.currentTimeMillis(), action, replicatingPath));
+                requestHandler.handle(new DistributionRequest(System.currentTimeMillis(), action, replicatingPath));
             }
         }
     }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTrigger.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ScheduledReplicationTrigger.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTrigger.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTrigger.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ScheduledReplicationTrigger.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ScheduledReplicationTrigger.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTrigger.java Fri Nov  7 10:28:02 2014
@@ -16,73 +16,73 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.trigger.impl;
+package org.apache.sling.distribution.trigger.impl;
 
 import javax.annotation.Nonnull;
 
 import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.trigger.DistributionRequestHandler;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.DistributionTriggerException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.trigger.ReplicationTrigger} to schedule replications on a certain
- * {@link org.apache.sling.replication.agent.ReplicationAgent}
+ * {@link org.apache.sling.distribution.trigger.DistributionTrigger} to schedule distributions on a certain
+ * {@link org.apache.sling.distribution.agent.DistributionAgent}
  */
-public class ScheduledReplicationTrigger implements ReplicationTrigger {
+public class ScheduledDistributionTrigger implements DistributionTrigger {
     private final static String SCHEDULE_NAME = "scheduledEventTrigger";
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final ReplicationActionType replicationAction;
+    private final DistributionActionType distributionAction;
     private final String path;
     private final int secondsInterval;
 
     private final Scheduler scheduler;
 
 
-    public ScheduledReplicationTrigger(String replicationActionName, String path, int secondsInterval, Scheduler scheduler) {
-        this.replicationAction = ReplicationActionType.fromName(replicationActionName);
+    public ScheduledDistributionTrigger(String distributionActionName, String path, int secondsInterval, Scheduler scheduler) {
+        this.distributionAction = DistributionActionType.fromName(distributionActionName);
         this.path = path;
         this.secondsInterval = secondsInterval;
         this.scheduler = scheduler;
     }
 
-    public void register(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         try {
             ScheduleOptions options = scheduler.NOW(-1, secondsInterval);
             options.name(getJobName(requestHandler));
-            scheduler.schedule(new ScheduledReplication(requestHandler), options);
+            scheduler.schedule(new ScheduledDistribution(requestHandler), options);
         } catch (Exception e) {
-            throw new ReplicationTriggerException("unable to register handler " + requestHandler, e);
+            throw new DistributionTriggerException("unable to register handler " + requestHandler, e);
         }
     }
 
-    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
+    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionTriggerException {
         scheduler.unschedule(getJobName(requestHandler));
     }
 
-    private class ScheduledReplication implements Runnable {
-        private final ReplicationRequestHandler requestHandler;
+    private class ScheduledDistribution implements Runnable {
+        private final DistributionRequestHandler requestHandler;
 
-        public ScheduledReplication(ReplicationRequestHandler requestHandler) {
+        public ScheduledDistribution(DistributionRequestHandler requestHandler) {
             this.requestHandler = requestHandler;
         }
 
         public void run() {
-            log.debug("agent {}: scheduling {} replication of {}", new Object[]{requestHandler, replicationAction, path});
+            log.debug("agent {}: scheduling {} distribution of {}", new Object[]{requestHandler, distributionAction, path});
 
-            requestHandler.handle(new ReplicationRequest(System.currentTimeMillis(), replicationAction, path));
+            requestHandler.handle(new DistributionRequest(System.currentTimeMillis(), distributionAction, path));
         }
     }
 
-    String getJobName(ReplicationRequestHandler requestHandler) {
+    String getJobName(DistributionRequestHandler requestHandler) {
         return SCHEDULE_NAME + requestHandler.toString();
     }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/package-info.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/package-info.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/package-info.java Fri Nov  7 10:28:02 2014
@@ -18,7 +18,7 @@
  */
 
 @Version("0.1.0")
-package org.apache.sling.replication.trigger;
+package org.apache.sling.distribution.trigger;
 
 import aQute.bnd.annotation.Version;
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/util/ReplicationJcrUtils.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/util/ReplicationJcrUtils.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/util/ReplicationJcrUtils.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.util;
+package org.apache.sling.distribution.util;
 
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
@@ -26,9 +26,9 @@ import javax.jcr.observation.Event;
 import org.apache.jackrabbit.api.observation.JackrabbitEvent;
 
 /**
- * Utility class for JCR related replication operations.
+ * Utility class for JCR related distribution operations.
  */
-public class ReplicationJcrUtils {
+public class DistributionJcrUtils {
 
     public static final String DO_NOT_REPLICATE = "do.not.replicate";
 
@@ -59,6 +59,6 @@ public class ReplicationJcrUtils {
      * @throws RepositoryException if retrieving the {@link javax.jcr.observation.ObservationManager} fails
      */
     public static void setDoNotReplicate(@Nonnull Session session) throws RepositoryException {
-        session.getWorkspace().getObservationManager().setUserData(ReplicationJcrUtils.DO_NOT_REPLICATE);
+        session.getWorkspace().getObservationManager().setUserData(DistributionJcrUtils.DO_NOT_REPLICATE);
     }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java Fri Nov  7 10:28:02 2014
@@ -16,36 +16,36 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.util;
+package org.apache.sling.distribution.util;
 
 import javax.servlet.http.HttpServletRequest;
 import java.net.URI;
 import java.net.URISyntaxException;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationParameter;
-import org.apache.sling.replication.communication.ReplicationRequest;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionParameter;
+import org.apache.sling.distribution.communication.DistributionRequest;
 
 /**
- * Utility class for HTTP / Replication request related operations.
+ * Utility class for HTTP / distribution request related operations.
  */
 public class RequestUtils {
 
-    public static ReplicationRequest fromServletRequest(HttpServletRequest request) {
-        String action = request.getParameter(ReplicationParameter.ACTION.toString());
-        String[] paths = request.getParameterValues(ReplicationParameter.PATH.toString());
+    public static DistributionRequest fromServletRequest(HttpServletRequest request) {
+        String action = request.getParameter(DistributionParameter.ACTION.toString());
+        String[] paths = request.getParameterValues(DistributionParameter.PATH.toString());
 
-        return new ReplicationRequest(System.currentTimeMillis(),
-                ReplicationActionType.fromName(action),
+        return new DistributionRequest(System.currentTimeMillis(),
+                DistributionActionType.fromName(action),
                 paths);
     }
 
-    public static URI appendReplicationRequest(URI uri, ReplicationRequest replicationRequest) throws URISyntaxException {
+    public static URI appenddistributionRequest(URI uri, DistributionRequest distributionRequest) throws URISyntaxException {
         URIBuilder uriBuilder = new URIBuilder(uri);
-        uriBuilder.addParameter(ReplicationParameter.ACTION.toString(), replicationRequest.getAction().getName());
-        for (String path : replicationRequest.getPaths()) {
-            uriBuilder.addParameter(ReplicationParameter.PATH.toString(), path);
+        uriBuilder.addParameter(DistributionParameter.ACTION.toString(), distributionRequest.getAction().getName());
+        for (String path : distributionRequest.getPaths()) {
+            uriBuilder.addParameter(DistributionParameter.PATH.toString(), path);
         }
         return uriBuilder.build();
     }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java Fri Nov  7 10:28:02 2014
@@ -18,7 +18,7 @@
  */
 
 @Version("0.1.0")
-package org.apache.sling.replication.util;
+package org.apache.sling.distribution.util;
 
 import aQute.bnd.annotation.Version;
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactoryTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactoryTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactoryTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactoryTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactoryTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactoryTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactoryTest.java Fri Nov  7 10:28:02 2014
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.component.ReplicationComponentFactory;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 
@@ -32,18 +32,18 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link org.apache.sling.replication.agent.impl.CoordinatingReplicationAgentFactory}
+ * Testcase for {@link CoordinatingDistributionAgentFactory}
  */
-public class CoordinatingReplicationAgentFactoryTest {
+public class CoordinatingDistributionAgentFactoryTest {
 
     @Test
     public void testActivationWithoutConfig() throws Exception {
-        CoordinatingReplicationAgentFactory coordinatingReplicationAgentFactory = new CoordinatingReplicationAgentFactory();
+        CoordinatingDistributionAgentFactory coordinatingdistributionAgentFactory = new CoordinatingDistributionAgentFactory();
         BundleContext context = mock(BundleContext.class);
         Map<String, Object> config = new HashMap<String, Object>();
         try {
-            config.put(CoordinatingReplicationAgentFactory.NAME, "agentName");
-            coordinatingReplicationAgentFactory.activate(context, config);
+            config.put(CoordinatingDistributionAgentFactory.NAME, "agentName");
+            coordinatingdistributionAgentFactory.activate(context, config);
             fail("cannot activate a coordinate agents without exporters/importers");
         } catch (IllegalArgumentException e) {
             // expected to fail
@@ -52,14 +52,14 @@ public class CoordinatingReplicationAgen
 
     @Test
     public void testActivationWithEmptyImportersAndExporters() throws Exception {
-        CoordinatingReplicationAgentFactory coordinatingReplicationAgentFactory = new CoordinatingReplicationAgentFactory();
+        CoordinatingDistributionAgentFactory coordinatingdistributionAgentFactory = new CoordinatingDistributionAgentFactory();
         BundleContext context = mock(BundleContext.class);
         Map<String, Object> config = new HashMap<String, Object>();
-        config.put(CoordinatingReplicationAgentFactory.NAME, "agentName");
-        config.put(CoordinatingReplicationAgentFactory.PACKAGE_IMPORTER, new String[]{});
-        config.put(CoordinatingReplicationAgentFactory.PACKAGE_EXPORTER, new String[]{});
+        config.put(CoordinatingDistributionAgentFactory.NAME, "agentName");
+        config.put(CoordinatingDistributionAgentFactory.PACKAGE_IMPORTER, new String[]{});
+        config.put(CoordinatingDistributionAgentFactory.PACKAGE_EXPORTER, new String[]{});
         try {
-            coordinatingReplicationAgentFactory.activate(context, config);
+            coordinatingdistributionAgentFactory.activate(context, config);
             fail("cannot activate a coordinate agents with empty exporters/importers");
         } catch (IllegalArgumentException e) {
             // expected to fail
@@ -73,28 +73,28 @@ public class CoordinatingReplicationAgen
         BundleContext context = mock(BundleContext.class);
         Map<String, Object> config = new HashMap<String, Object>();
 
-        config.put(CoordinatingReplicationAgentFactory.NAME, "agentName");
-        config.put(CoordinatingReplicationAgentFactory.PACKAGE_IMPORTER, new String[]{"packageBuilder/type=vlt",
-                "endpoints[0]=http://host:101/libs/sling/replication/services/exporters/reverse-101",
-                "endpoints[1]=http://host:102/libs/sling/replication/services/exporters/reverse-102",
-                "endpoints[2]=http://host:103/libs/sling/replication/services/exporters/reverse-103",
+        config.put(CoordinatingDistributionAgentFactory.NAME, "agentName");
+        config.put(CoordinatingDistributionAgentFactory.PACKAGE_IMPORTER, new String[]{"packageBuilder/type=vlt",
+                "endpoints[0]=http://host:101/libs/sling/distribution/services/exporters/reverse-101",
+                "endpoints[1]=http://host:102/libs/sling/distribution/services/exporters/reverse-102",
+                "endpoints[2]=http://host:103/libs/sling/distribution/services/exporters/reverse-103",
                 "endpoints.strategy=All"});
-        config.put(CoordinatingReplicationAgentFactory.PACKAGE_EXPORTER, new String[]{"packageBuilder/type=vlt",
-                "endpoints[0]=http://localhost:101/libs/sling/replication/services/importers/default",
-                "endpoints[1]=http://localhost:102/libs/sling/replication/services/importers/default",
-                "endpoints[2]=http://localhost:103/libs/sling/replication/services/importers/default",
+        config.put(CoordinatingDistributionAgentFactory.PACKAGE_EXPORTER, new String[]{"packageBuilder/type=vlt",
+                "endpoints[0]=http://localhost:101/libs/sling/distribution/services/importers/default",
+                "endpoints[1]=http://localhost:102/libs/sling/distribution/services/importers/default",
+                "endpoints[2]=http://localhost:103/libs/sling/distribution/services/importers/default",
                 "endpoints.strategy=All"});
-        ReplicationComponentFactory replicationComponentFactory = mock(ReplicationComponentFactory.class);
-        ReplicationAgent replicationAgent = mock(ReplicationAgent.class);
-        CoordinatingReplicationAgentFactory coordinatingReplicationAgentFactory = new CoordinatingReplicationAgentFactory();
-        when(replicationComponentFactory.createComponent(ReplicationAgent.class, config, coordinatingReplicationAgentFactory)).
-                thenReturn(replicationAgent);
+        DistributionComponentFactory distributionComponentFactory = mock(DistributionComponentFactory.class);
+        DistributionAgent distributionAgent = mock(DistributionAgent.class);
+        CoordinatingDistributionAgentFactory coordinatingdistributionAgentFactory = new CoordinatingDistributionAgentFactory();
+        when(distributionComponentFactory.createComponent(DistributionAgent.class, config, coordinatingdistributionAgentFactory)).
+                thenReturn(distributionAgent);
 
-        Field componentFactory = coordinatingReplicationAgentFactory.getClass().getDeclaredField("componentFactory");
+        Field componentFactory = coordinatingdistributionAgentFactory.getClass().getDeclaredField("componentFactory");
         componentFactory.setAccessible(true);
-        componentFactory.set(coordinatingReplicationAgentFactory, replicationComponentFactory);
+        componentFactory.set(coordinatingdistributionAgentFactory, distributionComponentFactory);
 
-        coordinatingReplicationAgentFactory.activate(context, config);
+        coordinatingdistributionAgentFactory.activate(context, config);
     }
 
 }
\ No newline at end of file



Mime
View raw message