jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1368602 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: WorkspaceImpl.java version/VersionImpl.java version/VersionManagerImpl.java
Date Thu, 02 Aug 2012 17:09:43 GMT
Author: jukka
Date: Thu Aug  2 17:09:43 2012
New Revision: 1368602

URL: http://svn.apache.org/viewvc?rev=1368602&view=rev
Log:
OAK-168: Basic JCR VersionManager support

Add dummy checkin() that just fakes a return value for now

Added:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
  (with props)
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1368602&r1=1368601&r2=1368602&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Thu Aug  2 17:09:43 2012
@@ -170,7 +170,7 @@ public class WorkspaceImpl implements Ja
 
     @Override
     public VersionManager getVersionManager() {
-        return new VersionManagerImpl();
+        return new VersionManagerImpl(sessionDelegate);
     }
 
     @Override

Added: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java?rev=1368602&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
Thu Aug  2 17:09:43 2012
@@ -0,0 +1,71 @@
+/*
+ * 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.oak.jcr.version;
+
+import java.util.Calendar;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.version.Version;
+import javax.jcr.version.VersionHistory;
+
+import org.apache.jackrabbit.oak.jcr.NodeDelegate;
+import org.apache.jackrabbit.oak.jcr.NodeImpl;
+import org.apache.jackrabbit.oak.util.TODO;
+
+class VersionImpl extends NodeImpl implements Version {
+
+    public VersionImpl(NodeDelegate dlg) {
+        super(dlg);
+    }
+
+    @Override
+    public VersionHistory getContainingHistory() throws RepositoryException {
+        return TODO.unimplemented().returnValue(null);
+    }
+
+    @Override
+    public Calendar getCreated() throws RepositoryException {
+        return TODO.unimplemented().returnValue(Calendar.getInstance());
+    }
+
+    @Override
+    public Version getLinearPredecessor() throws RepositoryException {
+        return TODO.unimplemented().returnValue(null);
+    }
+
+    @Override
+    public Version getLinearSuccessor() throws RepositoryException {
+        return TODO.unimplemented().returnValue(null);
+    }
+
+    @Override
+    public Version[] getPredecessors() throws RepositoryException {
+        return TODO.unimplemented().returnValue(new Version[0]);
+    }
+
+    @Override
+    public Version[] getSuccessors() throws RepositoryException {
+        return TODO.unimplemented().returnValue(new Version[0]);
+    }
+
+    @Override
+    public Node getFrozenNode() throws RepositoryException {
+        return TODO.unimplemented().returnValue(null);
+    }
+
+}

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionManagerImpl.java?rev=1368602&r1=1368601&r2=1368602&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionManagerImpl.java
Thu Aug  2 17:09:43 2012
@@ -29,10 +29,18 @@ import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionManager;
 
 import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
+import org.apache.jackrabbit.oak.jcr.NodeDelegate;
+import org.apache.jackrabbit.oak.jcr.SessionDelegate;
 import org.apache.jackrabbit.oak.util.TODO;
 
 public class VersionManagerImpl implements VersionManager {
 
+    private final SessionDelegate sessionDelegate;
+
+    public VersionManagerImpl(SessionDelegate sessionDelegate) {
+        this.sessionDelegate = sessionDelegate;
+    }
+
     @Override
     public Node setActivity(Node activity) throws RepositoryException {
         return TODO.unimplemented().returnValue(null);
@@ -107,17 +115,17 @@ public class VersionManagerImpl implemen
     @Override
     public VersionHistory getVersionHistory(String absPath)
             throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
     public Version getBaseVersion(String absPath) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
     public Node getActivity() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
@@ -128,17 +136,17 @@ public class VersionManagerImpl implemen
 
     @Override
     public Node createConfiguration(String absPath) throws RepositoryException {
-        throw TODO.unimplemented().exception();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
     public Node createActivity(String title) throws RepositoryException {
-        throw TODO.unimplemented().exception();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
     public Version checkpoint(String absPath) throws RepositoryException {
-        throw TODO.unimplemented().exception();
+        return TODO.unimplemented().returnValue(null);
     }
 
     @Override
@@ -148,7 +156,10 @@ public class VersionManagerImpl implemen
 
     @Override
     public Version checkin(String absPath) throws RepositoryException {
-        throw TODO.unimplemented().exception();
+        String oakPath = sessionDelegate.getOakPathOrThrowNotFound(absPath);
+        NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
+        return TODO.dummyImplementation().returnValue(
+                new VersionImpl(nodeDelegate));
     }
 
     @Override



Mime
View raw message