org.openstreetmap.osmosis.core.customdb.v0_5.impl
Class TempFileDatasetStoreFileManager

java.lang.Object
  extended by org.openstreetmap.osmosis.core.customdb.v0_5.impl.TempFileDatasetStoreFileManager
All Implemented Interfaces:
DatasetStoreFileManager, Releasable

public class TempFileDatasetStoreFileManager
extends java.lang.Object
implements DatasetStoreFileManager

Implements a dataset store file manager using temporary files.

Author:
Brett Henderson

Constructor Summary
TempFileDatasetStoreFileManager()
          Creates a new instance.
 
Method Summary
 java.io.File getNodeObjectFile()
          Returns the file to be used for storing node objects.
 java.io.File getNodeObjectOffsetIndexFile()
          Returns the file to be used for storing node object offsets against their id.
 java.io.File getNodeRelationIndexFile()
          Returns the file to be used for storing relationships between nodes and relations.
 java.io.File getNodeTileIndexFile()
          Returns the file to be used for storing node ids against tile ids.
 java.io.File getNodeWayIndexFile()
          Returns the file to be used for storing relationships between nodes and ways.
 java.io.File getRelationObjectFile()
          Returns the file to be used for storing relation objects.
 java.io.File getRelationObjectOffsetIndexFile()
          Returns the file to be used for storing relation object offsets against their id.
 java.io.File getRelationRelationIndexFile()
          Returns the file to be used for storing relationships between relations and relations.
 java.io.File getWayObjectFile()
          Returns the file to be used for storing way objects.
 java.io.File getWayObjectOffsetIndexFile()
          Returns the file to be used for storing way object offsets against their id.
 java.io.File getWayRelationIndexFile()
          Returns the file to be used for storing relationships between ways and relations.
 java.io.File getWayTileIndexFile(int instance)
          Returns the file to be used for storing way ids against tile ids.
 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

TempFileDatasetStoreFileManager

public TempFileDatasetStoreFileManager()
Creates a new instance.

Method Detail

getNodeObjectFile

public java.io.File getNodeObjectFile()
Returns the file to be used for storing node objects.

Specified by:
getNodeObjectFile in interface DatasetStoreFileManager
Returns:
The node object file.

getNodeObjectOffsetIndexFile

public java.io.File getNodeObjectOffsetIndexFile()
Returns the file to be used for storing node object offsets against their id.

Specified by:
getNodeObjectOffsetIndexFile in interface DatasetStoreFileManager
Returns:
The node object offset index file.

getNodeTileIndexFile

public java.io.File getNodeTileIndexFile()
Returns the file to be used for storing node ids against tile ids.

Specified by:
getNodeTileIndexFile in interface DatasetStoreFileManager
Returns:
The node tile index file.

getWayObjectFile

public java.io.File getWayObjectFile()
Returns the file to be used for storing way objects.

Specified by:
getWayObjectFile in interface DatasetStoreFileManager
Returns:
The way object file.

getWayObjectOffsetIndexFile

public java.io.File getWayObjectOffsetIndexFile()
Returns the file to be used for storing way object offsets against their id.

Specified by:
getWayObjectOffsetIndexFile in interface DatasetStoreFileManager
Returns:
The way object offset index file.

getWayTileIndexFile

public java.io.File getWayTileIndexFile(int instance)
Returns the file to be used for storing way ids against tile ids. Because multiple files are used for storing way tile indexes, the implementation must support an arbitrary number of index files to be returned.

Specified by:
getWayTileIndexFile in interface DatasetStoreFileManager
Parameters:
instance - The index file number.
Returns:
The way tile index file.

getNodeWayIndexFile

public java.io.File getNodeWayIndexFile()
Returns the file to be used for storing relationships between nodes and ways.

Specified by:
getNodeWayIndexFile in interface DatasetStoreFileManager
Returns:
The node way index file.

getRelationObjectFile

public java.io.File getRelationObjectFile()
Returns the file to be used for storing relation objects.

Specified by:
getRelationObjectFile in interface DatasetStoreFileManager
Returns:
The relation object file.

getRelationObjectOffsetIndexFile

public java.io.File getRelationObjectOffsetIndexFile()
Returns the file to be used for storing relation object offsets against their id.

Specified by:
getRelationObjectOffsetIndexFile in interface DatasetStoreFileManager
Returns:
The relation object offset index file.

getNodeRelationIndexFile

public java.io.File getNodeRelationIndexFile()
Returns the file to be used for storing relationships between nodes and relations.

Specified by:
getNodeRelationIndexFile in interface DatasetStoreFileManager
Returns:
The node relation index file.

getWayRelationIndexFile

public java.io.File getWayRelationIndexFile()
Returns the file to be used for storing relationships between ways and relations.

Specified by:
getWayRelationIndexFile in interface DatasetStoreFileManager
Returns:
The way relation index file.

getRelationRelationIndexFile

public java.io.File getRelationRelationIndexFile()
Returns the file to be used for storing relationships between relations and relations.

Specified by:
getRelationRelationIndexFile in interface DatasetStoreFileManager
Returns:
The relation relation index file.

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