jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1620490 - in /jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi: ./ impl/jcr20/
Date Tue, 26 Aug 2014 00:27:55 GMT
Author: tripod
Date: Tue Aug 26 00:27:55 2014
New Revision: 1620490

URL: http://svn.apache.org/r1620490
Log:
JCRVLT-56 Adjust filevault to reflect changes made with JCR-3802 (System User Feature)

Added:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JackrabbitServiceProvider.java
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakServiceProvider.java
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakUserManagement.java
Removed:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JcrServiceProvider.java
Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/DefaultNodeTypes.java
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/JcrVersion.java
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProviderFactory.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/DefaultNodeTypes.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/DefaultNodeTypes.java?rev=1620490&r1=1620489&r2=1620490&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/DefaultNodeTypes.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/DefaultNodeTypes.java
Tue Aug 26 00:27:55 2014
@@ -102,6 +102,25 @@ public final class DefaultNodeTypes {
         JACKRABBIT_2X_NODE_TYPES.add("rep:RetentionManageable");
     }
 
+    public static final Set<String> OAK_1X_NODE_TYPES = new HashSet<String>(JACKRABBIT_2X_NODE_TYPES);
+    static {
+        OAK_1X_NODE_TYPES.add("rep:SystemUser");
+        OAK_1X_NODE_TYPES.add("rep:MemberReferences");
+        OAK_1X_NODE_TYPES.add("rep:MemberReferencesList");
+        OAK_1X_NODE_TYPES.add("rep:Privileges");
+        OAK_1X_NODE_TYPES.add("rep:Privilege");
+        OAK_1X_NODE_TYPES.add("rep:Token");
+        OAK_1X_NODE_TYPES.add("rep:MergeConflict");
+        OAK_1X_NODE_TYPES.add("rep:PermissionStore");
+        OAK_1X_NODE_TYPES.add("rep:Permissions");
+        OAK_1X_NODE_TYPES.add("rep:Restrictions");
+        OAK_1X_NODE_TYPES.add("rep:NodeType");
+        OAK_1X_NODE_TYPES.add("rep:VersionablePaths");
+        OAK_1X_NODE_TYPES.add("rep:Unstructured");
+        OAK_1X_NODE_TYPES.add("oak:QueryIndexDefinition");
+        OAK_1X_NODE_TYPES.add("oak:Unstructured");
+    }
+
     public static final Set<String> CRX_1X_NODE_TYPES = new HashSet<String>(JACKRABBIT_1X_NODE_TYPES);
 
     static {
@@ -158,4 +177,10 @@ public final class DefaultNodeTypes {
         CRX_2X_NODE_TYPES.add("crx:PathRequestMapping");
     }
 
+    public static final Set<String> CRX_3X_NODE_TYPES = new HashSet<String>(CRX_2X_NODE_TYPES);
+    static {
+        CRX_3X_NODE_TYPES.addAll(OAK_1X_NODE_TYPES);
+    }
+
+
 }
\ No newline at end of file

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/JcrVersion.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/JcrVersion.java?rev=1620490&r1=1620489&r2=1620490&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/JcrVersion.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/JcrVersion.java
Tue Aug 26 00:27:55 2014
@@ -28,7 +28,7 @@ public enum JcrVersion {
     V10,
 
     /**
-     * Version 2.0 (JCR283)
+     * Version 2.0 (JSR283)
      */
     V20
 }

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProviderFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProviderFactory.java?rev=1620490&r1=1620489&r2=1620490&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProviderFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProviderFactory.java
Tue Aug 26 00:27:55 2014
@@ -17,18 +17,21 @@
 
 package org.apache.jackrabbit.vault.fs.spi;
 
