incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r689832 - /incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Date Thu, 28 Aug 2008 14:13:06 GMT
Author: cziegeler
Date: Thu Aug 28 07:13:05 2008
New Revision: 689832

URL: http://svn.apache.org/viewvc?rev=689832&view=rev
Log:
Fix query when props are specified.

Modified:
    incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java

Modified: incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java?rev=689832&r1=689831&r2=689832&view=diff
==============================================================================
--- incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
(original)
+++ incubator/sling/trunk/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Thu Aug 28 07:13:05 2008
@@ -318,7 +318,9 @@
         this.backgroundSession = this.createSession();
         this.backgroundSession.getWorkspace().getObservationManager()
                 .addEventListener(this,
-                                  javax.jcr.observation.Event.PROPERTY_REMOVED,
+                                  javax.jcr.observation.Event.PROPERTY_REMOVED
+                                    |javax.jcr.observation.Event.NODE_REMOVED
+                                    |javax.jcr.observation.Event.PROPERTY_CHANGED,
                                   this.repositoryPath,
                                   true,
                                   null,
@@ -881,6 +883,9 @@
                     } catch (RepositoryException re) {
                         this.logger.error("Exception during jcr event processing.", re);
                     }
+                } else if ( event.getType() == javax.jcr.observation.Event.NODE_REMOVED )
{
+                    final String nodePath = event.getPath();
+                    // TODO Cancel job
                 }
             }
         } catch (RepositoryException re) {
@@ -1116,9 +1121,9 @@
      * @return
      * @throws RepositoryException
      */
-    private Collection<Event> queryCurrentJobs(final String topic,
-                                               final Map<String, Object> filterProps,
-                                               final Boolean locked)  {
+    private Collection<Event> queryJobs(final String topic,
+                                        final Map<String, Object> filterProps,
+                                        final Boolean locked)  {
         // we create a new session
         Session s = null;
         final List<Event> jobs = new ArrayList<Event>();
@@ -1214,14 +1219,14 @@
      * @see org.apache.sling.event.JobStatusProvider#getCurrentJobs(java.lang.String, java.util.Map)
      */
     public Collection<Event> getCurrentJobs(String topic, Map<String, Object>
filterProps) {
-        return this.queryCurrentJobs(topic, null, true);
+        return this.queryJobs(topic, filterProps, true);
     }
 
     /**
      * @see org.apache.sling.event.JobStatusProvider#getScheduledJobs(java.lang.String, java.util.Map)
      */
     public Collection<Event> getScheduledJobs(String topic, Map<String, Object>
filterProps) {
-        return this.queryCurrentJobs(topic, null, false);
+        return this.queryJobs(topic, filterProps, false);
     }
 
 
@@ -1229,7 +1234,7 @@
      * @see org.apache.sling.event.JobStatusProvider#getAllJobs(java.lang.String, java.util.Map)
      */
     public Collection<Event> getAllJobs(String topic, Map<String, Object> filterProps)
{
-        return this.queryCurrentJobs(topic, null, null);
+        return this.queryJobs(topic, filterProps, null);
     }
 
 



Mime
View raw message