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 java.io.IOException;
27 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
28 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
29 import org.w3c.dom.Document;
32 * RemoteServiceContext is used to encapsulate the service context of a
33 * remotely invokable service
35 public interface MultipartServiceContext
36 extends RemoteServiceContext<MultipartInput, MultipartOutput> {
39 * Get input parts as received over the wire from service consumer
43 public MultipartInput getInput();
46 * setInput is used to set request input before starting to
51 public void setInput(MultipartInput input);
54 * Get output parts to send over the wire to service consumer
58 public MultipartOutput getOutput();
61 * Set output parts to send over the wire to service consumer
65 public void setOutput(MultipartOutput output);
68 * getInputPart returns part for given label from input
70 * @param clazz class of the object
73 public Object getInputPart(String label, Class clazz) throws IOException;
76 * addOutputPart adds given XML part with given label and content type to output
79 * @param contentType media type
81 public void addOutputPart(String label, Document doc, String contentType) throws Exception;