]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-60 introduced DocumentHandlerFactory interface that is implemented by all...
authorSanjay Dalal <sanjay.dalal@berkeley.edu>
Fri, 2 Oct 2009 17:42:12 +0000 (17:42 +0000)
committerSanjay Dalal <sanjay.dalal@berkeley.edu>
Fri, 2 Oct 2009 17:42:12 +0000 (17:42 +0000)
tests: mvn test passes at trunk/services level

M    services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java
M    services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java
A    services/common/src/main/java/org/collectionspace/services/common/repository/DocumentHandlerFactory.java
D    services/common/src/main/java/org/collectionspace/services/common/CollectionSpaceHandlerFactory.java
M    services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java
M    services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java

services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java
services/common/src/main/java/org/collectionspace/services/common/repository/DocumentHandlerFactory.java [moved from services/common/src/main/java/org/collectionspace/services/common/CollectionSpaceHandlerFactory.java with 67% similarity]
services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java

index 1638373367330d845448ff9607f00b87e019920a..b1522e1e6daf51214611dbdfdc9a77dd43083803 100644 (file)
@@ -25,6 +25,7 @@ package org.collectionspace.services.acquisition.nuxeo;
 
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.repository.DocumentHandler;
+import org.collectionspace.services.common.repository.DocumentHandlerFactory;
 
 /**
  * AcquisitionHandlerFactory creates handlers for acquisition based
@@ -33,7 +34,7 @@ import org.collectionspace.services.common.repository.DocumentHandler;
  * $LastChangedRevision: $
  * $LastChangedDate: $
  */
-public class AcquisitionHandlerFactory {
+public class AcquisitionHandlerFactory  implements DocumentHandlerFactory {
 
     private static final AcquisitionHandlerFactory self = new AcquisitionHandlerFactory();
 
@@ -44,6 +45,7 @@ public class AcquisitionHandlerFactory {
         return self;
     }
 
+    @Override
     public DocumentHandler getHandler(String clientType) {
         if(ClientType.JAVA.toString().equals(clientType)){
             return new AcquisitionDocumentModelHandler();
index a7de6e827191087d13904c1c2d5fc32bda025e4b..df91d5468adb5e97a13fcc599c9eed3741238cf8 100644 (file)
@@ -25,6 +25,7 @@ package org.collectionspace.services.collectionobject.nuxeo;
 
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.repository.DocumentHandler;
+import org.collectionspace.services.common.repository.DocumentHandlerFactory;
 
 /**
  * CollectionObjectHandlerFactory creates handlers for collectionobject based
@@ -33,7 +34,7 @@ import org.collectionspace.services.common.repository.DocumentHandler;
  * $LastChangedRevision: $
  * $LastChangedDate: $
  */
-public class CollectionObjectHandlerFactory {
+public class CollectionObjectHandlerFactory implements DocumentHandlerFactory {
 
     private static final CollectionObjectHandlerFactory self = new CollectionObjectHandlerFactory();
 
@@ -44,6 +45,7 @@ public class CollectionObjectHandlerFactory {
         return self;
     }
 
+    @Override
     public DocumentHandler getHandler(String clientType) {
         if(ClientType.JAVA.toString().equals(clientType)){
             return new CollectionObjectDocumentModelHandler();
similarity index 67%
rename from services/common/src/main/java/org/collectionspace/services/common/CollectionSpaceHandlerFactory.java
rename to services/common/src/main/java/org/collectionspace/services/common/repository/DocumentHandlerFactory.java
index b3e310b0e364dc67672f13c759b39000090b82f2..5d3fd2611d146262b5fc112402b5e422fe918521 100644 (file)
@@ -1,37 +1,38 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.common;\r
-\r
-import org.collectionspace.services.common.repository.DocumentHandler;\r
-\r
-public interface CollectionSpaceHandlerFactory {\r
-    /**\r
-     * getHandler gets or creates a document handler per given client type\r
-     * @param clientType (java|rest)\r
-     * @return\r
-     * @throws IllegalArgumentException\r
-     */\r
-    public DocumentHandler getHandler(String clientType) throws IllegalArgumentException;\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.common.repository;
+
+/**
+ *
+ * DocumentHandlerFactory creates document handler
+ *
+ */
+public interface DocumentHandlerFactory {
+
+    /**
+     * getHandler returns a document handler. The factory may create a new
+     * stateful handler or return an existing stateless handler.
+     */
+    public DocumentHandler getHandler(String clientType);
+}
index 077b226a96dbbb43142565c40b141283e480f428..a80dad8de17c2dfa227e8a47d87d7ac1a2af834f 100644 (file)
@@ -25,6 +25,7 @@ package org.collectionspace.services.intake.nuxeo;
 
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.repository.DocumentHandler;
+import org.collectionspace.services.common.repository.DocumentHandlerFactory;
 
 /**
  * IntakeHandlerFactory creates handlers for collectionobject based
@@ -33,7 +34,7 @@ import org.collectionspace.services.common.repository.DocumentHandler;
  * $LastChangedRevision: $
  * $LastChangedDate: $
  */
-public class IntakeHandlerFactory {
+public class IntakeHandlerFactory  implements DocumentHandlerFactory {
 
     private static final IntakeHandlerFactory self = new IntakeHandlerFactory();
 
@@ -44,6 +45,7 @@ public class IntakeHandlerFactory {
         return self;
     }
 
+    @Override
     public DocumentHandler getHandler(String clientType) {
         if(ClientType.JAVA.toString().equals(clientType)){
             return new IntakeDocumentModelHandler();
index 53ac92ff3696ab2427e97bc492bb9d549a6181fb..557fbcf23bab27cc5ac8ffe713832da1c676b4fa 100644 (file)
@@ -25,7 +25,7 @@ package org.collectionspace.services.relation.nuxeo;
 
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.repository.DocumentHandler;
-import org.collectionspace.services.common.CollectionSpaceHandlerFactory;
+import org.collectionspace.services.common.repository.DocumentHandlerFactory;
 
 /**
  * CollectionObjectHandlerFactory creates handlers for collectionobject based
@@ -34,7 +34,7 @@ import org.collectionspace.services.common.CollectionSpaceHandlerFactory;
  * $LastChangedRevision: $
  * $LastChangedDate: $
  */
-public class RelationHandlerFactory implements CollectionSpaceHandlerFactory {
+public class RelationHandlerFactory  implements DocumentHandlerFactory {
 
     private static final RelationHandlerFactory self = new RelationHandlerFactory();