sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1625933 - in /sling/trunk/contrib/extensions/replication/core: ./ src/main/java/org/apache/sling/replication/agent/impl/ src/main/java/org/apache/sling/replication/packaging/impl/exporter/ src/main/java/org/apache/sling/replication/packagi...
Date Thu, 18 Sep 2014 10:14:20 GMT
Author: tommaso
Date: Thu Sep 18 10:14:19 2014
New Revision: 1625933

URL: http://svn.apache.org/r1625933
Log:
SLING-3952 - applied Marius Petria's patch for fixing usage of wrong id in JHReplicationQueue, minor fixes to javadoc and logging

Modified:
    sling/trunk/contrib/extensions/replication/core/pom.xml
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/AgentReplicationPackageExporterFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/AdvancedRemoteReplicationPackageImporter.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/ErrorAwareQueueDistributionStrategy.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtils.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProviderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/RepositoryTransportAuthenticationProviderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java
    sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json
    sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json
    sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java
    sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueTest.java

Modified: sling/trunk/contrib/extensions/replication/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/pom.xml?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/pom.xml (original)
+++ sling/trunk/contrib/extensions/replication/core/pom.xml Thu Sep 18 10:14:19 2014
@@ -35,9 +35,9 @@
     <version>0.0.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
-    <name>Apache Sling Replication</name>
+    <name>Apache Sling Replication Core</name>
     <description>
