sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637339 - in /sling/trunk/contrib/extensions/distribution: core/ core/src/main/java/org/apache/sling/distribution/agent/impl/ core/src/main/java/org/apache/sling/distribution/event/ core/src/main/java/org/apache/sling/distribution/packagin...
Date Fri, 07 Nov 2014 10:45:50 GMT
Author: tommaso
Date: Fri Nov  7 10:45:49 2014
New Revision: 1637339

URL: http://svn.apache.org/r1637339
Log:
SLING-4140 - renamed and moved Sling Replication to Sling Content Distribution

Modified:
    sling/trunk/contrib/extensions/distribution/core/README.md
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/ChainDistributionTriggerTest.java
    sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/service/agent/replicate.html.esp

Modified: sling/trunk/contrib/extensions/distribution/core/README.md
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/README.md?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/README.md (original)
+++ sling/trunk/contrib/extensions/distribution/core/README.md Fri Nov  7 10:45:49 2014
@@ -160,7 +160,7 @@ We need to expose APIs for configuring, 
 - Delete config - DELETE _/libs/sling/distribution/settings/agents/{config identifier}_ or
POST with :operation=delete
 
 ##### Command API
-- Replicate - POST _/libs/sling/distribution/services/agents/{agentName}_
+- Distribute - 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}_
 

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
Fri Nov  7 10:45:49 2014
@@ -273,7 +273,7 @@ public class SimpleDistributionAgent imp
                 Dictionary<Object, Object> properties = new Properties();
                 properties.put("distribution.package.paths", distributionPackage.getPaths());
                 properties.put("distribution.agent.name", name);
