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.jboss.resteasy.plugins.providers.multipart.MultipartInput;
29 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
33 * MultipartRemoteServiceContextFactory creates a service context for
34 * a service processing multipart messages
37 public class MultipartServiceContextFactory
38 implements ServiceContextFactory<MultipartInput, MultipartOutput> {
40 /** The Constant self. */
41 final private static MultipartServiceContextFactory self = new MultipartServiceContextFactory();
44 * Instantiates a new multipart service context factory.
46 private MultipartServiceContextFactory() {} // private constructor as part of the singleton pattern
51 * @return the multipart service context factory
53 public static MultipartServiceContextFactory get() {
58 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String)
61 public ServiceContext<MultipartInput, MultipartOutput> createServiceContext(String serviceName) throws Exception {
62 MultipartServiceContext ctx = new MultipartServiceContextImpl(serviceName);
67 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object)
70 public ServiceContext<MultipartInput, MultipartOutput> createServiceContext(String serviceName,
71 MultipartInput input) throws Exception {
72 MultipartServiceContext ctx = new MultipartServiceContextImpl(serviceName, input);
77 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object, javax.ws.rs.core.MultivaluedMap)
80 public ServiceContext<MultipartInput, MultipartOutput> createServiceContext(String serviceName,
82 MultivaluedMap<String, String> queryParams)
84 ServiceContext<MultipartInput, MultipartOutput> ctx = new MultipartServiceContextImpl(serviceName,
91 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object, javax.ws.rs.core.MultivaluedMap, java.lang.String, java.lang.String)
94 public ServiceContext<MultipartInput, MultipartOutput> createServiceContext(String serviceName,
96 MultivaluedMap<String, String> queryParams,
98 String entityName) throws Exception {
99 return this.createServiceContext(serviceName, input, queryParams);