001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/wps/execute/ExecuteResponse.java $
002: /*---------------- FILE HEADER ------------------------------------------
003:
004: This file is part of deegree.
005: Copyright (C) 2001-2008 by:
006: EXSE, Department of Geography, University of Bonn
007: http://www.giub.uni-bonn.de/exse/
008: lat/lon GmbH
009: http://www.lat-lon.de
010:
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the GNU Lesser General Public
013: License as published by the Free Software Foundation; either
014: version 2.1 of the License, or (at your option) any later version.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: Contact:
026:
027: Andreas Poth
028: lat/lon GmbH
029: Aennchenstraße 19
030: 53177 Bonn
031: Germany
032: E-Mail: poth@lat-lon.de
033:
034: Prof. Dr. Klaus Greve
035: Department of Geography
036: University of Bonn
037: Meckenheimer Allee 166
038: 53115 Bonn
039: Germany
040: E-Mail: greve@giub.uni-bonn.de
041:
042: ---------------------------------------------------------------------------*/
043:
044: package org.deegree.ogcwebservices.wps.execute;
045:
046: import java.util.ArrayList;
047: import java.util.List;
048:
049: import org.deegree.datatypes.Code;
050:
051: /**
052: * ExecuteResponseType.java
053: *
054: * Created on 09.03.2006. 23:16:26h
055: *
056: *
057: * WPS Execute operation response. By default, this XML document is delivered to
058: * the client in response to an Execute request. If "status" is "false" in the
059: * Execute operation request, this document is normally returned when process
060: * execution has been completed. If "status" in the Execute request is "true",
061: * this response shall be returned as soon as the Execute request has been
062: * accepted for processing. In this case, the same XML document is also made
063: * available as a web-accessible resource from the URL identified in the
064: * statusLocation, and the WPS server shall repopulate it once the process has
065: * completed. It may repopulate it on an ongoing basis while the process is
066: * executing. However, the response to an Execute request will not include this
067: * element in the special case where the output is a single complex value result
068: * and the Execute request indicates that "store" is "false". Instead, the
069: * server shall return the complex result (e.g., GIF image or GML) directly,
070: * without encoding it in the ExecuteResponse. If processing fails in this
071: * special case, the normal ExecuteResponse shall be sent, with the error
072: * condition indicated. This option is provided to simplify the programming
073: * required for simple clients and for service chaining.
074: *
075: * @author <a href="mailto:christian@kiehle.org">Christian Kiehle</a>
076: * @author <a href="mailto:christian.heier@gmx.de">Christian Heier</a>
077: * @version 1.0.
078: * @since 2.0
079: */
080: public class ExecuteResponse {
081:
082: /**
083: * Identifier of the Process requested to be executed. This Process
084: * identifier shall be as listed in the ProcessOfferings section of the WPS
085: * Capabilities document.
086: */
087: protected Code identifier;
088:
089: /**
090: * Execution status of this process.
091: */
092: protected Status status;
093:
094: /**
095: * Inputs that were provided as part of the execute request. This element
096: * can be omitted as an implementation decision by the WPS server. However,
097: * it is often advisable to have the response include this information, so
098: * the client can confirm that the request was received correctly, and to
099: * provide a source of metadata if the client wishes to store the result for
100: * future reference.
101: */
102: protected ExecuteDataInputs dataInputs;
103:
104: /**
105: * Complete list of Output data types that were requested as part of the
106: * Execute request. This element can be omitted as an implementation
107: * decision by the WPS server. However, it is often advisable to have the
108: * response include this information, so the client can confirm that the
109: * request was received correctly, and to provide a source of metadata if
110: * the client wishes to store the result for future reference.
111: */
112: protected OutputDefinitions outputDefinitions;
113:
114: /**
115: * List of values of the Process output parameters. Normally there would be
116: * at least one output when the process has completed successfully. If the
117: * process has not finished executing, the implementer can choose to include
118: * whatever final results are ready at the time the Execute response is
119: * provided. If the reference locations of outputs are known in advance,
120: * these URLs may be provided before they are populated.
121: */
122: protected ProcessOutputs processOutputs;
123:
124: /**
125: * The URL referencing the location from which the ExecuteResponse can be
126: * retrieved. If "status" is "true" in the Execute request, the
127: * ExecuteResponse should also be found here as soon as the process returns
128: * the initial response to the client. It should persist at this location as
129: * long as the outputs are accessible from the server. The outputs may be
130: * stored for as long as the implementer of the server decides. If the
131: * process takes a long time, this URL can be repopulated on an ongoing
132: * basis in order to keep the client updated on progress. Before the process
133: * has succeeded, the ExecuteResponse contains information about the status
134: * of the process, including whether or not processing has started, and the
135: * percentage completed. It may also optionally contain the inputs and any
136: * ProcessStartedType interim results. When the process has succeeded, the
137: * ExecuteResponse found at this URL shall contain the output values or
138: * references to them.
139: */
140: protected String statusLocation;
141:
142: /**
143: * Version of the WPS interface specification implemented by the server.
144: */
145: protected String version;
146:
147: /**
148: * Convenience variable to simplify execute response handling.
149: */
150: boolean directResponse = false;
151:
152: /**
153: *
154: * @param dataInputs
155: * @param identifier
156: * @param outputDefinitions
157: * @param processOutputs
158: * @param status
159: * @param statusLocation
160: * @param version
161: * @param directResponse
162: */
163: public ExecuteResponse(ExecuteDataInputs dataInputs,
164: Code identifier, OutputDefinitions outputDefinitions,
165: ProcessOutputs processOutputs, Status status,
166: String statusLocation, String version,
167: boolean directResponse) {
168: this .dataInputs = dataInputs;
169: this .identifier = identifier;
170: this .outputDefinitions = outputDefinitions;
171: this .processOutputs = processOutputs;
172: this .status = status;
173: this .statusLocation = statusLocation;
174: this .version = version;
175: this .directResponse = directResponse;
176: }
177:
178: public ExecuteResponse() {
179:
180: }
181:
182: /**
183: * @return Returns the identifier.
184: */
185: public Code getIdentifier() {
186: return identifier;
187: }
188:
189: /**
190: * @return Returns the status.
191: */
192: public Status getStatus() {
193: return status;
194: }
195:
196: /**
197: * @return Returns the dataInputs.
198: */
199: public ExecuteDataInputs getDataInputs() {
200: return dataInputs;
201: }
202:
203: /**
204: * @return Returns the outputDefinitions.
205: */
206: public OutputDefinitions getOutputDefinitions() {
207: return outputDefinitions;
208: }
209:
210: /**
211: * @return Returns the processOutputs.
212: */
213: public ProcessOutputs getProcessOutputs() {
214: return processOutputs;
215: }
216:
217: /**
218: * @return Returns the statusLocation.
219: */
220: public String getStatusLocation() {
221: return statusLocation;
222: }
223:
224: /**
225: * @return Returns the version.
226: */
227: public String getVersion() {
228: return version;
229: }
230:
231: /**
232: * @return Returns the directResponse.
233: */
234: public boolean isDirectResponse() {
235: return directResponse;
236: }
237:
238: /**
239: *
240: * @param dataInputs
241: */
242: public void setDataInputs(ExecuteDataInputs dataInputs) {
243: this .dataInputs = dataInputs;
244: }
245:
246: /**
247: *
248: * @param directResponse
249: */
250: public void setDirectResponse(boolean directResponse) {
251: this .directResponse = directResponse;
252: }
253:
254: public void setIdentifier(Code identifier) {
255: this .identifier = identifier;
256: }
257:
258: public void setOutputDefinitions(OutputDefinitions outputDefinitions) {
259: this .outputDefinitions = outputDefinitions;
260: }
261:
262: public void setProcessOutputs(ProcessOutputs processOutputs) {
263: this .processOutputs = processOutputs;
264: }
265:
266: public void setStatus(Status status) {
267: this .status = status;
268: }
269:
270: public void setStatusLocation(String statusLocation) {
271: this .statusLocation = statusLocation;
272: }
273:
274: public void setVersion(String version) {
275: this .version = version;
276: }
277:
278: public static class ProcessOutputs {
279:
280: private List<IOValue> outputs;
281:
282: /**
283: * @return Returns the output.
284: */
285: public List<IOValue> getOutputs() {
286: if (outputs == null) {
287: outputs = new ArrayList<IOValue>();
288: }
289: return this .outputs;
290: }
291:
292: /**
293: *
294: * @param outputs
295: */
296: public void setOutputs(List<IOValue> outputs) {
297: this.outputs = outputs;
298: }
299:
300: }
301:
302: }
|