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, java.lang.String requestedMimeType, java.lang.String requestedSchema, java.lang.String requestedEncoding)
          Construct a complex output, values will be written to the location and probably not stored.
ComplexOutputImpl(ComplexOutputDefinition outputType, java.io.OutputStream outputStream, boolean isRequested, java.lang.String requestedMimeType, java.lang.String requestedSchema, java.lang.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).
 java.io.OutputStream getBinaryOutputStream()
          Returns the stream to write the output.
 java.io.InputStream getInputStream()
          Returns the stream to read the value.
 java.lang.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).
 java.lang.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).
 java.lang.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).
 javax.xml.stream.XMLStreamReader getStreamReader()
           
 java.lang.String getWebURL()
           
 javax.xml.stream.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,
                         java.lang.String requestedMimeType,
                         java.lang.String requestedSchema,
                         java.lang.String requestedEncoding)
                  throws java.io.FileNotFoundException,
                         javax.xml.stream.XMLStreamException
Construct a complex output, values will be written to the location and probably not stored.

Parameters:
outputType -
location -
isRequested -
requestedMimeType -
requestedSchema -
requestedEncoding -
Throws:
java.io.FileNotFoundException
javax.xml.stream.XMLStreamException

ComplexOutputImpl

public ComplexOutputImpl(ComplexOutputDefinition outputType,
                         java.io.OutputStream outputStream,
                         boolean isRequested,
                         java.lang.String requestedMimeType,
                         java.lang.String requestedSchema,
                         java.lang.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 java.io.OutputStream getBinaryOutputStream()
Returns the stream to write the output.

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

getXMLStreamWriter

public javax.xml.stream.XMLStreamWriter getXMLStreamWriter()
                                                    throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException

getRequestedMimeType

public java.lang.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 java.lang.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 java.lang.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 javax.xml.stream.XMLStreamReader getStreamReader()
Returns:
a reader on the stored location, or null if storing was disabled.

close

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

Throws:
javax.xml.stream.XMLStreamException
java.io.IOException

getInputStream

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

Returns:
the stream to read the value

getWebURL

public java.lang.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.