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