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