Return-Path: X-Original-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 457CB92DA for ; Thu, 13 Sep 2012 14:41:36 +0000 (UTC) Received: (qmail 28009 invoked by uid 500); 13 Sep 2012 14:41:36 -0000 Delivered-To: apmail-jackrabbit-oak-commits-archive@jackrabbit.apache.org Received: (qmail 27972 invoked by uid 500); 13 Sep 2012 14:41:36 -0000 Mailing-List: contact oak-commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-commits@jackrabbit.apache.org Received: (qmail 27964 invoked by uid 99); 13 Sep 2012 14:41:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 14:41:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Thu, 13 Sep 2012 14:41:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6584423889BB; Thu, 13 Sep 2012 14:40:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1384347 - /jackrabbit/oak/trunk/doc/nodestate.md Date: Thu, 13 Sep 2012 14:40:50 -0000 To: oak-commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120913144050.6584423889BB@eris.apache.org> Author: jukka Date: Thu Sep 13 14:40:49 2012 New Revision: 1384347 URL: http://svn.apache.org/viewvc?rev=1384347&view=rev Log: OAK-301: Document Oak internals More NodeState details Modified: jackrabbit/oak/trunk/doc/nodestate.md Modified: jackrabbit/oak/trunk/doc/nodestate.md URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/doc/nodestate.md?rev=1384347&r1=1384346&r2=1384347&view=diff ============================================================================== --- jackrabbit/oak/trunk/doc/nodestate.md (original) +++ jackrabbit/oak/trunk/doc/nodestate.md Thu Sep 13 14:40:49 2012 @@ -42,5 +42,51 @@ Implementations that use mutable data st aren't thread-safe by default, are expected to use other mechanisms like synchronization to ensure thread-safety. - +## The NodeState interface + +The above design principles are reflected in the `NodeState` interface +in the `org.apache.jackrabbit.oak.spi.state` package of oak-core. The +interface consits of three sets of methods: + + * Methods for accessing properties + * Methods for accessing child nodes + * The `compareAgainstBaseState` method for comparing states + +You can request a property or a child node by name, get the number of +properties or child nodes, or iterate through all of them. Even though +properties and child nodes are accessed through separate methods, they +share the same namespace so a given name can either refer to a property +or a child node, but not to both at the same time. + +Iteration order of properties and child nodes is _unspecified but stable_, +so that re-iterating through the items of a _specific NodeState instance_ +will return the items in the same order as before, but the specific ordering +is not defined nor does it necessarily remain the same across different +instances. + +The `compareAgainstBaseState` method takes another NodeState instance and +a `NodeStateDiff` object, compares the two node states, and reports all +differences by invoking appropriate methods on the given diff handler object. + +See the `NodeState` javadocs for full details of how the interface works. + +## Comparing node states + +TODO + +## Building new node states + +TODO + +## The commit hook mechanism + +TODO + +## Commit validation + +TODO + +## Commit modification + +TODO