2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
24 package org.collectionspace.services.common.context;
26 import javax.ws.rs.core.MultivaluedMap;
27 import javax.ws.rs.core.UriInfo;
29 import org.collectionspace.services.common.ResourceMap;
33 * ServiceContextFactory creates a service context
36 public interface ServiceContextFactory<IT, OT> {
39 * Creates a new ServiceContext object.
41 * @param serviceName the service name
42 * @param input the input
44 * @return the service context
46 * @throws Exception the exception
48 public ServiceContext<IT, OT> createServiceContext(String serviceName, IT input) throws Exception;
51 * Creates a new ServiceContext object.
53 * @param serviceName the service name
55 * @return the service context< i t, o t>
57 * @throws Exception the exception
59 public ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception;
62 * Creates a new ServiceContext object.
64 * @param serviceName the service name
65 * @param input the input
66 * @param queryParams the query params
68 * @return the service context
70 * @throws Exception the exception
72 public ServiceContext<IT, OT> createServiceContext(
75 ResourceMap resourceMap,
76 UriInfo uriInfo) throws Exception;
79 * Creates a new ServiceContext object.
81 * @param serviceName the service name
82 * @param input the input
83 * @param queryParams the query params
84 * @param documentType the document type
85 * @param entityName the entity name
87 * @return the service context
89 * @throws Exception the exception
91 public ServiceContext<IT, OT> createServiceContext(
94 ResourceMap resourceMap,
97 String entityName) throws Exception;