]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
bcc5e79a8ad3da81106ddfcc89100a681821404e
[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 import javax.ws.rs.core.UriInfo;
28
29 import org.collectionspace.services.common.ResourceMap;
30
31 /**
32  *
33  * ServiceContextFactory creates a service context
34  *
35  */
36 public interface ServiceContextFactory<IT, OT> {
37
38     /**
39      * Creates a new ServiceContext object.
40      * 
41      * @param serviceName the service name
42      * @param input the input
43      * 
44      * @return the service context
45      * 
46      * @throws Exception the exception
47      */
48     public ServiceContext<IT, OT> createServiceContext(String serviceName, IT input) throws Exception;
49     
50     /**
51      * Creates a new ServiceContext object.
52      * 
53      * @param serviceName the service name
54      * 
55      * @return the service context< i t, o t>
56      * 
57      * @throws Exception the exception
58      */
59     public ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception;
60
61     /**
62      * Creates a new ServiceContext object.
63      * 
64      * @param serviceName the service name
65      * @param input the input
66      * @param queryParams the query params
67      * 
68      * @return the service context
69      * 
70      * @throws Exception the exception
71      */
72     public ServiceContext<IT, OT> createServiceContext(
73                 String serviceName,
74                 IT input,
75                 ResourceMap resourceMap,                
76                 UriInfo uriInfo) throws Exception;    
77         
78     /**
79      * Creates a new ServiceContext object.
80      * 
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
86      * 
87      * @return the service context
88      * 
89      * @throws Exception the exception
90      */
91     public ServiceContext<IT, OT> createServiceContext(
92                 String serviceName,
93                 IT input, 
94                 ResourceMap resourceMap,
95                 UriInfo uriInfo,
96                 String documentType,
97                 String entityName) throws Exception;
98 }