jackrabbit-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1080601&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=1080601&r1=1080600&r2=1080601&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:18:39 2011
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.mk;
 /**
  * TBD:
  *
- * - workspaces are just top-level nodes (e.g. /default. /system) specified on login,
+ * - workspaces are just top-level nodes (e.g. /default. /system)
  *   => no need for inter-workspace operations, simplified versioning implenentation
  *
  * - nodeId is unique per repository and system-generated (e.g. sha1 or similar)
@@ -27,14 +27,8 @@ package org.apache.jackrabbit.mk;
  * - jcr:uuid is a regular property, decorated on top of rmk, will require an external
  *   uuid2nodeId index
  *
- * - should the api use structures/objects rather than primitives (e.g. Property object)
- *
  * - all properties are multi-valued strings or byte[] (simplifies api)
  *
- * - does the repository access need to be authenticated? OTOH would a
- *   'String open(String wspPath)' method sufficient? jcr access control will
- *    probably be implemented/handled on a higher layer.
- *
  * - should the rmk provide native support for shareable nodes?
  *
  * - should child nodes and properties share the same namespace?
@@ -46,49 +40,49 @@ package org.apache.jackrabbit.mk;
  */
 public interface MicroKernel {
 
-	String /* sessionId */ login(String user, String password, String workspacePath) throws
MicroKernelException;
-	/* @todo is the following method needed? do we need/want to expose a revision id? */
-	String /* sessionId */ login(String user, String password, String workspacePath, long revision)
throws MicroKernelException;
-	boolean isSessionAlive(String sessionId) throws MicroKernelException;
-	void logout(String sessionId);
-
-	/* @todo are the following methods needed? */
-	String /* nodeId */ getNodeId(String sessionId, String path) throws MicroKernelException;
-	String /* path */ getNodePath(String sessionId, String id) throws MicroKernelException;
-
-	boolean nodeExists(String sessionId, String idOrPath) throws MicroKernelException;
-	boolean propertyExists(String sessionId, String idOrPath) throws MicroKernelException;
-
-	String[] /* propNames */ getProperties(String sessionId, String idOrPath) throws MicroKernelException;
-
-	String[] /* propValue */ getProperty(String sessionId, String idOrPath) throws MicroKernelException;
-	byte[] /* propValue */ getBinaryProperty(String sessionId, String idOrPath) throws MicroKernelException;
-	int /* propType */ getPropertyType(String sessionId, String idOrPath) throws MicroKernelException;
-
-	/* @todo blobs (-> DataStore api?) */
-	/* @todo method to read node incl all properties */
-
-	String[] /* nodeNames */ getChildNodes(String sessionId, String idOrPath) throws MicroKernelException;
-	String[] /* nodeNames */ getChildNodes(String sessionId, String idOrPath, long offset, long
count) throws MicroKernelException;
-	long getChildNodeCount(String sessionId, String idOrPath) throws MicroKernelException;
-
-	void setProperty(String sessionId, String idOrPath, byte value[]) throws MicroKernelException;
-	void setProperty(String sessionId, String idOrPath, String value[]) throws MicroKernelException;
-	void setProperty(String sessionId, String idOrPath, String value[], int type) throws MicroKernelException;
-
-	String /* nodeId */ addNode(String sessionId, String idOrPathOfParent, String name) throws
MicroKernelException;
-	/* @todo method to add node with properties */
-
-	void move(String sessionId, String srcPath, String destPath) throws MicroKernelException;
-	void copy(String sessionId, String srcPath, String destPath) throws MicroKernelException;
-	void delete(String sessionId, String idOrPath) throws MicroKernelException;
-
-	boolean hasPendingChanges(String sessionId) throws MicroKernelException;
-	long /* revision */ commit(String sessionId) throws MicroKernelException;
-	void revert(String sessionId) throws MicroKernelException;
-
-	//String /* lockToken */ lock(String sessionId, String idOrPath, boolean deep, boolean sessionScoped)
throws RMKException;
-	//boolean isLocked(String sessionId, String idOrPath) throws RMKException;
-	//void unlock(String sessionId, String lockToken) throws RMKException;
+    /**
+     * REVISION ops
+     */
+    String /* revisionId */ getHeadRevision();
+    // history entry: revisionId, timestamp
+    String /* jsonObject */ getHistory(String idOrPath, long since) throws MicroKernelException;
+
+
+    /**
+     * READ ops
+     */
+    /* @todo are the following methods needed? */
+    String /* nodeId */ getNodeId(String path, String revision) throws MicroKernelException;
+    String /* path */ getNodePath(String id, String revision) throws MicroKernelException;
+
+    boolean nodeExists(String idOrPath, String revision) throws MicroKernelException;
+    boolean propertyExists(String idOrPath, String revision) throws MicroKernelException;
+
+    String[] /* propNames */ getProperties(String idOrPath, String revision) throws MicroKernelException;
+    String[] /* propValue */ getProperty(String idOrPath, String revision) throws MicroKernelException;
+    byte[] /* propValue */ getBinaryProperty(String idOrPath, String revision) throws MicroKernelException;
+    int /* propType */ getPropertyType(String idOrPath, String revision) throws MicroKernelException;
+
+    /* @todo return all properties in json format instead? */
+    //String /* jsonObject */ getProperties(String idOrPath, String revision) throws RMKException;
+
+    /* @todo blobs (-> DataStore api?) */
+
+    /* @todo how should nodeId be exposed? */
+    String[] /* nodeNames */ getChildNodes(String idOrPath, String revision) throws MicroKernelException;
+    String[] /* nodeNames */ getChildNodes(String idOrPath, long offset, long count, String
revision) throws MicroKernelException;
+    long getChildNodeCount(String idOrPath, String revision) throws MicroKernelException;
+
+    /* @todo return entire subtree in json format? */
+    String /* jsonTree */ getNodeTree(String idOrPath, int depth, String revision) throws
MicroKernelException;
+
+    String /* jsonDiff */ diff(String revision1, String revision2) throws MicroKernelException;
+
+    /**
+     * WRITE ops
+     */
+    /* @todo JSOP diff format doesn't specify a 'copy' op */
+    /* @todo JSOP format doesn't provide property type information */
+    String /* revision */ commit(String idOrPath, String jsonDiff) throws MicroKernelException;
 }
 



Mime
View raw message