jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1080618 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java
Date Fri, 11 Mar 2011 15:44:39 GMT
Author: stefan
Date: Fri Mar 11 15:44:39 2011
New Revision: 1080618

URL: http://svn.apache.org/viewvc?rev=1080618&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=1080618&r1=1080617&r2=1080618&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:44:39 2011
@@ -30,26 +30,31 @@ import java.io.InputStream;
  *   is the concept of a nodeId really required? if yes, how should the nodeId
  *   be exposed? as a system-generated synthetic property? should every node
  *   have a nodeId? if not, what governs the assignment of a nodeId?
+ *   => marker property ":id": null, value will be assigned on node creation
  *
  * - jcr:uuid is a regular property, decorated on top of rmk, will require an external
  *   uuid2nodeId index; alternatively jcr:uuid 'is' the nodeId -> no separate
- *   index required
+ *   index required  => marker property? ":id"
  *
- * - json representation of properties:
- *   objects? or name/value pairs (type information needs to be encoded somehow)
- *   what about multi-valued properties?
+ * - should the rmk provide native support for shareable nodes?  => probably no
+ *
+ * - all reading methods have a predefined timeout (e.g. 50ms)
  *
- * - should the rmk provide native support for shareable nodes?
+ * JSON/JSOP:
  *
- * - should child nodes and properties share the same namespace? how should this
- *   be represented in json?
+ * - json representation of properties:
+ *   name/value pairs
+ *   what about mvp? => array of vals
+ *
+ * - should child nodes and properties share the same namespace? => yes
  *
  * - does the order of child nodes matter? if yes, how should they be represented
  *   json (a json object is an unordered set of name/value pairs.
+ *   => child nodes are represented as array
  *
- * - do we need to specify a 'reorder' op in jsop? perhaps based on 'move'?
+ * - do we need to specify a 'reorder' op in jsop? perhaps based on 'move'?  => davex
  *
- * - how should an incomplete list of child nodes be represented in json?
+ * - how should an incomplete list of child nodes be represented in json? => length(array)
!= :childnodescount
  */
 public interface MicroKernel {
 
@@ -57,55 +62,36 @@ public interface MicroKernel {
      * REVISION ops
      */
     String /* revisionId */ getHeadRevision();
-    // history entry: revisionId, timestamp
-    // 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;
+    // revision entry: revisionId, timestamp, size?
+    // todo: is the idOrPath parameter required if we're using a DAG model (as opposed to
delta-based)
+    String /* jsonObject */ getRevisions(long since, int maxEntries) throws MicroKernelException;
+    String /* array of revisions (id, ts, jsonDiff) */ getJournal(String revisionId1, String
revisionId2) throws MicroKernelException;
 
     /**
      * READ ops
      */
-    /* @todo are the following methods needed? */
-    // id<->path mapping
-    String /* nodeId */ getNodeId(String path, String revisionId) throws MicroKernelException;
-    String /* path */ getNodePath(String id, String revisionId) throws MicroKernelException;
-
     boolean nodeExists(String idOrPath, String revisionId) throws MicroKernelException;
-    boolean propertyExists(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 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;
+    String /* jsonTree */ getNodes(String idOrPath, int depth, String revisionId) throws
MicroKernelException;
 
     // 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?
+    String /* array of jsonTrees */ getChildNodes(String idOrPath, long offset, long count,
int depth, String revisionId) throws MicroKernelException;
+    // maybe represented as special property (":childnodecount") -> no need for specific
api method?
     long getChildNodeCount(String idOrPath, String revisionId) throws MicroKernelException;
 
     /**
      * WRITE ops
      */
     /* @todo JSOP diff format doesn't specify a 'copy' op */
-    /* @todo JSOP format doesn't provide property type information */
     String /* revisionId */ commit(String idOrPath, String jsonDiff) throws MicroKernelException;
 
     /**
      * DataStore READ/WRITE ops
      */
-    // @todo encode length in id?
+    // @todo encode length in id? => yes
     long getLength(String dsId) throws MicroKernelException;
-    InputStream read(String dsId) throws MicroKernelException;
-    String /* dsId */ write(InputStream in) throws MicroKernelException;
-
     int /* count */ read(String dsId, byte[] buf, int off, int size) throws MicroKernelException;
-    // alternative a:
-    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;
+    String /* dsId */ write(InputStream in) throws MicroKernelException;
 }
+



Mime
View raw message