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 java.io.InputStream;
28 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
29 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
30 import org.w3c.dom.Document;
33 * RemoteServiceContext is used to encapsulate the service context of a
34 * remotely invokable service
36 public interface MultipartServiceContext
37 extends RemoteServiceContext<MultipartInput, MultipartOutput> {
40 * Get input parts as received over the wire from service consumer
44 public MultipartInput getInput();
47 * setInput is used to set request input before starting to
52 public void setInput(MultipartInput input);
55 * Get output parts to send over the wire to service consumer
59 public MultipartOutput getOutput();
62 * Set output parts to send over the wire to service consumer
66 public void setOutput(MultipartOutput output);
69 * getInputPart returns the input part object for given label and clazz
71 * @param clazz class of the object
74 public Object getInputPart(String label, Class clazz) throws IOException;
77 * getInputPartAsString returns the input part with given label in the string form
82 public String getInputPartAsString(String label) throws IOException;
85 * getInputPartAsStream returns input part as stream for given label
90 public InputStream getInputPartAsStream(String label) throws IOException;
92 * addOutputPart adds given XML part with given label and content type to output
95 * @param contentType media type
97 public void addOutputPart(String label, Document doc, String contentType) throws Exception;