]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
cf7c4ce99e817cfa94901f3e96ec689f11ee1f43
[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
29 import org.collectionspace.services.client.PoxPayloadIn;
30 import org.collectionspace.services.client.PoxPayloadOut;
31 import org.dom4j.Element;
32 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
33 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
34 import org.dom4j.Document;
35
36 /**
37  * RemoteServiceContext is used to encapsulate the service context of a
38  * remotely invokable service
39  */
40 public interface MultipartServiceContext
41         extends RemoteServiceContext<PoxPayloadIn, PoxPayloadOut> {
42
43     /**
44      * Get input parts as received over the wire from service consumer
45      * @return the input
46      */
47     @Override
48     public PoxPayloadIn getInput();
49
50     /**
51      * setInput is used to set request input before starting to
52      * process input data
53      * @param input
54      */
55     @Override
56     public void setInput(PoxPayloadIn input);
57
58     /**
59      * Get output parts to send over the wire to service consumer
60      * @return the output
61      */
62     @Override
63     public PoxPayloadOut getOutput();
64
65     /**
66      * Set output parts to send over the wire to service consumer
67      * @return the output
68      */
69     @Override
70     public void setOutput(PoxPayloadOut output);
71
72     /**
73      * getInputPart returns the input part object for given label and clazz
74      * @param label
75      * @param clazz class of the object
76      * @return part
77      */
78     @Deprecated
79     public Object getInputPart(String label, Class<?> clazz) throws IOException;
80     
81     /**
82      * Gets the input part.
83      *
84      * @param label the label
85      * @return the input part
86      * @throws IOException Signals that an I/O exception has occurred.
87      */
88     public Object getInputPart(String label) throws IOException;
89
90     /**
91      * getInputPartAsString returns the input part with given label in the string form
92      * @param label
93      * @return
94      * @throws IOException
95      */
96     public String getInputPartAsString(String label) throws IOException;
97
98     /**
99      * getInputPartAsStream returns input part as stream for given label
100      * @param label
101      * @return
102      * @throws IOException
103      */
104     public InputStream getInputPartAsStream(String label) throws IOException;
105     /**
106      * addOutputPart adds given XML part with given label and content type to output
107      * @param label
108      * @param document
109      * @param contentType media type
110      */
111     public void addOutputPart(String label, Element doc, String contentType) throws Exception;
112     
113     public void setRespositoryWorkspaceName(String workspaceName);    
114 }