org.openstreetmap.osmosis.core.pgsql.v0_6.impl
Class PersistentNodeLocationStore

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.PersistentNodeLocationStore
All Implemented Interfaces:
Releasable, NodeLocationStore

public class PersistentNodeLocationStore
extends java.lang.Object
implements NodeLocationStore

A file-based node location store implementation.

Author:
Brett Henderson

Constructor Summary
PersistentNodeLocationStore()
          Creates a new instance.
 
Method Summary
 void addLocation(long nodeId, NodeLocation nodeLocation)
          Adds the specified node location details.
 NodeLocation getNodeLocation(long nodeId)
          Gets the location details of the specified node.
 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

PersistentNodeLocationStore

public PersistentNodeLocationStore()
Creates a new instance.

Method Detail

addLocation

public void addLocation(long nodeId,
                        NodeLocation nodeLocation)
Adds the specified node location details.

Specified by:
addLocation in interface NodeLocationStore
Parameters:
nodeId - The node identifier.
nodeLocation - The geo-spatial location details.

getNodeLocation

public NodeLocation getNodeLocation(long nodeId)
Gets the location details of the specified node.

Specified by:
getNodeLocation in interface NodeLocationStore
Parameters:
nodeId - The node identifier.
Returns:
The geo-spatial location details. If the node doesn't exist, the valid flag will be set to false.

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