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;
30 * ServiceContextFactory creates a service context
33 public interface ServiceContextFactory<IT, OT> {
36 * Creates a new ServiceContext object.
38 * @param serviceName the service name
39 * @param input the input
41 * @return the service context
43 * @throws Exception the exception
45 public ServiceContext<IT, OT> createServiceContext(String serviceName, IT input) throws Exception;
48 * Creates a new ServiceContext object.
50 * @param serviceName the service name
52 * @return the service context< i t, o t>
54 * @throws Exception the exception
56 public ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception;
59 * Creates a new ServiceContext object.
61 * @param serviceName the service name
62 * @param input the input
63 * @param queryParams the query params
65 * @return the service context
67 * @throws Exception the exception
69 public ServiceContext<IT, OT> createServiceContext(String serviceName,
71 MultivaluedMap<String, String> queryParams) throws Exception;
74 * Creates a new ServiceContext object.
76 * @param serviceName the service name
77 * @param input the input
78 * @param queryParams the query params
79 * @param documentType the document type
80 * @param entityName the entity name
82 * @return the service context
84 * @throws Exception the exception
86 public ServiceContext<IT, OT> createServiceContext(
89 MultivaluedMap<String, String> queryParams,
91 String entityName) throws Exception;