jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1080594 - in /jackrabbit/sandbox/microkernel: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/jackrabbit/ src/main/java/org/apache/jackrabbit/mk/ src/test/ src/test/java/
Date Fri, 11 Mar 2011 15:13:58 GMT
Author: stefan
Date: Fri Mar 11 15:13:58 2011
New Revision: 1080594

URL: http://svn.apache.org/viewvc?rev=1080594&view=rev
Log:
start drafting a MicroKernel api

Added:
    jackrabbit/sandbox/microkernel/   (with props)
    jackrabbit/sandbox/microkernel/pom.xml
    jackrabbit/sandbox/microkernel/src/
    jackrabbit/sandbox/microkernel/src/main/
    jackrabbit/sandbox/microkernel/src/main/java/
    jackrabbit/sandbox/microkernel/src/main/java/org/
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelException.java
    jackrabbit/sandbox/microkernel/src/test/
    jackrabbit/sandbox/microkernel/src/test/java/

Propchange: jackrabbit/sandbox/microkernel/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 11 15:13:58 2011
@@ -0,0 +1,3 @@
+microkernel.iml
+
+.idea

Added: jackrabbit/sandbox/microkernel/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/pom.xml?rev=1080594&view=auto
==============================================================================
--- jackrabbit/sandbox/microkernel/pom.xml (added)
+++ jackrabbit/sandbox/microkernel/pom.xml Fri Mar 11 15:13:58 2011
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                             http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.jackrabbit</groupId>
+  <artifactId>microkernel</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <name>MicroKernel</name>
+  <description>Hierarchical MVCC-based persistence store</description>
+
+  <dependencies>
+
+    <!--Test Dependencies-->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.5</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: 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=1080594&view=auto
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java
(added)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernel.java
Fri Mar 11 15:13:58 2011
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk;
+
+/**
+ * TBD:
+ *
+ * - workspaces are just top-level nodes (e.g. /default. /system) specified on login,
+ *   => no need for inter-workspace operations, simplified versioning implenentation
+ *
+ * - nodeId is unique per repository and system-generated (e.g. sha1 or similar)
+ *
+ * - 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?
+ *
+ * - 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.
+ */
+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;
+}
+

Added: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelException.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelException.java?rev=1080594&view=auto
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelException.java
(added)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelException.java
Fri Mar 11 15:13:58 2011
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk;
+
+/**
+ * Exception thrown by methods of the <code>MicroKernel</code> API
+ */
+public class MicroKernelException extends Exception {
+}



Mime
View raw message