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;
27 import javax.ws.rs.core.UriInfo;
29 import org.collectionspace.services.client.PoxPayloadIn;
30 import org.collectionspace.services.client.PoxPayloadOut;
31 import org.collectionspace.services.common.ResourceMap;
35 * MultipartRemoteServiceContextFactory creates a service context for
36 * a service processing multipart messages
39 public class MultipartServiceContextFactory
40 implements ServiceContextFactory<PoxPayloadIn, PoxPayloadOut> {
42 /** The Constant self. */
43 final private static MultipartServiceContextFactory self = new MultipartServiceContextFactory();
46 * Instantiates a new multipart service context factory.
48 private MultipartServiceContextFactory() {} // private constructor as part of the singleton pattern
53 * @return the multipart service context factory
55 public static MultipartServiceContextFactory get() {
60 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String)
63 public ServiceContext<PoxPayloadIn, PoxPayloadOut> createServiceContext(String serviceName) throws Exception {
64 MultipartServiceContext ctx = new MultipartServiceContextImpl(serviceName);
69 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object)
72 public ServiceContext<PoxPayloadIn, PoxPayloadOut> createServiceContext(String serviceName,
73 PoxPayloadIn input) throws Exception {
74 MultipartServiceContext ctx = new MultipartServiceContextImpl(serviceName, input);
79 * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object, javax.ws.rs.core.MultivaluedMap)
82 public ServiceContext<PoxPayloadIn, PoxPayloadOut> createServiceContext(
85 ResourceMap resourceMap,
88 ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = new MultipartServiceContextImpl(serviceName,
96 * @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)
99 public ServiceContext<PoxPayloadIn, PoxPayloadOut> createServiceContext(
102 ResourceMap resourceMap,
105 String entityName) throws Exception {
106 return this.createServiceContext(serviceName, input, resourceMap, uriInfo);