sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [2/12] - in /sling/trunk/contrib/extensions: distribution/ distribution/core/ distribution/core/src/main/java/org/apache/sling/distribution/ distribution/core/src/main/java/org/apache/sling/distribution/agent/ distribution/core/src...
Date Fri, 07 Nov 2014 10:28:08 GMT

Modified: sling/trunk/contrib/extensions/distribution/core/README.md
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/README.md?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/README.md (original)
+++ sling/trunk/contrib/extensions/distribution/core/README.md Fri Nov  7 10:28:02 2014
@@ -1,84 +1,84 @@
-# Sling Replication
+# Sling Content Distribution
 
-This is the README for the Sling Replication module.
+This is the README for the Sling Content Distribution module.
 
 ## Overview
 
-### Replication agents
+### Distribution agents
 
-Each replication agent is an OSGi service and is resolved using a [Sling Resource Provider](#Resource_Providers) who locate it under `libs/sling/replication/services/agents`.
+Each distribution agent is an OSGi service and is resolved using a [Sling Resource Provider](#Resource_Providers) who locate it under `libs/sling/distribution/services/agents`.
 
-Replication agents can be triggered by sending `HTTP POST` requests to 
+Distribution agents can be triggered by sending `HTTP POST` requests to 
 
-`http://$host:$port/libs/sling/replication/services/agents/$agentname` 
+`http://$host:$port/libs/sling/distribution/services/agents/$agentname` 
 
 with HTTP parameters `action` and `path`.
 
 ### 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:
+One can configure a resource provider for a distribution resource to give access to OSGI distribution services.
+Already configured ones are: _DistributionAgents_, _DistributionPackageExporters_ and _DistributionPackageImporters_.
+Here is an example of the configuration for exposing _DistributionAgent_ services as resources:
 
     {
          "jcr:primaryType" : "sling:OsgiConfig",
     
-         "name" : "replicationAgents",
+         "name" : "distributionAgents",
     
-         "provider.roots" : [ "/libs/sling/replication/services/agents" ],
+         "provider.roots" : [ "/libs/sling/distribution/services/agents" ],
     
-         "serviceType" : "org.apache.sling.replication.agent.ReplicationAgent",
+         "serviceType" : "org.apache.sling.distribution.agent.DistributionAgent",
     
          "resourceProperties" : [
     
-             "sling:resourceType=sling/replication/service/agent",
+             "sling:resourceType=sling/distribution/service/agent",
     
-             "sling:resourceSuperType=sling/replication/service",
+             "sling:resourceSuperType=sling/distribution/service",
     
              "name={name}",
     
-             "queue/sling:resourceType=replication/agent/queue"
+             "queue/sling:resourceType=distribution/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_.
+When configuring such a provider you specify the service interface _DistributionAgent_, the url and some properties one 
+wants that resource to have like resourceType so basically this config governs _/libs/sling/distribution/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.
 
-### Replication agents configuration
+### Distribution agents configuration
 
-Replication agents configurations are proper OSGi configurations (backed by nodes of type `sling:OsgiConfig` in the repository), see [CompactSimpleReplicationAgentServiceFactory-publish.json](src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json).
+Distribution agents configurations are proper OSGi configurations (backed by nodes of type `sling:OsgiConfig` in the repository), see [CompactSimpleDistributionAgentServiceFactory-publish.json](src/main/resources/SLING-CONTENT/libs/sling/distribution/install.author/org.apache.sling.distribution.agent.impl.CompactSimpleDistributionAgentFactory-publish.json).
 
-Replication agents configuration include:
+Distribution agents configuration include:
 
 - Name: the name of the agent
-- Package exporter: algorithm for retrieving a replication package
-- Package importer: algorithm for installing a replication package
+- Package exporter: algorithm for retrieving a distribution package
+- Package importer: algorithm for installing a distribution package
 - Queue provider: current implementations are:
 -- In memory
 -- Sling Job Handling based
-- Queue distribution: how items to be replicated are distributed to agent's queues
-- Triggers: triggers able to handle replication requests
+- Queue distribution: how items to be distributed are distributed to agent's queues
+- Triggers: triggers able to handle distribution requests
 
-Replication agents' configurations can be retrieved via `HTTP GET`:
+Distribution agents' configurations can be retrieved via `HTTP GET`:
 
-- `http -a admin:admin -v -f GET http://localhost:8080/libs/sling/replication/settings/agents/publish`
+- `http -a admin:admin -v -f GET http://localhost:8080/libs/sling/distribution/settings/agents/publish`
 
-### Replication queues
+### Distribution queues
 
 #### In Memory queue
 
-That's a draft implementation using an in memory blocking queue together with a Sling scheduled processor which periodically fetches the first item of each queue and trigger a replication of such an item.
+That's a draft implementation using an in memory blocking queue together with a Sling scheduled processor which periodically fetches the first item of each queue and trigger a distribution of such an item.
 It's not suitable for production as it's currently not persisted and therefore restarting the bundle / platform would not keep the queue together with its items.
 
 #### Sling Job Handling based queue
 
 That's a queue implementation based on the queues and jobs provided by Sling Event bundle.
 Each item addition to a queue triggers the creation of a Sling job which will handle the processing of that item in the queue.
-By default Sling queues for replication have the following options:
+By default Sling queues for distribution have the following options:
 
 - ordered
 - with max priority
@@ -87,7 +87,7 @@ By default Sling queues for replication 
 
 ### Distribution of packages among queues
 
-Each replication agent uses a specific queue distribution mechanism, specified via a 'queue distribution strategy', which defines how packages are routed into agent queues.
+Each distribution agent uses a specific queue distribution mechanism, specified via a 'queue distribution strategy', which defines how packages are routed into agent queues.
 The currently available distribution strategies are
 
 - single: the agent has one only queue and all the items are routed there
@@ -97,22 +97,22 @@ The currently available distribution str
  
 ## Usecases
 
-### Forward replication (PUSH)
+### Forward distribution (PUSH)
 
-User/client makes an `HTTP POST`request to `http://localhost:8080/libs/sling/replication/services/agents/publish` with parameters `action=ADD` and `path=/content`
+User/client makes an `HTTP POST`request to `http://localhost:8080/libs/sling/distribution/services/agents/publish` with parameters `action=ADD` and `path=/content`
 
-- `ReplicationAgentServlet` servlet is triggered
-- `ReplicationAgentServlet` servlet adapts the resource to a `ReplicationAgent` via a registered `OsgiPropertiesResourceProviderFactory` 
-- `ReplicationAgent` executes the replication request (add the resource at path /content)
-- `ReplicationAgent` get the status of the request and update the response accordingly
-- `ReplicationAgentServlet` maps the agent response to an HTTP response accordingly
+- `DistributionAgentServlet` servlet is triggered
+- `DistributionAgentServlet` servlet adapts the resource to a `DistributionAgent` via a registered `OsgiPropertiesResourceProviderFactory` 
+- `DistributionAgent` executes the distribution request (add the resource at path /content)
+- `DistributionAgent` get the status of the request and update the response accordingly
+- `DistributionAgentServlet` maps the agent response to an HTTP response accordingly
 
 ## HOWTOs
 
 ### Installation
 
 - install the dependency bundles on all Sling instances
-- install Sling Replication core on all Sling instances
+- install Sling Distribution core on all Sling instances
 
 ### Push resources
 
@@ -121,13 +121,13 @@ User/client makes an `HTTP POST`request 
 - create/update some content on author (e.g. /content/sample1)
 - add 'content/sample1' by sending an HTTP POST on sender instance: 
 
-```http -a admin:admin -v -f POST http://localhost:8080/libs/sling/replication/services/agents/publish action=ADD path=/content/sample1```
+```http -a admin:admin -v -f POST http://localhost:8080/libs/sling/distribution/services/agents/publish action=ADD path=/content/sample1```
 
 #### Push deletions
 
 - delete 'content' by sending an HTTP POST on sender instance:
  
-```http -a admin:admin -v -f POST http://localhost:8080/libs/sling/replication/services/agents/publish action=DELETE path=/content/sample1```
+```http -a admin:admin -v -f POST http://localhost:8080/libs/sling/distribution/services/agents/publish action=DELETE path=/content/sample1```
 
 # Open Tasks
 
@@ -139,36 +139,36 @@ User/client makes an `HTTP POST`request 
 ### HTTP API
 
 #### API Requirements
-We need to expose APIs for configuring, commanding and monitoring replication agents.
+We need to expose APIs for configuring, commanding and monitoring distribution agents.
 
 - Configuration API should allow:
  - CRUD operations for agent configs
 - Command API (eventually issued to multiple agents at once) should allow:
- - to trigger a replication request on a specific agent
+ - to trigger a distribution request on a specific agent
  - to explicitly create and export a package
  - to explicitly import a formerly created package
 - Monitoring API should allow:
- - inspection to internal queues of replication agents
+ - inspection to internal queues of distribution agents
  - inspection of commands history
  
 #### API endpoints 
 
 ##### Configuration API
-- Create config:  - POST _/libs/sling/replication/settings/agents_
-- Read config - GET _/libs/sling/replication/settings/agents/{config identifier}_
-- Update config - PUT _/libs/sling/replication/settings/agents/{config identifier}_
-- Delete config - DELETE _/libs/sling/replication/settings/agents/{config identifier}_ or POST with :operation=delete
+- Create config:  - POST _/libs/sling/distribution/settings/agents_
+- Read config - GET _/libs/sling/distribution/settings/agents/{config identifier}_
+- Update config - PUT _/libs/sling/distribution/settings/agents/{config identifier}_
+- Delete config - DELETE _/libs/sling/distribution/settings/agents/{config identifier}_ or POST with :operation=delete
 
 ##### Command API
-- Replicate - POST _/libs/sling/replication/services/agents/{agentName}_
-- Import package - POST _/libs/sling/replication/services/importers/{importerName}_
-- Export package - POST _/libs/sling/replication/services/exporters/{exporterName}_
+- Replicate - POST _/libs/sling/distribution/services/agents/{agentName}_
+- Import package - POST _/libs/sling/distribution/services/importers/{importerName}_
+- Export package - POST _/libs/sling/distribution/services/exporters/{exporterName}_
 
 ##### Monitoring API
-- Replication history - GET _/libs/sling/replication/services/agents/{agentName}/history_ (not implemented yet)
-- Import package history - GET _/libs/sling/replication/services/importers/{importerName}/history_ (not implemented yet)
-- Export package history - GET _/libs/sling/replication/services/exporters/{exporterName}/history_ (not implemented yet)
-- Agent queue inspection  - GET _/libs/sling/replication/services/agents/{agentName}/queue_ or _{agentName}.queue_
+- Distribution history - GET _/libs/sling/distribution/services/agents/{agentName}/history_ (not implemented yet)
+- Import package history - GET _/libs/sling/distribution/services/importers/{importerName}/history_ (not implemented yet)
+- Export package history - GET _/libs/sling/distribution/services/exporters/{exporterName}/history_ (not implemented yet)
+- Agent queue inspection  - GET _/libs/sling/distribution/services/agents/{agentName}/queue_ or _{agentName}.queue_
 
 #### API Implementation 
 TODO

Modified: sling/trunk/contrib/extensions/distribution/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/pom.xml?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/pom.xml (original)
+++ sling/trunk/contrib/extensions/distribution/core/pom.xml Fri Nov  7 10:28:02 2014
@@ -32,20 +32,20 @@
     <!-- ======================================================================= -->
     <!-- P R O J E C T                                                           -->
     <!-- ======================================================================= -->
-    <artifactId>org.apache.sling.replication.core</artifactId>
+    <artifactId>org.apache.sling.distribution.core</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
-    <name>Apache Sling Replication Core</name>
+    <name>Apache Sling Distribution Core</name>
     <description>
-        The Apache Sling Replication core bundle provides a set of utilities to replicate content from / to other Sling
+        The Apache Sling Distribution core bundle provides a set of utilities to replicate content from / to other Sling
         instances.
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/replication/core</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/replication/core</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/core</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/core</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core</url>
     </scm>
 
     <!-- ======================================================================= -->
@@ -67,20 +67,17 @@
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
-                        <Bundle-SymbolicName>org.apache.sling.replication.core</Bundle-SymbolicName>
-                        <Sling-Initial-Content>
-                            SLING-CONTENT/libs/sling/replication;path:=/libs/sling/replication;overwrite:=true
-                        </Sling-Initial-Content>
+                        <Bundle-SymbolicName>org.apache.sling.distribution.core</Bundle-SymbolicName>
                         <Export-Package>
-                            org.apache.sling.replication.component,
-                            org.apache.sling.replication.agent,
-                            org.apache.sling.replication.communication,
-                            org.apache.sling.replication.event,
-                            org.apache.sling.replication.queue,
-                            org.apache.sling.replication.trigger,
-                            org.apache.sling.replication.packaging,
-                            org.apache.sling.replication.transport.authentication,
-                            org.apache.sling.replication.util
+                            org.apache.sling.distribution.component,
+                            org.apache.sling.distribution.agent,
+                            org.apache.sling.distribution.communication,
+                            org.apache.sling.distribution.event,
+                            org.apache.sling.distribution.queue,
+                            org.apache.sling.distribution.trigger,
+                            org.apache.sling.distribution.packaging,
+                            org.apache.sling.distribution.transport.authentication,
+                            org.apache.sling.distribution.util
                         </Export-Package>
                         <Embed-Dependency>httpasyncclient</Embed-Dependency>
                     </instructions>

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent;
+package org.apache.sling.distribution.agent;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
@@ -24,20 +24,20 @@ import javax.annotation.Nullable;
 
 import aQute.bnd.annotation.ProviderType;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.communication.ReplicationResponse;
-import org.apache.sling.replication.component.ReplicationComponent;
-import org.apache.sling.replication.queue.ReplicationQueue;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.communication.DistributionResponse;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.queue.DistributionQueue;
 
 /**
- * A replication agent is responsible for handling {@link org.apache.sling.replication.communication.ReplicationRequest}s.
+ * A distribution agent is responsible for handling {@link org.apache.sling.distribution.communication.DistributionRequest}s.
  * <p/>
- * This means executing actions of e.g.: a specific {@link org.apache.sling.replication.communication.ReplicationActionType}s on
+ * This means executing actions of e.g.: a specific {@link org.apache.sling.distribution.communication.DistributionActionType}s on
  * specific path(s) which will resume pulling resources from a certain Sling instance and / or pushing resources to
  * other instances.
  */
 @ProviderType
-public interface ReplicationAgent extends ReplicationComponent {
+public interface DistributionAgent extends DistributionComponent {
 
 
     /**
@@ -50,21 +50,21 @@ public interface ReplicationAgent extend
      * get the agent queue with the given name
      *
      * @param name a queue name
-     * @return a {@link ReplicationQueue} with the given name bound to this agent, if it exists, <code>null</code> otherwise
-     * @throws ReplicationAgentException if an error occurs in retrieving the queue
+     * @return a {@link org.apache.sling.distribution.queue.DistributionQueue} with the given name bound to this agent, if it exists, <code>null</code> otherwise
+     * @throws DistributionAgentException if an error occurs in retrieving the queue
      */
     @CheckForNull
-    ReplicationQueue getQueue(@Nullable String name) throws ReplicationAgentException;
+    DistributionQueue getQueue(@Nullable String name) throws DistributionAgentException;
 
     /**
-     * executes a {@link ReplicationRequest}
+     * executes a {@link org.apache.sling.distribution.communication.DistributionRequest}
      *
-     * @param replicationRequest the replication request
+     * @param distributionRequest the distribution request
      * @param resourceResolver   the resource resolver used for authenticating the request,
-     * @return a {@link ReplicationResponse}
-     * @throws ReplicationAgentException if any error happens during the execution of the request or if the authentication fails
+     * @return a {@link org.apache.sling.distribution.communication.DistributionResponse}
+     * @throws DistributionAgentException if any error happens during the execution of the request or if the authentication fails
      */
     @Nonnull
-    ReplicationResponse execute(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest) throws ReplicationAgentException;
+    DistributionResponse execute(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionAgentException;
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgentException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgentException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgentException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java Fri Nov  7 10:28:02 2014
@@ -16,19 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent;
+package org.apache.sling.distribution.agent;
 
 /**
- * Represents errors happened while {@link ReplicationAgent}s do replications.
+ * Represents errors happened while {@link DistributionAgent}s do distributions.
  */
 @SuppressWarnings("serial")
-public class ReplicationAgentException extends Exception {
+public class DistributionAgentException extends Exception {
 
-    public ReplicationAgentException(Exception e) {
+    public DistributionAgentException(Exception e) {
         super(e);
     }
 
-    public ReplicationAgentException(String string) {
+    public DistributionAgentException(String string) {
         super(string);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java Fri Nov  7 10:28:02 2014
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent;
+package org.apache.sling.distribution.agent;
 
 /**
- * An {@link Exception} representing failed authorization in execution of a certain {@link org.apache.sling.replication.communication.ReplicationRequest}
+ * An {@link Exception} representing failed authorization in execution of a certain {@link org.apache.sling.distribution.communication.DistributionRequest}
  */
-public class ReplicationRequestAuthorizationException extends Exception {
-    public ReplicationRequestAuthorizationException(String message) {
+public class DistributionRequestAuthorizationException extends Exception {
+    public DistributionRequestAuthorizationException(String message) {
         super(message);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationStrategy.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationStrategy.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationRequestAuthorizationStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java Fri Nov  7 10:28:02 2014
@@ -16,28 +16,28 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent;
+package org.apache.sling.distribution.agent;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ConsumerType;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.component.ReplicationComponent;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.component.DistributionComponent;
 
 /**
  * Strategy for authorizing requests
  */
 @ConsumerType
-public interface ReplicationRequestAuthorizationStrategy extends ReplicationComponent {
+public interface DistributionRequestAuthorizationStrategy extends DistributionComponent {
 
     /**
      * @param resourceResolver   a {@link org.apache.sling.api.resource.ResourceResolver} representing the calling 'user'
-     * @param replicationRequest a request bringing metadata for getting {@link org.apache.sling.replication.packaging.ReplicationPackage}s
+     * @param distributionRequest a request bringing metadata for getting {@link org.apache.sling.distribution.packaging.DistributionPackage}s
      *                           to be exported
-     * @throws ReplicationRequestAuthorizationException if the {@link org.apache.sling.api.resource.ResourceResolver} is
-     *                                                  not authorized to execute the given {@link org.apache.sling.replication.communication.ReplicationRequest}
+     * @throws DistributionRequestAuthorizationException if the {@link org.apache.sling.api.resource.ResourceResolver} is
+     *                                                  not authorized to execute the given {@link org.apache.sling.distribution.communication.DistributionRequest}
      */
-    void checkPermission(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest) throws ReplicationRequestAuthorizationException;
+    void checkPermission(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionRequestAuthorizationException;
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactory.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactory.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactory.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactory.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactory.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CoordinatingReplicationAgentFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactory.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -33,19 +33,19 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.event.jobs.JobManager;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.component.ReplicationComponent;
-import org.apache.sling.replication.component.ReplicationComponentFactory;
-import org.apache.sling.replication.component.ReplicationComponentProvider;
-import org.apache.sling.replication.component.impl.SettingsUtils;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.apache.sling.replication.queue.impl.SingleQueueDistributionStrategy;
-import org.apache.sling.replication.queue.impl.jobhandling.JobHandlingReplicationQueueProvider;
-import org.apache.sling.replication.resources.impl.OsgiUtils;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.component.ManagedDistributionComponent;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
+import org.apache.sling.distribution.component.DistributionComponentProvider;
+import org.apache.sling.distribution.component.impl.SettingsUtils;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.SingleQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
+import org.apache.sling.distribution.resources.impl.OsgiUtils;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.settings.SlingSettingsService;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -54,55 +54,55 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * An OSGi service factory for 'Coordinate' {@link org.apache.sling.replication.agent.ReplicationAgent}s.
+ * An OSGi service factory for 'Coordinate' {@link org.apache.sling.distribution.agent.DistributionAgent}s.
  */
 @Component(metatype = true,
-        label = "Sling Replication - Coordinating Agents Factory",
+        label = "Sling Distribution - Coordinating Agents Factory",
         description = "OSGi configuration factory for coordinate agents",
         configurationFactory = true,
         specVersion = "1.1",
         policy = ConfigurationPolicy.REQUIRE
 )
-public class CoordinatingReplicationAgentFactory implements ReplicationComponentProvider {
+public class CoordinatingDistributionAgentFactory implements DistributionComponentProvider {
 
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = ReplicationComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
+    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DistributionComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Property(boolValue = true, label = "Enabled")
-    private static final String ENABLED = ReplicationComponentFactory.COMPONENT_ENABLED;
+    private static final String ENABLED = DistributionComponentFactory.COMPONENT_ENABLED;
 
-    @Property(value = ReplicationComponentFactory.AGENT_SIMPLE, propertyPrivate = true)
-    private static final String TYPE = ReplicationComponentFactory.COMPONENT_TYPE;
+    @Property(value = DistributionComponentFactory.AGENT_SIMPLE, propertyPrivate = true)
+    private static final String TYPE = DistributionComponentFactory.COMPONENT_TYPE;
 
     @Property(label = "Name")
-    public static final String NAME = ReplicationComponentFactory.COMPONENT_NAME;
+    public static final String NAME = DistributionComponentFactory.COMPONENT_NAME;
 
     @Property(boolValue = false, propertyPrivate = true)
-    public static final String IS_PASSIVE = ReplicationComponentFactory.AGENT_SIMPLE_PROPERTY_IS_PASSIVE;
+    public static final String IS_PASSIVE = DistributionComponentFactory.AGENT_SIMPLE_PROPERTY_IS_PASSIVE;
 
     @Property(label = "Service Name")
-    public static final String SERVICE_NAME = ReplicationComponentFactory.AGENT_SIMPLE_PROPERTY_SERVICE_NAME;
+    public static final String SERVICE_NAME = DistributionComponentFactory.AGENT_SIMPLE_PROPERTY_SERVICE_NAME;
 
     @Property(label = "Request Authorization Strategy Properties", cardinality = 100)
-    public static final String REQUEST_AUTHORIZATION_STRATEGY = ReplicationComponentFactory.COMPONENT_REQUEST_AUTHORIZATION_STRATEGY;
+    public static final String REQUEST_AUTHORIZATION_STRATEGY = DistributionComponentFactory.COMPONENT_REQUEST_AUTHORIZATION_STRATEGY;
 
     @Property(label = "Package Exporter Properties", cardinality = 100)
-    public static final String PACKAGE_EXPORTER = ReplicationComponentFactory.COMPONENT_PACKAGE_EXPORTER;
+    public static final String PACKAGE_EXPORTER = DistributionComponentFactory.COMPONENT_PACKAGE_EXPORTER;
 
     @Property(label = "Package Importer Properties", cardinality = 100)
-    public static final String PACKAGE_IMPORTER = ReplicationComponentFactory.COMPONENT_PACKAGE_IMPORTER;
+    public static final String PACKAGE_IMPORTER = DistributionComponentFactory.COMPONENT_PACKAGE_IMPORTER;
 
     @Property(label = "Trigger Properties", cardinality = 100)
-    public static final String TRIGGER = ReplicationComponentFactory.COMPONENT_TRIGGER;
+    public static final String TRIGGER = DistributionComponentFactory.COMPONENT_TRIGGER;
 
     @Property(label = "Target TransportAuthenticationProvider", name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
     @Reference(name = "transportAuthenticationProvider")
     private volatile TransportAuthenticationProvider transportAuthenticationProvider;
 
     @Reference
-    private ReplicationEventFactory replicationEventFactory;
+    private DistributionEventFactory distributionEventFactory;
 
     @Reference
     private SlingSettingsService settingsService;
@@ -111,7 +111,7 @@ public class CoordinatingReplicationAgen
     private JobManager jobManager;
 
     @Reference
-    private ReplicationComponentFactory componentFactory;
+    private DistributionComponentFactory componentFactory;
 
     private BundleContext savedContext;
 
@@ -161,15 +161,15 @@ public class CoordinatingReplicationAgen
                 ((Map) properties.get(PACKAGE_IMPORTER)).put("type", "remote");
 
 
-                ReplicationAgent agent = componentFactory.createComponent(ReplicationAgent.class, properties, this);
+                DistributionAgent agent = componentFactory.createComponent(DistributionAgent.class, properties, this);
 
                 log.debug("activated agent {}", agentName);
 
                 if (agent != null) {
                     // register agent service
-                    componentReg = context.registerService(ReplicationAgent.class.getName(), agent, props);
-                    if (agent instanceof ManagedReplicationComponent) {
-                        ((ManagedReplicationComponent) agent).enable();
+                    componentReg = context.registerService(DistributionAgent.class.getName(), agent, props);
+                    if (agent instanceof ManagedDistributionComponent) {
+                        ((ManagedDistributionComponent) agent).enable();
                     }
                 }
             }
@@ -182,8 +182,8 @@ public class CoordinatingReplicationAgen
         if (componentReg != null) {
             ServiceReference reference = componentReg.getReference();
             Object service = context.getService(reference);
-            if (service instanceof ManagedReplicationComponent) {
-                ((ManagedReplicationComponent) service).disable();
+            if (service instanceof ManagedDistributionComponent) {
+                ((ManagedDistributionComponent) service).disable();
             }
 
             componentReg.unregister();
@@ -192,11 +192,11 @@ public class CoordinatingReplicationAgen
 
     }
 
-    public <ComponentType extends ReplicationComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
+    public <ComponentType extends DistributionComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
                                                                                    @Nullable String componentName) {
-        if (type.isAssignableFrom(ReplicationQueueProvider.class)) {
-            return (ComponentType) new JobHandlingReplicationQueueProvider(agentName, jobManager, savedContext);
-        } else if (type.isAssignableFrom(ReplicationQueueDistributionStrategy.class)) {
+        if (type.isAssignableFrom(DistributionQueueProvider.class)) {
+            return (ComponentType) new JobHandlingDistributionQueueProvider(agentName, jobManager, savedContext);
+        } else if (type.isAssignableFrom(DistributionQueueDistributionStrategy.class)) {
             return (ComponentType) new SingleQueueDistributionStrategy();
         } else if (type.isAssignableFrom(TransportAuthenticationProvider.class)) {
             return (ComponentType) transportAuthenticationProvider;

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/PrivilegeReplicationRequestAuthorizationStrategy.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/PrivilegeReplicationRequestAuthorizationStrategy.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/PrivilegeReplicationRequestAuthorizationStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
@@ -25,16 +25,16 @@ import javax.jcr.security.AccessControlM
 import javax.jcr.security.Privilege;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.agent.ReplicationRequestAuthorizationException;
-import org.apache.sling.replication.agent.ReplicationRequestAuthorizationStrategy;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
+import org.apache.sling.distribution.agent.DistributionRequestAuthorizationException;
+import org.apache.sling.distribution.agent.DistributionRequestAuthorizationStrategy;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
 
-public class PrivilegeReplicationRequestAuthorizationStrategy implements ReplicationRequestAuthorizationStrategy {
+public class PrivilegeDistributionRequestAuthorizationStrategy implements DistributionRequestAuthorizationStrategy {
 
     private final String jcrPrivilege;
 
-    public PrivilegeReplicationRequestAuthorizationStrategy(String jcrPrivilege) {
+    public PrivilegeDistributionRequestAuthorizationStrategy(String jcrPrivilege) {
         if (jcrPrivilege == null) {
             throw new IllegalArgumentException("Jcr Privilege is required");
         }
@@ -42,45 +42,45 @@ public class PrivilegeReplicationRequest
         this.jcrPrivilege = jcrPrivilege;
     }
 
-    public void checkPermission(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest) throws ReplicationRequestAuthorizationException {
+    public void checkPermission(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionRequestAuthorizationException {
         Session session = resourceResolver.adaptTo(Session.class);
 
         try {
-           if (ReplicationActionType.ADD.equals(replicationRequest.getAction())) {
-               checkPermissionForAdd(session, replicationRequest.getPaths());
+           if (DistributionActionType.ADD.equals(distributionRequest.getAction())) {
+               checkPermissionForAdd(session, distributionRequest.getPaths());
            }
-           else if (ReplicationActionType.DELETE.equals(replicationRequest.getAction())) {
-               checkPermissionForDelete(session, replicationRequest.getPaths());
+           else if (DistributionActionType.DELETE.equals(distributionRequest.getAction())) {
+               checkPermissionForDelete(session, distributionRequest.getPaths());
            }
 
         }
         catch (RepositoryException e) {
-            throw new ReplicationRequestAuthorizationException("Not enough privileges");
+            throw new DistributionRequestAuthorizationException("Not enough privileges");
         }
 
     }
 
     private void checkPermissionForAdd(Session session, String[] paths)
-            throws RepositoryException, ReplicationRequestAuthorizationException {
+            throws RepositoryException, DistributionRequestAuthorizationException {
         AccessControlManager acMgr = session.getAccessControlManager();
 
         Privilege[] privileges = new Privilege[] { acMgr.privilegeFromName(jcrPrivilege), acMgr.privilegeFromName(Privilege.JCR_READ) };
         for (String path : paths) {
             if(!acMgr.hasPrivileges(path, privileges)) {
-                throw new ReplicationRequestAuthorizationException("Not enough privileges");
+                throw new DistributionRequestAuthorizationException("Not enough privileges");
             }
         }
 
     }
 
     private void checkPermissionForDelete(Session session, String[] paths)
-            throws RepositoryException, ReplicationRequestAuthorizationException {
+            throws RepositoryException, DistributionRequestAuthorizationException {
         AccessControlManager acMgr = session.getAccessControlManager();
 
         Privilege[] privileges = new Privilege[] { acMgr.privilegeFromName(jcrPrivilege), acMgr.privilegeFromName(Privilege.JCR_REMOVE_NODE)  };
         for (String path : paths) {
             if(session.nodeExists(path) && !acMgr.hasPrivileges(path, privileges)) {
-                throw new ReplicationRequestAuthorizationException("Not enough privileges");
+                throw new DistributionRequestAuthorizationException("Not enough privileges");
             }
         }
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import javax.annotation.Nonnull;
 import java.util.ArrayList;
@@ -32,101 +32,101 @@ import org.apache.sling.api.resource.Log
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.agent.ReplicationAgentException;
-import org.apache.sling.replication.agent.ReplicationRequestAuthorizationStrategy;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.communication.ReplicationResponse;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.event.ReplicationEventType;
-import org.apache.sling.replication.packaging.*;
-import org.apache.sling.replication.queue.*;
-import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
-import org.apache.sling.replication.trigger.ReplicationRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.ReplicationTriggerException;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.agent.DistributionAgentException;
+import org.apache.sling.distribution.agent.DistributionRequestAuthorizationStrategy;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.communication.DistributionResponse;
+import org.apache.sling.distribution.component.ManagedDistributionComponent;
+import org.apache.sling.distribution.event.DistributionEventType;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.packaging.*;
+import org.apache.sling.distribution.queue.*;
+import org.apache.sling.distribution.serialization.DistributionPackageBuildingException;
+import org.apache.sling.distribution.trigger.DistributionRequestHandler;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.DistributionTriggerException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Basic implementation of a {@link ReplicationAgent}
+ * Basic implementation of a {@link org.apache.sling.distribution.agent.DistributionAgent}
  */
-public class SimpleReplicationAgent implements ReplicationAgent, ManagedReplicationComponent {
+public class SimpleDistributionAgent implements DistributionAgent, ManagedDistributionComponent {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final ReplicationQueueProvider queueProvider;
+    private final DistributionQueueProvider queueProvider;
 
     private final boolean passive;
-    private final ReplicationPackageImporter replicationPackageImporter;
-    private final ReplicationPackageExporter replicationPackageExporter;
+    private final DistributionPackageImporter distributionPackageImporter;
+    private final DistributionPackageExporter distributionPackageExporter;
 
-    private final ReplicationQueueDistributionStrategy queueDistributionStrategy;
+    private final DistributionQueueDistributionStrategy queueDistributionStrategy;
 
-    private final ReplicationEventFactory replicationEventFactory;
+    private final DistributionEventFactory distributionEventFactory;
 
-    private final List<ReplicationTrigger> triggers;
+    private final List<DistributionTrigger> triggers;
 
     private final String name;
 
-    private final ReplicationRequestAuthorizationStrategy replicationRequestAuthorizationStrategy;
+    private final DistributionRequestAuthorizationStrategy distributionRequestAuthorizationStrategy;
     private final ResourceResolverFactory resourceResolverFactory;
     private final String subServiceName;
     private AgentBasedRequestHandler agentBasedRequestHandler;
 
-    public SimpleReplicationAgent(String name,
-                                  boolean passive,
-                                  String subServiceName,
-                                  ReplicationPackageImporter replicationPackageImporter,
-                                  ReplicationPackageExporter replicationPackageExporter,
-                                  ReplicationRequestAuthorizationStrategy replicationRequestAuthorizationStrategy,
-                                  ReplicationQueueProvider queueProvider,
-                                  ReplicationQueueDistributionStrategy queueDistributionStrategy,
-                                  ReplicationEventFactory replicationEventFactory,
-                                  ResourceResolverFactory resourceResolverFactory,
-                                  List<ReplicationTrigger> triggers) {
+    public SimpleDistributionAgent(String name,
+                                   boolean passive,
+                                   String subServiceName,
+                                   DistributionPackageImporter distributionPackageImporter,
+                                   DistributionPackageExporter distributionPackageExporter,
+                                   DistributionRequestAuthorizationStrategy distributionRequestAuthorizationStrategy,
+                                   DistributionQueueProvider queueProvider,
+                                   DistributionQueueDistributionStrategy queueDistributionStrategy,
+                                   DistributionEventFactory distributionEventFactory,
+                                   ResourceResolverFactory resourceResolverFactory,
+                                   List<DistributionTrigger> triggers) {
 
 
         // check configuration is valid
         if (name == null
-                || replicationPackageImporter == null
-                || replicationPackageExporter == null
+                || distributionPackageImporter == null
+                || distributionPackageExporter == null
                 || subServiceName == null
-                || replicationRequestAuthorizationStrategy == null
+                || distributionRequestAuthorizationStrategy == null
                 || queueProvider == null
                 || queueDistributionStrategy == null
-                || replicationEventFactory == null
+                || distributionEventFactory == null
                 || resourceResolverFactory == null) {
 
             String errorMessage = Arrays.toString(new Object[]{name,
-                    replicationPackageImporter,
-                    replicationPackageExporter,
+                    distributionPackageImporter,
+                    distributionPackageExporter,
                     subServiceName,
-                    replicationRequestAuthorizationStrategy,
+                    distributionRequestAuthorizationStrategy,
                     queueProvider,
                     queueDistributionStrategy,
-                    replicationEventFactory,
+                    distributionEventFactory,
                     resourceResolverFactory});
             throw new IllegalArgumentException("all arguments are required: " + errorMessage);
         }
 
         this.subServiceName = subServiceName;
-        this.replicationRequestAuthorizationStrategy = replicationRequestAuthorizationStrategy;
+        this.distributionRequestAuthorizationStrategy = distributionRequestAuthorizationStrategy;
         this.resourceResolverFactory = resourceResolverFactory;
         this.name = name;
         this.passive = passive;
-        this.replicationPackageImporter = replicationPackageImporter;
-        this.replicationPackageExporter = replicationPackageExporter;
+        this.distributionPackageImporter = distributionPackageImporter;
+        this.distributionPackageExporter = distributionPackageExporter;
         this.queueProvider = queueProvider;
         this.queueDistributionStrategy = queueDistributionStrategy;
-        this.replicationEventFactory = replicationEventFactory;
-        this.triggers = triggers == null ? new ArrayList<ReplicationTrigger>() : triggers;
+        this.distributionEventFactory = distributionEventFactory;
+        this.triggers = triggers == null ? new ArrayList<DistributionTrigger>() : triggers;
     }
 
     @Nonnull
-    public ReplicationResponse execute(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationRequest replicationRequest)
-            throws ReplicationAgentException {
+    public DistributionResponse execute(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest)
+            throws DistributionAgentException {
 
 
         ResourceResolver agentResourceResolver = null;
@@ -134,12 +134,12 @@ public class SimpleReplicationAgent impl
         try {
             agentResourceResolver = getAgentResourceResolver();
 
-            replicationRequestAuthorizationStrategy.checkPermission(resourceResolver, replicationRequest);
+            distributionRequestAuthorizationStrategy.checkPermission(resourceResolver, distributionRequest);
 
-            return scheduleImport(exportPackages(agentResourceResolver, replicationRequest));
+            return scheduleImport(exportPackages(agentResourceResolver, distributionRequest));
         } catch (Exception e) {
-            log.error("Error executing replication request {}", replicationRequest, e);
-            throw new ReplicationAgentException(e);
+            log.error("Error executing distribution request {}", distributionRequest, e);
+            throw new DistributionAgentException(e);
         } finally {
             ungetAgentResourceResolver(agentResourceResolver);
 
@@ -151,58 +151,58 @@ public class SimpleReplicationAgent impl
         return passive;
     }
 
-    private List<ReplicationPackage> exportPackages(ResourceResolver agentResourceResolver, ReplicationRequest replicationRequest) throws ReplicationPackageBuildingException {
-        return replicationPackageExporter.exportPackages(agentResourceResolver, replicationRequest);
+    private List<DistributionPackage> exportPackages(ResourceResolver agentResourceResolver, DistributionRequest distributionRequest) throws DistributionPackageBuildingException {
+        return distributionPackageExporter.exportPackages(agentResourceResolver, distributionRequest);
     }
 
-    private ReplicationResponse scheduleImport(List<ReplicationPackage> replicationPackages) {
-        List<ReplicationResponse> replicationResponses = new LinkedList<ReplicationResponse>();
+    private DistributionResponse scheduleImport(List<DistributionPackage> distributionPackages) {
+        List<DistributionResponse> distributionResponses = new LinkedList<DistributionResponse>();
 
-        for (ReplicationPackage replicationPackage : replicationPackages) {
-            replicationResponses.add(schedule(replicationPackage));
+        for (DistributionPackage distributionPackage : distributionPackages) {
+            distributionResponses.add(schedule(distributionPackage));
         }
-        return replicationResponses.size() == 1 ? replicationResponses.get(0) : new CompositeReplicationResponse(replicationResponses);
+        return distributionResponses.size() == 1 ? distributionResponses.get(0) : new CompositeDistributionResponse(distributionResponses);
     }
 
-    private ReplicationResponse schedule(ReplicationPackage replicationPackage) {
-        ReplicationResponse replicationResponse;
-        log.info("scheduling replication of package {}", replicationPackage);
+    private DistributionResponse schedule(DistributionPackage distributionPackage) {
+        DistributionResponse distributionResponse;
+        log.info("scheduling distribution of package {}", distributionPackage);
 
 
 
-        // dispatch the replication package to the queue distribution handler
+        // dispatch the distribution package to the queue distribution handler
         try {
-            boolean success = queueDistributionStrategy.add(replicationPackage, queueProvider);
+            boolean success = queueDistributionStrategy.add(distributionPackage, queueProvider);
 
             Dictionary<Object, Object> properties = new Properties();
-            properties.put("replication.package.paths", replicationPackage.getPaths());
-            properties.put("replication.agent.name", name);
-            replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_QUEUED, properties);
+            properties.put("distribution.package.paths", distributionPackage.getPaths());
+            properties.put("distribution.agent.name", name);
+            distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_QUEUED, properties);
 
-            replicationResponse = new ReplicationResponse(success? ReplicationQueueItemState.ItemState.QUEUED.toString() :
-                    ReplicationQueueItemState.ItemState.ERROR.toString(), success);
+            distributionResponse = new DistributionResponse(success? DistributionQueueItemState.ItemState.QUEUED.toString() :
+                    DistributionQueueItemState.ItemState.ERROR.toString(), success);
         } catch (Exception e) {
             log.error("an error happened during queue processing", e);
-            replicationResponse = new ReplicationResponse(e.toString(), false);
+            distributionResponse = new DistributionResponse(e.toString(), false);
         }
 
-        return replicationResponse;
+        return distributionResponse;
     }
 
     public Iterable<String> getQueueNames() {
         return queueDistributionStrategy.getQueueNames();
     }
 
-    public ReplicationQueue getQueue(String queueName) throws ReplicationAgentException {
-        ReplicationQueue queue;
+    public DistributionQueue getQueue(String queueName) throws DistributionAgentException {
+        DistributionQueue queue;
         try {
             if (queueName != null && queueName.length() > 0) {
                 queue = queueProvider.getQueue(queueName);
             } else {
-                queue = queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME);
+                queue = queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME);
             }
-        } catch (ReplicationQueueException e) {
-            throw new ReplicationAgentException(e);
+        } catch (DistributionQueueException e) {
+            throw new DistributionAgentException(e);
         }
         return queue;
     }
@@ -214,10 +214,10 @@ public class SimpleReplicationAgent impl
         // register triggers if any
         agentBasedRequestHandler = new AgentBasedRequestHandler(this);
 
-        for (ReplicationTrigger trigger : triggers) {
+        for (DistributionTrigger trigger : triggers) {
             try {
                 trigger.register(agentBasedRequestHandler);
-            } catch (ReplicationTriggerException e) {
+            } catch (DistributionTriggerException e) {
                 log.error("could not register handler {} from trigger {}", agentBasedRequestHandler, trigger);
             }
         }
@@ -225,7 +225,7 @@ public class SimpleReplicationAgent impl
         if (!isPassive()) {
             try {
                 queueProvider.enableQueueProcessing(new PackageQueueProcessor());
-            } catch (ReplicationQueueException e) {
+            } catch (DistributionQueueException e) {
                 log.error("cannot enable queue processing", e);
             }
         }
@@ -234,10 +234,10 @@ public class SimpleReplicationAgent impl
     public void disable() {
         log.info("disabling agent");
 
-        for (ReplicationTrigger trigger : triggers) {
+        for (DistributionTrigger trigger : triggers) {
             try {
                 trigger.unregister(agentBasedRequestHandler);
-            } catch (ReplicationTriggerException e) {
+            } catch (DistributionTriggerException e) {
                 log.error("could not unregister handler {} from trigger {}", agentBasedRequestHandler, trigger);
             }
         }
@@ -248,13 +248,13 @@ public class SimpleReplicationAgent impl
 
             try {
                 queueProvider.disableQueueProcessing();
-            } catch (ReplicationQueueException e) {
+            } catch (DistributionQueueException e) {
                 log.error("cannot disable queue processing", e);
             }
         }
     }
 
-    private boolean processQueue(String queueName, ReplicationQueueItem queueItem) {
+    private boolean processQueue(String queueName, DistributionQueueItem queueItem) {
         boolean success = false;
         log.debug("reading package with id {}", queueItem.getId());
         ResourceResolver agentResourceResolver = null;
@@ -262,32 +262,32 @@ public class SimpleReplicationAgent impl
 
             agentResourceResolver = getAgentResourceResolver();
 
-            ReplicationPackage replicationPackage = replicationPackageExporter.getPackage(agentResourceResolver, queueItem.getId());
+            DistributionPackage distributionPackage = distributionPackageExporter.getPackage(agentResourceResolver, queueItem.getId());
 
 
-            if (replicationPackage != null) {
-                replicationPackage.getInfo().fillInfo(queueItem.getPackageInfo());
+            if (distributionPackage != null) {
+                distributionPackage.getInfo().fillInfo(queueItem.getPackageInfo());
 
-                replicationPackageImporter.importPackage(agentResourceResolver, replicationPackage);
+                distributionPackageImporter.importPackage(agentResourceResolver, distributionPackage);
 
                 Dictionary<Object, Object> properties = new Properties();
-                properties.put("replication.package.paths", replicationPackage.getPaths());
-                properties.put("replication.agent.name", name);
-                replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_REPLICATED, properties);
+                properties.put("distribution.package.paths", distributionPackage.getPaths());
+                properties.put("distribution.agent.name", name);
+                distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_REPLICATED, properties);
 
-                if (replicationPackage instanceof SharedReplicationPackage) {
-                    ((SharedReplicationPackage) replicationPackage).release(queueName);
+                if (distributionPackage instanceof SharedDistributionPackage) {
+                    ((SharedDistributionPackage) distributionPackage).release(queueName);
                 }
                 else {
-                    replicationPackage.delete();
+                    distributionPackage.delete();
                 }
                 success = true;
             } else {
                 success = true; // return success if package does not exist in order to clear the queue.
-                log.error("replication package with id {} does not exist", queueItem.getId());
+                log.error("distribution package with id {} does not exist", queueItem.getId());
             }
 
-        } catch (ReplicationPackageImportException e) {
+        } catch (DistributionPackageImportException e) {
             log.error("could not process transport queue", e);
         } catch (LoginException e) {
             log.error("cannot obtain resource resolver", e);
@@ -321,26 +321,26 @@ public class SimpleReplicationAgent impl
 
     }
 
-    class PackageQueueProcessor implements ReplicationQueueProcessor {
-        public boolean process(@Nonnull String queueName, @Nonnull ReplicationQueueItem packageInfo) {
+    class PackageQueueProcessor implements DistributionQueueProcessor {
+        public boolean process(@Nonnull String queueName, @Nonnull DistributionQueueItem packageInfo) {
             log.info("running package queue processor for queue {}", queueName);
             return processQueue(queueName, packageInfo);
         }
     }
 
-    public class AgentBasedRequestHandler implements ReplicationRequestHandler {
-        private final ReplicationAgent agent;
+    public class AgentBasedRequestHandler implements DistributionRequestHandler {
+        private final DistributionAgent agent;
 
-        public AgentBasedRequestHandler(ReplicationAgent agent) {
+        public AgentBasedRequestHandler(DistributionAgent agent) {
             this.agent = agent;
         }
 
-        public void handle(@Nonnull ReplicationRequest request) {
+        public void handle(@Nonnull DistributionRequest request) {
             ResourceResolver agentResourceResolver = null;
             try {
                 agentResourceResolver = getAgentResourceResolver();
                 agent.execute(agentResourceResolver, request);
-            } catch (ReplicationAgentException e) {
+            } catch (DistributionAgentException e) {
                 log.error("Error executing handler", e);
             } catch (LoginException e) {
                 log.error("Cannot obtain resource resolver");
@@ -350,21 +350,21 @@ public class SimpleReplicationAgent impl
         }
     }
 
-    private class CompositeReplicationResponse extends ReplicationResponse {
+    private class CompositeDistributionResponse extends DistributionResponse {
 
         private boolean successful;
 
         private String status;
 
-        public CompositeReplicationResponse(List<ReplicationResponse> replicationResponses) {
+        public CompositeDistributionResponse(List<DistributionResponse> distributionResponses) {
             super("", false);
-            if (replicationResponses.isEmpty()) {
+            if (distributionResponses.isEmpty()) {
                 successful = false;
                 status = "empty response";
             } else {
                 successful = true;
                 StringBuilder statusBuilder = new StringBuilder("[");
-                for (ReplicationResponse response : replicationResponses) {
+                for (DistributionResponse response : distributionResponses) {
                     successful &= response.isSuccessful();
                     statusBuilder.append(response.getStatus()).append(", ");
                 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java Fri Nov  7 10:28:02 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -32,19 +32,19 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.event.jobs.JobManager;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.component.ManagedReplicationComponent;
-import org.apache.sling.replication.component.ReplicationComponent;
-import org.apache.sling.replication.component.ReplicationComponentFactory;
-import org.apache.sling.replication.component.ReplicationComponentProvider;
-import org.apache.sling.replication.component.impl.SettingsUtils;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.apache.sling.replication.queue.impl.SingleQueueDistributionStrategy;
-import org.apache.sling.replication.queue.impl.jobhandling.JobHandlingReplicationQueueProvider;
-import org.apache.sling.replication.resources.impl.OsgiUtils;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.component.ManagedDistributionComponent;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
+import org.apache.sling.distribution.component.DistributionComponentProvider;
+import org.apache.sling.distribution.component.impl.SettingsUtils;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.SingleQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
+import org.apache.sling.distribution.resources.impl.OsgiUtils;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.settings.SlingSettingsService;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -53,48 +53,47 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * An OSGi service factory for {@link ReplicationAgent}s which references already existing OSGi services.
+ * An OSGi service factory for {@link org.apache.sling.distribution.agent.DistributionAgent}s which references already existing OSGi services.
  */
 @Component(metatype = true,
-        label = "Sling Replication - Simple Agents Factory",
+        label = "Sling Distribution - Simple Agents Factory",
         description = "OSGi configuration factory for agents",
         configurationFactory = true,
         specVersion = "1.1",
         policy = ConfigurationPolicy.REQUIRE
 )
-public class SimpleReplicationAgentFactory implements ReplicationComponentProvider {
+public class SimpleDistributionAgentFactory implements DistributionComponentProvider {
 
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = ReplicationComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
+    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DistributionComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Property(boolValue = true, label = "Enabled")
-    private static final String ENABLED = ReplicationComponentFactory.COMPONENT_ENABLED;
+    private static final String ENABLED = DistributionComponentFactory.COMPONENT_ENABLED;
 
-    @Property(value = ReplicationComponentFactory.AGENT_SIMPLE, propertyPrivate = true)
-    private static final String TYPE = ReplicationComponentFactory.COMPONENT_TYPE;
+    @Property(value = DistributionComponentFactory.AGENT_SIMPLE, propertyPrivate = true)
+    private static final String TYPE = DistributionComponentFactory.COMPONENT_TYPE;
 
     @Property(label = "Name")
-    public static final String NAME = ReplicationComponentFactory.COMPONENT_NAME;
+    public static final String NAME = DistributionComponentFactory.COMPONENT_NAME;
 
     @Property(boolValue = false, label = "Use this agent as a passive one (only queueing)")
-    public static final String IS_PASSIVE = ReplicationComponentFactory.AGENT_SIMPLE_PROPERTY_IS_PASSIVE;
+    public static final String IS_PASSIVE = DistributionComponentFactory.AGENT_SIMPLE_PROPERTY_IS_PASSIVE;
 
     @Property(label = "Request Authorization Strategy Properties", cardinality = 100)
-    public static final String REQUEST_AUTHORIZATION_STRATEGY = ReplicationComponentFactory.COMPONENT_REQUEST_AUTHORIZATION_STRATEGY;
+    public static final String REQUEST_AUTHORIZATION_STRATEGY = DistributionComponentFactory.COMPONENT_REQUEST_AUTHORIZATION_STRATEGY;
 
     @Property(label = "Package Exporter Properties", cardinality = 100)
-    public static final String PACKAGE_EXPORTER = ReplicationComponentFactory.COMPONENT_PACKAGE_EXPORTER;
+    public static final String PACKAGE_EXPORTER = DistributionComponentFactory.COMPONENT_PACKAGE_EXPORTER;
 
     @Property(label = "Package Importer Properties", cardinality = 100)
-    public static final String PACKAGE_IMPORTER = ReplicationComponentFactory.COMPONENT_PACKAGE_IMPORTER;
+    public static final String PACKAGE_IMPORTER = DistributionComponentFactory.COMPONENT_PACKAGE_IMPORTER;
 
     @Property(label = "Trigger Properties", cardinality = 100)
-    public static final String TRIGGER = ReplicationComponentFactory.COMPONENT_TRIGGER;
-
+    public static final String TRIGGER = DistributionComponentFactory.COMPONENT_TRIGGER;
 
     @Property(label = "Service Name")
-    public static final String SERVICE_NAME = ReplicationComponentFactory.AGENT_SIMPLE_PROPERTY_SERVICE_NAME;
+    public static final String SERVICE_NAME = DistributionComponentFactory.AGENT_SIMPLE_PROPERTY_SERVICE_NAME;
 
     @Property(label = "Target TransportAuthenticationProvider", name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
     @Reference(name = "transportAuthenticationProvider", policy = ReferencePolicy.DYNAMIC,
@@ -102,7 +101,7 @@ public class SimpleReplicationAgentFacto
     private volatile TransportAuthenticationProvider transportAuthenticationProvider;
 
     @Reference
-    private ReplicationEventFactory replicationEventFactory;
+    private DistributionEventFactory distributionEventFactory;
 
     @Reference
     private SlingSettingsService settingsService;
@@ -111,7 +110,7 @@ public class SimpleReplicationAgentFacto
     private JobManager jobManager;
 
     @Reference
-    private ReplicationComponentFactory componentFactory;
+    private DistributionComponentFactory componentFactory;
 
     private ServiceRegistration componentReg;
     private BundleContext savedContext;
@@ -152,9 +151,9 @@ public class SimpleReplicationAgentFacto
                 properties.put(PACKAGE_EXPORTER, SettingsUtils.parseLines(packageExporterProperties));
                 properties.put(TRIGGER, SettingsUtils.parseLines(triggerProperties));
 
-                ReplicationAgent agent = null;
+                DistributionAgent agent = null;
                 try {
-                    agent = componentFactory.createComponent(ReplicationAgent.class, properties, this);
+                    agent = componentFactory.createComponent(DistributionAgent.class, properties, this);
                 }
                 catch (IllegalArgumentException e) {
                     log.warn("cannot create agent", e);
@@ -165,9 +164,9 @@ public class SimpleReplicationAgentFacto
                 if (agent != null) {
 
                     // register agent service
-                    componentReg = context.registerService(ReplicationAgent.class.getName(), agent, props);
-                    if (agent instanceof ManagedReplicationComponent) {
-                        ((ManagedReplicationComponent) agent).enable();
+                    componentReg = context.registerService(DistributionAgent.class.getName(), agent, props);
+                    if (agent instanceof ManagedDistributionComponent) {
+                        ((ManagedDistributionComponent) agent).enable();
                     }
                 }
             }
@@ -180,8 +179,8 @@ public class SimpleReplicationAgentFacto
         if (componentReg != null) {
             ServiceReference reference = componentReg.getReference();
             Object service = context.getService(reference);
-            if (service instanceof ManagedReplicationComponent) {
-                ((ManagedReplicationComponent) service).disable();
+            if (service instanceof ManagedDistributionComponent) {
+                ((ManagedDistributionComponent) service).disable();
             }
 
             componentReg.unregister();
@@ -190,12 +189,12 @@ public class SimpleReplicationAgentFacto
 
     }
 
-    public <ComponentType extends ReplicationComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
+    public <ComponentType extends DistributionComponent> ComponentType getComponent(@Nonnull Class<ComponentType> type,
                                                                                    @Nullable String componentName) {
-        if (type.isAssignableFrom(ReplicationQueueProvider.class)) {
-            return (ComponentType) new JobHandlingReplicationQueueProvider(agentName, jobManager, savedContext);
+        if (type.isAssignableFrom(DistributionQueueProvider.class)) {
+            return (ComponentType) new JobHandlingDistributionQueueProvider(agentName, jobManager, savedContext);
         }
-        else if (type.isAssignableFrom(ReplicationQueueDistributionStrategy.class)) {
+        else if (type.isAssignableFrom(DistributionQueueDistributionStrategy.class)) {
             return (ComponentType) new SingleQueueDistributionStrategy();
         }
         else if (type.isAssignableFrom(TransportAuthenticationProvider.class)) {

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

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java Fri Nov  7 10:28:02 2014
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.communication;
+package org.apache.sling.distribution.communication;
 
 /**
- * The type of a specific replication action, used to decide what to do with specific replication
+ * The type of a specific distribution action, used to decide what to do with specific distribution
  * items / requests.
  */
-public enum ReplicationActionType {
+public enum DistributionActionType {
 
     /**
      * Content is added
@@ -49,7 +49,7 @@ public enum ReplicationActionType {
      *
      * @param name name
      */
-    private ReplicationActionType(String name) {
+    private DistributionActionType(String name) {
         this.name = name;
     }
 
@@ -69,12 +69,12 @@ public enum ReplicationActionType {
      * @param n the name
      * @return the type or <code>null</code>
      */
-    public static ReplicationActionType fromName(String n) {
+    public static DistributionActionType fromName(String n) {
         if (n == null) {
             return null;
         }
         try {
-            return ReplicationActionType.valueOf(n.toUpperCase());
+            return DistributionActionType.valueOf(n.toUpperCase());
         } catch (IllegalArgumentException e) {
             return null;
         }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationParameter.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationParameter.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationParameter.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java Fri Nov  7 10:28:02 2014
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.communication;
+package org.apache.sling.distribution.communication;
 
 /**
- * HTTP Parameters for replication
+ * HTTP Parameters for distribution
  */
-public enum ReplicationParameter {
+public enum DistributionParameter {
 
     QUEUE("queue"),
     TYPE("type"),
@@ -30,7 +30,7 @@ public enum ReplicationParameter {
 
     private final String name;
 
-    ReplicationParameter(String name) {
+    DistributionParameter(String name) {
         this.name = name;
     }
 



Mime
View raw message