You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2011/03/11 16:35:19 UTC

svn commit: r1080609 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java

Author: stefan
Date: Fri Mar 11 15:35:19 2011
New Revision: 1080609

URL: http://svn.apache.org/viewvc?rev=1080609&view=rev
Log:
drafting a MicroKernel api (WIP)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java?rev=1080609&r1=1080608&r2=1080609&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java (original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java Fri Mar 11 15:35:19 2011
@@ -31,16 +31,14 @@ package org.apache.jackrabbit.mk;
  *   uuid2nodeId index; alternatively jcr:uuid 'is' the nodeId -> no separate
  *   index required
  *
- * - all properties are multi-valued strings or byte[] (simplifies api)
+ * - json representation of properties:
+ *   objects? or name/value pairs (type information needs to be encoded somehow)
  *
  * - should the rmk provide native support for shareable nodes?
  *
  * - should child nodes and properties share the same namespace?
  *
- * - should the rmk support (polling) observation?
- *
- * - a c/php friendly DataStore api should be exposed separately; blobs are
- *   stored in the data store whereas the rmk just stores data store identifiers.
+ * - should the rmk support (polling) observation? are getHistory/diff sufficient?
  */
 public interface MicroKernel {
 
@@ -49,11 +47,10 @@ public interface MicroKernel {
      */
     String /* revisionId */ getHeadRevision();
     // history entry: revisionId, timestamp
-    // todo: is the idOrPath parameter required if we're using a DAG model (as opposed to delta-based)
+    // todo: is the idOrPath parameter required if we're usig a DAG model (as opposed to delta-based)
     String /* jsonObject */ getHistory(String idOrPath, long fromTS, long toTS) throws MicroKernelException;
     String /* jsonDiff */ diff(String revisionId1, String revisionId2) throws MicroKernelException;
 
-
     /**
      * READ ops
      */
@@ -65,38 +62,32 @@ public interface MicroKernel {
     boolean nodeExists(String idOrPath, String revisionId) throws MicroKernelException;
     boolean propertyExists(String idOrPath, String revisionId) throws MicroKernelException;
 
-    String[] /* propNames */ getProperties(String idOrPath, String revisionId) throws MicroKernelException;
-    String[] /* propValue */ getProperty(String idOrPath, String revisionId) throws MicroKernelException;
-    byte[] /* propValue */ getBinaryProperty(String idOrPath, String revisionId) throws MicroKernelException;
-    int /* propType */ getPropertyType(String idOrPath, String revisionId) throws MicroKernelException;
+    // prop entry: name, type, value
+    /* @todo json property format: objects? or name/value pairs (type information needs to be encoded somehow) */
+    String /* jsonObject */ getProperties(String idOrPath, String revisionId) throws MicroKernelException;
 
-    /* @todo return all properties in json format instead? */
-    //String /* jsonObject */ getProperties(String idOrPath, String revisionId) throws RMKException;
+    /* @todo how should flat hierarchies be handled/represented? use special child node entry/placeholder ([...]) if child node list is truncated?*/
+    String /* jsonTree */ getNodeTree(String idOrPath, int depth, String revisionId) throws MicroKernelException;
 
-    /* @todo blobs (-> DataStore api?) */
+    // specialized methods for reading flat hierarchies
+    String[] /* nodeNames */ getChildNodes(String idOrPath, long offset, long count, String revisionId) throws MicroKernelException;
+    // maybe represented as special property (childNodeCount) -> no need for specific api method?
+    long getChildNodeCount(String idOrPath, String revisionId) throws MicroKernelException;
 
+    /**
+     * DataStore READ/WRITE ops
+     */
     long getLength(String dsId) throws MicroKernelException;
     int /* count */ read(String dsId, byte[] buf, int off, int size) throws MicroKernelException;
     // alternative a:
-    String /* dsId */ write(byte[] data, int length) throws MicroKernelException;
+    String /* dsId */ write(byte[] data, int size) throws MicroKernelException;
+    // dispose=true: merged dsId's were only used temporary and may be gc'ed
     String /* dsId */ join(String[] dsIds, boolean dispose) throws MicroKernelException;
     // alternative b:
     // tmp: isTemporary, timeToLive=3600s, if tmp=false -> returned dsId is a hash of the content
     String /* dsId */ append(String dsBaseId, byte[] data, int size, boolean tmp) throws MicroKernelException;
 
 
-
-    /* @todo how should nodeId be exposed? */
-
-    // specialized methods for reading flat hierarchies
-    String[] /* nodeNames */ getChildNodes(String idOrPath, long offset, long count, String revisionId) throws MicroKernelException;
-    // maybe represented as special property (childNodeCount) -> no need for specific method?
-    long getChildNodeCount(String idOrPath, String revisionId) throws MicroKernelException;
-
-    /* @todo return entire subtree in json format? how should flat hierarchies be handled/represented? */
-    String /* jsonTree */ getNodeTree(String idOrPath, int depth, String revisionId) throws MicroKernelException;
-
-
     /**
      * WRITE ops
      */