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
* $LastChangedRevision: $
* $LastChangedDate: $
*/
-public class AcquisitionHandlerFactory {
+public class AcquisitionHandlerFactory implements DocumentHandlerFactory {
private static final AcquisitionHandlerFactory self = new AcquisitionHandlerFactory();
return self;
}
+ @Override
public DocumentHandler getHandler(String clientType) {
if(ClientType.JAVA.toString().equals(clientType)){
return new AcquisitionDocumentModelHandler();
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
* $LastChangedRevision: $
* $LastChangedDate: $
*/
-public class CollectionObjectHandlerFactory {
+public class CollectionObjectHandlerFactory implements DocumentHandlerFactory {
private static final CollectionObjectHandlerFactory self = new CollectionObjectHandlerFactory();
return self;
}
+ @Override
public DocumentHandler getHandler(String clientType) {
if(ClientType.JAVA.toString().equals(clientType)){
return new CollectionObjectDocumentModelHandler();
-/**\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);
+}
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
* $LastChangedRevision: $
* $LastChangedDate: $
*/
-public class IntakeHandlerFactory {
+public class IntakeHandlerFactory implements DocumentHandlerFactory {
private static final IntakeHandlerFactory self = new IntakeHandlerFactory();
return self;
}
+ @Override
public DocumentHandler getHandler(String clientType) {
if(ClientType.JAVA.toString().equals(clientType)){
return new IntakeDocumentModelHandler();