sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [5/12] - in /sling/trunk/contrib/extensions: distribution/ distribution/core/ distribution/core/src/main/java/org/apache/sling/distribution/ distribution/core/src/main/java/org/apache/sling/distribution/agent/ distribution/core/src...
Date Fri, 07 Nov 2014 10:28:08 GMT
Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.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.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import javax.annotation.Nonnull;
 import java.io.InputStream;
@@ -31,41 +31,41 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.replication.component.ReplicationComponentFactory;
-import org.apache.sling.replication.component.impl.SettingsUtils;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageImportException;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
+import org.apache.sling.distribution.component.impl.SettingsUtils;
+import org.apache.sling.distribution.packaging.DistributionPackageImportException;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link org.apache.sling.replication.packaging.ReplicationPackageImporter} implementation which imports a FileVault
- * based {@link ReplicationPackage} locally.
+ * {@link org.apache.sling.distribution.packaging.DistributionPackageImporter} implementation which imports a FileVault
+ * based {@link org.apache.sling.distribution.packaging.DistributionPackage} locally.
  */
-@Component(label = "Sling Replication - Local Package Importer Factory",
+@Component(label = "Sling Distribution - Local Package Importer Factory",
         metatype = true,
         configurationFactory = true,
         specVersion = "1.1",
         policy = ConfigurationPolicy.REQUIRE)
-@Service(value = ReplicationPackageImporter.class)
-public class LocalReplicationPackageImporterFactory implements ReplicationPackageImporter {
+@Service(value = DistributionPackageImporter.class)
+public class LocalDistributionPackageImporterFactory implements DistributionPackageImporter {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(value = ReplicationComponentFactory.PACKAGE_IMPORTER_LOCAL, propertyPrivate = true)
-    private static final String TYPE = ReplicationComponentFactory.COMPONENT_TYPE;
+    @Property(value = DistributionComponentFactory.PACKAGE_IMPORTER_LOCAL, propertyPrivate = true)
+    private static final String TYPE = DistributionComponentFactory.COMPONENT_TYPE;
 
     @Property
-    private static final String NAME = ReplicationComponentFactory.COMPONENT_NAME;
+    private static final String NAME = DistributionComponentFactory.COMPONENT_NAME;
 
 
     @Property(label = "Package Builder Properties", cardinality = 100)
-    public static final String PACKAGE_BUILDER = ReplicationComponentFactory.COMPONENT_PACKAGE_BUILDER;
+    public static final String PACKAGE_BUILDER = DistributionComponentFactory.COMPONENT_PACKAGE_BUILDER;
 
     @Reference
-    private ReplicationComponentFactory componentFactory;
+    private DistributionComponentFactory componentFactory;
 
-    ReplicationPackageImporter importer;
+    DistributionPackageImporter importer;
 
     @Activate
     public void activate(Map<String, Object> config) {
@@ -74,15 +74,15 @@ public class LocalReplicationPackageImpo
         String[] packageBuilderProperties = PropertiesUtil.toStringArray(config.get(PACKAGE_BUILDER));
         properties.put(PACKAGE_BUILDER, SettingsUtils.parseLines(packageBuilderProperties));
 
-        importer = componentFactory.createComponent(ReplicationPackageImporter.class, properties, null);
+        importer = componentFactory.createComponent(DistributionPackageImporter.class, properties, null);
     }
 
 
-    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageImportException {
-        return importer.importPackage(resourceResolver, replicationPackage);
+    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageImportException {
+        return importer.importPackage(resourceResolver, distributionPackage);
     }
 
-    public ReplicationPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageImportException {
+    public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException {
         return importer.importStream(resourceResolver, stream);
     }
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporter.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporter.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporter.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.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.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import javax.annotation.Nonnull;
 import java.io.InputStream;
@@ -24,31 +24,31 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.transport.impl.ReplicationEndpoint;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageImportException;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.ReplicationTransportHandler;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.transport.impl.MultipleEndpointReplicationTransportHandler;
-import org.apache.sling.replication.transport.impl.SimpleHttpReplicationTransportHandler;
-import org.apache.sling.replication.transport.impl.TransportEndpointStrategyType;
+import org.apache.sling.distribution.packaging.DistributionPackageImportException;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.transport.impl.DistributionEndpoint;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.transport.DistributionTransportHandler;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.impl.MultipleEndpointDistributionTransportHandler;
+import org.apache.sling.distribution.transport.impl.SimpleHttpDistributionTransportHandler;
+import org.apache.sling.distribution.transport.impl.TransportEndpointStrategyType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Remote implementation of {@link org.apache.sling.replication.packaging.ReplicationPackageImporter}
+ * Remote implementation of {@link org.apache.sling.distribution.packaging.DistributionPackageImporter}
  */
-public class RemoteReplicationPackageImporter implements ReplicationPackageImporter {
+public class RemoteDistributionPackageImporter implements DistributionPackageImporter {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private ReplicationTransportHandler transportHandler;
+    private DistributionTransportHandler transportHandler;
 
 
-    public RemoteReplicationPackageImporter(TransportAuthenticationProvider transportAuthenticationProvider,
-                                            String[] endpoints,
-                                            String  transportEndpointStrategyName) {
+    public RemoteDistributionPackageImporter(TransportAuthenticationProvider transportAuthenticationProvider,
+                                             String[] endpoints,
+                                             String transportEndpointStrategyName) {
 
         if (transportAuthenticationProvider == null) {
             throw new IllegalArgumentException("transportAuthenticationProviderFactory is required");
@@ -57,32 +57,32 @@ public class RemoteReplicationPackageImp
         TransportEndpointStrategyType transportEndpointStrategyType = TransportEndpointStrategyType.valueOf(transportEndpointStrategyName);
 
 
-        List<ReplicationTransportHandler> transportHandlers = new ArrayList<ReplicationTransportHandler>();
+        List<DistributionTransportHandler> transportHandlers = new ArrayList<DistributionTransportHandler>();
 
         for (String endpoint : endpoints) {
             if (endpoint != null && endpoint.length() > 0) {
-                transportHandlers.add(new SimpleHttpReplicationTransportHandler(transportAuthenticationProvider,
-                        new ReplicationEndpoint(endpoint), null, -1));
+                transportHandlers.add(new SimpleHttpDistributionTransportHandler(transportAuthenticationProvider,
+                        new DistributionEndpoint(endpoint), null, -1));
             }
         }
-        transportHandler = new MultipleEndpointReplicationTransportHandler(transportHandlers,
+        transportHandler = new MultipleEndpointDistributionTransportHandler(transportHandlers,
                 transportEndpointStrategyType);
 
     }
 
-    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) {
+    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) {
         boolean result = false;
         try {
-            transportHandler.deliverPackage(resourceResolver, replicationPackage);
+            transportHandler.deliverPackage(resourceResolver, distributionPackage);
             result = true;
         } catch (Exception e) {
-            log.error("failed in importing package {} ", replicationPackage, e);
+            log.error("failed in importing package {} ", distributionPackage, e);
         }
         return result;
     }
 
-    public ReplicationPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageImportException {
-        throw new ReplicationPackageImportException("not supported");
+    public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException {
+        throw new DistributionPackageImportException("not supported");
     }
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.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.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -33,46 +33,44 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.commons.osgi.PropertiesUtil;
-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.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageImportException;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.component.DistributionComponentFactory;
+import org.apache.sling.distribution.component.DistributionComponentProvider;
+import org.apache.sling.distribution.packaging.DistributionPackageImportException;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Remote implementation of {@link org.apache.sling.replication.packaging.ReplicationPackageImporter}
+ * Remote implementation of {@link org.apache.sling.distribution.packaging.DistributionPackageImporter}
  */
-@Component(label = "Sling Replication - Remote Package Importer Factory",
+@Component(label = "Sling Distribution - Remote Package Importer Factory",
         metatype = true,
         configurationFactory = true,
         specVersion = "1.1",
         policy = ConfigurationPolicy.REQUIRE)
-@Service(value = ReplicationPackageImporter.class)
-public class RemoteReplicationPackageImporterFactory implements ReplicationPackageImporter, ReplicationComponentProvider {
-    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = ReplicationComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
+@Service(value = DistributionPackageImporter.class)
+public class RemoteDistributionPackageImporterFactory implements DistributionPackageImporter, DistributionComponentProvider {
+    private static final String TRANSPORT_AUTHENTICATION_PROVIDER_TARGET = DistributionComponentFactory.COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER + ".target";
 
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property(value = ReplicationComponentFactory.PACKAGE_IMPORTER_REMOTE, propertyPrivate = true)
-    private static final String TYPE = ReplicationComponentFactory.COMPONENT_TYPE;
+    @Property(value = DistributionComponentFactory.PACKAGE_IMPORTER_REMOTE, propertyPrivate = true)
+    private static final String TYPE = DistributionComponentFactory.COMPONENT_TYPE;
 
     @Property
-    private static final String NAME = ReplicationComponentFactory.COMPONENT_NAME;
+    private static final String NAME = DistributionComponentFactory.COMPONENT_NAME;
 
     @Property(name = TRANSPORT_AUTHENTICATION_PROVIDER_TARGET)
     @Reference(name = "TransportAuthenticationProvider", policy = ReferencePolicy.STATIC)
     private volatile TransportAuthenticationProvider transportAuthenticationProvider;
 
     @Property(cardinality = 100)
-    public static final String ENDPOINTS = ReplicationComponentFactory.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS;
+    public static final String ENDPOINTS = DistributionComponentFactory.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS;
 
     @Property(options = {
             @PropertyOption(name = "All",
@@ -83,12 +81,12 @@ public class RemoteReplicationPackageImp
             )},
             value = "One"
     )
-    private static final String ENDPOINT_STRATEGY = ReplicationComponentFactory.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY;
+    private static final String ENDPOINT_STRATEGY = DistributionComponentFactory.PACKAGE_IMPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY;
 
-    private ReplicationPackageImporter importer;
+    private DistributionPackageImporter importer;
 
     @Reference
-    ReplicationComponentFactory replicationComponentFactory;
+    DistributionComponentFactory distributionComponentFactory;
 
     @Activate
     protected void activate(BundleContext context, Map<String, Object> config) throws Exception {
@@ -96,19 +94,19 @@ public class RemoteReplicationPackageImp
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.putAll(config);
 
-        importer = replicationComponentFactory.createComponent(ReplicationPackageImporter.class, properties, this);
+        importer = distributionComponentFactory.createComponent(DistributionPackageImporter.class, properties, this);
 
     }
 
-    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageImportException {
-        return importer.importPackage(resourceResolver, replicationPackage);
+    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageImportException {
+        return importer.importPackage(resourceResolver, distributionPackage);
     }
 
-    public ReplicationPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageImportException {
+    public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException {
         return importer.importStream(resourceResolver, stream);
     }
 
-    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(TransportAuthenticationProvider.class)) {
             return (ComponentType) transportAuthenticationProvider;

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RepositoryReplicationPackageImporter.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RepositoryReplicationPackageImporter.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RepositoryReplicationPackageImporter.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.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.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import javax.annotation.Nonnull;
 import javax.jcr.Node;
@@ -31,22 +31,22 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.util.Text;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.replication.transport.impl.ReplicationEndpoint;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.event.ReplicationEventType;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageImportException;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.event.DistributionEventType;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.packaging.DistributionPackageImportException;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.transport.impl.DistributionEndpoint;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link ReplicationPackageImporter} importing
- * {@link ReplicationPackage} stream + type into an underlying JCR repository.
+ * {@link org.apache.sling.distribution.packaging.DistributionPackageImporter} importing
+ * {@link org.apache.sling.distribution.packaging.DistributionPackage} stream + type into an underlying JCR repository.
  */
-public class RepositoryReplicationPackageImporter implements ReplicationPackageImporter {
+public class RepositoryDistributionPackageImporter implements DistributionPackageImporter {
 
     static final String NAME = "repository";
 
@@ -56,22 +56,22 @@ public class RepositoryReplicationPackag
 
     private SlingRepository repository;
 
-    private ReplicationEventFactory replicationEventFactory;
+    private DistributionEventFactory distributionEventFactory;
 
     private TransportAuthenticationProvider<SlingRepository, Session> transportAuthenticationProvider;
 
-    public void deliverPackageToEndpoint(ReplicationPackage replicationPackage, ReplicationEndpoint replicationEndpoint)
+    public void deliverPackageToEndpoint(DistributionPackage distributionPackage, DistributionEndpoint distributionEndpoint)
             throws Exception {
 
         Session session = null;
         try {
             TransportAuthenticationContext transportAuthenticationContext = new TransportAuthenticationContext();
-            String path = replicationEndpoint.getUri().toString().replace("repo:/", "");
+            String path = distributionEndpoint.getUri().toString().replace("repo:/", "");
             transportAuthenticationContext.addAttribute("path", path);
             session = transportAuthenticationProvider.authenticate(repository, transportAuthenticationContext);
-            int lastSlash = replicationPackage.getId().lastIndexOf('/');
-            String nodeName = Text.escape(lastSlash < 0 ? replicationPackage.getId() : replicationPackage.getId().substring(lastSlash + 1));
-            log.info("creating node {} in {}", replicationPackage.getId(), nodeName);
+            int lastSlash = distributionPackage.getId().lastIndexOf('/');
+            String nodeName = Text.escape(lastSlash < 0 ? distributionPackage.getId() : distributionPackage.getId().substring(lastSlash + 1));
+            log.info("creating node {} in {}", distributionPackage.getId(), nodeName);
 
             if (session != null) {
                 Node addedNode = session.getNode(path).addNode(nodeName,
@@ -80,20 +80,20 @@ public class RepositoryReplicationPackag
                 if (contentNode != null) {
                     InputStream inputStream = null;
                     try {
-                        inputStream = replicationPackage.createInputStream();
+                        inputStream = distributionPackage.createInputStream();
                         contentNode.setProperty(JcrConstants.JCR_DATA, session.getValueFactory().createBinary(inputStream));
-                        contentNode.setProperty("package.type", replicationPackage.getType());
+                        contentNode.setProperty("package.type", distributionPackage.getType());
                         session.save();
                     } finally {
                         IOUtils.closeQuietly(inputStream);
                     }
                 }
                 log.info("package {} imported into the repository as node {} ",
-                        replicationPackage.getId(), addedNode.getPath());
+                        distributionPackage.getId(), addedNode.getPath());
 
                 Dictionary<Object, Object> props = new Properties();
-                props.put("path", replicationPackage.getPaths());
-                replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_IMPORTED, props);
+                props.put("path", distributionPackage.getPaths());
+                distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_IMPORTED, props);
             } else {
                 throw new Exception("could not get a Session to deliver package to the repository");
             }
@@ -104,11 +104,11 @@ public class RepositoryReplicationPackag
         }
     }
 
-    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull ReplicationPackage replicationPackage) throws ReplicationPackageImportException {
+    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageImportException {
         return false;
     }
 
-    public ReplicationPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws ReplicationPackageImportException {
-        throw new ReplicationPackageImportException("not supported");
+    public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException {
+        throw new DistributionPackageImportException("not supported");
     }
 }

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

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueue.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java Fri Nov  7 10:28:02 2014
@@ -16,20 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 import aQute.bnd.annotation.ConsumerType;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
-import java.util.Collection;
 
 /**
- * a queue for handling {@link org.apache.sling.replication.agent.ReplicationAgent}s' requests
+ * a queue for handling {@link org.apache.sling.distribution.agent.DistributionAgent}s' requests
  */
 @ConsumerType
-public interface ReplicationQueue {
+public interface DistributionQueue {
 
     /**
      * get this queue name
@@ -40,24 +39,24 @@ public interface ReplicationQueue {
     String getName();
 
     /**
-     * add a replication item to this queue
+     * add a distribution item to this 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,
+     * @param item a distribution item representing the package to replicate
+     * @return <code>true</code> if the distribution item was added correctly to the queue,
      * <code>false</code otherwise
      */
-    boolean add(@Nonnull ReplicationQueueItem item);
+    boolean add(@Nonnull DistributionQueueItem item);
 
     /**
      * get the status of a certain item in the queue
      *
-     * @param item the replication item to get the status for
+     * @param item the distribution item to get the status for
      * @return the item status in the queue
-     * @throws ReplicationQueueException if any error occurs while getting the status
+     * @throws DistributionQueueException if any error occurs while getting the status
      */
     @Nonnull
-    ReplicationQueueItemState getStatus(@Nonnull ReplicationQueueItem item)
-            throws ReplicationQueueException;
+    DistributionQueueItemState getStatus(@Nonnull DistributionQueueItem item)
+            throws DistributionQueueException;
 
     /**
      * get the first item (FIFO wise, the next to be processed) into the queue
@@ -65,7 +64,7 @@ public interface ReplicationQueue {
      * @return the first item into the queue or <code>null</code> if the queue is empty
      */
     @CheckForNull
-    ReplicationQueueItem getHead();
+    DistributionQueueItem getHead();
 
     /**
      * check if the queue is empty
@@ -79,10 +78,10 @@ public interface ReplicationQueue {
      *
      * @param queueItemSelector represents the criteria to filter queue items.
      *                          if null is passed then all items are returned.
-     * @return a <code>Iterable</code> of {@link org.apache.sling.replication.queue.ReplicationQueueItem}s
+     * @return a <code>Iterable</code> of {@link DistributionQueueItem}s
      */
     @Nonnull
-    Iterable<ReplicationQueueItem> getItems(@Nullable ReplicationQueueItemSelector queueItemSelector);
+    Iterable<DistributionQueueItem> getItems(@Nullable DistributionQueueItemSelector queueItemSelector);
 
     /**
      * remove an item from the queue by specifying its id

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueDistributionStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java Fri Nov  7 10:28:02 2014
@@ -16,35 +16,34 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.component.ReplicationComponent;
-import org.apache.sling.replication.packaging.ReplicationPackage;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.packaging.DistributionPackage;
 
 import java.util.List;
 
 /**
- * a {@link ReplicationQueueDistributionStrategy} implements an algorithm for the distribution of
- * {@link org.apache.sling.replication.packaging.ReplicationPackage}s among the available queues
+ * a {@link DistributionQueueDistributionStrategy} implements an algorithm for the distribution of
+ * {@link org.apache.sling.distribution.packaging.DistributionPackage}s among the available queues
  */
 @ConsumerType
-public interface ReplicationQueueDistributionStrategy extends ReplicationComponent {
+public interface DistributionQueueDistributionStrategy extends DistributionComponent {
     String DEFAULT_QUEUE_NAME = "default";
 
     /**
-     * synchronously distribute a {@link org.apache.sling.replication.packaging.ReplicationPackage}
-     * to one or more {@link ReplicationQueue}s provided by the given {@link ReplicationQueueProvider}
+     * synchronously distribute a {@link org.apache.sling.distribution.packaging.DistributionPackage}
+     * to one or more {@link DistributionQueue}s provided by the given {@link DistributionQueueProvider}
      *
-     * @param replicationPackage          a {@link org.apache.sling.replication.packaging.ReplicationPackage} to distribute
-     * @param queueProvider the {@link ReplicationQueueProvider} used to provide the queues to be used for the given package
+     * @param distributionPackage          a {@link org.apache.sling.distribution.packaging.DistributionPackage} to distribute
+     * @param queueProvider the {@link DistributionQueueProvider} used to provide the queues to be used for the given package
      * @return <code>true</code> if addition was successful, <code>false</code> otherwise
-     * @throws ReplicationQueueException if any internal error happens during distribution
+     * @throws DistributionQueueException if any internal error happens during distribution
      */
-    boolean add(@Nonnull ReplicationPackage replicationPackage, @Nonnull ReplicationQueueProvider queueProvider) throws ReplicationQueueException;
+    boolean add(@Nonnull DistributionPackage distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws DistributionQueueException;
 
 
     /**

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueException.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueException.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueException.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.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.queue;
+package org.apache.sling.distribution.queue;
 
 /**
  * Represents errors happening during queue operations
  */
 @SuppressWarnings("serial")
-public class ReplicationQueueException extends Exception {
+public class DistributionQueueException extends Exception {
 
-    public ReplicationQueueException(String message, Exception e) {
+    public DistributionQueueException(String message, Exception e) {
         super(message, e);
     }
 
-    public ReplicationQueueException(String string) {
+    public DistributionQueueException(String string) {
         super(string);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java Fri Nov  7 10:28:02 2014
@@ -16,19 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
-import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.replication.packaging.ReplicationPackageInfo;
+import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 
 /**
- * An item in a {@link org.apache.sling.replication.queue.ReplicationQueue}
+ * An item in a {@link DistributionQueue}
  * <p/>
- * 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
+ * This is basically a proxy to {@link org.apache.sling.distribution.packaging.DistributionPackage} designed to avoid having
+ * to keep the package {@link org.apache.sling.distribution.packaging.DistributionPackage#createInputStream() stream} into
  * the queues.
  */
-public class ReplicationQueueItem {
+public class DistributionQueueItem {
 
     private final String id;
 
@@ -38,9 +37,9 @@ public class ReplicationQueueItem {
 
     private final String type;
 
-    private final ReplicationPackageInfo packageInfo;
+    private final DistributionPackageInfo packageInfo;
 
-    public ReplicationQueueItem(String id, String[] paths, String action, String type, ReplicationPackageInfo packageInfo) {
+    public DistributionQueueItem(String id, String[] paths, String action, String type, DistributionPackageInfo packageInfo) {
         this.id = id;
         this.paths = paths;
         this.action = action;
@@ -64,7 +63,7 @@ public class ReplicationQueueItem {
         return type;
     }
 
-    public ReplicationPackageInfo getPackageInfo() {
+    public DistributionPackageInfo getPackageInfo() {
         return packageInfo;
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemSelector.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemSelector.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemSelector.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java Fri Nov  7 10:28:02 2014
@@ -17,12 +17,12 @@
  * under the License.
  */
 
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 /**
  * Class representing criteria for queue items selection.
  */
-public class ReplicationQueueItemSelector {
+public class DistributionQueueItemSelector {
     private final int skip;
     private final int limit;
 
@@ -31,7 +31,7 @@ public class ReplicationQueueItemSelecto
      * @param skip the number of items to skip
      * @param limit the maximum number of items to return. use -1 to return all items.
      */
-    public ReplicationQueueItemSelector(int skip, int limit) {
+    public DistributionQueueItemSelector(int skip, int limit) {
         this.skip = skip;
         this.limit = limit;
     }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemState.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemState.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItemState.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java Fri Nov  7 10:28:02 2014
@@ -16,15 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 import java.util.Calendar;
 
 /**
- * the current status of a certain item in a {@link ReplicationQueue}
+ * the current status of a certain item in a {@link DistributionQueue}
  */
 
-public class ReplicationQueueItemState {
+public class DistributionQueueItemState {
 
     private final int attempts;
 
@@ -32,14 +32,14 @@ public class ReplicationQueueItemState {
 
     private final Calendar entered;
 
-    public ReplicationQueueItemState(Calendar entered, ItemState state, int attempts) {
+    public DistributionQueueItemState(Calendar entered, ItemState state, int attempts) {
 
         this.entered = entered;
         this.state = state;
         this.attempts = attempts;
     }
 
-    public ReplicationQueueItemState(ItemState state) {
+    public DistributionQueueItemState(ItemState state) {
         this(Calendar.getInstance(), state, 0);
     }
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProcessor.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProcessor.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProcessor.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java Fri Nov  7 10:28:02 2014
@@ -16,24 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 import aQute.bnd.annotation.ConsumerType;
 
 import javax.annotation.Nonnull;
 
 /**
- * Processor of {@link org.apache.sling.replication.queue.ReplicationQueueItem}s
+ * Processor of {@link DistributionQueueItem}s
  */
 @ConsumerType
-public interface ReplicationQueueProcessor {
+public interface DistributionQueueProcessor {
 
     /**
-     * Process an item from a certain <code>ReplicationQueue</code>
+     * Process an item from a certain <code>distributionQueue</code>
      *
-     * @param queueName            the name of the <code>ReplicationQueue</code> to be processed
-     * @param replicationQueueItem the <code>ReplicationQueueItem</code> to be processed
+     * @param queueName            the name of the <code>distributionQueue</code> to be processed
+     * @param distributionQueueItem the <code>distributionQueueItem</code> to be processed
      * @return <code>true</code> if the item was successfully processed, <code>false</code> otherwise
      */
-    public boolean process(@Nonnull String queueName, @Nonnull ReplicationQueueItem replicationQueueItem);
+    public boolean process(@Nonnull String queueName, @Nonnull DistributionQueueItem distributionQueueItem);
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java Fri Nov  7 10:28:02 2014
@@ -16,40 +16,40 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue;
+package org.apache.sling.distribution.queue;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.replication.component.ReplicationComponent;
+import org.apache.sling.distribution.component.DistributionComponent;
 
 /**
- * A provider for {@link ReplicationQueue}s
+ * A provider for {@link DistributionQueue}s
  */
 @ConsumerType
-public interface ReplicationQueueProvider extends ReplicationComponent {
+public interface DistributionQueueProvider extends DistributionComponent {
 
     /**
      * provide a named queue for the given agent
      *
      * @param queueName the name of the queue to retrieve
-     * @return a {@link org.apache.sling.replication.queue.ReplicationQueue}
-     * @throws ReplicationQueueException if any error happens
+     * @return a {@link DistributionQueue}
+     * @throws DistributionQueueException if any error happens
      */
     @Nonnull
-    ReplicationQueue getQueue(@Nonnull String queueName) throws ReplicationQueueException;
+    DistributionQueue getQueue(@Nonnull String queueName) throws DistributionQueueException;
 
     /**
      * enables queue driven processing for an agent
      *
      * @param queueProcessor the queue processor to be used
      */
-    void enableQueueProcessing(@Nonnull ReplicationQueueProcessor queueProcessor) throws ReplicationQueueException;
+    void enableQueueProcessing(@Nonnull DistributionQueueProcessor queueProcessor) throws DistributionQueueException;
 
 
     /**
      * disables queue driven processing for an agent
      *
      */
-    void disableQueueProcessing() throws ReplicationQueueException;
+    void disableQueueProcessing() throws DistributionQueueException;
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategy.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategy.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.queue.impl;
+package org.apache.sling.distribution.queue.impl;
 
 import javax.annotation.Nonnull;
 import java.util.Arrays;
@@ -24,19 +24,16 @@ import java.util.Calendar;
 import java.util.List;
 
 import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.PropertyOption;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-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.ReplicationQueueItemState.ItemState;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueException;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,7 +43,7 @@ import org.slf4j.LoggerFactory;
  * delivering packages with an error queue which can be used when an item is stuck in the default
  * queue for too much time, then the stuck item is moved to the error queue or dropped.
  */
-public class ErrorAwareQueueDistributionStrategy implements ReplicationQueueDistributionStrategy {
+public class ErrorAwareQueueDistributionStrategy implements DistributionQueueDistributionStrategy {
 
     protected static final String ERROR_QUEUE_NAME = "error";
 
@@ -82,10 +79,10 @@ public class ErrorAwareQueueDistribution
         timeThreshold = PropertiesUtil.toInteger(ctx.getProperties().get(TIME_THRESHOLD), 600000);
     }
 
-    public boolean add(@Nonnull ReplicationPackage replicationPackage, @Nonnull ReplicationQueueProvider queueProvider) throws ReplicationQueueException {
+    public boolean add(@Nonnull DistributionPackage distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws DistributionQueueException {
         boolean added;
-        ReplicationQueueItem queueItem = getItem(replicationPackage);
-        ReplicationQueue queue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
+        DistributionQueueItem queueItem = getItem(distributionPackage);
+        DistributionQueue queue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
         added = queue.add(queueItem);
         checkAndRemoveStuckItems(queueProvider);
         return added;
@@ -96,12 +93,12 @@ public class ErrorAwareQueueDistribution
         return Arrays.asList(new String[] { ERROR_QUEUE_NAME, DEFAULT_QUEUE_NAME });
     }
 
-    private void checkAndRemoveStuckItems(ReplicationQueueProvider queueProvider) throws ReplicationQueueException {
-        ReplicationQueue defaultQueue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
+    private void checkAndRemoveStuckItems(DistributionQueueProvider queueProvider) throws DistributionQueueException {
+        DistributionQueue defaultQueue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
         // get first item in the queue with its status
-        ReplicationQueueItem firstItem = defaultQueue.getHead();
+        DistributionQueueItem firstItem = defaultQueue.getHead();
         if (firstItem != null) {
-            ReplicationQueueItemState status = defaultQueue.getStatus(firstItem);
+            DistributionQueueItemState status = defaultQueue.getStatus(firstItem);
             // if item is still in the queue after a max no. of attempts, move it to the error queue
             int attempts = status.getAttempts();
             Calendar entered = status.getEntered();
@@ -110,10 +107,10 @@ public class ErrorAwareQueueDistribution
                 if (ERROR.equals(stuckQueueHandling)) {
                     log.warn("item {} moved to the error queue", firstItem);
 
-                    ReplicationQueue errorQueue = queueProvider.getQueue(ERROR_QUEUE_NAME);
+                    DistributionQueue errorQueue = queueProvider.getQueue(ERROR_QUEUE_NAME);
                     if (!errorQueue.add(firstItem)) {
                         log.error("failed to move item {} the queue {}", firstItem, errorQueue);
-                        throw new ReplicationQueueException("could not move an item to the error queue");
+                        throw new DistributionQueueException("could not move an item to the error queue");
                     }
                 }
                 log.warn("item {} dropped from the default queue", firstItem);
@@ -122,14 +119,14 @@ public class ErrorAwareQueueDistribution
         }
     }
 
-    private ReplicationQueueItem getItem(ReplicationPackage replicationPackage) {
-        ReplicationQueueItem replicationQueueItem = new ReplicationQueueItem(replicationPackage.getId(),
-                replicationPackage.getPaths(),
-                replicationPackage.getAction(),
-                replicationPackage.getType(),
-                replicationPackage.getInfo());
+    private DistributionQueueItem getItem(DistributionPackage distributionPackage) {
+        DistributionQueueItem distributionQueueItem = new DistributionQueueItem(distributionPackage.getId(),
+                distributionPackage.getPaths(),
+                distributionPackage.getAction(),
+                distributionPackage.getType(),
+                distributionPackage.getInfo());
 
-        return replicationQueueItem;
+        return distributionQueueItem;
     }
 
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/PriorityPathDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/PriorityPathDistributionStrategy.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/PriorityPathDistributionStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/PriorityPathDistributionStrategy.java Fri Nov  7 10:28:02 2014
@@ -16,26 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl;
+package org.apache.sling.distribution.queue.impl;
 
 import javax.annotation.Nonnull;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-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.ReplicationQueueItemState.ItemState;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.osgi.service.component.ComponentContext;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueException;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,7 +35,7 @@ import org.slf4j.LoggerFactory;
  * Distribution algorithm which keeps one specific queue to handle specific paths and another queue
  * for handling all the other paths
  */
-public class PriorityPathDistributionStrategy implements ReplicationQueueDistributionStrategy {
+public class PriorityPathDistributionStrategy implements DistributionQueueDistributionStrategy {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -57,9 +49,9 @@ public class PriorityPathDistributionStr
 
 
 
-    private ReplicationQueue getQueue(ReplicationQueueItem replicationPackage, ReplicationQueueProvider queueProvider)
-            throws ReplicationQueueException {
-        String[] paths = replicationPackage.getPaths();
+    private DistributionQueue getQueue(DistributionQueueItem distributionPackage, DistributionQueueProvider queueProvider)
+            throws DistributionQueueException {
+        String[] paths = distributionPackage.getPaths();
 
         log.info("calculating priority for paths {}", Arrays.toString(paths));
 
@@ -75,7 +67,7 @@ public class PriorityPathDistributionStr
             }
         }
 
-        ReplicationQueue queue;
+        DistributionQueue queue;
         if (usePriorityQueue) {
             log.info("using priority queue for path {}", pp);
             queue = queueProvider.getQueue(pp);
@@ -86,14 +78,14 @@ public class PriorityPathDistributionStr
         return queue;
     }
 
-    public boolean add(@Nonnull ReplicationPackage replicationPackage, @Nonnull ReplicationQueueProvider queueProvider) throws ReplicationQueueException {
+    public boolean add(@Nonnull DistributionPackage distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws DistributionQueueException {
 
-        ReplicationQueueItem queueItem = getItem(replicationPackage);
-        ReplicationQueue queue = getQueue(queueItem, queueProvider);
+        DistributionQueueItem queueItem = getItem(distributionPackage);
+        DistributionQueue queue = getQueue(queueItem, queueProvider);
         if (queue != null) {
             return queue.add(queueItem);
         } else {
-            throw new ReplicationQueueException("could not get a queue");
+            throw new DistributionQueueException("could not get a queue");
         }
     }
 
@@ -107,14 +99,14 @@ public class PriorityPathDistributionStr
         return paths;
     }
 
-    private ReplicationQueueItem getItem(ReplicationPackage replicationPackage) {
-        ReplicationQueueItem replicationQueueItem = new ReplicationQueueItem(replicationPackage.getId(),
-                replicationPackage.getPaths(),
-                replicationPackage.getAction(),
-                replicationPackage.getType(),
-                replicationPackage.getInfo());
+    private DistributionQueueItem getItem(DistributionPackage distributionPackage) {
+        DistributionQueueItem distributionQueueItem = new DistributionQueueItem(distributionPackage.getId(),
+                distributionPackage.getPaths(),
+                distributionPackage.getAction(),
+                distributionPackage.getType(),
+                distributionPackage.getInfo());
 
-        return replicationQueueItem;
+        return distributionQueueItem;
     }
 
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategy.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategy.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategy.java Fri Nov  7 10:28:02 2014
@@ -16,25 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl;
+package org.apache.sling.distribution.queue.impl;
 
 import javax.annotation.Nonnull;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-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.ReplicationQueueItemState.ItemState;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueException;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -42,13 +36,13 @@ import java.util.List;
  * The default strategy for delivering packages to queues. Each agent just manages a single queue,
  * no failure / stuck handling where each package is put regardless of anything.
  */
-public class SingleQueueDistributionStrategy implements ReplicationQueueDistributionStrategy {
+public class SingleQueueDistributionStrategy implements DistributionQueueDistributionStrategy {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    public boolean add(@Nonnull ReplicationPackage replicationPackage, @Nonnull ReplicationQueueProvider queueProvider) throws ReplicationQueueException {
-        ReplicationQueueItem queueItem = getItem(replicationPackage);
-        ReplicationQueue queue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
+    public boolean add(@Nonnull DistributionPackage distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws DistributionQueueException {
+        DistributionQueueItem queueItem = getItem(distributionPackage);
+        DistributionQueue queue = queueProvider.getQueue(DEFAULT_QUEUE_NAME);
         return queue.add(queueItem);
     }
 
@@ -58,14 +52,14 @@ public class SingleQueueDistributionStra
     }
 
 
-    private ReplicationQueueItem getItem(ReplicationPackage replicationPackage) {
-        ReplicationQueueItem replicationQueueItem = new ReplicationQueueItem(replicationPackage.getId(),
-                replicationPackage.getPaths(),
-                replicationPackage.getAction(),
-                replicationPackage.getType(),
-                replicationPackage.getInfo());
+    private DistributionQueueItem getItem(DistributionPackage distributionPackage) {
+        DistributionQueueItem distributionQueueItem = new DistributionQueueItem(distributionPackage.getId(),
+                distributionPackage.getPaths(),
+                distributionPackage.getAction(),
+                distributionPackage.getType(),
+                distributionPackage.getInfo());
 
-        return replicationQueueItem;
+        return distributionQueueItem;
     }
 
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/ReplicationAgentJobConsumer.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/ReplicationAgentJobConsumer.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/ReplicationAgentJobConsumer.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java Fri Nov  7 10:28:02 2014
@@ -16,33 +16,32 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.jobhandling;
+package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueProcessor;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueProcessor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * {@link JobConsumer} for {@link ReplicationAgent}s using {@link org.apache.sling.replication.queue.impl.jobhandling.JobHandlingReplicationQueue}
+ * {@link JobConsumer} for {@link org.apache.sling.distribution.agent.DistributionAgent}s using {@link JobHandlingDistributionQueue}
  */
-public class ReplicationAgentJobConsumer implements JobConsumer {
+public class DistributionAgentJobConsumer implements JobConsumer {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final ReplicationQueueProcessor queueProcessor;
+    private final DistributionQueueProcessor queueProcessor;
 
-    public ReplicationAgentJobConsumer(ReplicationQueueProcessor queueProcessor) {
+    public DistributionAgentJobConsumer(DistributionQueueProcessor queueProcessor) {
         this.queueProcessor = queueProcessor;
     }
 
     public JobResult process(Job job) {
         log.debug("processing job {}", job.getId());
         String queueName = JobHandlingUtils.getQueueName(job);
-        ReplicationQueueItem info = JobHandlingUtils.getPackage(job);
+        DistributionQueueItem info = JobHandlingUtils.getPackage(job);
         log.info("processing item {} in queue {}", info.getId(), queueName);
         boolean processingResult = queueProcessor.process(queueName, info);
         JobResult jobResult = processingResult ? JobResult.OK : JobResult.FAILED;

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java (from r1637123, 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/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueue.java&r1=1637123&r2=1637333&rev=1637333&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/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.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.queue.impl.jobhandling;
+package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import javax.annotation.Nonnull;
 import java.util.ArrayList;
@@ -27,17 +27,17 @@ import java.util.Map;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.JobManager.QueryType;
-import org.apache.sling.replication.queue.*;
-import org.apache.sling.replication.queue.ReplicationQueueItemState.ItemState;
+import org.apache.sling.distribution.queue.*;
+import org.apache.sling.distribution.queue.DistributionQueueItemState.ItemState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a {@link ReplicationQueue} based on Sling Job Handling facilities
+ * a {@link org.apache.sling.distribution.queue.DistributionQueue} based on Sling Job Handling facilities
  */
-public class JobHandlingReplicationQueue implements ReplicationQueue {
+public class JobHandlingDistributionQueue implements DistributionQueue {
 
-    public final static String REPLICATION_QUEUE_TOPIC = "org/apache/sling/replication/queue";
+    public final static String DISTRIBUTION_QUEUE_TOPIC = "org/apache/sling/distribution/queue";
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -47,7 +47,7 @@ public class JobHandlingReplicationQueue
 
     private final JobManager jobManager;
 
-    protected JobHandlingReplicationQueue(String name, String topic, JobManager jobManager) {
+    protected JobHandlingDistributionQueue(String name, String topic, JobManager jobManager) {
         this.name = name;
         this.topic = topic;
         this.jobManager = jobManager;
@@ -58,7 +58,7 @@ public class JobHandlingReplicationQueue
         return name;
     }
 
-    public boolean add(@Nonnull ReplicationQueueItem item) {
+    public boolean add(@Nonnull DistributionQueueItem item) {
         boolean result = true;
         try {
             Map<String, Object> properties = JobHandlingUtils.createFullProperties(item);
@@ -73,14 +73,14 @@ public class JobHandlingReplicationQueue
     }
 
     @Nonnull
-    public ReplicationQueueItemState getStatus(@Nonnull ReplicationQueueItem replicationPackage)
-            throws ReplicationQueueException {
+    public DistributionQueueItemState getStatus(@Nonnull DistributionQueueItem distributionPackage)
+            throws DistributionQueueException {
         try {
-            Map<String, Object> properties = JobHandlingUtils.createIdProperties(replicationPackage.getId());
+            Map<String, Object> properties = JobHandlingUtils.createIdProperties(distributionPackage.getId());
             Job job = jobManager.getJob(topic, properties);
             if (job != null) {
 
-                ReplicationQueueItemState itemState = new ReplicationQueueItemState(job.getCreated(),
+                DistributionQueueItemState itemState = new DistributionQueueItemState(job.getCreated(),
                         ItemState.valueOf(job.getJobState().toString()),
                         job.getRetryCount());
 
@@ -88,15 +88,15 @@ public class JobHandlingReplicationQueue
 
                 return itemState;
             } else {
-                ReplicationQueueItemState itemState = new ReplicationQueueItemState(ItemState.DROPPED);
+                DistributionQueueItemState itemState = new DistributionQueueItemState(ItemState.DROPPED);
                 return itemState;
             }
         } catch (Exception e) {
-            throw new ReplicationQueueException("unable to retrieve the queue status", e);
+            throw new DistributionQueueException("unable to retrieve the queue status", e);
         }
     }
 
-    public ReplicationQueueItem getHead() {
+    public DistributionQueueItem getHead() {
         Job firstItem = getFirstJob();
         if (firstItem != null) {
             return JobHandlingUtils.getPackage(firstItem);
@@ -152,12 +152,12 @@ public class JobHandlingReplicationQueue
     }
 
     @Nonnull
-    public List<ReplicationQueueItem> getItems(ReplicationQueueItemSelector selector) {
+    public List<DistributionQueueItem> getItems(DistributionQueueItemSelector selector) {
         if (selector == null) {
-            selector = new ReplicationQueueItemSelector(0, -1);
+            selector = new DistributionQueueItemSelector(0, -1);
         }
 
-        List<ReplicationQueueItem> items = new ArrayList<ReplicationQueueItem>();
+        List<DistributionQueueItem> items = new ArrayList<DistributionQueueItem>();
         Collection<Job> jobs = getJobs(selector.getSkip(), selector.getLimit());
         for (Job job : jobs) {
             items.add(JobHandlingUtils.getPackage(job));

Copied: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueueProvider.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java?p2=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java&p1=sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueueProvider.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingReplicationQueueProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java Fri Nov  7 10:28:02 2014
@@ -16,36 +16,28 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl.jobhandling;
+package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import javax.annotation.Nonnull;
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueException;
-import org.apache.sling.replication.queue.ReplicationQueueProcessor;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueException;
+import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a queue provider {@link ReplicationQueueProvider} for sling jobs based
- * {@link ReplicationQueue}s
+ * a queue provider {@link org.apache.sling.distribution.queue.DistributionQueueProvider} for sling jobs based
+ * {@link org.apache.sling.distribution.queue.DistributionQueue}s
  */
-public class JobHandlingReplicationQueueProvider implements ReplicationQueueProvider {
+public class JobHandlingDistributionQueueProvider implements DistributionQueueProvider {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     private final String name;
@@ -58,7 +50,7 @@ public class JobHandlingReplicationQueue
     private BundleContext context;
 
 
-    public JobHandlingReplicationQueueProvider(String name, JobManager jobManager, BundleContext context) {
+    public JobHandlingDistributionQueueProvider(String name, JobManager jobManager, BundleContext context) {
         if (name == null || jobManager == null || context == null) {
             throw new IllegalArgumentException("all arguments are required");
         }
@@ -68,23 +60,23 @@ public class JobHandlingReplicationQueue
     }
 
     @Nonnull
-    public ReplicationQueue getQueue(@Nonnull String queueName) throws ReplicationQueueException {
-        String topic = JobHandlingReplicationQueue.REPLICATION_QUEUE_TOPIC + '/' + name + "/" + queueName;
-        return new JobHandlingReplicationQueue(name, topic, jobManager);
+    public DistributionQueue getQueue(@Nonnull String queueName) throws DistributionQueueException {
+        String topic = JobHandlingDistributionQueue.DISTRIBUTION_QUEUE_TOPIC + '/' + name + "/" + queueName;
+        return new JobHandlingDistributionQueue(name, topic, jobManager);
     }
 
 
-    public void enableQueueProcessing(@Nonnull ReplicationQueueProcessor queueProcessor) throws ReplicationQueueException {
+    public void enableQueueProcessing(@Nonnull DistributionQueueProcessor queueProcessor) throws DistributionQueueException {
         if (jobConsumer != null) {
-            throw new ReplicationQueueException("job already registered");
+            throw new DistributionQueueException("job already registered");
         }
         // eventually register job consumer for sling job handling based queues
         Dictionary<String, Object> jobProps = new Hashtable<String, Object>();
-        String topic = JobHandlingReplicationQueue.REPLICATION_QUEUE_TOPIC + '/' + name;
+        String topic = JobHandlingDistributionQueue.DISTRIBUTION_QUEUE_TOPIC + '/' + name;
         String childTopic = topic + "/*";
         jobProps.put(JobConsumer.PROPERTY_TOPICS, new String[]{topic, childTopic});
         log.info("registering job consumer for agent {}", name);
-        jobConsumer = context.registerService(JobConsumer.class.getName(), new ReplicationAgentJobConsumer(queueProcessor), jobProps);
+        jobConsumer = context.registerService(JobConsumer.class.getName(), new DistributionAgentJobConsumer(queueProcessor), jobProps);
         log.info("job consumer for agent {} registered", name);
     }
 



Mime
View raw message