]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
e17a5abdcc9e1ce197ef491981071d2d0151a48e
[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 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;
30
31 /**
32  * RemoteServiceContext is used to encapsulate the service context of a
33  * remotely invokable service
34  */
35 public interface MultipartServiceContext
36         extends RemoteServiceContext<MultipartInput, MultipartOutput> {
37
38     /**
39      * Get input parts as received over the wire from service consumer
40      * @return the input
41      */
42     @Override
43     public MultipartInput getInput();
44
45     /**
46      * setInput is used to set request input before starting to
47      * process input data
48      * @param input
49      */
50     @Override
51     public void setInput(MultipartInput input);
52
53     /**
54      * Get output parts to send over the wire to service consumer
55      * @return the output
56      */
57     @Override
58     public MultipartOutput getOutput();
59
60     /**
61      * Set output parts to send over the wire to service consumer
62      * @return the output
63      */
64     @Override
65     public void setOutput(MultipartOutput output);
66
67     /**
68      * getInputPart returns part for given label from input
69      * @param label
70      * @param clazz class of the object
71      * @return part
72      */
73     public Object getInputPart(String label, Class clazz) throws IOException;
74
75     /**
76      * addOutputPart adds given XML part with given label and content type to output
77      * @param label
78      * @param document
79      * @param contentType media type
80      */
81     public void addOutputPart(String label, Document doc, String contentType) throws Exception;
82 }