org.openstreetmap.osmosis.core.merge.v0_6.impl
Class SortedDeltaChangePipeValidator

java.lang.Object
  extended by org.openstreetmap.osmosis.core.merge.v0_6.impl.SortedDeltaChangePipeValidator
All Implemented Interfaces:
Completable, Releasable, Task, ChangeSink, ChangeSinkChangeSource, ChangeSource

public class SortedDeltaChangePipeValidator
extends java.lang.Object
implements ChangeSinkChangeSource

Validates that change data in a pipeline is sorted by entity type then id thus only allowing delta style changes (ie. not full history). It accepts input data from a Source and passes all data to a downstream Sink.

Author:
Brett Henderson

Constructor Summary
SortedDeltaChangePipeValidator()
          Creates a new instance.
 
Method Summary
 void complete()
          Ensures that all information is fully persisted.
 void process(ChangeContainer changeContainer)
          Process the change.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 void setChangeSink(ChangeSink changeSink)
          Sets the change sink to send data to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedDeltaChangePipeValidator

public SortedDeltaChangePipeValidator()
Creates a new instance.

Method Detail

complete

public void complete()
Ensures that all information is fully persisted. This includes database commits, file buffer flushes, etc. Implementations must call complete on any nested Completable objects. Where the releasable method of a Releasable class should be called within a finally block, this method should typically be the final statement within the try block.

Specified by:
complete in interface Completable

process

public void process(ChangeContainer changeContainer)
Process the change.

Specified by:
process in interface ChangeSink
Parameters:
changeContainer - The change to be processed.

release

public void release()
Performs resource cleanup tasks such as closing files, or database connections. This must be called after all processing is complete and may be called multiple times. Implementations must call release on any nested Releasable objects. It should be called within a finally block to ensure it is called in exception scenarios.

Specified by:
release in interface Releasable

setChangeSink

public void setChangeSink(ChangeSink changeSink)
Sets the change sink to send data to.

Specified by:
setChangeSink in interface ChangeSource
Parameters:
changeSink - The sink for receiving all produced data.