jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770603 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
Date Fri, 01 May 2009 09:55:36 GMT
Author: jukka
Date: Fri May  1 09:55:36 2009
New Revision: 770603

URL: http://svn.apache.org/viewvc?rev=770603&view=rev
Log:
JCR-2062: JSR 283: Repository Compliance

Added new Repository methods to jcr2spi

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java?rev=770603&r1=770602&r2=770603&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
Fri May  1 09:55:36 2009
@@ -26,6 +26,7 @@
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.Value;
 import javax.naming.Context;
 import javax.naming.Name;
 import javax.naming.NamingException;
@@ -39,6 +40,7 @@
 import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.XASessionInfo;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 
 /**
  * <code>RepositoryImpl</code>...
@@ -75,6 +77,29 @@
         return (String) descriptors.get(descriptorKey);
     }
 
+    public Value getDescriptorValue(String key) {
+        String value = getDescriptor(key);
+        if (value != null) {
+            // TODO: Do we have a better value factory?
+            return ValueFactoryImpl.getInstance().createValue(value);
+        } else {
+            return null;
+        }
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        Value value = getDescriptorValue(key);
+        if (value != null) {
+            return new Value[] { value };
+        } else {
+            return null;
+        }
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        return descriptors.containsKey(key);
+    }
+
     /**
      * @see Repository#login(javax.jcr.Credentials, String)
      */
@@ -207,4 +232,5 @@
             return res;
         }
     }
+
 }
\ No newline at end of file



Mime
View raw message