-import org.apache.jackrabbit.vault.fs.spi.impl.jcr20.JcrServiceProvider;
+import org.apache.jackrabbit.vault.fs.spi.impl.jcr20.OakServiceProvider;
 
 /**
  * <code>StaticServiceProvider</code>...
  */
 public class ServiceProviderFactory {
 
+
     private static ServiceProvider instance;
 
     public static ServiceProvider getProvider() {
+        // FIXME: provide means to retrieve service provider impl match the desired
+        // repository version (currently jr2.x or oak1.x)
         if (instance == null) {
-            instance = new JcrServiceProvider();
+            instance = new OakServiceProvider();
         }
         return instance;
     }

Added: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JackrabbitServiceProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JackrabbitServiceProvider.java?rev=1620490&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JackrabbitServiceProvider.java
(added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/JackrabbitServiceProvider.java
Tue Aug 26 00:27:55 2014
@@ -0,0 +1,105 @@
+/*
+ * 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.vault.fs.spi.impl.jcr20;
+
+import java.io.Writer;
+import java.util.Set;
+
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.vault.fs.spi.ACLManagement;
+import org.apache.jackrabbit.vault.fs.spi.CNDReader;
+import org.apache.jackrabbit.vault.fs.spi.CNDWriter;
+import org.apache.jackrabbit.vault.fs.spi.DefaultNodeTypes;
+import org.apache.jackrabbit.vault.fs.spi.JcrVersion;
+import org.apache.jackrabbit.vault.fs.spi.NodeTypeInstaller;
+import org.apache.jackrabbit.vault.fs.spi.PrivilegeInstaller;
+import org.apache.jackrabbit.vault.fs.spi.ServiceProvider;
+import org.apache.jackrabbit.vault.fs.spi.UserManagement;
+
+/**
+ * Implements a Service Provider for JCR 2.0 Repositories
+ */
+public class JackrabbitServiceProvider implements ServiceProvider {
+
+    private ACLManagement aclManagement;
+
+    private UserManagement userManagement;
+
+    /**
+     * {@inheritDoc}
+     */
+    public JcrVersion getJCRVersion() {
+        return JcrVersion.V20;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Set<String> getBuiltInNodeTypeNames() {
+        return DefaultNodeTypes.CRX_2X_NODE_TYPES;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public NodeTypeInstaller getDefaultNodeTypeInstaller(Session session) {
+        return new JcrNodeTypeInstaller(session);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PrivilegeInstaller getDefaultPrivilegeInstaller(Session session) {
+        return new JackrabbitPrivilegeInstaller(session);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public CNDReader getCNDReader() {
+        return new DefaultCNDReader();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public CNDWriter getCNDWriter(Writer out, Session s, boolean includeNS) {
+        return new DefaultCNDWriter(out, s, includeNS);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public ACLManagement getACLManagement() {
+        if (aclManagement == null) {
+            aclManagement = new JcrACLManagement();
+        }
+        return aclManagement;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public UserManagement getUserManagement() {
+        if (userManagement == null) {
+            userManagement = new JackrabbitUserManagement();
+        }
+        return userManagement;
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakServiceProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakServiceProvider.java?rev=1620490&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakServiceProvider.java
(added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakServiceProvider.java
Tue Aug 26 00:27:55 2014
@@ -0,0 +1,48 @@
+/*
+ * 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.vault.fs.spi.impl.jcr20;
+
+import java.util.Set;
+
+import org.apache.jackrabbit.vault.fs.spi.DefaultNodeTypes;
+import org.apache.jackrabbit.vault.fs.spi.UserManagement;
+
+/**
+ * Implements a Service Provider for JCR 2.0 Repositories
+ */
+public class OakServiceProvider extends JackrabbitServiceProvider {
+
+    private UserManagement userManagement;
+
+    /**
+     * {@inheritDoc}
+     */
+    public Set<String> getBuiltInNodeTypeNames() {
+        return DefaultNodeTypes.CRX_3X_NODE_TYPES;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public UserManagement getUserManagement() {
+        if (userManagement == null) {
+            userManagement = new OakUserManagement();
+        }
+        return userManagement;
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakUserManagement.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakUserManagement.java?rev=1620490&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakUserManagement.java
(added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/impl/jcr20/OakUserManagement.java
Tue Aug 26 00:27:55 2014
@@ -0,0 +1,31 @@
+/*
+ * 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.vault.fs.spi.impl.jcr20;
+
+/**
+ * <code>JackrabbitUserManagement</code>...
+ */
+public class OakUserManagement extends JackrabbitUserManagement {
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isAuthorizableNodeType(String ntName) {
+        return ntName.equals("rep:Group") || ntName.equals("rep:User") || ntName.equals("rep:SystemUser");
+    }
+}
\ No newline at end of file



Mime
View raw message