sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [7/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/serialization/impl/vlt/FileVaultDistributionPackage.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackage.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackage.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackage.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.serialization.impl.vlt;
+package org.apache.sling.distribution.serialization.impl.vlt;
 
 import javax.annotation.Nonnull;
 import java.io.File;
@@ -31,14 +31,14 @@ import org.apache.jackrabbit.vault.fs.ap
 import org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter;
 import org.apache.jackrabbit.vault.fs.config.MetaInf;
 import org.apache.jackrabbit.vault.packaging.VaultPackage;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.impl.AbstractReplicationPackage;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.impl.AbstractDistributionPackage;
 
 /**
- * a FileVault {@link ReplicationPackage}
+ * a FileVault {@link org.apache.sling.distribution.packaging.DistributionPackage}
  */
-public class FileVaultReplicationPackage extends AbstractReplicationPackage implements ReplicationPackage {
+public class FileVaultDistributionPackage extends AbstractDistributionPackage implements DistributionPackage {
 
     private static final long serialVersionUID = 1L;
 
@@ -50,7 +50,7 @@ public class FileVaultReplicationPackage
 
     private final String action;
 
-    public FileVaultReplicationPackage(VaultPackage pkg) {
+    public FileVaultDistributionPackage(VaultPackage pkg) {
         this.pkg = pkg;
         MetaInf metaInf = pkg.getMetaInf();
         String[] paths = new String[0];
@@ -67,7 +67,7 @@ public class FileVaultReplicationPackage
         }
         this.paths = paths;
         this.id = pkg.getFile().getAbsolutePath();
-        this.action = ReplicationActionType.ADD.toString();
+        this.action = DistributionActionType.ADD.toString();
     }
 
     @Nonnull
@@ -91,7 +91,7 @@ public class FileVaultReplicationPackage
 
     @Nonnull
     public String getType() {
-        return FileVaultReplicationPackageBuilder.PACKAGING_TYPE;
+        return FileVaultDistributionPackageBuilder.PACKAGING_TYPE;
     }
 
     @Nonnull
@@ -116,7 +116,7 @@ public class FileVaultReplicationPackage
 
     @Override
     public String toString() {
-        return "FileVaultReplicationPackage{" +
+        return "FileVaultDistributionPackage{" +
                 "id='" + id + '\'' +
                 ", paths=" + Arrays.toString(paths) +
                 ", pkg=" + pkg +

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilder.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilder.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilder.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilder.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.serialization.impl.vlt;
+package org.apache.sling.distribution.serialization.impl.vlt;
 
 import javax.jcr.Session;
 import java.io.File;
@@ -35,24 +35,24 @@ import org.apache.jackrabbit.vault.packa
 import org.apache.jackrabbit.vault.packaging.Packaging;
 import org.apache.jackrabbit.vault.packaging.VaultPackage;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
-import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
-import org.apache.sling.replication.serialization.ReplicationPackageReadingException;
-import org.apache.sling.replication.serialization.impl.AbstractReplicationPackageBuilder;
+import org.apache.sling.distribution.communication.DistributionRequest;
+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.AbstractDistributionPackageBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a {@link org.apache.sling.replication.serialization.ReplicationPackageBuilder} based on Apache Jackrabbit FileVault.
+ * a {@link org.apache.sling.distribution.serialization.DistributionPackageBuilder} based on Apache Jackrabbit FileVault.
  * <p/>
- * Each {@link org.apache.sling.replication.packaging.ReplicationPackage} created by <code>FileVaultReplicationPackageBuilder</code> is
+ * Each {@link org.apache.sling.distribution.packaging.DistributionPackage} created by <code>FileVaultdistributionPackageBuilder</code> is
  * backed by a {@link org.apache.jackrabbit.vault.packaging.VaultPackage}. 
  */
-public class FileVaultReplicationPackageBuilder extends AbstractReplicationPackageBuilder implements
-        ReplicationPackageBuilder {
+public class FileVaultDistributionPackageBuilder extends AbstractDistributionPackageBuilder implements
+        DistributionPackageBuilder {
 
     private static final String VERSION = "0.0.1";
 
@@ -66,21 +66,21 @@ public class FileVaultReplicationPackage
 
     private AccessControlHandling aclHandling;
 
-    public FileVaultReplicationPackageBuilder(Packaging packaging, ReplicationEventFactory replicationEventFactory) {
-        super(PACKAGING_TYPE, replicationEventFactory);
+    public FileVaultDistributionPackageBuilder(Packaging packaging, DistributionEventFactory distributionEventFactory) {
+        super(PACKAGING_TYPE, distributionEventFactory);
         this.packaging = packaging;
     }
 
-    public FileVaultReplicationPackageBuilder(Packaging packaging, ReplicationEventFactory replicationEventFactory, String importMode, String aclHandling) {
-        super(PACKAGING_TYPE, replicationEventFactory);
+    public FileVaultDistributionPackageBuilder(Packaging packaging, DistributionEventFactory distributionEventFactory, String importMode, String aclHandling) {
+        super(PACKAGING_TYPE, distributionEventFactory);
         this.packaging = packaging;
         this.importMode = ImportMode.valueOf(importMode);
         this.aclHandling = AccessControlHandling.valueOf(aclHandling);
     }
 
     @Override
-    protected ReplicationPackage createPackageForAdd(ResourceResolver resourceResolver, ReplicationRequest request)
-            throws ReplicationPackageBuildingException {
+    protected DistributionPackage createPackageForAdd(ResourceResolver resourceResolver, DistributionRequest request)
+            throws DistributionPackageBuildingException {
         Session session = null;
         try {
             session = getSession(resourceResolver);
@@ -96,7 +96,7 @@ public class FileVaultReplicationPackage
             inf.setFilter(filter);
 
             Properties props = new Properties();
-            String packageGroup = "sling/replication";
+            String packageGroup = "sling/distribution";
             props.setProperty(VaultPackage.NAME_GROUP, packageGroup);
             String packageName = String.valueOf(request.getTime());
             props.setProperty(VaultPackage.NAME_NAME, packageName);
@@ -109,19 +109,19 @@ public class FileVaultReplicationPackage
             opts.setRootPath("/");
             File tmpFile = File.createTempFile("rp-vlt-create-" + System.nanoTime(), ".zip");
             VaultPackage vaultPackage = packaging.getPackageManager().assemble(session, opts, tmpFile);
-            return new FileVaultReplicationPackage(vaultPackage);
+            return new FileVaultDistributionPackage(vaultPackage);
         } catch (Exception e) {
-            throw new ReplicationPackageBuildingException(e);
+            throw new DistributionPackageBuildingException(e);
         } finally {
             ungetSession(session);
         }
     }
 
     @Override
-    protected ReplicationPackage readPackageInternal(ResourceResolver resourceResolver, final InputStream stream)
-            throws ReplicationPackageReadingException {
+    protected DistributionPackage readPackageInternal(ResourceResolver resourceResolver, final InputStream stream)
+            throws DistributionPackageReadingException {
         log.debug("reading a stream");
-        ReplicationPackage pkg = null;
+        DistributionPackage pkg = null;
         try {
             File tmpFile = File.createTempFile("rp-vlt-read-" + System.nanoTime(), ".zip");
             FileOutputStream fileStream = new FileOutputStream(tmpFile);
@@ -131,42 +131,42 @@ public class FileVaultReplicationPackage
             VaultPackage vaultPackage = packaging.getPackageManager().open(tmpFile);
 
             if (vaultPackage != null) {
-                pkg = new FileVaultReplicationPackage(vaultPackage);
+                pkg = new FileVaultDistributionPackage(vaultPackage);
             } else {
                 log.warn("stream could not be read as a vlt package");
             }
 
         } catch (Exception e) {
-            throw new ReplicationPackageReadingException("could not read / install the package", e);
+            throw new DistributionPackageReadingException("could not read / install the package", e);
         }
         return pkg;
     }
 
 
     @Override
-    protected ReplicationPackage getPackageInternal(ResourceResolver resourceResolver, String id) {
-        ReplicationPackage replicationPackage = null;
+    protected DistributionPackage getPackageInternal(ResourceResolver resourceResolver, String id) {
+        DistributionPackage distributionPackage = null;
         try {
             File file = new File(id);
             if (file.exists()) {
                 VaultPackage pkg = packaging.getPackageManager().open(file);
-                replicationPackage = new FileVaultReplicationPackage(pkg);
+                distributionPackage = new FileVaultDistributionPackage(pkg);
             }
         } catch (Exception e) {
             log.warn("could not find a package with id : {}", id);
         }
-        return replicationPackage;
+        return distributionPackage;
     }
 
 
     @Override
-    public boolean installPackageInternal(ResourceResolver resourceResolver, ReplicationPackage replicationPackage) throws ReplicationPackageReadingException {
-        log.debug("reading a replication package stream");
+    public boolean installPackageInternal(ResourceResolver resourceResolver, DistributionPackage distributionPackage) throws DistributionPackageReadingException {
+        log.debug("reading a distribution package stream");
 
         Session session = null;
         try {
             session = getSession(resourceResolver);
-            File file = new File(replicationPackage.getId());
+            File file = new File(distributionPackage.getId());
             if (file.exists()) {
                 VaultPackage pkg = packaging.getPackageManager().open(file);
                 ImportOptions opts = new ImportOptions();
@@ -191,7 +191,7 @@ public class FileVaultReplicationPackage
             }
         } catch (Exception e) {
             log.error("could not read / install the package", e);
-            throw new ReplicationPackageReadingException(e);
+            throw new DistributionPackageReadingException(e);
         } finally {
             ungetSession(session);
         }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -25,31 +25,31 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.communication.ReplicationParameter;
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueItemState;
-import org.apache.sling.replication.resources.ReplicationConstants;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.communication.DistributionParameter;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.resources.DistributionConstants;
 
 /**
- * Servlet to retrieve a {@link org.apache.sling.replication.queue.ReplicationQueue} status.
+ * Servlet to retrieve a {@link org.apache.sling.distribution.queue.DistributionQueue} status.
  */
-@SlingServlet(resourceTypes = ReplicationConstants.AGENT_QUEUE_RESOURCE_TYPE, methods = {"GET", "POST", "DELETE"})
-public class ReplicationAgentQueueServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = DistributionConstants.AGENT_QUEUE_RESOURCE_TYPE, methods = {"GET", "POST", "DELETE"})
+public class DistributionAgentQueueServlet extends SlingAllMethodsServlet {
 
     @Override
     protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
         response.setContentType("application/json");
 
-        String queueName = request.getParameter(ReplicationParameter.QUEUE.toString());
+        String queueName = request.getParameter(DistributionParameter.QUEUE.toString());
 
-        ReplicationAgent agent = request.getResource().adaptTo(ReplicationAgent.class);
+        DistributionAgent agent = request.getResource().adaptTo(DistributionAgent.class);
 
         if (agent != null) {
             try {
-                ReplicationQueue queue = agent.getQueue(queueName);
+                DistributionQueue queue = agent.getQueue(queueName);
                 response.getWriter().write(toJSoN(queue)); // TODO : use json writer
                 response.setStatus(200);
             } catch (Exception e) {
@@ -78,19 +78,19 @@ public class ReplicationAgentQueueServle
     @Override
     protected void doDelete(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
-        ReplicationQueue queue = request.getResource().adaptTo(ReplicationQueue.class);
+        DistributionQueue queue = request.getResource().adaptTo(DistributionQueue.class);
 
         while (!queue.isEmpty()) {
-            ReplicationQueueItem queueItem = queue.getHead();
+            DistributionQueueItem queueItem = queue.getHead();
             queue.remove(queueItem.getId());
         }
     }
 
-    private String toJSoN(ReplicationQueue queue) throws Exception {
+    private String toJSoN(DistributionQueue queue) throws Exception {
         StringBuilder builder = new StringBuilder("{\"name\":\"" + queue.getName() + "\",\"empty\":" + queue.isEmpty());
         if (!queue.isEmpty()) {
             builder.append(",\"items\":[");
-            for (ReplicationQueueItem item : queue.getItems(null)) {
+            for (DistributionQueueItem item : queue.getItems(null)) {
                 builder.append('{');
                 builder.append(toJSoN(item));
                 builder.append(',');
@@ -104,7 +104,7 @@ public class ReplicationAgentQueueServle
         return builder.toString();
     }
 
-    private String toJSoN(ReplicationQueueItemState status) {
+    private String toJSoN(DistributionQueueItemState status) {
         StringBuilder builder = new StringBuilder("\"attempts\":" + status.getAttempts() + ",\"state\":\"" +
                 status.getItemState().name() + "\"");
         if (status.getEntered() != null) {
@@ -113,7 +113,7 @@ public class ReplicationAgentQueueServle
         return builder.toString();
     }
 
-    private String toJSoN(ReplicationQueueItem item) {
+    private String toJSoN(DistributionQueueItem item) {
         StringBuilder builder = new StringBuilder();
         builder.append("\"id\":\"").append(item.getId().replace("\\", "\\\\"));
         builder.append("\",\"paths\":[");

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentRootServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentRootServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentRootServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentRootServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentRootServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentRootServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentRootServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -26,19 +26,19 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.agent.ReplicationAgentException;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.resources.ReplicationConstants;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.agent.DistributionAgentException;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.resources.DistributionConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet for aggregate replication on all agents
+ * Servlet for aggregate distribution on all agents
  */
-@SlingServlet(resourceTypes = ReplicationConstants.AGENT_ROOT_RESOURCE_TYPE, methods = "POST")
-public class ReplicationAgentRootServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = DistributionConstants.AGENT_ROOT_RESOURCE_TYPE, methods = "POST")
+public class DistributionAgentRootServlet extends SlingAllMethodsServlet {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -51,24 +51,24 @@ public class ReplicationAgentRootServlet
     protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
 
-        ReplicationAgent[] agents = request.getResource().adaptTo(ReplicationAgent[].class);
+        DistributionAgent[] agents = request.getResource().adaptTo(DistributionAgent[].class);
 
         String a = request.getParameter(ACTION_PARAMETER);
         String[] paths = request.getParameterValues(PATH_PARAMETER);
 
-        ReplicationActionType action = ReplicationActionType.fromName(a);
+        DistributionActionType action = DistributionActionType.fromName(a);
 
 
-        ReplicationRequest replicationRequest = new ReplicationRequest(System.currentTimeMillis(),
+        DistributionRequest distributionRequest = new DistributionRequest(System.currentTimeMillis(),
                 action, paths);
 
         ResourceResolver resourceResolver = request.getResourceResolver();
 
         boolean failed = false;
-        for (ReplicationAgent agent : agents) {
+        for (DistributionAgent agent : agents) {
             try {
-                agent.execute(resourceResolver, replicationRequest);
-            } catch (ReplicationAgentException e) {
+                agent.execute(resourceResolver, distributionRequest);
+            } catch (DistributionAgentException e) {
                 log.warn("agent {} execution failed", agent, e);
 
                 response.getWriter().append("error :'").append(e.toString()).append("'");

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -29,21 +29,21 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.agent.ReplicationAgentException;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.communication.ReplicationResponse;
-import org.apache.sling.replication.queue.ReplicationQueueItemState.ItemState;
-import org.apache.sling.replication.resources.ReplicationConstants;
-import org.apache.sling.replication.util.RequestUtils;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.agent.DistributionAgentException;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.communication.DistributionResponse;
+import org.apache.sling.distribution.queue.DistributionQueueItemState.ItemState;
+import org.apache.sling.distribution.resources.DistributionConstants;
+import org.apache.sling.distribution.util.RequestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to ask {@link ReplicationAgent}s to replicate (via HTTP POST).
+ * Servlet to ask {@link org.apache.sling.distribution.agent.DistributionAgent}s to replicate (via HTTP POST).
  */
-@SlingServlet(resourceTypes = ReplicationConstants.AGENT_RESOURCE_TYPE, methods = "POST")
-public class ReplicationAgentServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = DistributionConstants.AGENT_RESOURCE_TYPE, methods = "POST")
+public class DistributionAgentServlet extends SlingAllMethodsServlet {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -53,36 +53,36 @@ public class ReplicationAgentServlet ext
 
         response.setContentType("application/json");
 
-        ReplicationRequest replicationRequest = RequestUtils.fromServletRequest(request);
+        DistributionRequest distributionRequest = RequestUtils.fromServletRequest(request);
 
-        ReplicationAgent agent = request.getResource().adaptTo(ReplicationAgent.class);
+        DistributionAgent agent = request.getResource().adaptTo(DistributionAgent.class);
 
         ResourceResolver resourceResolver = request.getResourceResolver();
 
         if (agent != null) {
             try {
-                ReplicationResponse replicationResponse = agent.execute(resourceResolver, replicationRequest);
-                if (replicationResponse.isSuccessful()) {
-                    if (ItemState.SUCCEEDED.toString().equals(replicationResponse.getStatus())) {
+                DistributionResponse distributionResponse = agent.execute(resourceResolver, distributionRequest);
+                if (distributionResponse.isSuccessful()) {
+                    if (ItemState.SUCCEEDED.toString().equals(distributionResponse.getStatus())) {
                         response.setStatus(200);
                     }
-                    if (ItemState.QUEUED.toString().equals(replicationResponse.getStatus())
+                    if (ItemState.QUEUED.toString().equals(distributionResponse.getStatus())
                             || ItemState.ACTIVE.toString().equals(
-                            replicationResponse.getStatus())) {
+                            distributionResponse.getStatus())) {
                         response.setStatus(202);
                     }
 
                 }
                 else {
-                    if (ItemState.DROPPED.toString().equals(replicationResponse.getStatus())) {
+                    if (ItemState.DROPPED.toString().equals(distributionResponse.getStatus())) {
                         response.setStatus(404);
                     } else {
                         response.setStatus(400);
                     }
                 }
 
-                response.getWriter().append(replicationResponse.toString());
-            } catch (ReplicationAgentException e) {
+                response.getWriter().append(distributionResponse.toString());
+            } catch (DistributionAgentException e) {
                 response.setStatus(503);
                 response.getWriter().append("{\"error\" : \"").append(e.toString()).append("\"}");
             }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageExporterServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageExporterServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageExporterServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageExporterServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -30,19 +30,19 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageExporter;
-import org.apache.sling.replication.resources.ReplicationConstants;
-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.packaging.DistributionPackageExporter;
+import org.apache.sling.distribution.resources.DistributionConstants;
+import org.apache.sling.distribution.util.RequestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to handle fetching of replication content.
+ * Servlet to handle fetching of distribution content.
  */
-@SlingServlet(resourceTypes = ReplicationConstants.EXPORTER_RESOURCE_TYPE, methods = "POST")
-public class ReplicationPackageExporterServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = DistributionConstants.EXPORTER_RESOURCE_TYPE, methods = "POST")
+public class DistributionPackageExporterServlet extends SlingAllMethodsServlet {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -50,40 +50,40 @@ public class ReplicationPackageExporterS
     protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
 
-        ReplicationPackageExporter replicationPackageExporter = request
+        DistributionPackageExporter distributionPackageExporter = request
                 .getResource()
-                .adaptTo(ReplicationPackageExporter.class);
+                .adaptTo(DistributionPackageExporter.class);
 
         final long start = System.currentTimeMillis();
 
         response.setContentType(ContentType.APPLICATION_OCTET_STREAM.toString());
 
-        ReplicationRequest replicationRequest = RequestUtils.fromServletRequest(request);
+        DistributionRequest distributionRequest = RequestUtils.fromServletRequest(request);
         ResourceResolver resourceResolver = request.getResourceResolver();
 
         int consumed = 0;
         int fetched = 0;
         try {
             // get all items
-            List<ReplicationPackage> replicationPackages = replicationPackageExporter.exportPackages(resourceResolver, replicationRequest);
-            fetched = replicationPackages.size();
+            List<DistributionPackage> distributionPackages = distributionPackageExporter.exportPackages(resourceResolver, distributionRequest);
+            fetched = distributionPackages.size();
 
-            if (replicationPackages.size() > 0) {
-                log.info("{} package(s) available for fetching", replicationPackages.size());
+            if (distributionPackages.size() > 0) {
+                log.info("{} package(s) available for fetching", distributionPackages.size());
 
-                for (ReplicationPackage replicationPackage : replicationPackages) {
-                    if (replicationPackage != null) {
+                for (DistributionPackage distributionPackage : distributionPackages) {
+                    if (distributionPackage != null) {
                         InputStream inputStream = null;
                         int bytesCopied = -1;
                         try {
-                            inputStream = replicationPackage.createInputStream();
+                            inputStream = distributionPackage.createInputStream();
                             bytesCopied = IOUtils.copy(inputStream, response.getOutputStream());
                         } finally {
                             IOUtils.closeQuietly(inputStream);
                         }
 
                         // delete the package permanently
-                        replicationPackage.delete();
+                        distributionPackage.delete();
 
                         // everything ok
                         response.setStatus(200);
@@ -102,7 +102,7 @@ public class ReplicationPackageExporterS
             log.error("error while exporting from {}", request.getRequestURL(), e);
         } finally {
             long end = System.currentTimeMillis();
-            log.info("Processed replication export request in {} ms: : consumed {} of {}", new Object[]{end - start, consumed, fetched});
+            log.info("Processed distribution export request in {} ms: : consumed {} of {}", new Object[]{end - start, consumed, fetched});
         }
     }
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageImporterServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageImporterServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageImporterServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -27,17 +27,17 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.resources.ReplicationConstants;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.resources.DistributionConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to handle reception of replication content.
+ * Servlet to handle reception of distribution content.
  */
-@SlingServlet(resourceTypes = ReplicationConstants.IMPORTER_RESOURCE_TYPE, methods = "POST")
-public class ReplicationPackageImporterServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = DistributionConstants.IMPORTER_RESOURCE_TYPE, methods = "POST")
+public class DistributionPackageImporterServlet extends SlingAllMethodsServlet {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -45,9 +45,9 @@ public class ReplicationPackageImporterS
     protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
             throws ServletException, IOException {
 
-        ReplicationPackageImporter replicationPackageImporter = request
+        DistributionPackageImporter distributionPackageImporter = request
                 .getResource()
-                .adaptTo(ReplicationPackageImporter.class);
+                .adaptTo(DistributionPackageImporter.class);
 
         boolean success = false;
         final long start = System.currentTimeMillis();
@@ -57,18 +57,18 @@ public class ReplicationPackageImporterS
         InputStream stream = request.getInputStream();
         ResourceResolver resourceResolver = request.getResourceResolver();
         try {
-            ReplicationPackage replicationPackage = replicationPackageImporter.importStream(resourceResolver, stream);
-            if (replicationPackage != null) {
-                replicationPackage.delete();
+            DistributionPackage distributionPackage = distributionPackageImporter.importStream(resourceResolver, stream);
+            if (distributionPackage != null) {
+                distributionPackage.delete();
             } else {
-                log.warn("cannot import replication package from request {}", request);
+                log.warn("cannot import distribution package from request {}", request);
                 response.setStatus(400);
                 response.getWriter().print("error: could not import a package from the request stream");
             }
         } catch (final Exception e) {
             response.setStatus(400);
             response.getWriter().print("error: " + e.toString());
-            log.error("Error during replication import: {}", e.getMessage(), e);
+            log.error("Error during distribution import: {}", e.getMessage(), e);
         } finally {
             long end = System.currentTimeMillis();
             log.info("Processed package import request in {} ms: : {}", new Object[]{end - start, success});

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionTriggerServlet.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionTriggerServlet.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionTriggerServlet.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionTriggerServlet.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.servlet;
+package org.apache.sling.distribution.servlet;
 
 import javax.annotation.Nonnull;
 import javax.servlet.ServletException;
@@ -28,18 +28,18 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-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.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;
 
 /**
  * Triggers Server Sent Events servlet
  */
-@SlingServlet(resourceTypes = "sling/replication/service/trigger", extensions = "event", methods = "GET")
-public class ReplicationTriggerServlet extends SlingAllMethodsServlet {
+@SlingServlet(resourceTypes = "sling/distribution/service/trigger", extensions = "event", methods = "GET")
+public class DistributionTriggerServlet extends SlingAllMethodsServlet {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -61,7 +61,7 @@ public class ReplicationTriggerServlet e
             seconds = DEFAULT_NUMBER_OF_SECONDS;
         }
 
-        ReplicationTrigger replicationTrigger = request.getResource().adaptTo(ReplicationTrigger.class);
+        DistributionTrigger distributionTrigger = request.getResource().adaptTo(DistributionTrigger.class);
 
         // setup SSE headers
         response.setContentType("text/event-stream");
@@ -75,13 +75,13 @@ public class ReplicationTriggerServlet e
 
         final PrintWriter writer = response.getWriter();
 
-        ReplicationRequestHandler replicationRequestHandler = new ReplicationRequestHandler() {
-            public void handle(@Nonnull ReplicationRequest request) {
+        DistributionRequestHandler distributionRequestHandler = new DistributionRequestHandler() {
+            public void handle(@Nonnull DistributionRequest request) {
                 writeEvent(writer, request);
             }
         };
         try {
-            replicationTrigger.register(replicationRequestHandler);
+            distributionTrigger.register(distributionRequestHandler);
 
             try {
                 Thread.sleep(seconds * 1000);
@@ -89,28 +89,28 @@ public class ReplicationTriggerServlet e
                 log.error("thread interrupted", e);
             }
 
-            replicationTrigger.unregister(replicationRequestHandler);
+            distributionTrigger.unregister(distributionRequestHandler);
 
-        } catch (ReplicationTriggerException e) {
+        } catch (DistributionTriggerException e) {
             response.setStatus(400);
             response.getWriter().write("error while (un)registering trigger " + e.toString());
         }
     }
 
     /* Write a single server-sent event to the response stream for the given event and message */
-    private void writeEvent(PrintWriter writer, ReplicationRequest replicationRequest) {
+    private void writeEvent(PrintWriter writer, DistributionRequest distributionRequest) {
 
         // write the event type (make sure to include the double newline)
-        writer.write("id: " + replicationRequest.getTime() + "\n");
+        writer.write("id: " + distributionRequest.getTime() + "\n");
 
         // write the actual data
         // this could be simple text or could be JSON-encoded text that the
         // client then decodes
-        writer.write("data: " + replicationRequest.getAction() + " " + Arrays.toString(replicationRequest.getPaths()) + "\n\n");
+        writer.write("data: " + distributionRequest.getAction() + " " + Arrays.toString(distributionRequest.getPaths()) + "\n\n");
 
         // flush the buffers to make sure the container sends the bytes
         writer.flush();
-        log.debug("SSE event {}: {} {}", new Object[]{replicationRequest.getTime(), replicationRequest.getAction(),
-                replicationRequest.getPaths()});
+        log.debug("SSE event {}: {} {}", new Object[]{distributionRequest.getTime(), distributionRequest.getAction(),
+                distributionRequest.getPaths()});
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportException.java Fri Nov  7 10:28:02 2014
@@ -16,20 +16,20 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport;
+package org.apache.sling.distribution.transport;
 
 /**
- * Represents an error happened while a {@link ReplicationTransportHandler} is delivering a replication item to
+ * Represents an error happened while a {@link DistributionTransportHandler} is delivering a distribution item to
  * and endpoint.
  */
 @SuppressWarnings("serial")
-public class ReplicationTransportException extends Exception {
+public class DistributionTransportException extends Exception {
 
-    public ReplicationTransportException(Exception e) {
+    public DistributionTransportException(Exception e) {
         super(e);
     }
 
-    public ReplicationTransportException(String string) {
+    public DistributionTransportException(String string) {
         super(string);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportHandler.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportHandler.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportHandler.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/DistributionTransportHandler.java Fri Nov  7 10:28:02 2014
@@ -16,42 +16,41 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport;
+package org.apache.sling.distribution.transport;
 
 import javax.annotation.Nonnull;
 import java.util.List;
 
 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.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
 
 /**
- * A {@link org.apache.sling.replication.transport.ReplicationTransportHandler} is responsible for implementing the transport of a
- * {@link ReplicationPackage}s to / from another instance described by a {@link ReplicationEndpoint}.
- * {@link org.apache.sling.replication.transport.ReplicationTransportHandler} implementations are meant to be stateful,
+ * A {@link DistributionTransportHandler} is responsible for implementing the transport of a
+ * {@link org.apache.sling.distribution.packaging.DistributionPackage}s to / from another instance described by a {@link org.apache.sling.distribution.transport.impl.DistributionEndpoint}.
+ * {@link DistributionTransportHandler} implementations are meant to be stateful,
  * so all the information regarding the target endpoint of the transport algorithm is part of its state and thus not exposed
  * in the API.
  */
-public interface ReplicationTransportHandler {
+public interface DistributionTransportHandler {
 
     /**
-     * Delivers a given {@link ReplicationPackage}
+     * Delivers a given {@link org.apache.sling.distribution.packaging.DistributionPackage}
      *
      * @param resourceResolver   used to eventually access local resources needed by the transport algorithm
-     * @param replicationPackage a {@link org.apache.sling.replication.packaging.ReplicationPackage} to transport
-     * @throws ReplicationTransportException if any error occurs during the transport
+     * @param distributionPackage a {@link org.apache.sling.distribution.packaging.DistributionPackage} to transport
+     * @throws DistributionTransportException if any error occurs during the transport
      */
-    void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationTransportException;
+    void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionTransportException;
 
     /**
-     * Retrieves a list of {@link ReplicationPackage}
+     * Retrieves a list of {@link org.apache.sling.distribution.packaging.DistributionPackage}
      *
      * @param resourceResolver   used to eventually access local resources needed by the transport algorithm
-     * @param replicationRequest the replication request
-     * @throws ReplicationTransportException if any error occurs during the transport
+     * @param distributionRequest the distribution request
+     * @throws DistributionTransportException if any error occurs during the transport
      */
     @Nonnull
-    List<ReplicationPackage> retrievePackages(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest) throws ReplicationTransportException;
+    List<DistributionPackage> retrievePackages(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionTransportException;
 
 }
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.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.authentication;
+package org.apache.sling.distribution.transport.authentication;
 
 import java.util.HashMap;
 import java.util.Map;

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.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.authentication;
+package org.apache.sling.distribution.transport.authentication;
 
 /**
  * Represents an error in transport authentication

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java Fri Nov  7 10:28:02 2014
@@ -16,20 +16,20 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.authentication;
+package org.apache.sling.distribution.transport.authentication;
 
 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.transport.authentication.TransportAuthenticationProvider} is responsible for
- * authentication of instances sending and receiving replication items via {@link org.apache.sling.replication.transport.ReplicationTransportHandler}s
- * A {@link org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider} will authenticate
+ * A {@link org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider} is responsible for
+ * authentication of instances sending and receiving distribution items via {@link org.apache.sling.distribution.transport.DistributionTransportHandler}s
+ * A {@link org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider} will authenticate
  * 'authenticables' objects of type {@link A}, producing 'authenticated' objects of type {@link T}.
  *
  */
 @ConsumerType
-public interface TransportAuthenticationProvider<A, T> extends ReplicationComponent {
+public interface TransportAuthenticationProvider<A, T> extends DistributionComponent {
 
     /**
      * Check if this provider is able to authenticate objects belonging to given 'authenticable' class.
@@ -42,7 +42,7 @@ public interface TransportAuthentication
 
     /**
      * Authenticate an 'authenticable' object by performing some implementation specific operation on it, and producing
-     * an 'authenticated' object to be passed back to the {@link org.apache.sling.replication.transport.ReplicationTransportHandler}.
+     * an 'authenticated' object to be passed back to the {@link org.apache.sling.distribution.transport.DistributionTransportHandler}.
      * The returned 'authenticated' object may be of the same class of the 'authenticable' object (e.g. passing an 'authenticable'
      * http client and returning an 'authenticated' http client) or of a different class (e.g. passing an 'authenticable'
      * jcr repository and returning an 'authenticated' jcr session).

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/NopTransportAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/NopTransportAuthenticationProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/NopTransportAuthenticationProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/NopTransportAuthenticationProvider.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.transport.authentication.impl;
+package org.apache.sling.distribution.transport.authentication.impl;
 
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationException;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationException;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 
 /**
- * {@link org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider} used when no authentication is required
+ * {@link org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider} used when no authentication is required
  */
 public class NopTransportAuthenticationProvider implements TransportAuthenticationProvider<Object, Object> {
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProvider.java Fri Nov  7 10:28:02 2014
@@ -16,15 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.authentication.impl;
+package org.apache.sling.distribution.transport.authentication.impl;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationException;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationException;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java Fri Nov  7 10:28:02 2014
@@ -16,17 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.authentication.impl;
+package org.apache.sling.distribution.transport.authentication.impl;
 
 import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.fluent.Executor;
-import org.apache.sling.replication.transport.impl.ReplicationEndpoint;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationException;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.impl.DistributionEndpoint;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationException;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +50,7 @@ public class UserCredentialsTransportAut
 
     public Object authenticate(Object authenticable, TransportAuthenticationContext context) throws TransportAuthenticationException {
 
-        ReplicationEndpoint endpoint = context.getAttribute("endpoint", ReplicationEndpoint.class);
+        DistributionEndpoint endpoint = context.getAttribute("endpoint", DistributionEndpoint.class);
 
         if (endpoint == null) {
             throw new TransportAuthenticationException("the endpoint to authenticate is missing from the context");

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=1637333&r1=1637123&r2=1637333&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 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.authentication.impl;
+package org.apache.sling.distribution.transport.authentication.impl;
 
 import java.util.Map;
 
@@ -25,10 +25,10 @@ import org.apache.felix.scr.annotations.
 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.replication.component.ReplicationComponentFactory;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationException;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationException;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,26 +40,26 @@ import org.slf4j.LoggerFactory;
 public class UserCredentialsTransportAuthenticationProviderFactory implements
         TransportAuthenticationProvider {
 
-    @Property(value = ReplicationComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER, propertyPrivate = true)
-    private static final String TYPE = ReplicationComponentFactory.COMPONENT_TYPE;
+    @Property(value = DistributionComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER, propertyPrivate = true)
+    private static final String TYPE = DistributionComponentFactory.COMPONENT_TYPE;
 
     @Property
-    public final static String USERNAME = ReplicationComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_USERNAME;
+    public final static String USERNAME = DistributionComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_USERNAME;
 
     @Property
-    public final static String PASSWORD = ReplicationComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_PASSWORD;
+    public final static String PASSWORD = DistributionComponentFactory.TRANSPORT_AUTHENTICATION_PROVIDER_USER_PROPERTY_PASSWORD;
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
 
     @Reference
-    ReplicationComponentFactory replicationComponentFactory;
+    DistributionComponentFactory distributionComponentFactory;
 
     private TransportAuthenticationProvider transportAuthenticationProvider;
 
 
     public void activate(Map<String, Object> config) {
-        transportAuthenticationProvider = replicationComponentFactory.createComponent(TransportAuthenticationProvider.class, config, null);
+        transportAuthenticationProvider = distributionComponentFactory.createComponent(TransportAuthenticationProvider.class, config, null);
     }
 
     public Object authenticate(Object authenticable, TransportAuthenticationContext context)

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

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/AdvancedHttpDistributionTransportHandler.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandler.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/AdvancedHttpDistributionTransportHandler.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/AdvancedHttpDistributionTransportHandler.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandler.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/AdvancedHttpDistributionTransportHandler.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.ByteArrayInputStream;
@@ -33,27 +33,26 @@ import org.apache.http.client.fluent.Req
 import org.apache.http.client.fluent.Response;
 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.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
-import org.apache.sling.replication.transport.ReplicationTransportException;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+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.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Advanced HTTP {@link org.apache.sling.replication.transport.ReplicationTransportHandler} supporting custom HTTP headers
+ * Advanced HTTP {@link org.apache.sling.distribution.transport.DistributionTransportHandler} supporting custom HTTP headers
  * and body.
  */
-public class AdvancedHttpReplicationTransportHandler extends SimpleHttpReplicationTransportHandler {
+public class AdvancedHttpDistributionTransportHandler extends SimpleHttpDistributionTransportHandler {
 
     private static final String PATH_VARIABLE_NAME = "{path}";
 
-    private static final Logger log = LoggerFactory.getLogger(AdvancedHttpReplicationTransportHandler.class);
+    private static final Logger log = LoggerFactory.getLogger(AdvancedHttpDistributionTransportHandler.class);
 
     private final TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider;
-    private final ReplicationEndpoint replicationEndpoint;
+    private final DistributionEndpoint distributionEndpoint;
 
     private final boolean useCustomHeaders;
 
@@ -63,42 +62,42 @@ public class AdvancedHttpReplicationTran
 
     private final String customBody;
 
-    public AdvancedHttpReplicationTransportHandler(boolean useCustomHeaders,
-                                                   String[] customHeaders,
-                                                   boolean useCustomBody,
-                                                   String customBody,
-                                                   TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider,
-                                                   ReplicationEndpoint replicationEndpoint,
-                                                   ReplicationPackageBuilder packageBuilder,
-                                                   int maxNoOfPackages) {
+    public AdvancedHttpDistributionTransportHandler(boolean useCustomHeaders,
+                                                    String[] customHeaders,
+                                                    boolean useCustomBody,
+                                                    String customBody,
+                                                    TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider,
+                                                    DistributionEndpoint distributionEndpoint,
+                                                    DistributionPackageBuilder packageBuilder,
+                                                    int maxNoOfPackages) {
 
 
-        super(transportAuthenticationProvider, replicationEndpoint, packageBuilder, maxNoOfPackages);
+        super(transportAuthenticationProvider, distributionEndpoint, packageBuilder, maxNoOfPackages);
         this.useCustomHeaders = useCustomHeaders;
         this.customHeaders = customHeaders;
         this.useCustomBody = useCustomBody;
         this.customBody = customBody;
         this.transportAuthenticationProvider = transportAuthenticationProvider;
 
-        this.replicationEndpoint = replicationEndpoint;
+        this.distributionEndpoint = distributionEndpoint;
     }
 
     @Override
-    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationTransportException {
+    public void deliverPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionTransportException {
         log.info("delivering package {} to {} using auth {}",
-                new Object[]{replicationPackage.getId(),
-                        replicationEndpoint.getUri(), transportAuthenticationProvider});
+                new Object[]{distributionPackage.getId(),
+                        distributionEndpoint.getUri(), transportAuthenticationProvider});
 
         try {
             Executor executor = Executor.newInstance();
             TransportAuthenticationContext context = new TransportAuthenticationContext();
-            context.addAttribute("endpoint", replicationEndpoint);
+            context.addAttribute("endpoint", distributionEndpoint);
             executor = transportAuthenticationProvider.authenticate(executor, context);
 
-            deliverPackage(executor, replicationPackage, replicationEndpoint);
+            deliverPackage(executor, distributionPackage, distributionEndpoint);
 
         } catch (Exception ex) {
-            throw new ReplicationTransportException(ex);
+            throw new DistributionTransportException(ex);
         }
 
     }
@@ -141,15 +140,15 @@ public class AdvancedHttpReplicationTran
         return boundHeaders.toArray(new String[boundHeaders.size()]);
     }
 
-    private void deliverPackage(Executor executor, ReplicationPackage replicationPackage,
-                                ReplicationEndpoint replicationEndpoint) throws IOException {
-        String type = replicationPackage.getType();
+    private void deliverPackage(Executor executor, DistributionPackage distributionPackage,
+                                DistributionEndpoint distributionEndpoint) throws IOException {
+        String type = distributionPackage.getType();
 
 
-        Request req = Request.Post(replicationEndpoint.getUri()).useExpectContinue();
+        Request req = Request.Post(distributionEndpoint.getUri()).useExpectContinue();
 
         if (useCustomHeaders) {
-            String[] customizedHeaders = getCustomizedHeaders(customHeaders, replicationPackage.getAction(), replicationPackage.getPaths());
+            String[] customizedHeaders = getCustomizedHeaders(customHeaders, distributionPackage.getAction(), distributionPackage.getPaths());
             for (String header : customizedHeaders) {
                 addHeader(req, header);
             }
@@ -162,7 +161,7 @@ public class AdvancedHttpReplicationTran
                 String body = customBody == null ? "" : customBody;
                 inputStream = new ByteArrayInputStream(body.getBytes("UTF-8"));
             } else {
-                inputStream = replicationPackage.createInputStream();
+                inputStream = distributionPackage.createInputStream();
             }
 
             req = req.bodyStream(inputStream, ContentType.APPLICATION_OCTET_STREAM);
@@ -174,8 +173,8 @@ public class AdvancedHttpReplicationTran
 
         if (response != null) {
             Content content = response.returnContent();
-            log.info("Replication content of type {} for {} delivered: {}", new Object[]{
-                    type, Arrays.toString(replicationPackage.getPaths()), content});
+            log.info("Distribution content of type {} for {} delivered: {}", new Object[]{
+                    type, Arrays.toString(distributionPackage.getPaths()), content});
         } else {
             throw new IOException("response is empty");
         }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/DistributionEndpoint.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/ReplicationEndpoint.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/DistributionEndpoint.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/DistributionEndpoint.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/ReplicationEndpoint.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/ReplicationEndpoint.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/DistributionEndpoint.java Fri Nov  7 10:28:02 2014
@@ -16,27 +16,27 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.transport.impl;
+package org.apache.sling.distribution.transport.impl;
 
 import java.net.URI;
 
 /**
- * A replication endpoint
+ * A distribution endpoint
  */
-public class ReplicationEndpoint {
+public class DistributionEndpoint {
 
     private final URI uri;
 
-    public ReplicationEndpoint(URI uri) {
+    public DistributionEndpoint(URI uri) {
         this.uri = uri;
     }
 
-    public ReplicationEndpoint(String uriString) {
+    public DistributionEndpoint(String uriString) {
         this.uri = URI.create(uriString);
     }
 
     /**
-     * get the URI of this replication endpoint
+     * get the URI of this distribution endpoint
      *
      * @return a <code>URI</code>
      */
@@ -54,7 +54,7 @@ public class ReplicationEndpoint {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
 
-        ReplicationEndpoint that = (ReplicationEndpoint) o;
+        DistributionEndpoint that = (DistributionEndpoint) o;
 
         return uri.equals(that.uri);
 



Mime
View raw message