sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [6/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
Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java Fri Nov  7 10:28:02 2014
@@ -16,47 +16,47 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.jobhandling;
+package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.sling.event.jobs.Job;
-import org.apache.sling.replication.packaging.ReplicationPackageInfo;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
+import org.apache.sling.distribution.packaging.DistributionPackageInfo;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
 
 public class JobHandlingUtils {
 
-    private static final String PATHS = "replication.package.paths";
+    private static final String PATHS = "distribution.package.paths";
 
-    public static final String ID = "replication.package.id";
+    public static final String ID = "distribution.package.id";
 
-    private static final String TYPE = "replication.package.type";
+    private static final String TYPE = "distribution.package.type";
 
-    protected static final String ACTION = "replication.package.action";
+    protected static final String ACTION = "distribution.package.action";
 
-    protected static final String ORIGIN = "replication.package.origin";
+    protected static final String ORIGIN = "distribution.package.origin";
 
-    public static ReplicationQueueItem getPackage(final Job job) {
-        ReplicationPackageInfo packageInfo = new ReplicationPackageInfo();
+    public static DistributionQueueItem getPackage(final Job job) {
+        DistributionPackageInfo packageInfo = new DistributionPackageInfo();
         packageInfo.setOrigin((String) job.getProperty(ORIGIN));
 
-        return new ReplicationQueueItem((String) job.getProperty(ID),
+        return new DistributionQueueItem((String) job.getProperty(ID),
                 (String[]) job.getProperty(PATHS),
                 String.valueOf(job.getProperty(ACTION)),
                 String.valueOf(job.getProperty(TYPE)), packageInfo);
     }
 
     public static Map<String, Object> createFullProperties(
-            ReplicationQueueItem replicationQueueItem) {
+            DistributionQueueItem distributionQueueItem) {
         Map<String, Object> properties = new HashMap<String, Object>();
 
-        properties.put(ID, replicationQueueItem.getId());
-        properties.put(PATHS, replicationQueueItem.getPaths());
-        properties.put(ACTION, replicationQueueItem.getAction());
-        properties.put(TYPE, replicationQueueItem.getType());
+        properties.put(ID, distributionQueueItem.getId());
+        properties.put(PATHS, distributionQueueItem.getPaths());
+        properties.put(ACTION, distributionQueueItem.getAction());
+        properties.put(TYPE, distributionQueueItem.getType());
 
-        ReplicationPackageInfo packageInfo = replicationQueueItem.getPackageInfo();
+        DistributionPackageInfo packageInfo = distributionQueueItem.getPackageInfo();
         if (packageInfo != null && packageInfo.getOrigin() != null) {
             properties.put(ORIGIN, packageInfo.getOrigin());
         }
@@ -73,9 +73,9 @@ public class JobHandlingUtils {
     public static String getQueueName(Job job) {
 
         String topic = job.getTopic();
-        if (topic == null || !topic.startsWith(JobHandlingReplicationQueue.REPLICATION_QUEUE_TOPIC)) return null;
+        if (topic == null || !topic.startsWith(JobHandlingDistributionQueue.DISTRIBUTION_QUEUE_TOPIC)) return null;
 
-        String queue = topic.substring(JobHandlingReplicationQueue.REPLICATION_QUEUE_TOPIC.length() + 1);
+        String queue = topic.substring(JobHandlingDistributionQueue.DISTRIBUTION_QUEUE_TOPIC.length() + 1);
         int idx = queue.indexOf("/");
 
         if (idx < 0) return "";

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/ScheduledDistributionQueueProcessorTask.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessorTask.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/ScheduledDistributionQueueProcessorTask.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/ScheduledDistributionQueueProcessorTask.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessorTask.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessorTask.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/ScheduledDistributionQueueProcessorTask.java Fri Nov  7 10:28:02 2014
@@ -16,38 +16,37 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.simple;
+package org.apache.sling.distribution.queue.impl.simple;
 
 import java.util.Arrays;
 
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueProcessor;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueProcessor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a simple scheduled {@link SimpleReplicationQueue}s processor
+ * a simple scheduled {@link SimpleDistributionQueue}s processor
  */
-public class ScheduledReplicationQueueProcessorTask implements Runnable {
+public class ScheduledDistributionQueueProcessorTask implements Runnable {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
-    private final SimpleReplicationQueueProvider queueProvider;
-    private final ReplicationQueueProcessor queueProcessor;
+    private final SimpleDistributionQueueProvider queueProvider;
+    private final DistributionQueueProcessor queueProcessor;
 
-    public ScheduledReplicationQueueProcessorTask(SimpleReplicationQueueProvider queueProvider,
-                                                  ReplicationQueueProcessor queueProcessor) {
+    public ScheduledDistributionQueueProcessorTask(SimpleDistributionQueueProvider queueProvider,
+                                                   DistributionQueueProcessor queueProcessor) {
         this.queueProvider = queueProvider;
         this.queueProcessor = queueProcessor;
     }
 
     public void run() {
         try {
-            for (ReplicationQueue queue : queueProvider.getQueues()) {
+            for (DistributionQueue queue : queueProvider.getQueues()) {
                 while (!queue.isEmpty()) {
                     // synchronized (queue) {
-                    ReplicationQueueItem item = queue.getHead();
+                    DistributionQueueItem item = queue.getHead();
                     if (item != null) {
                         if (queueProcessor.process(queue.getName(), item)) {
                             queue.remove(item.getId());

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueue.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueue.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueue.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java Fri Nov  7 10:28:02 2014
@@ -16,46 +16,45 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.simple;
+package org.apache.sling.distribution.queue.impl.simple;
 
 import javax.annotation.Nonnull;
 import java.util.Calendar;
-import java.util.Collection;
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueItemSelector;
-import org.apache.sling.replication.queue.ReplicationQueueItemState;
-import org.apache.sling.replication.queue.ReplicationQueueItemState.ItemState;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueItemSelector;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.queue.DistributionQueueItemState.ItemState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A simple implementation of a {@link ReplicationQueue}.
+ * A simple implementation of a {@link org.apache.sling.distribution.queue.DistributionQueue}.
  * <p/>
  * Note that, at the moment, this is a transient in memory queue not persisted on the repository and
  * therefore not usable for production.
  */
-public class SimpleReplicationQueue implements ReplicationQueue {
+public class SimpleDistributionQueue implements DistributionQueue {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     private final String name;
 
-    private final BlockingQueue<ReplicationQueueItem> queue;
+    private final BlockingQueue<DistributionQueueItem> queue;
 
-    private final Map<ReplicationQueueItem, ReplicationQueueItemState> statusMap;
+    private final Map<DistributionQueueItem, DistributionQueueItemState> statusMap;
 
-    public SimpleReplicationQueue(String agentName, String name) {
+    public SimpleDistributionQueue(String agentName, String name) {
         log.info("starting a simple queue for agent {}", agentName);
         this.name = name;
-        this.queue = new LinkedBlockingQueue<ReplicationQueueItem>();
-        this.statusMap = new WeakHashMap<ReplicationQueueItem, ReplicationQueueItemState>(10);
+        this.queue = new LinkedBlockingQueue<DistributionQueueItem>();
+        this.statusMap = new WeakHashMap<DistributionQueueItem, DistributionQueueItemState>(10);
     }
 
     @Nonnull
@@ -63,7 +62,7 @@ public class SimpleReplicationQueue impl
         return name;
     }
 
-    public boolean add(@Nonnull ReplicationQueueItem item) {
+    public boolean add(@Nonnull DistributionQueueItem item) {
         ItemState itemState = ItemState.ERROR;
         boolean result = false;
         try {
@@ -72,27 +71,27 @@ public class SimpleReplicationQueue impl
         } catch (InterruptedException e) {
             log.error("cannot add an item to the queue", e);
         } finally {
-            statusMap.put(item, new ReplicationQueueItemState(Calendar.getInstance(), itemState, 0));
+            statusMap.put(item, new DistributionQueueItemState(Calendar.getInstance(), itemState, 0));
         }
         return result;
     }
 
     @Nonnull
-    public ReplicationQueueItemState getStatus(@Nonnull ReplicationQueueItem queueItem) {
-        ReplicationQueueItemState itemStatus = statusMap.get(queueItem);
+    public DistributionQueueItemState getStatus(@Nonnull DistributionQueueItem queueItem) {
+        DistributionQueueItemState itemStatus = statusMap.get(queueItem);
 
         if (queue.contains(queueItem)) {
             return itemStatus;
         } else {
-            return new ReplicationQueueItemState(itemStatus.getEntered(), ItemState.SUCCEEDED, itemStatus.getAttempts());
+            return new DistributionQueueItemState(itemStatus.getEntered(), ItemState.SUCCEEDED, itemStatus.getAttempts());
         }
     }
 
-    public ReplicationQueueItem getHead() {
-        ReplicationQueueItem element = queue.peek();
+    public DistributionQueueItem getHead() {
+        DistributionQueueItem element = queue.peek();
         if (element != null) {
-            ReplicationQueueItemState itemState = statusMap.get(element);
-            statusMap.put(element, new ReplicationQueueItemState(itemState.getEntered(),
+            DistributionQueueItemState itemState = statusMap.get(element);
+            statusMap.put(element, new DistributionQueueItemState(itemState.getEntered(),
                     itemState.getItemState(),
                     itemState.getAttempts()+1));
         }
@@ -104,15 +103,15 @@ public class SimpleReplicationQueue impl
     }
 
     @Nonnull
-    public Iterable<ReplicationQueueItem> getItems(ReplicationQueueItemSelector queueItemSelector) {
+    public Iterable<DistributionQueueItem> getItems(DistributionQueueItemSelector queueItemSelector) {
         return queue;
     }
 
 
 
     public void remove(@Nonnull String id) {
-        ReplicationQueueItem toRemove = null;
-        for (ReplicationQueueItem item : queue) {
+        DistributionQueueItem toRemove = null;
+        for (DistributionQueueItem item : queue) {
             if (id.equals(item.getId())) {
                 toRemove = item;
             }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java Fri Nov  7 10:28:02 2014
@@ -16,29 +16,28 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.simple;
+package org.apache.sling.distribution.queue.impl.simple;
 
 import javax.annotation.Nonnull;
 
 import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueException;
-import org.apache.sling.replication.queue.ReplicationQueueProcessor;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueException;
+import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * a queue provider {@link ReplicationQueueProvider} for simple in memory
- * {@link ReplicationQueue}s
+ * a queue provider {@link org.apache.sling.distribution.queue.DistributionQueueProvider} for simple in memory
+ * {@link org.apache.sling.distribution.queue.DistributionQueue}s
  */
-public class SimpleReplicationQueueProvider  implements ReplicationQueueProvider {
+public class SimpleDistributionQueueProvider implements DistributionQueueProvider {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -46,10 +45,10 @@ public class SimpleReplicationQueueProvi
     private final String name;
     private final Scheduler scheduler;
 
-    private final Map<String, ReplicationQueue> queueMap = new ConcurrentHashMap<String, ReplicationQueue>();
+    private final Map<String, DistributionQueue> queueMap = new ConcurrentHashMap<String, DistributionQueue>();
 
 
-    public SimpleReplicationQueueProvider(Scheduler scheduler, String name) {
+    public SimpleDistributionQueueProvider(Scheduler scheduler, String name) {
         if (name == null || scheduler == null) {
             throw new IllegalArgumentException("all arguments are required");
         }
@@ -60,14 +59,14 @@ public class SimpleReplicationQueueProvi
     }
 
     @Nonnull
-    public ReplicationQueue getQueue(@Nonnull String queueName)
-            throws ReplicationQueueException {
+    public DistributionQueue getQueue(@Nonnull String queueName)
+            throws DistributionQueueException {
         String key = name + queueName;
 
-        ReplicationQueue queue = queueMap.get(key);
+        DistributionQueue queue = queueMap.get(key);
         if (queue == null) {
             log.info("creating a queue with key {}", key);
-            queue = new SimpleReplicationQueue(name, queueName);
+            queue = new SimpleDistributionQueue(name, queueName);
             queueMap.put(key, queue);
             log.info("queue created {}", queue);
         }
@@ -75,15 +74,15 @@ public class SimpleReplicationQueueProvi
     }
 
 
-    protected Collection<ReplicationQueue> getQueues() {
+    protected Collection<DistributionQueue> getQueues() {
         return queueMap.values();
     }
 
-    public void enableQueueProcessing(@Nonnull ReplicationQueueProcessor queueProcessor) {
+    public void enableQueueProcessing(@Nonnull DistributionQueueProcessor queueProcessor) {
         ScheduleOptions options = scheduler.NOW(-1, 10)
                 .canRunConcurrently(false)
                 .name(getJobName());
-        scheduler.schedule(new ScheduledReplicationQueueProcessorTask(this, queueProcessor), options);
+        scheduler.schedule(new ScheduledDistributionQueueProcessorTask(this, queueProcessor), options);
     }
 
     public void disableQueueProcessing() {

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

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionConstants.java Fri Nov  7 10:28:02 2014
@@ -16,23 +16,23 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.resources;
+package org.apache.sling.distribution.resources;
 
 /**
- * constants replication resource types and paths
+ * constants distribution resource types and paths
  */
-public class ReplicationConstants {
+public class DistributionConstants {
 
     public static final String SUFFIX_RESOURCE_LIST = "/list";
     public static final String SUFFIX_AGENT_QUEUE = "/queue";
     public static final String SUFFIX_AGENT_QUEUE_EVENT = "/queue/event";
 
-    public static final String AGENT_RESOURCE_TYPE = "sling/replication/service/agent";
+    public static final String AGENT_RESOURCE_TYPE = "sling/distribution/service/agent";
     public static final String AGENT_QUEUE_RESOURCE_TYPE = AGENT_RESOURCE_TYPE + SUFFIX_AGENT_QUEUE;
     public static final String AGENT_QUEUE_EVENT_RESOURCE_TYPE = AGENT_QUEUE_RESOURCE_TYPE + SUFFIX_AGENT_QUEUE_EVENT;
     public static final String AGENT_ROOT_RESOURCE_TYPE = AGENT_RESOURCE_TYPE + SUFFIX_RESOURCE_LIST;
 
-    public static final String IMPORTER_RESOURCE_TYPE = "sling/replication/service/importer";
-    public static final String EXPORTER_RESOURCE_TYPE = "sling/replication/service/exporter";
+    public static final String IMPORTER_RESOURCE_TYPE = "sling/distribution/service/importer";
+    public static final String EXPORTER_RESOURCE_TYPE = "sling/distribution/service/exporter";
 
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiConfigurationResourceProvider.java 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.resources.impl;
+package org.apache.sling.distribution.resources.impl;
 
 
 import java.io.IOException;
@@ -37,7 +37,7 @@ import org.apache.sling.api.resource.Per
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.resources.impl.common.AbstractModifyingResourceProvider;
+import org.apache.sling.distribution.resources.impl.common.AbstractModifyingResourceProvider;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiPropertiesResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiPropertiesResourceProviderFactory.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiPropertiesResourceProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiPropertiesResourceProviderFactory.java Fri Nov  7 10:28:02 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.sling.replication.resources.impl;
+package org.apache.sling.distribution.resources.impl;
 
 import java.util.Map;
 
@@ -56,7 +56,7 @@ public class OsgiPropertiesResourceProvi
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    public final static String SERVICE_PID = "org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory";
+    public final static String SERVICE_PID = "org.apache.sling.distribution.resources.impl.OsgiPropertiesResourceProviderFactory";
 
     /**
      * The name of the class that is used for resource resolution.

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiServicePropertiesResourceProvider.java Fri Nov  7 10:28:02 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.sling.replication.resources.impl;
+package org.apache.sling.distribution.resources.impl;
 
 
 import java.util.Collection;
@@ -30,7 +30,7 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.replication.resources.impl.common.AbstractReadableResourceProvider;
+import org.apache.sling.distribution.resources.impl.common.AbstractReadableResourceProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;

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

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java 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.resources.impl.common;
+package org.apache.sling.distribution.resources.impl.common;
 
 
 import javax.jcr.Session;

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java Fri Nov  7 10:28:02 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.sling.replication.resources.impl.common;
+package org.apache.sling.distribution.resources.impl.common;
 
 
 import javax.jcr.RepositoryException;

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

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

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimplePathInfo.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimplePathInfo.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimplePathInfo.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimplePathInfo.java Fri Nov  7 10:28:02 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.sling.replication.resources.impl.common;
+package org.apache.sling.distribution.resources.impl.common;
 
 /**
  * Path info representing a main resource.

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimpleReadableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimpleReadableResource.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimpleReadableResource.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimpleReadableResource.java Fri Nov  7 10:28:02 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.sling.replication.resources.impl.common;
+package org.apache.sling.distribution.resources.impl.common;
 
 
 import java.lang.reflect.Array;

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuilder.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuilder.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuilder.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuilder.java Fri Nov  7 10:28:02 2014
@@ -16,61 +16,61 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.serialization;
+package org.apache.sling.distribution.serialization;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import java.io.InputStream;
 
 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.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
 
 /**
- * A builder for {@link org.apache.sling.replication.packaging.ReplicationPackage}s
+ * A builder for {@link org.apache.sling.distribution.packaging.DistributionPackage}s
  */
-public interface ReplicationPackageBuilder {
+public interface DistributionPackageBuilder {
 
     /**
-     * creates a {@link org.apache.sling.replication.packaging.ReplicationPackage} for a specific {@link ReplicationRequest}
+     * creates a {@link org.apache.sling.distribution.packaging.DistributionPackage} for a specific {@link org.apache.sling.distribution.communication.DistributionRequest}
      *
      * @param resourceResolver the resource resolver used to access the resources to be packaged
-     * @param request          the {@link org.apache.sling.replication.communication.ReplicationRequest} to create the package for
-     * @return a {@link org.apache.sling.replication.packaging.ReplicationPackage} or <code>null</code> if it could not be created
-     * @throws ReplicationPackageBuildingException if any error occurs while creating the package, or if the resource resolver is not authorized to do that
+     * @param request          the {@link org.apache.sling.distribution.communication.DistributionRequest} to create the package for
+     * @return a {@link org.apache.sling.distribution.packaging.DistributionPackage} or <code>null</code> if it could not be created
+     * @throws DistributionPackageBuildingException if any error occurs while creating the package, or if the resource resolver is not authorized to do that
      */
     @CheckForNull
-    ReplicationPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest request) throws ReplicationPackageBuildingException;
+    DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionPackageBuildingException;
 
     /**
-     * reads a stream and tries to convert it to a {@link ReplicationPackage} this provider can read and install
+     * reads a stream and tries to convert it to a {@link org.apache.sling.distribution.packaging.DistributionPackage} this provider can read and install
      *
      * @param resourceResolver resource resolver used to store the eventually created package
      * @param stream           the {@link InputStream} of the package to read
-     * @return a {@link ReplicationPackage} if it can read it from the stream
-     * @throws ReplicationPackageReadingException when the stream cannot be read as a {@link ReplicationPackage}
+     * @return a {@link org.apache.sling.distribution.packaging.DistributionPackage} if it can read it from the stream
+     * @throws DistributionPackageReadingException when the stream cannot be read as a {@link org.apache.sling.distribution.packaging.DistributionPackage}
      */
     @CheckForNull
-    ReplicationPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageReadingException;
+    DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageReadingException;
 
     /**
-     * get an already created (and saved into the repository) {@link ReplicationPackage} by its id
+     * get an already created (and saved into the repository) {@link org.apache.sling.distribution.packaging.DistributionPackage} by its id
      *
      * @param resourceResolver resource resolver used to access the package with the given id
-     * @param id               the unique identifier of an already created {@link ReplicationPackage}
-     * @return a {@link ReplicationPackage} if one with such an id exists, <code>null</code> otherwise
+     * @param id               the unique identifier of an already created {@link org.apache.sling.distribution.packaging.DistributionPackage}
+     * @return a {@link org.apache.sling.distribution.packaging.DistributionPackage} if one with such an id exists, <code>null</code> otherwise
      */
     @CheckForNull
-    ReplicationPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id);
+    DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id);
 
     /**
-     * Installs the given replicationPackage into the repository
+     * Installs the given distributionPackage into the repository
      *
      * @param resourceResolver   the resource resolver used to install the packaged resources
-     * @param replicationPackage the replication package to install
+     * @param distributionPackage the distribution package to install
      * @return <code>true</code> if the package was installed successfully
-     * @throws ReplicationPackageReadingException
+     * @throws DistributionPackageReadingException
      */
-    boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageReadingException;
+    boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageReadingException;
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuildingException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuildingException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuildingException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuildingException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuildingException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageBuildingException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageBuildingException.java Fri Nov  7 10:28:02 2014
@@ -16,19 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.serialization;
+package org.apache.sling.distribution.serialization;
 
 /**
- * This represents an error happening while building a {@link org.apache.sling.replication.packaging.ReplicationPackage}
+ * This represents an error happening while building a {@link org.apache.sling.distribution.packaging.DistributionPackage}
  */
 @SuppressWarnings("serial")
-public class ReplicationPackageBuildingException extends Exception {
+public class DistributionPackageBuildingException extends Exception {
 
-    public ReplicationPackageBuildingException(String message) {
+    public DistributionPackageBuildingException(String message) {
         super(message);
     }
 
-    public ReplicationPackageBuildingException(Throwable t) {
+    public DistributionPackageBuildingException(Throwable t) {
         super(t);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageReadingException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageReadingException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageReadingException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageReadingException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageReadingException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/ReplicationPackageReadingException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/DistributionPackageReadingException.java Fri Nov  7 10:28:02 2014
@@ -16,24 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.serialization;
+package org.apache.sling.distribution.serialization;
 
 /**
  * This represents an error happening while reading / installing a
- * {@link org.apache.sling.replication.packaging.ReplicationPackage}
+ * {@link org.apache.sling.distribution.packaging.DistributionPackage}
  */
 @SuppressWarnings("serial")
-public class ReplicationPackageReadingException extends Exception {
+public class DistributionPackageReadingException extends Exception {
 
-    public ReplicationPackageReadingException(String message) {
+    public DistributionPackageReadingException(String message) {
         super(message);
     }
 
-    public ReplicationPackageReadingException(Throwable t) {
+    public DistributionPackageReadingException(Throwable t) {
         super(t);
     }
 
-    public ReplicationPackageReadingException(String message, Exception e) {
+    public DistributionPackageReadingException(String message, Exception e) {
         super(message, e);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackage.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackage.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackage.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackage.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackage.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackage.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackage.java Fri Nov  7 10:28:02 2014
@@ -16,21 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.serialization.impl;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.Nonnull;
 
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageInfo;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 
 /**
- * abstract implementation of a {@link org.apache.sling.replication.packaging.ReplicationPackage}
+ * abstract implementation of a {@link org.apache.sling.distribution.packaging.DistributionPackage}
  */
-public abstract class AbstractReplicationPackage implements ReplicationPackage {
-    private final ReplicationPackageInfo info = new ReplicationPackageInfo();
+public abstract class AbstractDistributionPackage implements DistributionPackage {
+    private final DistributionPackageInfo info = new DistributionPackageInfo();
 
     @Nonnull
-    public ReplicationPackageInfo getInfo() {
+    public DistributionPackageInfo getInfo() {
         return info;
     }
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackageBuilder.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackageBuilder.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/AbstractReplicationPackageBuilder.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.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;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
@@ -30,60 +30,60 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.event.ReplicationEventType;
-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.util.ReplicationJcrUtils;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.event.DistributionEventType;
+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.util.DistributionJcrUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * base abstract implementation of a JCR based {@link ReplicationPackageBuilder}
+ * base abstract implementation of a JCR based {@link org.apache.sling.distribution.serialization.DistributionPackageBuilder}
  */
-public abstract class AbstractReplicationPackageBuilder implements ReplicationPackageBuilder {
+public abstract class AbstractDistributionPackageBuilder implements DistributionPackageBuilder {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     private final String type;
 
-    private final ReplicationEventFactory replicationEventFactory;
+    private final DistributionEventFactory distributionEventFactory;
 
-    public AbstractReplicationPackageBuilder(String type, ReplicationEventFactory replicationEventFactory) {
+    public AbstractDistributionPackageBuilder(String type, DistributionEventFactory distributionEventFactory) {
         this.type = type;
-        this.replicationEventFactory = replicationEventFactory;
+        this.distributionEventFactory = distributionEventFactory;
     }
 
     @CheckForNull
-    public ReplicationPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest request)
-            throws ReplicationPackageBuildingException {
-        ReplicationPackage replicationPackage;
-        if (ReplicationActionType.ADD.equals(request.getAction())) {
-            replicationPackage = createPackageForAdd(resourceResolver, request);
-        } else if (ReplicationActionType.DELETE.equals(request.getAction())) {
-            replicationPackage = new VoidReplicationPackage(request, type);
-        } else if (ReplicationActionType.POLL.equals(request.getAction())) {
-            replicationPackage = new VoidReplicationPackage(request, type);
+    public DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request)
+            throws DistributionPackageBuildingException {
+        DistributionPackage distributionPackage;
+        if (DistributionActionType.ADD.equals(request.getAction())) {
+            distributionPackage = createPackageForAdd(resourceResolver, request);
+        } else if (DistributionActionType.DELETE.equals(request.getAction())) {
+            distributionPackage = new VoidDistributionPackage(request, type);
+        } else if (DistributionActionType.POLL.equals(request.getAction())) {
+            distributionPackage = new VoidDistributionPackage(request, type);
         } else {
-            throw new ReplicationPackageBuildingException("unknown action type "
+            throw new DistributionPackageBuildingException("unknown action type "
                     + request.getAction());
         }
-        if (replicationPackage != null && replicationEventFactory != null) {
+        if (distributionPackage != null && distributionEventFactory != null) {
             Dictionary<String, Object> dictionary = new Hashtable<String, Object>();
-            dictionary.put("replication.action", replicationPackage.getAction());
-            dictionary.put("replication.path", replicationPackage.getPaths());
-            replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_CREATED, dictionary);
+            dictionary.put("distribution.action", distributionPackage.getAction());
+            dictionary.put("distribution.path", distributionPackage.getPaths());
+            distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_CREATED, dictionary);
         }
-        return replicationPackage;
+        return distributionPackage;
     }
 
     @CheckForNull
-    public ReplicationPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageReadingException {
-        ReplicationPackage replicationPackage = null;
+    public DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageReadingException {
+        DistributionPackage distributionPackage = null;
         if (!stream.markSupported()) {
             stream = new BufferedInputStream(stream);
         }
@@ -96,43 +96,43 @@ public abstract class AbstractReplicatio
             log.info("read {} bytes as {}", bytesRead, s);
 
             if (bytesRead > 0 && buffer[0] > 0 && s.startsWith("DEL")) {
-                replicationPackage = VoidReplicationPackage.fromStream(stream);
+                distributionPackage = VoidDistributionPackage.fromStream(stream);
             }
         } catch (Exception e) {
             log.warn("cannot parse stream", e);
         }
         stream.mark(-1);
-        if (replicationPackage == null) {
-            replicationPackage = readPackageInternal(resourceResolver, stream);
+        if (distributionPackage == null) {
+            distributionPackage = readPackageInternal(resourceResolver, stream);
         }
-        return replicationPackage;
+        return distributionPackage;
     }
 
-    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageReadingException {
-        ReplicationActionType actionType = ReplicationActionType.fromName(replicationPackage.getAction());
+    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageReadingException {
+        DistributionActionType actionType = DistributionActionType.fromName(distributionPackage.getAction());
         boolean installed;
-        if (ReplicationActionType.DELETE.equals(actionType)) {
-            installed = installDeletePackage(resourceResolver, replicationPackage);
+        if (DistributionActionType.DELETE.equals(actionType)) {
+            installed = installDeletePackage(resourceResolver, distributionPackage);
         } else {
-            installed = installPackageInternal(resourceResolver, replicationPackage);
+            installed = installPackageInternal(resourceResolver, distributionPackage);
         }
 
-        if (installed && replicationEventFactory != null) {
+        if (installed && distributionEventFactory != null) {
             Dictionary<String, Object> dictionary = new Hashtable<String, Object>();
-            dictionary.put("replication.action", replicationPackage.getAction());
-            dictionary.put("replication.path", replicationPackage.getPaths());
-            replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_INSTALLED, dictionary);
+            dictionary.put("distribution.action", distributionPackage.getAction());
+            dictionary.put("distribution.path", distributionPackage.getPaths());
+            distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_INSTALLED, dictionary);
         }
 
         return installed;
     }
 
-    private boolean installDeletePackage(ResourceResolver resourceResolver, ReplicationPackage replicationPackage) throws ReplicationPackageReadingException {
+    private boolean installDeletePackage(ResourceResolver resourceResolver, DistributionPackage distributionPackage) throws DistributionPackageReadingException {
         Session session = null;
         try {
-            if (replicationPackage != null) {
+            if (distributionPackage != null) {
                 session = getSession(resourceResolver);
-                for (String path : replicationPackage.getPaths()) {
+                for (String path : distributionPackage.getPaths()) {
                     if (session.itemExists(path)) {
                         session.removeItem(path);
                     }
@@ -141,7 +141,7 @@ public abstract class AbstractReplicatio
                 return true;
             }
         } catch (Exception e) {
-            throw new ReplicationPackageReadingException(e);
+            throw new DistributionPackageReadingException(e);
         } finally {
             ungetSession(session);
         }
@@ -149,24 +149,24 @@ public abstract class AbstractReplicatio
         return false;
     }
 
-    public ReplicationPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) {
-        ReplicationPackage replicationPackage = null;
+    public DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) {
+        DistributionPackage distributionPackage = null;
         try {
-            replicationPackage = VoidReplicationPackage.fromStream(new ByteArrayInputStream(id.getBytes("UTF-8")));
+            distributionPackage = VoidDistributionPackage.fromStream(new ByteArrayInputStream(id.getBytes("UTF-8")));
         } catch (IOException ex) {
             // not a void package
         }
 
-        if (replicationPackage == null) {
-            replicationPackage = getPackageInternal(resourceResolver, id);
+        if (distributionPackage == null) {
+            distributionPackage = getPackageInternal(resourceResolver, id);
         }
-        return replicationPackage;
+        return distributionPackage;
     }
 
     protected Session getSession(ResourceResolver resourceResolver) throws RepositoryException {
         Session session = resourceResolver.adaptTo(Session.class);
         if (session != null) {
-            ReplicationJcrUtils.setDoNotReplicate(session);
+            DistributionJcrUtils.setDoNotReplicate(session);
         } else {
             throw new RepositoryException("could not obtain a session from calling user " + resourceResolver.getUserID());
         }
@@ -183,17 +183,17 @@ public abstract class AbstractReplicatio
        }
     }
 
-    protected abstract ReplicationPackage createPackageForAdd(ResourceResolver resourceResolver, ReplicationRequest request)
-            throws ReplicationPackageBuildingException;
+    protected abstract DistributionPackage createPackageForAdd(ResourceResolver resourceResolver, DistributionRequest request)
+            throws DistributionPackageBuildingException;
 
 
-    protected abstract ReplicationPackage readPackageInternal(ResourceResolver resourceResolver, InputStream stream)
-            throws ReplicationPackageReadingException;
+    protected abstract DistributionPackage readPackageInternal(ResourceResolver resourceResolver, InputStream stream)
+            throws DistributionPackageReadingException;
 
 
-    protected abstract boolean installPackageInternal(ResourceResolver resourceResolver, ReplicationPackage replicationPackage)
-            throws ReplicationPackageReadingException;
+    protected abstract boolean installPackageInternal(ResourceResolver resourceResolver, DistributionPackage distributionPackage)
+            throws DistributionPackageReadingException;
 
-    protected abstract ReplicationPackage getPackageInternal(ResourceResolver resourceResolver, String id);
+    protected abstract DistributionPackage getPackageInternal(ResourceResolver resourceResolver, String id);
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackage.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackage.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackage.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.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.serialization.impl;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.*;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageInfo;
-import org.apache.sling.replication.packaging.SharedReplicationPackage;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.packaging.DistributionPackageInfo;
+import org.apache.sling.distribution.packaging.SharedDistributionPackage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,7 +31,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collections;
 
-public class ResourceSharedReplicationPackage implements SharedReplicationPackage {
+public class ResourceSharedDistributionPackage implements SharedDistributionPackage {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     protected static final String  REFERENCE_ROOT_NODE = "refs";
@@ -40,12 +40,12 @@ public class ResourceSharedReplicationPa
 
     private final ResourceResolver resourceResolver;
     private final String packagePath;
-    private final ReplicationPackage replicationPackage;
+    private final DistributionPackage distributionPackage;
 
-    public ResourceSharedReplicationPackage(ResourceResolver resourceResolver, String packagePath, ReplicationPackage replicationPackage) {
+    public ResourceSharedDistributionPackage(ResourceResolver resourceResolver, String packagePath, DistributionPackage distributionPackage) {
         this.resourceResolver = resourceResolver;
         this.packagePath = packagePath;
-        this.replicationPackage = replicationPackage;
+        this.distributionPackage = distributionPackage;
     }
 
     public void acquire(@Nonnull String holderName) {
@@ -87,26 +87,26 @@ public class ResourceSharedReplicationPa
 
     @Nonnull
     public String[] getPaths() {
-        return replicationPackage.getPaths();
+        return distributionPackage.getPaths();
     }
 
     @Nonnull
     public String getAction() {
-        return replicationPackage.getAction();
+        return distributionPackage.getAction();
     }
 
     @Nonnull
     public String getType() {
-        return replicationPackage.getType();
+        return distributionPackage.getType();
     }
 
     @Nonnull
     public InputStream createInputStream() throws IOException {
-        return replicationPackage.createInputStream();
+        return distributionPackage.createInputStream();
     }
 
     public long getLength() {
-        return replicationPackage.getLength();
+        return distributionPackage.getLength();
     }
 
     public void delete() {
@@ -117,16 +117,16 @@ public class ResourceSharedReplicationPa
         } catch (PersistenceException e) {
             log.error("cannot delete shared resource", e);
         }
-        replicationPackage.delete();
+        distributionPackage.delete();
     }
 
     @Nonnull
-    public ReplicationPackageInfo getInfo() {
-        return replicationPackage.getInfo();
+    public DistributionPackageInfo getInfo() {
+        return distributionPackage.getInfo();
     }
 
-    public ReplicationPackage getPackage() {
-        return replicationPackage;
+    public DistributionPackage getPackage() {
+        return distributionPackage;
     }
 
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackageBuilder.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackageBuilder.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/ResourceSharedReplicationPackageBuilder.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java Fri Nov  7 10:28:02 2014
@@ -16,115 +16,115 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.serialization.impl;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.*;
-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.serialization.ReplicationPackageBuildingException;
-import org.apache.sling.replication.serialization.ReplicationPackageReadingException;
+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.serialization.DistributionPackageBuildingException;
+import org.apache.sling.distribution.serialization.DistributionPackageReadingException;
 
 import java.io.InputStream;
 import java.util.*;
 
-public class ResourceSharedReplicationPackageBuilder implements ReplicationPackageBuilder {
+public class ResourceSharedDistributionPackageBuilder implements DistributionPackageBuilder {
 
     private String PN_ORIGINAL_ID = "original.package.id";
     private String PN_ORIGINAL_ACTION = "original.package.action";
     private String PN_ORIGINAL_PATHS = "original.package.paths";
 
     private String PACKAGE_NAME_PREFIX = "replpackage";
-    private String sharedPackagesRoot = "/var/sling/replication/";
+    private String sharedPackagesRoot = "/var/sling/distribution/";
 
-    private final ReplicationPackageBuilder replicationPackageBuilder;
+    private final DistributionPackageBuilder distributionPackageBuilder;
 
-    public ResourceSharedReplicationPackageBuilder(ReplicationPackageBuilder replicationPackageExporter) {
-        this.replicationPackageBuilder = replicationPackageExporter;
+    public ResourceSharedDistributionPackageBuilder(DistributionPackageBuilder distributionPackageExporter) {
+        this.distributionPackageBuilder = distributionPackageExporter;
     }
 
     @CheckForNull
-    public ReplicationPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest request) throws ReplicationPackageBuildingException {
-        ReplicationPackage replicationPackage = replicationPackageBuilder.createPackage(resourceResolver, request);
+    public DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionPackageBuildingException {
+        DistributionPackage distributionPackage = distributionPackageBuilder.createPackage(resourceResolver, request);
 
-        if (replicationPackage == null) {
+        if (distributionPackage == null) {
             return null;
         }
 
         try {
-            String packagePath = generatePathFromId(resourceResolver, replicationPackage);
+            String packagePath = generatePathFromId(resourceResolver, distributionPackage);
 
-            return new ResourceSharedReplicationPackage(resourceResolver, packagePath, replicationPackage);
+            return new ResourceSharedDistributionPackage(resourceResolver, packagePath, distributionPackage);
         }
         catch (PersistenceException e) {
-            throw new ReplicationPackageBuildingException(e);
+            throw new DistributionPackageBuildingException(e);
         }
     }
 
     @CheckForNull
-    public ReplicationPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageReadingException {
-        ReplicationPackage replicationPackage = replicationPackageBuilder.readPackage(resourceResolver, stream);
+    public DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageReadingException {
+        DistributionPackage distributionPackage = distributionPackageBuilder.readPackage(resourceResolver, stream);
 
-        if (replicationPackage == null) {
+        if (distributionPackage == null) {
             return null;
         }
 
         try {
-            String packagePath = generatePathFromId(resourceResolver, replicationPackage);
+            String packagePath = generatePathFromId(resourceResolver, distributionPackage);
 
-            return new ResourceSharedReplicationPackage(resourceResolver, packagePath, replicationPackage);
+            return new ResourceSharedDistributionPackage(resourceResolver, packagePath, distributionPackage);
         }
         catch (PersistenceException e) {
-            throw new ReplicationPackageReadingException(e);
+            throw new DistributionPackageReadingException(e);
         }
     }
 
-    public ReplicationPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String replicationPackageId) {
-        String originalPackageId = retrieveIdFromPath(resourceResolver, replicationPackageId);
+    public DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String distributionPackageId) {
+        String originalPackageId = retrieveIdFromPath(resourceResolver, distributionPackageId);
 
         if (originalPackageId == null) {
             return null;
         }
 
-        ReplicationPackage replicationPackage = replicationPackageBuilder.getPackage(resourceResolver, originalPackageId);
+        DistributionPackage distributionPackage = distributionPackageBuilder.getPackage(resourceResolver, originalPackageId);
 
-        if (replicationPackage == null) {
+        if (distributionPackage == null) {
             return null;
         }
 
-        return new ResourceSharedReplicationPackage(resourceResolver, replicationPackageId, replicationPackage);
+        return new ResourceSharedDistributionPackage(resourceResolver, distributionPackageId, distributionPackage);
     }
 
-    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageReadingException {
-        if (! (replicationPackage instanceof ResourceSharedReplicationPackage)) {
+    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageReadingException {
+        if (! (distributionPackage instanceof ResourceSharedDistributionPackage)) {
             return false;
         }
 
-        ResourceSharedReplicationPackage sharedReplicationPackage = (ResourceSharedReplicationPackage) replicationPackage;
+        ResourceSharedDistributionPackage shareddistributionPackage = (ResourceSharedDistributionPackage) distributionPackage;
 
-        ReplicationPackage originalPackage = sharedReplicationPackage.getPackage();
-        return replicationPackageBuilder.installPackage(resourceResolver, originalPackage);
+        DistributionPackage originalPackage = shareddistributionPackage.getPackage();
+        return distributionPackageBuilder.installPackage(resourceResolver, originalPackage);
     }
 
 
-    private String generatePathFromId(ResourceResolver resourceResolver, ReplicationPackage replicationPackage) throws PersistenceException {
+    private String generatePathFromId(ResourceResolver resourceResolver, DistributionPackage distributionPackage) throws PersistenceException {
         String name = PACKAGE_NAME_PREFIX + "_" + System.currentTimeMillis() + "_" +  UUID.randomUUID();
         String packagePath = sharedPackagesRoot + name;
 
         Map<String, Object> properties = new HashMap<String, Object>();
-        properties.put(PN_ORIGINAL_ID, replicationPackage.getId());
-        properties.put(PN_ORIGINAL_ACTION, replicationPackage.getAction());
-        properties.put(PN_ORIGINAL_PATHS, replicationPackage.getPaths());
+        properties.put(PN_ORIGINAL_ID, distributionPackage.getId());
+        properties.put(PN_ORIGINAL_ACTION, distributionPackage.getAction());
+        properties.put(PN_ORIGINAL_PATHS, distributionPackage.getPaths());
 
         Resource resource = ResourceUtil.getOrCreateResource(resourceResolver, packagePath, "sling:Folder", "sling:Folder", false);
 
         ModifiableValueMap valueMap = resource.adaptTo(ModifiableValueMap.class);
         valueMap.putAll(properties);
 
-        resourceResolver.create(resource, ResourceSharedReplicationPackage.REFERENCE_ROOT_NODE,
+        resourceResolver.create(resource, ResourceSharedDistributionPackage.REFERENCE_ROOT_NODE,
                 Collections.singletonMap(ResourceResolver.PROPERTY_RESOURCE_TYPE, (Object)"sling:Folder"));
 
         resourceResolver.commit();

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackage.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackage.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackage.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackage.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackage.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackage.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackage.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;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.Nonnull;
 import java.io.ByteArrayInputStream;
@@ -27,14 +27,14 @@ import java.util.Arrays;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.vault.util.Text;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
 
 /**
- * A void {@link ReplicationPackage} is used for deletion of certain paths on the target instance
+ * A void {@link org.apache.sling.distribution.packaging.DistributionPackage} is used for deletion of certain paths on the target instance
  */
-public class VoidReplicationPackage extends AbstractReplicationPackage implements ReplicationPackage {
+public class VoidDistributionPackage extends AbstractDistributionPackage implements DistributionPackage {
 
     private static final String TYPE = "VOID";
 
@@ -47,11 +47,11 @@ public class VoidReplicationPackage exte
     private final String action;
 
 
-    public VoidReplicationPackage(ReplicationRequest request) {
+    public VoidDistributionPackage(DistributionRequest request) {
         this(request, TYPE);
     }
 
-    public VoidReplicationPackage(ReplicationRequest request, String type) {
+    public VoidDistributionPackage(DistributionRequest request, String type) {
         this.type = type;
         this.paths = request.getPaths();
         this.action = request.getAction().toString();
@@ -61,7 +61,7 @@ public class VoidReplicationPackage exte
                 + ':' + type;
     }
 
-    public static VoidReplicationPackage fromStream(InputStream stream) throws IOException {
+    public static VoidDistributionPackage fromStream(InputStream stream) throws IOException {
         String streamString = IOUtils.toString(stream);
 
         String[] parts = streamString.split(":");
@@ -73,19 +73,19 @@ public class VoidReplicationPackage exte
         String timeString = parts[2];
         String typeString = parts[3];
 
-        ReplicationActionType replicationActionType = ReplicationActionType.fromName(actionString);
+        DistributionActionType distributionActionType = DistributionActionType.fromName(actionString);
 
-        VoidReplicationPackage replicationPackage = null;
-        if (replicationActionType != null) {
+        VoidDistributionPackage distributionPackage = null;
+        if (distributionActionType != null) {
             pathsString = Text.unescape(pathsString);
             String[] paths = pathsString.split(", ");
 
-            ReplicationRequest request = new ReplicationRequest(Long.valueOf(timeString),
-                    replicationActionType, paths);
-            replicationPackage = new VoidReplicationPackage(request, typeString);
+            DistributionRequest request = new DistributionRequest(Long.valueOf(timeString),
+                    distributionActionType, paths);
+            distributionPackage = new VoidDistributionPackage(request, typeString);
         }
 
-        return replicationPackage;
+        return distributionPackage;
     }
 
 
@@ -132,7 +132,7 @@ public class VoidReplicationPackage exte
 
     @Override
     public String toString() {
-        return "VoidReplicationPackage{" +
+        return "VoidDistributionPackage{" +
                 "type='" + type + '\'' +
                 ", paths=" + Arrays.toString(paths) +
                 ", id='" + id + '\'' +

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackageBuilder.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackageBuilder.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackageBuilder.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackageBuilder.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackageBuilder.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/VoidReplicationPackageBuilder.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/VoidDistributionPackageBuilder.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;
+package org.apache.sling.distribution.serialization.impl;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
@@ -28,42 +28,42 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Service;
 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.serialization.ReplicationPackageBuilder;
-import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
-import org.apache.sling.replication.serialization.ReplicationPackageReadingException;
-
-@Component(metatype = false, label = "Void Replication Package Builder")
-@Service(value = ReplicationPackageBuilder.class)
-@Property(name = "name", value = VoidReplicationPackageBuilder.NAME)
-public class VoidReplicationPackageBuilder implements ReplicationPackageBuilder {
+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.serialization.DistributionPackageBuildingException;
+import org.apache.sling.distribution.serialization.DistributionPackageReadingException;
+
+@Component(metatype = false, label = "Void Distribution Package Builder")
+@Service(value = DistributionPackageBuilder.class)
+@Property(name = "name", value = VoidDistributionPackageBuilder.NAME)
+public class VoidDistributionPackageBuilder implements DistributionPackageBuilder {
 
     static final String NAME = "void";
 
     @CheckForNull
-    public ReplicationPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest request) throws ReplicationPackageBuildingException {
-        return new VoidReplicationPackage(request);
+    public DistributionPackage createPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest request) throws DistributionPackageBuildingException {
+        return new VoidDistributionPackage(request);
     }
 
     @CheckForNull
-    public ReplicationPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageReadingException {
+    public DistributionPackage readPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageReadingException {
         try {
-            return VoidReplicationPackage.fromStream(stream);
+            return VoidDistributionPackage.fromStream(stream);
         } catch (Exception e) {
-            throw new ReplicationPackageReadingException(e);
+            throw new DistributionPackageReadingException(e);
         }
     }
 
-    public ReplicationPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) {
+    public DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String id) {
         try {
-            return VoidReplicationPackage.fromStream(new ByteArrayInputStream(id.getBytes("UTF-8")));
+            return VoidDistributionPackage.fromStream(new ByteArrayInputStream(id.getBytes("UTF-8")));
         } catch (IOException ex) {
             return null;
         }
     }
 
-    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) {
+    public boolean installPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) {
         // installation is always successful as no installation is needed for void packages
         return true;
     }



Mime
View raw message