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;
28 import org.collectionspace.services.common.ResourceMap;
32 * ServiceContextFactory creates a service context
35 public interface ServiceContextFactory<IT, OT> {
38 * Creates a new ServiceContext object.
40 * @param serviceName the service name
41 * @param input the input
43 * @return the service context
45 * @throws Exception the exception
47 public ServiceContext<IT, OT> createServiceContext(String serviceName, IT input) throws Exception;
50 * Creates a new ServiceContext object.
52 * @param serviceName the service name
54 * @return the service context< i t, o t>
56 * @throws Exception the exception
58 public ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception;
61 * Creates a new ServiceContext object.
63 * @param serviceName the service name
64 * @param input the input
65 * @param queryParams the query params
67 * @return the service context
69 * @throws Exception the exception
71 public ServiceContext<IT, OT> createServiceContext(
74 ResourceMap resourceMap,
75 MultivaluedMap<String, String> queryParams) throws Exception;
78 * Creates a new ServiceContext object.
80 * @param serviceName the service name
81 * @param input the input
82 * @param queryParams the query params
83 * @param documentType the document type
84 * @param entityName the entity name
86 * @return the service context
88 * @throws Exception the exception
90 public ServiceContext<IT, OT> createServiceContext(
93 ResourceMap resourceMap,
94 MultivaluedMap<String, String> queryParams,
96 String entityName) throws Exception;