public class AqdGetObservationResponseXmlStreamWriter extends XmlStreamWriter<FeatureCollection> implements StreamingDataEncoder
Modifier and Type | Class and Description |
---|---|
private class |
AqdGetObservationResponseXmlStreamWriter.WriteTimerTask
TimerTask to write blank strings to the OutputStream to
avoid conncetion timeout after 1000 ms |
Modifier and Type | Field and Description |
---|---|
private FeatureCollection |
featureCollection |
private static org.slf4j.Logger |
LOGGER |
private Timer |
timer |
private static long |
TIMER_PERIOD |
private TimerTask |
timerTask |
indent, out, XML_FRAGMENT, XML_VERSION
Constructor and Description |
---|
AqdGetObservationResponseXmlStreamWriter()
constructor
|
AqdGetObservationResponseXmlStreamWriter(FeatureCollection featureCollection)
constructor
|
Modifier and Type | Method and Description |
---|---|
private String |
addGmlId(String gmlId) |
private void |
addNamespaces() |
private void |
addSchemaLocations() |
private void |
cleanup()
Cleanup the
Timer and TimerTask to avoid conncetion
timeout after 1000 ms Stops the AqdGetObservationResponseXmlStreamWriter.WriteTimerTask , Cancel
Timer and set to null . |
private Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> |
getEncoder(AbstractFeature feature,
Map<SosConstants.HelperValues,String> additionalValues) |
private FeatureCollection |
getFeatureCollection()
Get the
FeatureCollection which should be written |
private void |
initTimer()
Initializ a new
AqdGetObservationResponseXmlStreamWriter.WriteTimerTask |
private String |
prepareObservation(OmObservation omObservation,
Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> encoder,
EncodingValues encodingValues) |
private void |
setFeatureCollection(FeatureCollection featureCollection)
Set
FeatureCollection which should be written |
private void |
startTimer()
|
private void |
stopTimer()
Cancel the
AqdGetObservationResponseXmlStreamWriter.WriteTimerTask and set to null |
void |
write(FeatureCollection featureCollection,
OutputStream out)
Encode and write the elementToStream to the
OutputStream |
void |
write(FeatureCollection featureCollection,
OutputStream out,
EncodingValues encodingValues)
Encode and write the elementToStream to the
OutputStream |
void |
write(OutputStream out)
Encode and write element to the
OutputStream |
void |
write(OutputStream out,
EncodingValues encodingValues)
Encode and write element to the
OutputStream |
private void |
writeFeatureCollectionDoc(EncodingValues encodingValues) |
private void |
writeMember(AbstractFeature abstractFeature,
Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> encoder,
EncodingValues encodingValues) |
private void |
writeMember(String memberContent) |
attr, attr, attr, chars, chars, empty, end, end, endInline, finish, flush, getXmlWriter, init, namespace, start, start
addXlinkHrefAttr, addXlinkTitleAttr, getOutputStream, getReplacement, getXmlOutputFactory, init, init, init, rawText, schemaLocation, time, time, writeIndent, writeNewLine, writeXmlObject
private static final org.slf4j.Logger LOGGER
private static final long TIMER_PERIOD
private FeatureCollection featureCollection
private Timer timer
private TimerTask timerTask
public AqdGetObservationResponseXmlStreamWriter()
public AqdGetObservationResponseXmlStreamWriter(FeatureCollection featureCollection)
observation
- FeatureCollection
to write to streamprivate void setFeatureCollection(FeatureCollection featureCollection)
FeatureCollection
which should be writtenfeatureCollection
- the FeatureCollection
private FeatureCollection getFeatureCollection()
FeatureCollection
which should be writtenFeatureCollection
public void write(OutputStream out) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,FeatureCollection>
out
- OutputStream to write the encoded elementXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(OutputStream out, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,FeatureCollection>
out
- OutputStream to write the encoded elementencodingValues
- EncodingValues
with additional informationXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(FeatureCollection featureCollection, OutputStream out) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,FeatureCollection>
featureCollection
- Element to encode and write to streamout
- OutputStream to write the encoded elementXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(FeatureCollection featureCollection, OutputStream out, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,FeatureCollection>
featureCollection
- Element to encode and write to streamout
- OutputStream to write the encoded elementencodingValues
- EncodingValues
with additional informationXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occursprivate void writeFeatureCollectionDoc(EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XMLStreamException
OwsExceptionReport
private void addNamespaces() throws XMLStreamException
XMLStreamException
private void addSchemaLocations() throws XMLStreamException
XMLStreamException
private String addGmlId(String gmlId) throws XMLStreamException
XMLStreamException
private String prepareObservation(OmObservation omObservation, Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> encoder, EncodingValues encodingValues) throws UnsupportedEncoderInputException, OwsExceptionReport, XMLStreamException
private void writeMember(AbstractFeature abstractFeature, Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> encoder, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XMLStreamException
OwsExceptionReport
private void writeMember(String memberContent) throws XMLStreamException, OwsExceptionReport
XMLStreamException
OwsExceptionReport
private Encoder<org.apache.xmlbeans.XmlObject,AbstractFeature> getEncoder(AbstractFeature feature, Map<SosConstants.HelperValues,String> additionalValues) throws OwsExceptionReport
OwsExceptionReport
private void initTimer()
AqdGetObservationResponseXmlStreamWriter.WriteTimerTask
private void startTimer()
private void stopTimer()
AqdGetObservationResponseXmlStreamWriter.WriteTimerTask
and set to null
private void cleanup()
Timer
and TimerTask
to avoid conncetion
timeout after 1000 ms Stops the AqdGetObservationResponseXmlStreamWriter.WriteTimerTask
, Cancel
Timer
and set to null
.Copyright © 2012-2015 52north.org. All Rights Reserved.