sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1623955 - in /sling/trunk/contrib/extensions/replication/core: ./ src/main/java/org/apache/sling/replication/agent/ src/main/java/org/apache/sling/replication/agent/impl/ src/main/java/org/apache/sling/replication/communication/ src/main/j...
Date Wed, 10 Sep 2014 09:26:18 GMT
Author: tommaso
Date: Wed Sep 10 09:26:17 2014
New Revision: 1623955

URL: http://svn.apache.org/r1623955
Log:
SLING-3891 - added README.md, fixing stale javadocs, adding some TODOs

Added:
    sling/trunk/contrib/extensions/replication/core/README.md
Modified:
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationResponse.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/queue/ReplicationQueue.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.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/PriorityPathDistributionStrategy.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.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/simple/SimpleReplicationQueue.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/rule/impl/ChainReplicateReplicationRule.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java

Added: sling/trunk/contrib/extensions/replication/core/README.md
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/README.md?rev=1623955&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/README.md (added)
+++ sling/trunk/contrib/extensions/replication/core/README.md Wed Sep 10 09:26:17 2014
@@ -0,0 +1,50 @@
+Sling Replication
+=================
+
+This is the README for the Sling Replication module.
+
+Overview
+========
+
+Configuration
+=============
+
+Resource providers
+==================
+
+One can configure a resource provider for a replication resource to give access to OSGI replication
services.
+Already configured ones are: ReplicationAgents, ReplicationPackageExporters and ReplicationPackageImporters.
+Here is an example of the configuration for exposing _ReplicationAgent_ services as resources:
+
+    {
+         "jcr:primaryType" : "sling:OsgiConfig",
+    
+         "name" : "replicationAgents",
+    
+         "provider.roots" : [ "/libs/sling/replication/services/agents" ],
+    
+         "serviceType" : "org.apache.sling.replication.agent.ReplicationAgent",
+    
+         "resourceProperties" : [
+    
+             "sling:resourceType=sling/replication/service/agent",
+    
+             "sling:resourceSuperType=sling/replication/service",
+    
+             "name={name}",
+    
+             "queue/sling:resourceType=replication/agent/queue"
+    
+         ]
+    
+     }
+
+When configuring such a provider you specify the service interface _ReplicationAgent_, the
url and some properties one 
+wants that resource to have like resourceType so basically this config governs _/libs/sling/replication/services/agents_.
+Sub resources to an agent can also be added, as the _queue_ for example and add properties
to it by specifying _queue/propertyName = propertyValue_.
+That's the mechanism to expose services as resources.
+
+HTTP API
+========
+
+See the [wiki](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=38572805).

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
Wed Sep 10 09:26:17 2014
@@ -24,7 +24,11 @@ import org.apache.sling.replication.queu
 import org.apache.sling.replication.queue.ReplicationQueueException;
 
 /**
- * A replication agent is responsible for delivering content to another instance
+ * A replication agent is responsible for handling {@link org.apache.sling.replication.communication.ReplicationRequest}s.
+ *
+ * This means executing actions of a specific {@link org.apache.sling.replication.communication.ReplicationActionType}s
on
+ * specific path(s) which will resume in e.g. polling resources from a certain Sling instance
and / or sending resources to
+ * other instances.
  */
 public interface ReplicationAgent {
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
Wed Sep 10 09:26:17 2014
@@ -31,7 +31,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * An OSGi service factory for {@link ReplicationAgent}s
+ * An OSGi service factory for {@link ReplicationAgent}s using a compact configuration, already
existing OSGi services
+ * for the components to be wired can be used as well as directly instantiated components
(called by type name).
  */
 @Component(metatype = true,
         label = "Compact Replication Agents Factory",

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
Wed Sep 10 09:26:17 2014
@@ -32,9 +32,16 @@ import org.apache.sling.replication.even
 import org.apache.sling.replication.packaging.ReplicationPackage;
 import org.apache.sling.replication.packaging.ReplicationPackageExporter;
 import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.queue.*;
+import org.apache.sling.replication.queue.ReplicationQueue;
+import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
+import org.apache.sling.replication.queue.ReplicationQueueException;
+import org.apache.sling.replication.queue.ReplicationQueueItem;
+import org.apache.sling.replication.queue.ReplicationQueueItemState;
+import org.apache.sling.replication.queue.ReplicationQueueProcessor;
+import org.apache.sling.replication.queue.ReplicationQueueProvider;
 import org.apache.sling.replication.rule.ReplicationRuleEngine;
-import org.apache.sling.replication.serialization.*;
+import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
+import org.apache.sling.replication.serialization.ReplicationPackageReadingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -85,13 +92,8 @@ public class SimpleReplicationAgent impl
 
     public ReplicationResponse execute(ReplicationRequest replicationRequest)
             throws AgentReplicationException {
-
-        // create packages from request
-        List<ReplicationPackage> replicationPackages;
         try {
-            replicationPackages = buildPackages(replicationRequest);
-            return schedule(replicationPackages);
-
+            return schedule(buildPackages(replicationRequest));
         } catch (ReplicationPackageBuildingException e) {
             log.error("Error building packages", e);
             throw new AgentReplicationException(e);
@@ -103,7 +105,6 @@ public class SimpleReplicationAgent impl
         return passive;
     }
 
-
     private List<ReplicationPackage> buildPackages(ReplicationRequest replicationRequest)
throws ReplicationPackageBuildingException {
 
         List<ReplicationPackage> replicationPackages = new ArrayList<ReplicationPackage>();
@@ -125,6 +126,7 @@ public class SimpleReplicationAgent impl
     }
 
     private ReplicationResponse schedule(List<ReplicationPackage> replicationPackages)
{
+        // TODO : create a composite replication response otherwise only the last response
will be returned
         ReplicationResponse replicationResponse = new ReplicationResponse();
 
         for (ReplicationPackage replicationPackage : replicationPackages) {
@@ -150,8 +152,13 @@ public class SimpleReplicationAgent impl
         try {
             ReplicationQueueItemState state = queueDistributionStrategy.add(getName(), replicationQueueItem,
                     queueProvider);
+
+            // TODO : it probably makes sense to always generate the package queued event
             if (isPassive()) {
-                generatePackageQueuedEvent(replicationQueueItem);
+                Dictionary<Object, Object> properties = new Properties();
+                properties.put("replication.package.paths", replicationQueueItem.getPaths());
+                properties.put("replication.agent.name", name);
+                replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_QUEUED,
properties);
             }
             if (state != null) {
                 replicationResponse.setStatus(state.getItemState().toString());
@@ -169,14 +176,6 @@ public class SimpleReplicationAgent impl
         return replicationResponse;
     }
 
-    private void generatePackageQueuedEvent(ReplicationQueueItem replicationQueueItem) {
-        Dictionary<Object, Object> properties = new Properties();
-        properties.put("replication.package.paths", replicationQueueItem.getPaths());
-        properties.put("replication.agent.name", name);
-        replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_QUEUED, properties);
-    }
-
-
     public String getName() {
         return name;
     }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
Wed Sep 10 09:26:17 2014
@@ -39,7 +39,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * An OSGi service factory for {@link ReplicationAgent}s
+ * An OSGi service factory for {@link ReplicationAgent}s which references already existing
OSGi services.
  */
 @Component(metatype = true,
         label = "Simple Replication Agents Factory",

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationResponse.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationResponse.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationResponse.java
Wed Sep 10 09:26:17 2014
@@ -40,7 +40,7 @@ public class ReplicationResponse {
     }
 
     public String getStatus() {
-        return status;
+        return status != null ? status : "done nothing";
     }
 
     public void setStatus(String status) {

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=1623955&r1=1623954&r2=1623955&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
Wed Sep 10 09:26:17 2014
@@ -71,10 +71,10 @@ public class AgentReplicationPackageExpo
 
             ReplicationQueue queue = agent.getQueue(queueName);
             ReplicationQueueItem info = queue.getHead();
-            ReplicationPackage replicationPackage = null;
+            ReplicationPackage replicationPackage;
             if (info != null) {
-                queue.removeHead();
                 replicationPackage = replicationPackageBuilder.getPackage(info.getId());
+                queue.remove(info.getId());
                 if (replicationPackage != null) {
                     result.add(replicationPackage);
                 }

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=1623955&r1=1623954&r2=1623955&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
Wed Sep 10 09:26:17 2014
@@ -33,18 +33,18 @@ public interface ReplicationQueue {
     String getName();
 
     /**
-     * add a replication package to this queue
+     * add a replication item to this queue
      *
-     * @param replicationPackage a replication package to replicate
-     * @return <code>true</code> if the replication package was added correctly
to the queue,
+     * @param item a replication item representing the package to replicate
+     * @return <code>true</code> if the replication item was added correctly
to the queue,
      * <code>false</code otherwise
      */
-    boolean add(ReplicationQueueItem replicationPackage);
+    boolean add(ReplicationQueueItem item);
 
     /**
-     * get the status of a certain package in the queue
+     * get the status of a certain item in the queue
      *
-     * @param item the replication package to get the status for
+     * @param item the replication item to get the status for
      * @return the item status in the queue
      * @throws ReplicationQueueException
      */
@@ -59,7 +59,7 @@ public interface ReplicationQueue {
     ReplicationQueueItem getHead();
 
     /**
-     * remove the first package into the queue from it
+     * remove the first item into the queue from it
      */
     void removeHead();
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java
Wed Sep 10 09:26:17 2014
@@ -19,33 +19,32 @@
 package org.apache.sling.replication.queue;
 
 import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.packaging.ReplicationPackage;
 
 /**
  * a {@link ReplicationQueueDistributionStrategy} implements an algorithm for the distribution
of
- * replication packages among the available queues for a certain agent
+ * {@link org.apache.sling.replication.queue.ReplicationQueueItem}s among the available queues
for a certain agent
  */
 public interface ReplicationQueueDistributionStrategy {
 
     /**
-     * synchronously distribute a {@link ReplicationPackage} to a {@link ReplicationAgent}
to a {@link ReplicationQueue}
-     * provided by the given {@link ReplicationQueueProvider}
+     * synchronously distribute a {@link org.apache.sling.replication.queue.ReplicationQueueItem}
to a {@link ReplicationAgent}
+     * to a {@link ReplicationQueue} provided by the given {@link ReplicationQueueProvider}
      *
-     * @param agentName the name of a {@link ReplicationAgent}
-     * @param replicationPackage a {@link org.apache.sling.replication.packaging.ReplicationPackage}
to distribute
-     * @param queueProvider      the {@link ReplicationQueueProvider} used to provide the
queue to be used for the given package
+     * @param agentName     the name of a {@link ReplicationAgent}
+     * @param item          a {@link org.apache.sling.replication.queue.ReplicationQueueItem}
to distribute
+     * @param queueProvider the {@link ReplicationQueueProvider} used to provide the queue
to be used for the given package
      * @return a {@link ReplicationQueueItemState} representing the state of the package
in the queue after its distribution
      * @throws ReplicationQueueException
      */
-    ReplicationQueueItemState add(String agentName, ReplicationQueueItem replicationPackage,
+    ReplicationQueueItemState add(String agentName, ReplicationQueueItem item,
                                   ReplicationQueueProvider queueProvider) throws ReplicationQueueException;
 
     /**
-     * asynchronously distribute a {@link ReplicationPackage} to a {@link ReplicationAgent}
to a {@link ReplicationQueue}
-     * provided by the given {@link ReplicationQueueProvider}
+     * asynchronously distribute a {@link org.apache.sling.replication.queue.ReplicationQueueItem}
to a {@link ReplicationAgent}
+     * to a {@link ReplicationQueue} provided by the given {@link ReplicationQueueProvider}
      *
-     * @param agentName the name of a {@link ReplicationAgent}
-     * @param replicationPackage a {@link org.apache.sling.replication.packaging.ReplicationPackage}
to distribute
+     * @param agentName          the name of a {@link ReplicationAgent}
+     * @param replicationPackage a {@link org.apache.sling.replication.queue.ReplicationQueueItem}
to distribute
      * @param queueProvider      the {@link ReplicationQueueProvider} used to provide the
queue to be used for the given package
      * @return <code>true</code> if the package could be distributed to a {@link
ReplicationQueue}, <code>false</code> otherwise
      * @throws ReplicationQueueException

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
Wed Sep 10 09:26:17 2014
@@ -20,6 +20,10 @@ package org.apache.sling.replication.que
 
 /**
  * An item in a {@link org.apache.sling.replication.queue.ReplicationQueue}
+ *
+ * This is basically a proxy to {@link org.apache.sling.replication.packaging.ReplicationPackage}
designed to avoid having
+ * to keep the package {@link org.apache.sling.replication.packaging.ReplicationPackage#createInputStream()
stream} into
+ * the queues.
  */
 public class ReplicationQueueItem {
 

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=1623955&r1=1623954&r2=1623955&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
Wed Sep 10 09:26:17 2014
@@ -26,9 +26,8 @@ import java.util.Collection;
 public interface ReplicationQueueProvider {
 
     /**
-     * provide the queue to be used for a certain agent and package or creates it if it doesn't
+     * provide a named queue for the given agent or creates it if the agent doesn't
      * exist
-     * 
      *
      * @param agentName
      *            the replication agent needing the queue
@@ -43,7 +42,6 @@ public interface ReplicationQueueProvide
 
     /**
      * get the default queue to be used for a certain agent
-     * 
      *
      * @param agentName
      *            a replication agent

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=1623955&r1=1623954&r2=1623955&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
Wed Sep 10 09:26:17 2014
@@ -69,7 +69,7 @@ public class ErrorAwareQueueDistribution
         timeThreshold = PropertiesUtil.toInteger(ctx.getProperties().get(TIME_THRESHOLD),
600000);
     }
 
-    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem replicationPackage,
+    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem item,
                                          ReplicationQueueProvider queueProvider)
             throws ReplicationQueueException {
         try {
@@ -78,9 +78,9 @@ public class ErrorAwareQueueDistribution
             ReplicationQueue queue = queueProvider.getDefaultQueue(agentName);
             log.info("obtained queue {}", queue);
             if (queue != null) {
-                if (queue.add(replicationPackage)) {
+                if (queue.add(item)) {
                     log.info("replication status: {}", state);
-                    state = queue.getStatus(replicationPackage);
+                    state = queue.getStatus(item);
                 } else {
                     log.error("could not add the item to the queue {}", queue);
                     state.setItemState(ItemState.ERROR);

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/PriorityPathDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/PriorityPathDistributionStrategy.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/PriorityPathDistributionStrategy.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/PriorityPathDistributionStrategy.java
Wed Sep 10 09:26:17 2014
@@ -54,19 +54,19 @@ public class PriorityPathDistributionStr
         priorityPaths = PropertiesUtil.toStringArray(context.getProperties().get(PRIORITYPATHS));
     }
 
-    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem replicationPackage,
+    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem item,
                                          ReplicationQueueProvider queueProvider)
             throws ReplicationQueueException {
         log.info("using path priority based queue distribution");
         ReplicationQueueItemState state = new ReplicationQueueItemState();
 
-        ReplicationQueue queue = getQueue(agentName, replicationPackage, queueProvider);
+        ReplicationQueue queue = getQueue(agentName, item, queueProvider);
         log.info("obtained queue {}", queue);
 
         if (queue != null) {
-            if (queue.add(replicationPackage)) {
+            if (queue.add(item)) {
                 log.info("replication status: {}", state);
-                state = queue.getStatus(replicationPackage);
+                state = queue.getStatus(item);
             } else {
                 log.error("could not add the item to the queue {}", queue);
                 state.setItemState(ItemState.ERROR);

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
Wed Sep 10 09:26:17 2014
@@ -40,7 +40,7 @@ public class SingleQueueDistributionStra
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem replicationPackage,
+    public ReplicationQueueItemState add(String agentName, ReplicationQueueItem item,
                                          ReplicationQueueProvider queueProvider)
                     throws ReplicationQueueException {
         log.info("using single queue distribution");
@@ -50,8 +50,8 @@ public class SingleQueueDistributionStra
         log.info("obtained queue {}", queue);
 
         if (queue != null) {
-            if (queue.add(replicationPackage)) {
-                state = queue.getStatus(replicationPackage);
+            if (queue.add(item)) {
+                state = queue.getStatus(item);
                 log.info("replication status: {}", state);
             } else {
                 log.error("could not add the item to the queue {}", queue);

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=1623955&r1=1623954&r2=1623955&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
Wed Sep 10 09:26:17 2014
@@ -56,11 +56,11 @@ public class JobHandlingReplicationQueue
         return name;
     }
 
-    public boolean add(ReplicationQueueItem replicationPackage) {
+    public boolean add(ReplicationQueueItem item) {
         boolean result = true;
         try {
             Map<String, Object> properties = JobHandlingUtils
-                    .createFullPropertiesFromPackage(replicationPackage);
+                    .createFullPropertiesFromPackage(item);
 
             Job job = jobManager.createJob(topic).properties(properties).add();
             log.info("job {} added", job.getId());

Modified: 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/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueue.java?rev=1623955&r1=1623954&r2=1623955&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/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueue.java
Wed Sep 10 09:26:17 2014
@@ -60,17 +60,17 @@ public class SimpleReplicationQueue impl
         return name;
     }
 
-    public boolean add(ReplicationQueueItem replicationPackage) {
+    public boolean add(ReplicationQueueItem item) {
         ReplicationQueueItemState status = new ReplicationQueueItemState();
         boolean result = false;
         try {
-            result = queue.offer(replicationPackage, 10, TimeUnit.SECONDS);
+            result = queue.offer(item, 10, TimeUnit.SECONDS);
             status.setEntered(Calendar.getInstance());
         } catch (InterruptedException e) {
             log.error("cannot add an item to the queue", e);
             status.setSuccessful(false);
         } finally {
-            statusMap.put(replicationPackage, status);
+            statusMap.put(item, status);
         }
         return result;
     }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/rule/impl/ChainReplicateReplicationRule.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/rule/impl/ChainReplicateReplicationRule.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/rule/impl/ChainReplicateReplicationRule.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/rule/impl/ChainReplicateReplicationRule.java
Wed Sep 10 09:26:17 2014
@@ -43,7 +43,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a rule for triggering a chain replication upon replication package installation {@link
org.apache.sling.replication.event.ReplicationEventType.PACKAGE_INSTALLED}
+ * a rule for triggering a chain replication upon replication package installation {@link
org.apache.sling.replication.event.ReplicationEventType#PACKAGE_INSTALLED}
  */
 @Component(immediate = true, label = "Rule for Chain Replication")
 @Service(value = ReplicationRule.class)

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java?rev=1623955&r1=1623954&r2=1623955&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationPackageExporterServlet.java
Wed Sep 10 09:26:17 2014
@@ -44,7 +44,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to handle reception of replication content.
+ * Servlet to handle fetching of replication content.
  */
 @SuppressWarnings("serial")
 @Component(metatype = false)



Mime
View raw message