org.openstreetmap.osmosis.core.pgsql.v0_5.impl
Class NodeDao

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_5.impl.NodeDao
All Implemented Interfaces:
Releasable

public class NodeDao
extends java.lang.Object
implements Releasable

Performs all node-specific db operations.

Author:
Brett Henderson

Constructor Summary
NodeDao(DatabaseContext dbCtx)
          Creates a new instance.
 
Method Summary
 Node getNode(long nodeId)
          Loads the specified node from the database.
 ReleasableIterator<Node> iterate()
          Returns an iterator providing access to all nodes in the database.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeDao

public NodeDao(DatabaseContext dbCtx)
Creates a new instance.

Parameters:
dbCtx - The database context to use for accessing the database.
Method Detail

getNode

public Node getNode(long nodeId)
Loads the specified node from the database.

Parameters:
nodeId - The unique identifier of the node.
Returns:
The loaded node.

iterate

public ReleasableIterator<Node> iterate()
Returns an iterator providing access to all nodes in the database.

Returns:
The node iterator.

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