org.deegree.services.wps.output
Class ComplexOutputImpl

java.lang.Object
  extended by org.deegree.services.wps.output.ProcessletOutputImpl
      extended by org.deegree.services.wps.output.ComplexOutputImpl
All Implemented Interfaces:
ComplexOutput, ProcessletOutput

public class ComplexOutputImpl
extends ProcessletOutputImpl
implements ComplexOutput

Identifies this ProcessletOutput to be a complex data structure encoded in XML (e.g., using GML), and provides a sink for writing it.

Version:
$Revision: $, $Date: $
Author:
Markus Schneider, last edited by: $Author: schneider $

Field Summary
 
Fields inherited from class org.deegree.services.wps.output.ProcessletOutputImpl
definition
 
Constructor Summary
ComplexOutputImpl(ComplexOutputDefinition outputType, OutputStorage location, boolean isRequested, String requestedMimeType, String requestedSchema, String requestedEncoding)
          Construct a complex output, values will be written to the location and probably not stored.
ComplexOutputImpl(ComplexOutputDefinition outputType, OutputStream outputStream, boolean isRequested, String requestedMimeType, String requestedSchema, String requestedEncoding)
          Construct a complex output, values will be written to the stream and (probably) not stored.
 
Method Summary
 void close()
          Closes the stream writer and writes the end document (if it was initialized).
 OutputStream getBinaryOutputStream()
          Returns the stream to write the output.
 InputStream getInputStream()
          Returns the stream to read the value.
 String getRequestedEncoding()
          Returns the requested encoding for the complex value, it is guaranteed that the encoding is supported for this parameter (according to the process description).
 String getRequestedMimeType()
          Returns the requested mime type for the complex value, it is guaranteed that the mime type is supported for this parameter (according to the process description).
 String getRequestedSchema()
          Returns the requested XML format for the complex value (specified by a schema URL), it is guaranteed that the format is supported for this parameter (according to the process description).
 XMLStreamReader getStreamReader()
           
 String getWebURL()
           
 XMLStreamWriter getXMLStreamWriter()
          Returns a stream for for writing XML output.
 
Methods inherited from class org.deegree.services.wps.output.ProcessletOutputImpl
getDefinition, getIdentifier, getSubmittedAbstract, getSubmittedTitle, isRequested, setAbstract, setTitle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.services.wps.output.ProcessletOutput
getIdentifier, getSubmittedAbstract, getSubmittedTitle, isRequested, setAbstract, setTitle
 

Constructor Detail

ComplexOutputImpl

public ComplexOutputImpl(ComplexOutputDefinition outputType,
                         OutputStorage location,
                         boolean isRequested,
                         String requestedMimeType,
                         String requestedSchema,
                         String requestedEncoding)
                  throws FileNotFoundException,
                         XMLStreamException
Construct a complex output, values will be written to the location and probably not stored.

Parameters:
outputType -
location -
isRequested -
requestedMimeType -
requestedSchema -
requestedEncoding -
Throws:
FileNotFoundException
XMLStreamException

ComplexOutputImpl

public ComplexOutputImpl(ComplexOutputDefinition outputType,
                         OutputStream outputStream,
                         boolean isRequested,
                         String requestedMimeType,
                         String requestedSchema,
                         String requestedEncoding)
Construct a complex output, values will be written to the stream and (probably) not stored.

Parameters:
outputType -
outputStream -
isRequested -
requestedMimeType -
requestedSchema -
requestedEncoding -
Method Detail

getBinaryOutputStream

public OutputStream getBinaryOutputStream()
Returns the stream to write the output.

Specified by:
getBinaryOutputStream in interface ComplexOutput
Returns:
the stream to write the output

getXMLStreamWriter

public XMLStreamWriter getXMLStreamWriter()
                                   throws XMLStreamException
Description copied from interface: ComplexOutput
Returns a stream for for writing XML output. The stream is already initialized with a XMLStreamWriter.writeStartDocument().

Specified by:
getXMLStreamWriter in interface ComplexOutput
Returns:
a stream for writing XML output, never null
Throws:
XMLStreamException

getRequestedMimeType

public String getRequestedMimeType()
Description copied from interface: ComplexOutput
Returns the requested mime type for the complex value, it is guaranteed that the mime type is supported for this parameter (according to the process description).

Specified by:
getRequestedMimeType in interface ComplexOutput
Returns:
the requested mime type, never null (as each complex output format has a default mime type)

getRequestedSchema

public String getRequestedSchema()
Description copied from interface: ComplexOutput
Returns the requested XML format for the complex value (specified by a schema URL), it is guaranteed that the format is supported for this parameter (according to the process description).

Specified by:
getRequestedSchema in interface ComplexOutput
Returns:
the requested schema (XML format), may be null (as a complex output format may omit schema information)

getRequestedEncoding

public String getRequestedEncoding()
Description copied from interface: ComplexOutput
Returns the requested encoding for the complex value, it is guaranteed that the encoding is supported for this parameter (according to the process description).

Specified by:
getRequestedEncoding in interface ComplexOutput
Returns:
the requested encoding, may be null (as a complex output format may omit encoding information)

getStreamReader

public XMLStreamReader getStreamReader()
Returns:
a reader on the stored location, or null if storing was disabled.

close

public void close()
           throws XMLStreamException,
                  IOException
Closes the stream writer and writes the end document (if it was initialized).

Throws:
XMLStreamException
IOException

getInputStream

public InputStream getInputStream()
Returns the stream to read the value.

Returns:
the stream to read the value

getWebURL

public String getWebURL()
Returns:
if the storage location was set, this method will return the web url of the stored output file. Null otherwise.


Copyright © 2011. All Rights Reserved.