incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1556499 - /sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java
Date Wed, 08 Jan 2014 11:26:02 GMT
Author: bdelacretaz
Date: Wed Jan  8 11:26:01 2014
New Revision: 1556499

URL: http://svn.apache.org/r1556499
Log:
SLING-3299 - Remote agent queue poll should be restricted to "queueing" agents - contributed
by Tommaso Teofili, thanks!

Modified:
    sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java

Modified: sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java?rev=1556499&r1=1556498&r2=1556499&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java
(original)
+++ sling/trunk/contrib/extensions/replication/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentPollServlet.java
Wed Jan  8 11:26:01 2014
@@ -60,7 +60,9 @@ public class ReplicationAgentPollServlet
 
         ReplicationAgent agent = request.getResource().adaptTo(ReplicationAgent.class);
 
-        if (agent != null) {
+        /* directly polling an agent queue is only possible if such an agent doesn't have
its own endpoint
+        (that is it just adds items to its queue to be polled remotely)*/
+        if (agent != null && (agent.getEndpoint() == null || agent.getEndpoint().toString().length()
== 0 )) {
             try {
                 // TODO : consider using queue distribution strategy and validating who's
making this request
                 if (log.isInfoEnabled()) {



Mime
View raw message