public abstract class DiffFeatureWriter extends Object implements FeatureWriter<SimpleFeatureType,SimpleFeature>
You will eventually need to write out the differences, later.
The api has been implemented in terms of FeatureReader
TransactionStateDiff
Modifier and Type | Field and Description |
---|---|
protected Diff |
diff |
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
reader |
Constructor and Description |
---|
DiffFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> reader,
Diff diff)
DiffFeatureWriter construction.
|
DiffFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> reader,
Diff diff,
Filter filter)
DiffFeatureWriter construction.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Clean up resources associated with this writer.
|
protected abstract void |
fireNotification(int eventType,
ReferencedEnvelope bounds)
Subclass must provide the notification.
|
SimpleFeatureType |
getFeatureType()
Supplys FeatureTypeFrom reader
|
boolean |
hasNext()
Query for more content.
|
SimpleFeature |
next()
Next Feature from reader or new content.
|
void |
remove()
Removes current Feature, must be called before hasNext.
|
void |
write()
Writes out the current feature.
|
protected FeatureReader<SimpleFeatureType,SimpleFeature> reader
protected Diff diff
public DiffFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> reader, Diff diff)
reader
- diff
- public DiffFeatureWriter(FeatureReader<SimpleFeatureType,SimpleFeature> reader, Diff diff, Filter filter)
reader
- diff
- filter
- public SimpleFeatureType getFeatureType()
getFeatureType
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
FeatureWriter.getFeatureType()
public SimpleFeature next() throws IOException
next
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
IOException
- if the writer has been closed or an I/O error occurs reading the next
Feature
.FeatureWriter.next()
public void remove() throws IOException
FeatureWriter
FeatureWriters will need to allow all FeatureSources of the same typeName to issue a
FeatureEvent event of type FeatureEvent.FEATURES_REMOVED
when this method is
called.
If this FeatureWriter is opperating against a Transaction FEATURES_REMOVED events should only be sent to FeatureSources operating on the same Transaction. When Transaction commit() is called other FeatureSources will be informed of the modifications.
When the current Feature has been provided as new content, this method "cancels" the add opperation (and notification needed).
remove
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
IOException
- DOCUMENT ME!FeatureWriter.remove()
public void write() throws IOException
write
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
IOException
FeatureWriter.write()
public boolean hasNext() throws IOException
hasNext
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
true
if an additional Feature
is available, false
if not.IOException
- if an I/O error occurs.FeatureWriter.hasNext()
public void close() throws IOException
Diff is not clear()ed as it is assumed that it belongs to a Transaction.State object and may yet be written out.
close
in interface Closeable
close
in interface AutoCloseable
close
in interface FeatureWriter<SimpleFeatureType,SimpleFeature>
IOException
- if there there are problems releasing underlying resources, or possibly
if close has been called (up to the implementation).FeatureWriter.close()
protected abstract void fireNotification(int eventType, ReferencedEnvelope bounds)
Notification requirements for modifications against a Transaction should only be issued to SimpleFeatureSource instances that opperate against the same typeName and Transaction.
Other SimpleFeatureSource instances with the same typeName will be notified when the Transaction is committed.
eventType
- One of FeatureType.FEATURES_ADDED, FeatureType.CHANGED,
FeatureType.FEATURES_REMOVEDbounds
- Copyright © 1996–2019 Geotools. All rights reserved.