jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r742923 - in /jackrabbit/sandbox/spi/client: ./ src/main/java/org/apache/jackrabbit/client/ src/main/java/org/apache/jackrabbit/client/spi2davex/ src/test/java/org/apache/jackrabbit/client/ src/test/resources/
Date Tue, 10 Feb 2009 10:04:52 GMT
Author: angela
Date: Tue Feb 10 10:04:39 2009
New Revision: 742923

URL: http://svn.apache.org/viewvc?rev=742923&view=rev
Log:
- JCR-1958: Enhanced JCR remoting (work in progress)

> extend client config
> add simple connection test

Added:
    jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/
    jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
  (with props)
    jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
  (with props)
Modified:
    jackrabbit/sandbox/spi/client/pom.xml
    jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/RepositoryFactoryImpl.java
    jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/JCR2SPIRepositoryStub.java
    jackrabbit/sandbox/spi/client/src/test/resources/repositoryStubImpl.properties

Modified: jackrabbit/sandbox/spi/client/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/pom.xml?rev=742923&r1=742922&r2=742923&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/client/pom.xml (original)
+++ jackrabbit/sandbox/spi/client/pom.xml Tue Feb 10 10:04:39 2009
@@ -80,6 +80,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-spi-spi2davex</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-spi2jcr</artifactId>
     </dependency>
     <dependency>

Modified: jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/RepositoryFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/RepositoryFactoryImpl.java?rev=742923&r1=742922&r2=742923&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/RepositoryFactoryImpl.java
(original)
+++ jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/RepositoryFactoryImpl.java
Tue Feb 10 10:04:39 2009
@@ -39,6 +39,7 @@
 
     public static final String REPOSITORY_SPI2RMI_URL = "org.apache.jackrabbit.repository.spi2rmi.url";
     public static final String REPOSITORY_SPI2DAV_URL = "org.apache.jackrabbit.repository.spi2dav.url";
+    public static final String REPOSITORY_SPI2DAVEX_URL = "org.apache.jackrabbit.repository.spi2davex.url";
 
     public static final String REPOSITORY_SPILOG_WRITER = "org.apache.jackrabbit.repository.spilog.writer";
 
@@ -88,6 +89,9 @@
             } else if (parameters.containsKey(REPOSITORY_SPI2DAV_URL)) {
                 String url = parameters.get(REPOSITORY_SPI2DAV_URL).toString();
                 config = new org.apache.jackrabbit.client.spi2dav.RepositoryConfigImpl(url,
cb, cacheSize);
+            }  else if (parameters.containsKey(REPOSITORY_SPI2DAVEX_URL)) {
+                String url = parameters.get(REPOSITORY_SPI2DAVEX_URL).toString();
+                config = new org.apache.jackrabbit.client.spi2davex.RepositoryConfigImpl(url,
cb, cacheSize);
             }
         }
 