-                distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_REPLICATED,
properties);
+                distributionEventFactory.generateEvent(DistributionEventType.PACKAGE_DISTRIBUTED,
properties);
 
                 if (distributionPackage instanceof SharedDistributionPackage) {
                     ((SharedDistributionPackage) distributionPackage).release(queueName);

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
Fri Nov  7 10:45:49 2014
@@ -36,7 +36,7 @@ public enum DistributionEventType {
     /**
      * event for package replicated
      */
-    PACKAGE_REPLICATED,
+    PACKAGE_DISTRIBUTED,
 
     /**
      * event for package installed

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
Fri Nov  7 10:45:49 2014
@@ -90,7 +90,7 @@ public interface DistributionPackage ext
     /**
      * gets an additional info holder for this package.
      * The additional info object contains control information rather than content information.
-     * For example info.origin can be used to skip replicating back to the originating endpoint.
+     * For example info.origin can be used to skip distributing back to the originating endpoint.
      * It should not be be serialized between instances as its main purpose is to allow
      * inter component communication on the same instance.
      * @return the associated metadata to this package

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
Fri Nov  7 10:45:49 2014
@@ -41,7 +41,7 @@ public interface DistributionQueue {
     /**
      * add a distribution item to this queue
      *
-     * @param item a distribution item representing the package to replicate
+     * @param item a distribution item representing the package to distribute
      * @return <code>true</code> if the distribution item was added correctly
to the queue,
      * <code>false</code otherwise
      */

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java
Fri Nov  7 10:45:49 2014
@@ -166,7 +166,7 @@ public abstract class AbstractDistributi
     protected Session getSession(ResourceResolver resourceResolver) throws RepositoryException
{
         Session session = resourceResolver.adaptTo(Session.class);
         if (session != null) {
-            DistributionJcrUtils.setDoNotReplicate(session);
+            DistributionJcrUtils.setDoNotDistribute(session);
         } else {
             throw new RepositoryException("could not obtain a session from calling user "
+ resourceResolver.getUserID());
         }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
Fri Nov  7 10:45:49 2014
@@ -37,7 +37,7 @@ public class ResourceSharedDistributionP
     private String PN_ORIGINAL_ACTION = "original.package.action";
     private String PN_ORIGINAL_PATHS = "original.package.paths";
 
-    private String PACKAGE_NAME_PREFIX = "replpackage";
+    private String PACKAGE_NAME_PREFIX = "distrpackage";
     private String sharedPackagesRoot = "/var/sling/distribution/";
 
     private final DistributionPackageBuilder distributionPackageBuilder;

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java
Fri Nov  7 10:45:49 2014
@@ -40,7 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to ask {@link org.apache.sling.distribution.agent.DistributionAgent}s to replicate
(via HTTP POST).
+ * Servlet to ask {@link org.apache.sling.distribution.agent.DistributionAgent}s to distribute
(via HTTP POST).
  */
 @SlingServlet(resourceTypes = DistributionConstants.AGENT_RESOURCE_TYPE, methods = "POST")
 public class DistributionAgentServlet extends SlingAllMethodsServlet {

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ChainDistributeDistributionTrigger.java
Fri Nov  7 10:45:49 2014
@@ -65,7 +65,7 @@ public class ChainDistributeDistribution
 
         // TODO : make it possible to configure the type of event handled here, currently
'package-installed' is hardcoded
         properties.put(EventConstants.EVENT_TOPIC, DistributionEvent.getTopic(DistributionEventType.PACKAGE_INSTALLED));
-        log.info("handler {} will chain replicate on path '{}'", requestHandler, pathPrefix);
+        log.info("handler {} will chain distribute on path '{}'", requestHandler, pathPrefix);
 
 //            properties.put(EventConstants.EVENT_FILTER, "(path=" + path + "/*)");
         if (bundleContext != null) {

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java
Fri Nov  7 10:45:49 2014
@@ -52,7 +52,7 @@ public class JcrEventDistributionTrigger
             }
             distributionRequest = new DistributionRequest(System.currentTimeMillis(), Event.NODE_REMOVED
==
                     type ? DistributionActionType.DELETE : DistributionActionType.ADD, replicatingPath);
-            log.info("replicating {}", distributionRequest);
+            log.info("distributing {}", distributionRequest);
         }
         return distributionRequest;
     }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
Fri Nov  7 10:45:49 2014
@@ -118,8 +118,8 @@ public class ResourceEventDistributionTr
 
             Object pathProperty = event.getProperty("path");
             if (pathProperty != null) {
-                String replicatingPath = String.valueOf(pathProperty);
-                requestHandler.handle(new DistributionRequest(System.currentTimeMillis(),
action, replicatingPath));
+                String distributingPath = String.valueOf(pathProperty);
+                requestHandler.handle(new DistributionRequest(System.currentTimeMillis(),
action, distributingPath));
             }
         }
     }

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/DistributionJcrUtils.java
Fri Nov  7 10:45:49 2014
@@ -30,21 +30,21 @@ import org.apache.jackrabbit.api.observa
  */
 public class DistributionJcrUtils {
 
-    public static final String DO_NOT_REPLICATE = "do.not.replicate";
+    public static final String DO_NOT_DISTRIBUTE = "do.not.distribute";
 
     /**
-     * checks a generated JCR event was not created by a JCR session having set the 'userData'
to {@link #DO_NOT_REPLICATE}.
+     * checks a generated JCR event was not created by a JCR session having set the 'userData'
to {@link #DO_NOT_DISTRIBUTE}.
      *
      * @param jcrEvent an {@link javax.jcr.observation.Event}
      * @return <code>false</code> if the event was generated by a {@link javax.jcr.Session}
having its
-     * {@link javax.jcr.observation.ObservationManager#setUserData(String)} set to {@link
#DO_NOT_REPLICATE}
+     * {@link javax.jcr.observation.ObservationManager#setUserData(String)} set to {@link
#DO_NOT_DISTRIBUTE}
      * @throws javax.jcr.RepositoryException if retrieving 'userData' fails
      */
     public static boolean isSafe(@Nonnull Event jcrEvent) throws RepositoryException {
         boolean safe = false;
         if (jcrEvent instanceof JackrabbitEvent && !((JackrabbitEvent) jcrEvent).isExternal())
{
             String userData = jcrEvent.getUserData();
-            if (!DO_NOT_REPLICATE.equals(userData)) {
+            if (!DO_NOT_DISTRIBUTE.equals(userData)) {
                 safe = true;
             }
         }
@@ -53,12 +53,12 @@ public class DistributionJcrUtils {
     }
 
     /**
-     * set {@link #DO_NOT_REPLICATE} on the given {@link Session}'s {@link javax.jcr.observation.ObservationManager#setUserData(String)}
+     * set {@link #DO_NOT_DISTRIBUTE} on the given {@link Session}'s {@link javax.jcr.observation.ObservationManager#setUserData(String)}
      *
      * @param session a {@link javax.jcr.Session}
      * @throws RepositoryException if retrieving the {@link javax.jcr.observation.ObservationManager}
fails
      */
-    public static void setDoNotReplicate(@Nonnull Session session) throws RepositoryException
{
-        session.getWorkspace().getObservationManager().setUserData(DistributionJcrUtils.DO_NOT_REPLICATE);
+    public static void setDoNotDistribute(@Nonnull Session session) throws RepositoryException
{
+        session.getWorkspace().getObservationManager().setUserData(DistributionJcrUtils.DO_NOT_DISTRIBUTE);
     }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/ChainDistributionTriggerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/ChainDistributionTriggerTest.java?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/ChainDistributionTriggerTest.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/ChainDistributionTriggerTest.java
Fri Nov  7 10:45:49 2014
@@ -33,33 +33,33 @@ public class ChainDistributionTriggerTes
     public void testRegister() throws Exception {
         String pathPrefix = "/prefix";
         BundleContext bundleContext = mock(BundleContext.class);
-        ChainDistributeDistributionTrigger chainReplicatedistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
+        ChainDistributeDistributionTrigger chainDistributeDistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
         DistributionRequestHandler handler = mock(DistributionRequestHandler.class);
-        chainReplicatedistributionTrigger.register(handler);
+        chainDistributeDistributionTrigger.register(handler);
     }
 
     @Test
     public void testUnregister() throws Exception {
         String pathPrefix = "/prefix";
         BundleContext bundleContext = mock(BundleContext.class);
-        ChainDistributeDistributionTrigger chainReplicatedistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
+        ChainDistributeDistributionTrigger chainDistributeDistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
         DistributionRequestHandler handler = mock(DistributionRequestHandler.class);
-        chainReplicatedistributionTrigger.unregister(handler);
+        chainDistributeDistributionTrigger.unregister(handler);
     }
 
     @Test
     public void testEnable() throws Exception {
         String pathPrefix = "/prefix";
         BundleContext bundleContext = mock(BundleContext.class);
-        ChainDistributeDistributionTrigger chainReplicatedistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
-        chainReplicatedistributionTrigger.enable();
+        ChainDistributeDistributionTrigger chainDistributeDistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
+        chainDistributeDistributionTrigger.enable();
     }
 
     @Test
     public void testDisable() throws Exception {
         String pathPrefix = "/prefix";
         BundleContext bundleContext = mock(BundleContext.class);
-        ChainDistributeDistributionTrigger chainReplicatedistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
-        chainReplicatedistributionTrigger.disable();
+        ChainDistributeDistributionTrigger chainDistributeDistributionTrigger = new ChainDistributeDistributionTrigger(pathPrefix,
bundleContext);
+        chainDistributeDistributionTrigger.disable();
     }
 }
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/service/agent/replicate.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/service/agent/replicate.html.esp?rev=1637339&r1=1637338&r2=1637339&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/service/agent/replicate.html.esp
(original)
+++ sling/trunk/contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/service/agent/replicate.html.esp
Fri Nov  7 10:45:49 2014
@@ -4,7 +4,7 @@ var pit = valueMap.keySet().iterator();
 %>
 <html>
   <body>
-    <h1>Replicate: <%= valueMap.get("name") %></h1>
+    <h1>Distribute: <%= valueMap.get("name") %></h1>
 
     <form action="<%= request.contextPath + resource.path %>" method="POST">
         Path: <input type="text" name="path"><br>



Mime
View raw message