org.deegree.protocol.wps.client.output
Class ComplexOutput

java.lang.Object
  extended by org.deegree.protocol.wps.client.output.ExecutionOutput
      extended by org.deegree.protocol.wps.client.output.ComplexOutput

public class ComplexOutput
extends ExecutionOutput

ExecutionOutput that encapsulates an XML or a binary value.

Version:
$Revision: 31619 $, $Date: 2011-08-23 14:56:28 +0200 (Tue, 23 Aug 2011) $
Author:
Andrei Ionita, Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
ComplexOutput(CodeType id, InputStream is, String mimeType, String encoding, String schema)
          Creates a new ComplexOutput instance.
ComplexOutput(CodeType id, StreamBufferStore store, String mimeType, String encoding, String schema)
          Creates a new ComplexOutput instance.
ComplexOutput(CodeType id, URL url, String mimeType, String encoding, String schema)
          Creates a new ComplexOutput instance.
 
Method Summary
 InputStream getAsBinaryStream()
          Returns an InputStream for accessing the complex value as a binary stream.
 XMLStreamReader getAsXMLStream()
          Returns an XMLStreamReader for accessing the complex value as an XML event stream.
 ComplexFormat getFormat()
          Returns the format of the output.
 URL getWebAccessibleURL()
          Returns the web-accessible URL for the complex data (as provided by the process).
 
Methods inherited from class org.deegree.protocol.wps.client.output.ExecutionOutput
getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexOutput

public ComplexOutput(CodeType id,
                     URL url,
                     String mimeType,
                     String encoding,
                     String schema)
Creates a new ComplexOutput instance.

Parameters:
id - output parameter identifier, must not be null
url - web-accessible URL for accessing the resource, must not be null
mimeType - mime type of the complex data, can be null (unspecified)
encoding - encoding of the complex data, can be null (unspecified)
schema - XML schema of the complex data, can be null (unspecified)

ComplexOutput

public ComplexOutput(CodeType id,
                     StreamBufferStore store,
                     String mimeType,
                     String encoding,
                     String schema)
Creates a new ComplexOutput instance.

Parameters:
id - output parameter identifier, must not be null
store - stream that holds the complex data, must not be null
mimeType - mime type of the complex data, can be null (unspecified)
encoding - encoding of the complex data, can be null (unspecified)
schema - XML schema of the complex data, can be null (unspecified)

ComplexOutput

public ComplexOutput(CodeType id,
                     InputStream is,
                     String mimeType,
                     String encoding,
                     String schema)
              throws IOException
Creates a new ComplexOutput instance.

Parameters:
id - output parameter identifier, must not be null
is - input stream to the complex data, must not be null
mimeType - mime type of the complex data, can be null (unspecified)
encoding - encoding of the complex data, can be null (unspecified)
schema - XML schema of the complex data, can be null (unspecified)
Throws:
IOException
Method Detail

getFormat

public ComplexFormat getFormat()
Returns the format of the output.

Returns:
the format of the output, never null

getWebAccessibleURL

public URL getWebAccessibleURL()
Returns the web-accessible URL for the complex data (as provided by the process).

This method is only applicable if the parameter has been requested as reference.

Returns:
the web-accessible URL, or null if the parameter has been returned in the response document or raw

getAsXMLStream

public XMLStreamReader getAsXMLStream()
                               throws XMLStreamException,
                                      IOException
Returns an XMLStreamReader for accessing the complex value as an XML event stream.

NOTE: Never use this method if the input parameter is a binary value -- use getAsBinaryStream() instead.

Returns:
an XMLStreamReader instance, positioned after the START_DOCUMENT element
Throws:
IOException - if accessing the value fails
XMLStreamException

getAsBinaryStream

public InputStream getAsBinaryStream()
                              throws IOException
Returns an InputStream for accessing the complex value as a binary stream.

NOTE: Don't use this method if the input parameter is encoded in XML -- use getAsXMLStream() instead. Otherwise erroneous behaviour has to be expected (e.g. if the input value is given embedded in the execute request document).

The returned stream will point at the first START_ELEMENT event of the data.

Returns:
the input value as an XML event stream, current event is START_ELEMENT (the root element of the data object)
Throws:
IOException - if accessing the value fails


Copyright © 2011. All Rights Reserved.