You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2009/04/29 17:02:36 UTC

svn commit: r769795 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/

Author: reschke
Date: Wed Apr 29 15:02:35 2009
New Revision: 769795

URL: http://svn.apache.org/viewvc?rev=769795&view=rev
Log:
JCR-2062: add o.a.j.api.jsr283.Repository extension interface, and add method stubs in the three jackrabbit-core implementations  

Added:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java   (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepository.java

Added: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java?rev=769795&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java (added)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java Wed Apr 29 15:02:35 2009
@@ -0,0 +1,83 @@
+/*
+ * 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.api.jsr283;
+
+import javax.jcr.Value;
+
+/**
+ * This interface holds extensions made in JCR 2.0 while work
+ * is in progress implementing JCR 2.0.
+ *
+ * @since JCR 2.0
+ */
+public interface Repository extends javax.jcr.Repository {
+    
+    /**
+     * Returns <code>true</code> if <code>key</code> is a standard descriptor
+     * defined by the string constants in this interface and <code>false</code>
+     * if it is either a valid implementation-specific key or not a valid key.
+     *
+     * @param key a descriptor key.
+     *
+     * @return whether <code>key</code> is a standard descriptor.
+     *
+     * @since JCR 2.0
+     */
+    public boolean isStandardDescriptor(String key);
+
+    /**
+     * Returns <code>true</code> if <code>key</code> is a valid single-value
+     * descriptor; otherwise returns <code>false</code>.
+     *
+     * @param key a descriptor key.
+     *
+     * @return whether the specified desdfriptor is multi-valued.
+     *
+     * @since JCR 2.0
+     */
+    public boolean isSingleValueDescriptor(String key);
+
+    /**
+     * The value of a single-value descriptor is found by passing the key for
+     * that descriptor to this method. If <code>key</code> is the key of a
+     * multi-value descriptor or not a valid key this method returns
+     * <code>null</code>.
+     *
+     * @param key a descriptor key.
+     *
+     * @return The value of the indicated descriptor
+     *
+     * @since JCR 2.0
+     */
+    public Value getDescriptorValue(String key);
+
+    /**
+     * The value array of a multi-value descriptor is found by passing the key
+     * for that descriptor to this method. If <code>key</code> is the key of a
+     * single-value descriptor then this method returns that value as an array
+     * of size one. If <code>key</code> is not a valid key this method returns
+     * <code>null</code>.
+     *
+     * @param key a descriptor key.
+     *
+     * @return the value array for the indicated descriptor
+     *
+     * @since JCR 2.0
+     */
+    public Value[] getDescriptorValues(String key);
+
+}

Propchange: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Repository.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=769795&r1=769794&r2=769795&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java Wed Apr 29 15:02:35 2009
@@ -84,6 +84,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.jcr.Value;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.EventIterator;
 import javax.jcr.observation.EventListener;
@@ -110,7 +111,7 @@
  * A <code>RepositoryImpl</code> ...
  */
 public class RepositoryImpl extends AbstractRepository
-        implements JackrabbitRepository, SessionListener, EventListener, WorkspaceListener {
+        implements org.apache.jackrabbit.api.jsr283.Repository, JackrabbitRepository, SessionListener, EventListener, WorkspaceListener {
 
     private static Logger log = LoggerFactory.getLogger(RepositoryImpl.class);
 
@@ -1418,6 +1419,23 @@
         return keys;
     }
 
+    public Value getDescriptorValue(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isStandardDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+
     //------------------------------------------------------< SessionListener >
     /**
      * {@inheritDoc}

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java?rev=769795&r1=769794&r2=769795&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java Wed Apr 29 15:02:35 2009
@@ -31,6 +31,7 @@
 import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.Value;
 
 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.commons.io.IOUtils;
@@ -48,7 +49,7 @@
  * shut down the repository.
  */
 public class TransientRepository
-        implements JackrabbitRepository, SessionListener {
+        implements org.apache.jackrabbit.api.jsr283.Repository, JackrabbitRepository, SessionListener {
 
     /**
      * The logger instance used to log the repository and session lifecycles.
@@ -378,6 +379,23 @@
         return login(null, null);
     }
 
+
+    public Value getDescriptorValue(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isStandardDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
     //--------------------------------------------------<JackrabbitRepository>
 
     /**
@@ -423,5 +441,4 @@
      */
     public void loggingOut(SessionImpl session) {
     }
-
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepository.java?rev=769795&r1=769794&r2=769795&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepository.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/BindableRepository.java Wed Apr 29 15:02:35 2009
@@ -30,6 +30,7 @@
 import javax.jcr.NoSuchWorkspaceException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.Value;
 import javax.naming.Reference;
 import javax.naming.Referenceable;
 
@@ -58,7 +59,7 @@
  * needed.
  */
 public class BindableRepository extends AbstractRepository
-        implements JackrabbitRepository, Referenceable, Serializable {
+        implements org.apache.jackrabbit.api.jsr283.Repository, JackrabbitRepository, Referenceable, Serializable {
 
     /**
      * The serialization UID of this class.
@@ -177,6 +178,22 @@
         return repository.getDescriptorKeys();
     }
 
+    public Value getDescriptorValue(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
+    public boolean isStandardDescriptor(String key) {
+        throw new RuntimeException("not implemented yet - see JCR-2062");
+    }
+
     //--------------------------------------------------------< Referenceable >
 
     /**
@@ -229,5 +246,4 @@
             // ignore. exception is thrown when hook itself calls shutdown
         }
     }
-
 }