Added: jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java?rev=742923&view=auto
==============================================================================
--- jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
(added)
+++ jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
Tue Feb 10 10:04:39 2009
@@ -0,0 +1,59 @@
+/*
+ * 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.client.spi2davex;
+
+import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
+import org.apache.jackrabbit.spi.RepositoryService;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.spi2davex.RepositoryServiceImpl;
+import org.apache.jackrabbit.spi.spi2davex.BatchReadConfig;
+import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
+import org.apache.jackrabbit.client.AbstractRepositoryConfig;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.NamespaceException;
+
+/**
+ * <code>RepositoryFactoryImpl</code>...
+ */
+public class RepositoryConfigImpl extends AbstractRepositoryConfig {
+
+    private final RepositoryService service;
+
+    public RepositoryConfigImpl(String uri) throws RepositoryException {
+        super();
+        service = createService(uri);
+    }
+
+    public RepositoryConfigImpl(String uri, CacheBehaviour cacheBehaviour, int itemCacheSize)
throws RepositoryException {
+        super(cacheBehaviour, itemCacheSize);
+        service = createService(uri);
+    }
+
+    private static RepositoryService createService(String uri) throws RepositoryException
{
+        BatchReadConfig brc = new BatchReadConfig() {
+            public int getDepth(Path path, PathResolver pathResolver) throws NamespaceException
{
+                return 4;
+            }
+        };
+        return new RepositoryServiceImpl(uri, brc);
+    }
+
+    public RepositoryService getRepositoryService() throws RepositoryException {
+        return service;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/sandbox/spi/client/src/main/java/org/apache/jackrabbit/client/spi2davex/RepositoryConfigImpl.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java?rev=742923&view=auto
==============================================================================
--- jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
(added)
+++ jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
Tue Feb 10 10:04:39 2009
@@ -0,0 +1,41 @@
+/*
+ * 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.client;
+
+import junit.framework.TestCase;
+import org.apache.jackrabbit.test.RepositoryHelper;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Repository;
+import javax.jcr.Session;
+
+/**
+ * <code>ClientTest</code>...
+ */
+public class ConnectionTest extends TestCase {
+
+    public static RepositoryHelper helper = new RepositoryHelper();
+
+    public void testGetRepository() throws RepositoryException {
+        Repository repo = helper.getRepository();        
+    }
+
+    public void testLogin() throws RepositoryException {
+        Repository repo = helper.getRepository();   
+        Session s = repo.login();
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/ConnectionTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/JCR2SPIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/JCR2SPIRepositoryStub.java?rev=742923&r1=742922&r2=742923&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/JCR2SPIRepositoryStub.java
(original)
+++ jackrabbit/sandbox/spi/client/src/test/java/org/apache/jackrabbit/client/JCR2SPIRepositoryStub.java
Tue Feb 10 10:04:39 2009
@@ -35,7 +35,8 @@
      * Property for the repository url
      */
     public static final String PROP_REPOSITORY_URL = "org.apache.jackrabbit.jcr2spi.repository.url";
-    
+    public static final String PROP_REPOSITORY_SPI = "org.apache.jackrabbit.jcr2spi.repository.spi";
+
     static {
         PropertyConfigurator.configure(JCR2SPIRepositoryStub.class.getClassLoader().getResource("log4j.properties"));
     }
@@ -56,7 +57,14 @@
         if (repository == null) {
             try {
                 String url = environment.getProperty(PROP_REPOSITORY_URL);
-                Map params = Collections.singletonMap(RepositoryFactoryImpl.REPOSITORY_SPI2DAV_URL,
url);
+                String spi = environment.getProperty(PROP_REPOSITORY_SPI);
+
+                Map params;
+                if ("spi2davex".equals(spi)) {
+                    params = Collections.singletonMap(RepositoryFactoryImpl.REPOSITORY_SPI2DAVEX_URL,
url);
+                } else {
+                    params = Collections.singletonMap(RepositoryFactoryImpl.REPOSITORY_SPI2DAV_URL,
url);
+                }
 
                 repository = new RepositoryFactoryImpl().getRepository(params);
             } catch (Exception e) {

Modified: jackrabbit/sandbox/spi/client/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/client/src/test/resources/repositoryStubImpl.properties?rev=742923&r1=742922&r2=742923&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/client/src/test/resources/repositoryStubImpl.properties (original)
+++ jackrabbit/sandbox/spi/client/src/test/resources/repositoryStubImpl.properties Tue Feb
10 10:04:39 2009
@@ -35,8 +35,9 @@
 # Use this stub implementation for testing Jackrabbit-Core over JNDI without intermediate
SPI
 # javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.client.DefaultRepositoryStub
 
-# config for JCR2SPIRepositoryStub (SPI2DAV)
-org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:4302/jackrabbit/server/
+# config for JCR2SPIRepositoryStub (SPI2DAV, SPI2DAV_ex)
+org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:8080/jackrabbit/server/
+org.apache.jackrabbit.jcr2spi.repository.spi=spi2davex
 
 # alternative workspace used for update tests etc.
 org.apache.jackrabbit.jcr2spi.workspace2.name=test



Mime
View raw message