Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 25929 invoked from network); 3 Jun 2009 08:28:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jun 2009 08:28:25 -0000 Received: (qmail 91426 invoked by uid 500); 3 Jun 2009 08:28:37 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 91373 invoked by uid 500); 3 Jun 2009 08:28:37 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 91364 invoked by uid 99); 3 Jun 2009 08:28:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2009 08:28:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2009 08:28:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D148D238888E; Wed, 3 Jun 2009 08:28:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090603082812.D148D238888E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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.");