-        The Apache Sling Replication bundle provides a set of utilities to replicate content from / to other Sling instances.
+        The Apache Sling Replication core bundle provides a set of utilities to replicate content from / to other Sling instances.
     </description>
 
     <scm>

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java Thu Sep 18 10:14:19 2014
@@ -136,9 +136,7 @@ public class SettingsUtils {
 
             }
             else {
-                if (value != null) {
-                    result.add(key + "=" + value.toString());
-                }
+                result.add(key + "=" + value.toString());
             }
         }
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/AgentReplicationPackageExporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/AgentReplicationPackageExporterFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/AgentReplicationPackageExporterFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/AgentReplicationPackageExporterFactory.java Thu Sep 18 10:14:19 2014
@@ -34,7 +34,10 @@ import org.apache.sling.replication.pack
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component(label = "Agent Based Replication Package Exporter", configurationFactory = true)
+@Component(label = "Agent Based Replication Package Exporter",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageExporter.class)
 public class AgentReplicationPackageExporterFactory implements ReplicationPackageExporter {
     private final Logger log = LoggerFactory.getLogger(getClass());

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterFactory.java Thu Sep 18 10:14:19 2014
@@ -34,7 +34,10 @@ import java.util.List;
  * {@link org.apache.sling.replication.packaging.ReplicationPackageExporter} implementation which creates a FileVault based
  * {@link org.apache.sling.replication.packaging.ReplicationPackage} locally.
  */
-@Component(label = "Local Replication Package Exporter", configurationFactory = true)
+@Component(label = "Local Replication Package Exporter",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageExporter.class)
 public class LocalReplicationPackageExporterFactory implements ReplicationPackageExporter {
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterFactory.java Thu Sep 18 10:14:19 2014
@@ -18,33 +18,37 @@
  */
 package org.apache.sling.replication.packaging.impl.exporter;
 
-import org.apache.felix.scr.annotations.*;
-import org.apache.http.client.fluent.Executor;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.PropertyOption;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.replication.communication.ReplicationEndpoint;
 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.serialization.*;
-import org.apache.sling.replication.transport.ReplicationTransportHandler;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
+import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProviderFactory;
-import org.apache.sling.replication.transport.impl.MultipleEndpointReplicationTransportHandler;
 import org.apache.sling.replication.transport.impl.ReplicationTransportConstants;
-import org.apache.sling.replication.transport.impl.SimpleHttpReplicationTransportHandler;
 import org.apache.sling.replication.transport.impl.TransportEndpointStrategyType;
-import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Default implementation of {@link org.apache.sling.replication.packaging.ReplicationPackageExporter}
  */
-@Component(label = "Remote Replication Package Exporter", configurationFactory = true)
+@Component(label = "Remote Replication Package Exporter",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageExporter.class)
 public class RemoteReplicationPackageExporterFactory implements ReplicationPackageExporter {
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -59,7 +63,6 @@ public class RemoteReplicationPackageExp
     @Reference(name = "TransportAuthenticationProviderFactory", policy = ReferencePolicy.DYNAMIC)
     private TransportAuthenticationProviderFactory transportAuthenticationProviderFactory;
 
-
     @Property(label = "Target ReplicationPackageBuilder", name = "ReplicationPackageBuilder.target")
     @Reference(name = "ReplicationPackageBuilder", policy = ReferencePolicy.DYNAMIC)
     private ReplicationPackageBuilder packageBuilder;

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/AdvancedRemoteReplicationPackageImporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/AdvancedRemoteReplicationPackageImporter.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/AdvancedRemoteReplicationPackageImporter.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/AdvancedRemoteReplicationPackageImporter.java Thu Sep 18 10:14:19 2014
@@ -46,7 +46,10 @@ import org.slf4j.LoggerFactory;
  * Implementation of {@link org.apache.sling.replication.packaging.ReplicationPackageImporter} supporting multiple
  * endpoints and custom HTTP headers and body.
  */
-@Component(label = "Advanced Remote Replication Package Importer", configurationFactory = true)
+@Component(label = "Advanced Remote Replication Package Importer",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageImporter.class)
 public class AdvancedRemoteReplicationPackageImporter implements ReplicationPackageImporter {
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java Thu Sep 18 10:14:19 2014
@@ -38,7 +38,10 @@ import org.slf4j.LoggerFactory;
  * {@link org.apache.sling.replication.packaging.ReplicationPackageImporter} implementation which imports a FileVault
  * based {@link ReplicationPackage} locally.
  */
-@Component(label = "Default Replication Package Importer", configurationFactory = true)
+@Component(label = "Default Replication Package Importer",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageImporter.class)
 public class LocalReplicationPackageImporterFactory implements ReplicationPackageImporter {
     private final Logger log = LoggerFactory.getLogger(getClass());

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java Thu Sep 18 10:14:19 2014
@@ -45,7 +45,10 @@ import org.slf4j.LoggerFactory;
 /**
  * Remote implementation of {@link org.apache.sling.replication.packaging.ReplicationPackageImporter}
  */
-@Component(label = "Remote Replication Package Importer", configurationFactory = true)
+@Component(label = "Remote Replication Package Importer",
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE)
 @Service(value = ReplicationPackageImporter.class)
 public class RemoteReplicationPackageImporterFactory implements ReplicationPackageImporter {
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java Thu Sep 18 10:14:19 2014
@@ -59,11 +59,6 @@ public interface ReplicationQueue {
     ReplicationQueueItem getHead();
 
     /**
-     * remove the first item into the queue from it
-     */
-    void removeHead();
-
-    /**
      * check if the queue is empty
      *
      * @return <code>true</code> if the queue is empty, <code>false</code> otherwise

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java Thu Sep 18 10:14:19 2014
@@ -26,51 +26,46 @@ import java.util.Collection;
 public interface ReplicationQueueProvider {
 
     /**
-     * provide a named queue for the given agent or creates it if the agent doesn't
-     * exist
+     * provide a named queue for the given agent or creates it if the queue doesn't exist
      *
-     * @param agentName
-     *            the replication agent needing the queue
-     * @param name
-     *            the name of the queue to retrieve
+     * @param agentName the replication agent needing the queue
+     * @param name      the name of the queue to retrieve
      * @return a replication queue to be used for the given parameters
      * @throws ReplicationQueueException
      */
     ReplicationQueue getQueue(String agentName, String name)
-                    throws ReplicationQueueException;
+            throws ReplicationQueueException;
 
 
     /**
      * get the default queue to be used for a certain agent
      *
-     * @param agentName
-     *            a replication agent
+     * @param agentName a replication agent
      * @return the default replication queue for the given agent
      * @throws ReplicationQueueException
      */
     ReplicationQueue getDefaultQueue(String agentName)
-                    throws ReplicationQueueException;
+            throws ReplicationQueueException;
 
     /**
      * get all the available queues from this provider
-     * 
+     *
      * @return a collection of replication queues
      */
     Collection<ReplicationQueue> getAllQueues();
 
     /**
      * removes an existing queue owned by this provider
-     * 
-     * @param queue
-     *            a replication queue to be removed
+     *
+     * @param queue a replication queue to be removed
      * @throws ReplicationQueueException
      */
     void removeQueue(ReplicationQueue queue) throws ReplicationQueueException;
 
     /**
-     * enables queue driven processing for an agent.
-     * @param agentName
-     *          a replication agent
+     * enables queue driven processing for an agent
+     *
+     * @param agentName      a replication agent
      * @param queueProcessor the queue processor to be used
      */
     void enableQueueProcessing(String agentName, ReplicationQueueProcessor queueProcessor);
@@ -78,8 +73,8 @@ public interface ReplicationQueueProvide
 
     /**
      * disables queue driven processing for an agent
-     * @param agentName
-     *          a replication agent
+     *
+     * @param agentName a replication agent
      */
     void disableQueueProcessing(String agentName);
 }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/ErrorAwareQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/ErrorAwareQueueDistributionStrategy.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/ErrorAwareQueueDistributionStrategy.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/ErrorAwareQueueDistributionStrategy.java Thu Sep 18 10:14:19 2014
@@ -130,7 +130,7 @@ public class ErrorAwareQueueDistribution
                     }
                 }
                 log.warn("item {} dropped from the default queue", firstItem);
-                defaultQueue.removeHead();
+                defaultQueue.remove(firstItem.getId());
             }
         }
     }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java Thu Sep 18 10:14:19 2014
@@ -59,8 +59,7 @@ public class JobHandlingReplicationQueue
     public boolean add(ReplicationQueueItem item) {
         boolean result = true;
         try {
-            Map<String, Object> properties = JobHandlingUtils
-                    .createFullPropertiesFromPackage(item);
+            Map<String, Object> properties = JobHandlingUtils.createFullProperties(item);
 
             Job job = jobManager.createJob(topic).properties(properties).add();
             log.info("job {} added", job.getId());
@@ -75,8 +74,7 @@ public class JobHandlingReplicationQueue
             throws ReplicationQueueException {
         ReplicationQueueItemState itemStatus = new ReplicationQueueItemState();
         try {
-            Map<String, Object> properties = JobHandlingUtils
-                    .createIdPropertiesFromPackage(replicationPackage);
+            Map<String, Object> properties = JobHandlingUtils.createIdProperties(replicationPackage.getId());
             Job job = jobManager.getJob(topic, properties);
             if (job != null) {
                 itemStatus.setAttempts(job.getRetryCount());
@@ -93,7 +91,7 @@ public class JobHandlingReplicationQueue
     }
 
     public ReplicationQueueItem getHead() {
-        Job firstItem = getFirstItem();
+        Job firstItem = getFirstJob();
         if (firstItem != null) {
             return JobHandlingUtils.getPackage(firstItem);
         } else {
@@ -101,50 +99,52 @@ public class JobHandlingReplicationQueue
         }
     }
 
-    public void removeHead() {
-        Job firstItem = getFirstItem();
-        if (firstItem != null) {
-            jobManager.removeJobById(firstItem.getId());
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private Job getFirstItem() {
+    private Job getFirstJob() {
         log.info("getting first item in the queue");
 
-        Collection<Job> jobs = jobManager.findJobs(QueryType.QUEUED, topic, -1);
-        jobs.addAll(jobManager.findJobs(QueryType.ACTIVE, topic, -1));
+        Collection<Job> jobs = getJobs(1);
         if (jobs.size() > 0) {
-            ArrayList<Job> list = new ArrayList<Job>(jobs);
-            Collections.sort(list, new Comparator<Job>() {
-                public int compare(Job o1, Job o2) {
-                    return o2.getRetryCount() - o1.getRetryCount();
-                }
-            });
-            Job firstItem = list.get(0);
-            log.info("first item in the queue is {}, retried {} times", firstItem.getId(),
-                    firstItem.getRetryCount());
+            Job firstItem = jobs.toArray(new Job[jobs.size()])[0];
+            log.info("first item in the queue is {}, retried {} times", firstItem.getId(), firstItem.getRetryCount());
             return firstItem;
         }
         return null;
     }
 
+    private Job getJob(String itemId) {
+        Map<String, Object> properties = JobHandlingUtils.createIdProperties(itemId);
+        Job job = jobManager.getJob(topic, properties);
+
+        if (job == null) {
+            log.warn("item with id {} cannot be found", itemId);
+        }
+
+        return job;
+    }
+
+    private Collection<Job> getJobs(int limit) {
+        return jobManager.findJobs(QueryType.ALL, topic, limit);
+    }
+
     public boolean isEmpty() {
         return getItems().isEmpty();
     }
 
-    public Collection<ReplicationQueueItem> getItems() {
-        Collection<ReplicationQueueItem> items = new LinkedList<ReplicationQueueItem>();
-        Collection<Job> jobs = jobManager.findJobs(QueryType.ALL, topic, -1);
+    public List<ReplicationQueueItem> getItems() {
+        List<ReplicationQueueItem> items = new ArrayList<ReplicationQueueItem>();
+        Collection<Job> jobs = getJobs(-1);
         for (Job job : jobs) {
             items.add(JobHandlingUtils.getPackage(job));
         }
-        return Collections.unmodifiableCollection(items);
+
+        return items;
     }
 
     public void remove(String id) {
-        boolean removed = jobManager.removeJobById(id);
-        if (log.isInfoEnabled()) {
+        Job job = getJob(id);
+
+        if (job != null) {
+            boolean removed = jobManager.removeJobById(job.getId());
             log.info("item with id {} removed from the queue: {}", id, removed);
         }
     }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtils.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtils.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtils.java Thu Sep 18 10:14:19 2014
@@ -18,13 +18,10 @@
  */
 package org.apache.sling.replication.queue.impl.jobhandling;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class JobHandlingUtils {
 
@@ -43,42 +40,41 @@ public class JobHandlingUtils {
                 String.valueOf(job.getProperty(TYPE)));
     }
 
-    public static Map<String, Object> createFullPropertiesFromPackage(
-            ReplicationQueueItem replicationPackage) {
+    public static Map<String, Object> createFullProperties(
+            ReplicationQueueItem replicationQueueItem) {
         Map<String, Object> properties = new HashMap<String, Object>();
 
-        properties.put(ID, replicationPackage.getId());
-        properties.put(PATHS, replicationPackage.getPaths());
-        properties.put(ACTION, replicationPackage.getAction());
-        properties.put(TYPE, replicationPackage.getType());
+        properties.put(ID, replicationQueueItem.getId());
+        properties.put(PATHS, replicationQueueItem.getPaths());
+        properties.put(ACTION, replicationQueueItem.getAction());
+        properties.put(TYPE, replicationQueueItem.getType());
 
         return properties;
     }
 
-    public static Map<String, Object> createIdPropertiesFromPackage(
-            ReplicationQueueItem replicationPackage) {
+    public static Map<String, Object> createIdProperties(String itemId) {
         Map<String, Object> properties = new HashMap<String, Object>();
-        properties.put(ID, replicationPackage.getId());
+        properties.put(ID, itemId);
         return properties;
     }
 
-    public static Byte[] box(byte[] bytes) {
-        if (bytes == null) return null;
-        Byte[] result = new Byte[bytes.length];
-        for (int i = 0; i < bytes.length; i++) {
-            result[i] = bytes[i];
-        }
-        return result;
-    }
-
-    public static byte[] unBox(Byte[] bytes) {
-        if (bytes == null) return null;
-        byte[] result = new byte[bytes.length];
-        for (int i = 0; i < bytes.length; i++) {
-            result[i] = bytes[i];
-        }
-        return result;
-    }
+//    public static Byte[] box(byte[] bytes) {
+//        if (bytes == null) return null;
+//        Byte[] result = new Byte[bytes.length];
+//        for (int i = 0; i < bytes.length; i++) {
+//            result[i] = bytes[i];
+//        }
+//        return result;
+//    }
+//
+//    public static byte[] unBox(Byte[] bytes) {
+//        if (bytes == null) return null;
+//        byte[] result = new byte[bytes.length];
+//        for (int i = 0; i < bytes.length; i++) {
+//            result[i] = bytes[i];
+//        }
+//        return result;
+//    }
 
     public static String getQueueName(Job job) {
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java Thu Sep 18 10:14:19 2014
@@ -52,7 +52,7 @@ public class ScheduledReplicationQueuePr
                     ReplicationQueueItem item = queue.getHead();
                     if (item != null) {
                         if (queueProcessor.process(queue.getName(), item)) {
-                            queue.removeHead();
+                            queue.remove(item.getId());
                         } else {
                             log.warn("processing of item {} failed",
                                     Arrays.toString(item.getPaths()));

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java Thu Sep 18 10:14:19 2014
@@ -34,14 +34,17 @@ import org.apache.sling.commons.osgi.Pro
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.util.tracker.ServiceTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.Map;
 
 
 @Component(label="Osgi Service Properties Resource Provider Factory",
         description="Osgi Service Properties Resource Provider Factory",
-        configurationFactory=true,
-        policy= ConfigurationPolicy.REQUIRE,
+        configurationFactory = true,
+        specVersion = "1.1",
+        policy = ConfigurationPolicy.REQUIRE,
         name = OsgiPropertiesResourceProviderFactory.SERVICE_PID,
         metatype=true)
 @Service(value=ResourceProviderFactory.class)
@@ -50,6 +53,9 @@ import java.util.Map;
         @Property(name = ResourceProvider.OWNS_ROOTS, boolValue=true, propertyPrivate=true)
 })
 public class OsgiPropertiesResourceProviderFactory implements ResourceProviderFactory {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
     public final static String SERVICE_PID = "org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory";
 
     /**
@@ -107,6 +113,9 @@ public class OsgiPropertiesResourceProvi
 
     @Activate
     public void activate(BundleContext context, Map<String, Object> properties) {
+
+        log.debug("activating resource provider with config {}", properties);
+
         String friendlyNameProperty = PropertiesUtil.toString(properties.get(FRIENDLY_NAME_PROPERTY), DEFAULT_FRIENDLY_NAME_PROPERTY);
         String type = PropertiesUtil.toString(properties.get(SERVICE_INTERFACE), null);
         String resourceRoot = PropertiesUtil.toString(properties.get(ResourceProvider.ROOTS), null);
@@ -136,6 +145,7 @@ public class OsgiPropertiesResourceProvi
             serviceTracker = new ServiceTracker(context, type, servicePropertiesResourceProvider);
             serviceTracker.open();
         }
+        log.debug("created resource provider {}", resourceProvider);
     }
 
     @Deactivate

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilderFactory.java Thu Sep 18 10:14:19 2014
@@ -47,6 +47,7 @@ import org.slf4j.LoggerFactory;
  * backed by a {@link VaultPackage}. 
  */
 @Component(metatype = true,
+        immediate = true,
         label = "FileVault based Replication Package Builder",
         description = "OSGi configuration based PackageBuilder service factory",
         name = FileVaultReplicationPackageBuilderFactory.SERVICE_PID,

Modified: 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/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentQueueServlet.java Thu Sep 18 10:14:19 2014
@@ -88,7 +88,8 @@ public class ReplicationAgentQueueServle
         ReplicationQueue queue = request.getResource().adaptTo(ReplicationQueue.class);
 
         while (!queue.isEmpty()) {
-            queue.removeHead();
+            ReplicationQueueItem queueItem = queue.getHead();
+            queue.remove(queueItem.getId());
         }
     }
 

Modified: 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/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java Thu Sep 18 10:14:19 2014
@@ -77,6 +77,7 @@ public class ReplicationTriggerServlet e
         response.setCharacterEncoding("UTF-8");
         response.setHeader("Cache-Control", "no-cache");
         response.setHeader("Connection", "keep-alive");
+
         // needed to allow the JavaScript EventSource API to make a call from author to this server and listen for the events
         response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
         response.setHeader("Access-Control-Allow-Credentials", "true");

Modified: 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/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/ReplicationTransportHandler.java Thu Sep 18 10:14:19 2014
@@ -44,6 +44,6 @@ public interface ReplicationTransportHan
      * @param replicationRequest the replication request
      * @throws ReplicationTransportException if any error occurs during the transport
      */
-    public List<ReplicationPackage> retrievePackages(ReplicationRequest replicationRequest) throws ReplicationTransportException;
+    List<ReplicationPackage> retrievePackages(ReplicationRequest replicationRequest) throws ReplicationTransportException;
 
 }
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java Thu Sep 18 10:14:19 2014
@@ -18,16 +18,29 @@
  */
 package org.apache.sling.replication.transport.authentication;
 
-
 /**
  * A <code>TransportAuthenticationProvider</code> is responsible for authentication of instances sending and
  * receiving replication items via {@link org.apache.sling.replication.transport.ReplicationTransportHandler}s
  */
 public interface TransportAuthenticationProvider<A, T> {
 
+    /**
+     * check if this provider is able to authenticate objects belonging to given 'authenticable' class.
+     *
+     * @param authenticable class of objects to be authenticated
+     * @return <code>true</code> if this provider can check authentication on instances of this class, <code>false</code>
+     * otherwise
+     */
     boolean canAuthenticate(Class<?> authenticable);
 
+    /**
+     *
+     * @param authenticable
+     * @param context
+     * @return
+     * @throws TransportAuthenticationException
+     */
     T authenticate(A authenticable, TransportAuthenticationContext context)
-                    throws TransportAuthenticationException;
+            throws TransportAuthenticationException;
 
 }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProviderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProviderFactory.java Thu Sep 18 10:14:19 2014
@@ -25,7 +25,19 @@ import java.util.Map;
  */
 public interface TransportAuthenticationProviderFactory {
 
+    /**
+     * create a {@link org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider}
+     *
+     * @param properties the provider properties
+     * @return a {@link org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider}
+     */
     TransportAuthenticationProvider<?, ?> createAuthenticationProvider(Map<String, String> properties);
 
+    /**
+     * get the type of the {@link org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider}s created
+     * via this factory
+     *
+     * @return a <code>String</code> representing the type of providers created via this factory
+     */
     String getType();
 }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderFactory.java Thu Sep 18 10:14:19 2014
@@ -26,11 +26,11 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProviderFactory;
 
-
 @Component(immediate = true, label = "Factory for Nop Authentication Providers")
 @Service(value = TransportAuthenticationProviderFactory.class)
 @Property(name = "name", value = NopTransportAuthenticationProviderFactory.TYPE)
 public class NopTransportAuthenticationProviderFactory implements TransportAuthenticationProviderFactory {
+
     public static final String TYPE = "nop";
 
     private static final TransportAuthenticationProvider<Object, Object> NOP_TRANSPORT_AUTHENTICATION_PROVIDER = new NopTransportAuthenticationProvider();

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/RepositoryTransportAuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/RepositoryTransportAuthenticationProviderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/RepositoryTransportAuthenticationProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/RepositoryTransportAuthenticationProviderFactory.java Thu Sep 18 10:14:19 2014
@@ -18,8 +18,8 @@
  */
 package org.apache.sling.replication.transport.authentication.impl;
 
-import java.util.Map;
 import javax.jcr.Session;
+import java.util.Map;
 
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
@@ -28,11 +28,11 @@ import org.apache.sling.jcr.api.SlingRep
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProviderFactory;
 
-
 @Component(immediate = true, label = "Factory for Repository Transport Authentication Providers")
 @Service(value = TransportAuthenticationProviderFactory.class)
 @Property(name = "name", value = RepositoryTransportAuthenticationProviderFactory.TYPE)
 public class RepositoryTransportAuthenticationProviderFactory implements TransportAuthenticationProviderFactory {
+
     public static final String TYPE = "repo-user";
 
     public TransportAuthenticationProvider<SlingRepository, Session> createAuthenticationProvider(Map<String, String> properties) {

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java Thu Sep 18 10:14:19 2014
@@ -27,11 +27,11 @@ import org.apache.http.client.fluent.Exe
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProviderFactory;
 
-
 @Component(immediate = true, label = "Factory for User based Transport Authentication Providers")
 @Service(value = TransportAuthenticationProviderFactory.class)
 @Property(name = "name", value = UserCredentialsTransportAuthenticationProviderFactory.TYPE)
 public class UserCredentialsTransportAuthenticationProviderFactory implements TransportAuthenticationProviderFactory {
+
     public static final String TYPE = "user";
 
     public TransportAuthenticationProvider<Executor, Executor> createAuthenticationProvider(

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java Thu Sep 18 10:14:19 2014
@@ -46,7 +46,6 @@ import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 public class SimpleHttpReplicationTransportHandler implements ReplicationTransportHandler {
 
     private static final Logger log = LoggerFactory.getLogger(SimpleHttpReplicationTransportHandler.class);
@@ -85,11 +84,9 @@ public class SimpleHttpReplicationTransp
 
                 inputStream = replicationPackage.createInputStream();
 
-
                 if(inputStream != null) {
                     req = req.bodyStream(inputStream, ContentType.APPLICATION_OCTET_STREAM);
                 }
-
                 response = executor.execute(req);
             }
             finally {
@@ -104,7 +101,6 @@ public class SimpleHttpReplicationTransp
             else {
                 throw new IOException("response is empty");
             }
-
         }
         catch (Exception ex) {
             throw new ReplicationTransportException(ex);
@@ -124,8 +120,8 @@ public class SimpleHttpReplicationTransp
             context.addAttribute("endpoint", replicationEndpoint);
             executor = transportAuthenticationProvider.authenticate(executor, context);
 
-            Request req = Request.Post(replicationURI)
-                    .useExpectContinue();
+            Request req = Request.Post(replicationURI).useExpectContinue();
+
             // TODO : add queue parameter
 
             // continuously requests package streams as long as type header is received with the response (meaning there's a package of a certain type)

Modified: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json Thu Sep 18 10:14:19 2014
@@ -19,7 +19,6 @@
 
     "packageImporter": [
         "type=local",
-
         "packageBuilder/type=vlt",
         "packageBuilder/username=admin",
         "packageBuilder/password=admin"
@@ -40,4 +39,4 @@
         "remote trigger on http://localhost:4503/libs/sling/replication/services/triggers/content-event?3600000 with user admin and password admin"
     ]
 
-}
+}
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json (original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json Thu Sep 18 10:14:19 2014
@@ -31,4 +31,4 @@
         "type=service",
         "name=error"
     ]
-}
+}
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java Thu Sep 18 10:14:19 2014
@@ -35,12 +35,12 @@ import static org.mockito.Mockito.when;
 public class JobHandlingUtilsTest {
     @Test
     public void testFullPropertiesFromPackageCreation() throws Exception {
-        ReplicationQueueItem replicationPackage = mock(ReplicationQueueItem.class);
-        when(replicationPackage.getAction()).thenReturn("ADD");
-        when(replicationPackage.getId()).thenReturn("an-id");
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/content", "/apps"});
-        when(replicationPackage.getType()).thenReturn("vlt");
-        Map<String,Object> fullPropertiesFromPackage = JobHandlingUtils.createFullPropertiesFromPackage(replicationPackage);
+        ReplicationQueueItem replicationQueueItem = mock(ReplicationQueueItem.class);
+        when(replicationQueueItem.getAction()).thenReturn("ADD");
+        when(replicationQueueItem.getId()).thenReturn("an-id");
+        when(replicationQueueItem.getPaths()).thenReturn(new String[]{"/content", "/apps"});
+        when(replicationQueueItem.getType()).thenReturn("vlt");
+        Map<String,Object> fullPropertiesFromPackage = JobHandlingUtils.createFullProperties(replicationQueueItem);
         assertNotNull(fullPropertiesFromPackage);
         assertEquals(4, fullPropertiesFromPackage.size());
         assertNotNull(fullPropertiesFromPackage.get("replication.package.paths"));
@@ -53,7 +53,7 @@ public class JobHandlingUtilsTest {
     public void testIdPropertiesFromPackageCreation() throws Exception {
         ReplicationQueueItem replicationPackage = mock(ReplicationQueueItem.class);
         when(replicationPackage.getId()).thenReturn("an-id");
-        Map<String,Object> idPropertiesFromPackage = JobHandlingUtils.createIdPropertiesFromPackage(replicationPackage);
+        Map<String,Object> idPropertiesFromPackage = JobHandlingUtils.createIdProperties(replicationPackage.getId());
         assertNotNull(idPropertiesFromPackage);
         assertEquals(1, idPropertiesFromPackage.size());
         assertNotNull(idPropertiesFromPackage.get("replication.package.id"));

Modified: sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueTest.java?rev=1625933&r1=1625932&r2=1625933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueTest.java (original)
+++ sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueTest.java Thu Sep 18 10:14:19 2014
@@ -28,6 +28,7 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 /**
  * Testcase for {@link SimpleReplicationQueue}
@@ -46,9 +47,10 @@ public class SimpleReplicationQueueTest 
     public void testPackageAdditionAndRemoval() throws Exception {
         ReplicationQueue queue = new SimpleReplicationQueue("agentName", "default");
         ReplicationQueueItem pkg = mock(ReplicationQueueItem.class);
+        when(pkg.getId()).thenReturn("id");
         assertTrue(queue.add(pkg));
         assertFalse(queue.isEmpty());
-        queue.removeHead();
+        queue.remove(pkg.getId());
         assertTrue(queue.isEmpty());
         ReplicationQueueItemState status = queue.getStatus(pkg);
         assertNotNull(status);
@@ -59,11 +61,12 @@ public class SimpleReplicationQueueTest 
     public void testPackageAdditionRetrievalAndRemoval() throws Exception {
         ReplicationQueue queue = new SimpleReplicationQueue("agentName", "default");
         ReplicationQueueItem pkg = mock(ReplicationQueueItem.class);
+        when(pkg.getId()).thenReturn("id");
         assertTrue(queue.add(pkg));
         assertFalse(queue.isEmpty());
         assertEquals(pkg, queue.getHead());
         assertFalse(queue.isEmpty());
-        queue.removeHead();
+        queue.remove(pkg.getId());
         assertTrue(queue.isEmpty());
         ReplicationQueueItemState status = queue.getStatus(pkg);
         assertNotNull(status);



Mime
View raw message