]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
49b78493acc1e68909da04efa851787447bd08b2
[tmp/jakarta-migration.git] /
1 /**
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:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
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.
23  */
24 package org.collectionspace.services.common.context;
25
26 import javax.ws.rs.core.MultivaluedMap;
27
28 /**
29  *
30  * ServiceContextFactory creates a service context
31  *
32  */
33 public interface ServiceContextFactory<IT, OT> {
34
35     /**
36      * Creates a new ServiceContext object.
37      * 
38      * @param serviceName the service name
39      * @param input the input
40      * 
41      * @return the service context
42      * 
43      * @throws Exception the exception
44      */
45     public ServiceContext<IT, OT> createServiceContext(String serviceName, IT input) throws Exception;
46     
47     /**
48      * Creates a new ServiceContext object.
49      * 
50      * @param serviceName the service name
51      * 
52      * @return the service context< i t, o t>
53      * 
54      * @throws Exception the exception
55      */
56     public ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception;
57
58     /**
59      * Creates a new ServiceContext object.
60      * 
61      * @param serviceName the service name
62      * @param input the input
63      * @param queryParams the query params
64      * 
65      * @return the service context
66      * 
67      * @throws Exception the exception
68      */
69     public ServiceContext<IT, OT> createServiceContext(String serviceName,
70                 IT input,
71                 MultivaluedMap<String, String> queryParams) throws Exception;    
72         
73     /**
74      * Creates a new ServiceContext object.
75      * 
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
81      * 
82      * @return the service context
83      * 
84      * @throws Exception the exception
85      */
86     public ServiceContext<IT, OT> createServiceContext(
87                 String serviceName,
88                 IT input, 
89                 MultivaluedMap<String, String> queryParams,
90                 String documentType,
91                 String entityName) throws Exception;
92 }