org.openstreetmap.osmosis.core.apidb.v0_6
Class ApidbReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.ApidbReader
All Implemented Interfaces:
java.lang.Runnable, Task, RunnableSource, Source

public class ApidbReader
extends java.lang.Object
implements RunnableSource

An OSM data source reading from a database. The entire contents of the database are read.

Author:
Brett Henderson

Constructor Summary
ApidbReader(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences, java.util.Date snapshotInstant)
          Creates a new instance.
 
Method Summary
 void run()
          Reads all data from the database and send it to the sink.
protected  void runImpl(DatabaseContext2 dbCtx)
          Runs the task implementation.
 void setSink(Sink sink)
          Sets the osm 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

ApidbReader

public ApidbReader(DatabaseLoginCredentials loginCredentials,
                   DatabasePreferences preferences,
                   java.util.Date snapshotInstant)
Creates a new instance.

Parameters:
loginCredentials - Contains all information required to connect to the database.
preferences - Contains preferences configuring database behaviour.
snapshotInstant - The state of the node table at this point in time will be dumped. This ensures a consistent snapshot.
Method Detail

setSink

public void setSink(Sink sink)
Sets the osm sink to send data to.

Specified by:
setSink in interface Source
Parameters:
sink - The sink for receiving all produced data.

runImpl

protected void runImpl(DatabaseContext2 dbCtx)
Runs the task implementation. This is called by the run method within a transaction.

Parameters:
dbCtx - Used to access the database.

run

public void run()
Reads all data from the database and send it to the sink.

Specified by:
run in interface java.lang.Runnable