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