jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r781298 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy: HierarchyEventListener.java NodeEntryImpl.java
Date Wed, 03 Jun 2009 08:28:12 GMT
Author: angela
Date: Wed Jun  3 08:28:12 2009
New Revision: 781298

URL: http://svn.apache.org/viewvc?rev=781298&view=rev
Log:
JCR-2108: JSR 283 Observation   (work in progress)

- add more TODOs

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java?rev=781298&r1=781297&r2=781298&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
Wed Jun  3 08:28:12 2009
@@ -106,6 +106,9 @@
             log.debug("Empty event bundle");
             return;
         }
+
+        // TODO: handle new 283 event types and clean add/remove that is also present as
move-event.
+
         // collect set of removed node ids
         Set removedEvents = new HashSet();
         // separately collect the add events
@@ -173,25 +176,37 @@
 
             NodeId parentId = event.getParentId();
             NodeEntry parent = (parentId != null) ? (NodeEntry) hierarchyMgr.lookup(parentId)
: null;
-            if (type == Event.NODE_REMOVED || type == Event.PROPERTY_REMOVED) {
-                // notify parent about removal if its child-entry.
-                // - if parent is 'null' (i.e. not yet loaded) the child-entry does
-                //   not exist either -> no need to inform child-entry
-                // - if parent got removed with the same event-bundle
-                //   only remove the parent an skip this event.
-                if (parent != null && !removedEvents.contains(parentId)) {
-                    parent.refresh(event);
-                }
-            } else if (type == Event.PROPERTY_CHANGED) {
-                // notify parent in case jcr:mixintypes or jcr:uuid was changed.
-                // if parent is 'null' (i.e. not yet loaded) the prop-entry does
-                // not exist either -> no need to inform propEntry
-                if (parent != null) {
-                    parent.refresh(event);
-                }
-            } else {
-                // should never occur
-                throw new IllegalArgumentException("Invalid event type: " + event.getType());
+            switch (type) {
+                case Event.NODE_REMOVED:
+                case Event.PROPERTY_REMOVED:
+                    // notify parent about removal if its child-entry.
+                    // - if parent is 'null' (i.e. not yet loaded) the child-entry does
+                    //   not exist either -> no need to inform child-entry
+                    // - if parent got removed with the same event-bundle
+                    //   only remove the parent an skip this event.
+                    if (parent != null && !removedEvents.contains(parentId)) {
+                        parent.refresh(event);
+                    }
+                    break;
+                case Event.PROPERTY_CHANGED:
+                    // notify parent in case jcr:mixintypes or jcr:uuid was changed.
+                    // if parent is 'null' (i.e. not yet loaded) the prop-entry does
+                    // not exist either -> no need to inform propEntry
+                    if (parent != null) {
+                        parent.refresh(event);
+                    }
+                    break;
+                case Event.NODE_MOVED:
+                    // TODO: implementation missing
+                    throw new UnsupportedOperationException("Implementation missing");
+                    //break;
+                case Event.PERSIST:
+                    // TODO: implementation missing
+                    throw new UnsupportedOperationException("Implementation missing");
+                    //break;
+                default:
+                    // should never occur
+                    throw new IllegalArgumentException("Invalid event type: " + event.getType());
             }
         }
     }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java?rev=781298&r1=781297&r2=781298&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
Wed Jun  3 08:28:12 2009
@@ -970,6 +970,13 @@
                     }
                 } // else: existing entry but state not yet built -> ignore event
                 break;
+            case Event.NODE_MOVED:
+                // TODO: implementation missing
+                throw new UnsupportedOperationException("Implementation missing");
+                //break;
+            case Event.PERSIST:
+                // TODO: implementation missing
+                throw new UnsupportedOperationException("Implementation missing");
             default:
                 // ILLEGAL
                 throw new IllegalArgumentException("Illegal event type " + childEvent.getType()
+ " for NodeState.");



Mime
View raw message