org.openstreetmap.osmosis.core.pgsql.v0_5
Class PostgreSqlWriter

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_5.PostgreSqlWriter
All Implemented Interfaces:
EntityProcessor, Completable, Releasable, Task, Sink

public class PostgreSqlWriter
extends java.lang.Object
implements Sink, EntityProcessor

An OSM data sink for storing all data to a database. This task is intended for writing to an empty database.

Author:
Brett Henderson

Constructor Summary
PostgreSqlWriter(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences)
          Creates a new instance.
 
Method Summary
 void complete()
          Writes any buffered data to the database and commits.
 void process(BoundContainer bound)
          Process the bound.
 void process(EntityContainer entityContainer)
          Process the entity.
 void process(NodeContainer nodeContainer)
          Process the node.
 void process(RelationContainer relationContainer)
          Process the relation.
 void process(WayContainer wayContainer)
          Process the way.
 void release()
          Releases all database resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgreSqlWriter

public PostgreSqlWriter(DatabaseLoginCredentials loginCredentials,
                        DatabasePreferences preferences)
Creates a new instance.

Parameters:
loginCredentials - Contains all information required to connect to the database.
preferences - Contains preferences configuring database behaviour.
Method Detail

complete

public void complete()
Writes any buffered data to the database and commits.

Specified by:
complete in interface Completable

release

public void release()
Releases all database resources.

Specified by:
release in interface Releasable

process

public void process(EntityContainer entityContainer)
Process the entity.

Specified by:
process in interface Sink
Parameters:
entityContainer - The entity to be processed.

process

public void process(BoundContainer bound)
Process the bound.

Specified by:
process in interface EntityProcessor
Parameters:
bound - The bound to be processed.

process

public void process(NodeContainer nodeContainer)
Process the node.

Specified by:
process in interface EntityProcessor
Parameters:
nodeContainer - The node to be processed.

process

public void process(WayContainer wayContainer)
Process the way.

Specified by:
process in interface EntityProcessor
Parameters:
wayContainer - The way to be processed.

process

public void process(RelationContainer relationContainer)
Process the relation.

Specified by:
process in interface EntityProcessor
Parameters:
relationContainer - The relation to be processed.