chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r915230 - in /incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory: pom.xml src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java
Date Tue, 23 Feb 2010 07:54:16 GMT
Author: jens
Date: Tue Feb 23 07:54:15 2010
New Revision: 915230

URL: http://svn.apache.org/viewvc?rev=915230&view=rev
Log:
Integrate ServiceWrapper from server utils to inmemory server

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml?rev=915230&r1=915229&r2=915230&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml Tue
Feb 23 07:54:15 2010
@@ -83,6 +83,11 @@
       <version>${version}</version>
 	  <type>war</type>
     </dependency>
+    <dependency>
+      <groupId>org.opencmis</groupId>
+      <artifactId>opencmis-server-support</artifactId>
+      <version>${version}</version>
+    </dependency>
   </dependencies>
   
 </project>

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java?rev=915230&r1=915229&r2=915230&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java
Tue Feb 23 07:54:15 2010
@@ -18,8 +18,8 @@
  */
 package org.apache.opencmis.inmemory.server;
 
+import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -46,18 +46,28 @@
 import org.apache.opencmis.server.spi.CmisObjectService;
 import org.apache.opencmis.server.spi.CmisRepositoryService;
 import org.apache.opencmis.server.spi.CmisVersioningService;
+import org.apache.opencmis.server.support.DiscoveryServiceWrapper;
+import org.apache.opencmis.server.support.NavigationServiceWrapper;
+import org.apache.opencmis.server.support.ObjectServiceWrapper;
+import org.apache.opencmis.server.support.RepositoryServiceWrapper;
+import org.apache.opencmis.server.support.VersioningServiceWrapper;
 import org.apache.opencmis.util.repository.ObjectGenerator;
 
 public class ServiceFactory extends AbstractServicesFactory {
 
   private static final Log LOG = LogFactory.getLog(ServiceFactory.class.getName());
+  private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(1000);
+  private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(100);
+  private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(2);
+  private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
+
   private  StoreManager fStoreManager; // singleton root of everything
 
-  private InMemoryRepositoryService fRepositoryService;
-  private InMemoryNavigationService fNavigationService;
-  private InMemoryObjectService fObjectService;
-  private InMemoryVersioningService fVersioningService;
-  private InMemoryDiscoveryService fDiscoveryService;
+  private CmisRepositoryService fRepositoryService;
+  private CmisNavigationService fNavigationService;
+  private CmisObjectService fObjectService;
+  private CmisVersioningService fVersioningService;
+  private CmisDiscoveryService fDiscoveryService;
 
   public StoreManager getStoreManager() {
     return fStoreManager;
@@ -93,19 +103,24 @@
       }
     }
 
-//    if (repositoryId != null) {
-//      String repoInfoCreatorClassName = parameters.get(ConfigConstants.REPOSITORY_INFO_CREATOR_CLASS);
-//      fStoreManager.initRepositoryInfo(repositoryId, repoInfoCreatorClassName);    
-//    }
-    
-    // initialize services
-    fRepositoryService = new InMemoryRepositoryService(fStoreManager);
-    fNavigationService = new InMemoryNavigationService(fStoreManager);
-    fObjectService = new InMemoryObjectService(fStoreManager);
-    fVersioningService = new InMemoryVersioningService(fStoreManager, fObjectService.getObjectService());
-    // Begin temporary implementation for discover service
-    fDiscoveryService = new InMemoryDiscoveryService(fStoreManager, fRepositoryService.getRepositoryService(),
 fNavigationService.getNavigationService());
-    // End temporary implementation
+    InMemoryRepositoryService repSvc = new InMemoryRepositoryService(fStoreManager);
+    InMemoryNavigationService navSvc = new InMemoryNavigationService(fStoreManager);
+    InMemoryObjectService objSvc = new InMemoryObjectService(fStoreManager);
+    InMemoryVersioningService verSvc = new InMemoryVersioningService(fStoreManager, objSvc
+        .getObjectService());
+    InMemoryDiscoveryService disSvc = new InMemoryDiscoveryService(fStoreManager, repSvc
+        .getRepositoryService(), navSvc.fNavigationService);
+    
+    // Initialize services, use the service wrappers to provide suitable default parameters
and
+    // paging sets
+    fRepositoryService = new RepositoryServiceWrapper(repSvc,
+        DEFAULT_MAX_ITEMS_TYPES, DEFAULT_DEPTH_TYPES);
+    fNavigationService = new NavigationServiceWrapper(navSvc,
+        DEFAULT_MAX_ITEMS_OBJECTS, DEFAULT_DEPTH_OBJECTS);
+    fObjectService = new ObjectServiceWrapper(objSvc,
+        DEFAULT_MAX_ITEMS_OBJECTS);
+    fVersioningService = new VersioningServiceWrapper(verSvc);
+    fDiscoveryService = new DiscoveryServiceWrapper(disSvc, DEFAULT_MAX_ITEMS_OBJECTS);
     
     // With some special configuration settings fill the repository with some documents and
folders if is empty
     if (!allAvailableRepositories.contains(repositoryId))



Mime
View raw message