org.geotools.caching.grid.spatialindex.store
Class BufferedDiskStorage

java.lang.Object
  extended by org.geotools.caching.grid.spatialindex.store.BufferedDiskStorage
All Implemented Interfaces:
Storage

public class BufferedDiskStorage
extends java.lang.Object
implements Storage

Disk storage that buffers read/writes of nodes.

To ensure all data has been written flush() should be called.


Field Summary
static java.lang.String BUFFER_SIZE_PROPERTY
           
protected static java.util.logging.Logger logger
           
 
Fields inherited from interface org.geotools.caching.spatialindex.Storage
STORAGE_TYPE_PROPERTY
 
Method Summary
 void addFeatureType(org.opengis.feature.type.FeatureType ft)
          Adds a feature type to the storage
 void clear()
          Clears the buffer
 void clearFeatureTypes()
          Clears all feature types
static Storage createInstance()
           
static Storage createInstance(java.util.Properties pset)
           
 void dispose()
          Disposes of the storage
 NodeIdentifier findUniqueInstance(NodeIdentifier id)
          Finds the unique node identifier
 void flush()
          Writes all dirty nodes to underlying disk storage.
 Node get(NodeIdentifier id)
          Gets a particular node.
 ReferencedEnvelope getBounds()
          gets the bounds of the store
 java.util.Collection<org.opengis.feature.type.FeatureType> getFeatureTypes()
          Removes feature types from the store
 java.util.Properties getPropertySet()
          Get storage properties
 void put(Node n)
          Adds a node to the storage.
 void remove(NodeIdentifier id)
          Removes a node from the storage.
 void setBounds(ReferencedEnvelope bounds)
          Sets the bounds of the data store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE_PROPERTY

public static final java.lang.String BUFFER_SIZE_PROPERTY
See Also:
Constant Field Values

logger

protected static java.util.logging.Logger logger
Method Detail

createInstance

public static Storage createInstance(java.util.Properties pset)

createInstance

public static Storage createInstance()

clear

public void clear()
Clears the buffer

Specified by:
clear in interface Storage

dispose

public void dispose()
Disposes of the storage

Specified by:
dispose in interface Storage

get

public Node get(NodeIdentifier id)
Gets a particular node.

First looks in buffer; if not found will look in the underlying storage

Specified by:
get in interface Storage
Parameters:
id - identifier of the node to read
Returns:

put

public void put(Node n)
Adds a node to the storage.

Specified by:
put in interface Storage

remove

public void remove(NodeIdentifier id)
Removes a node from the storage.

Specified by:
remove in interface Storage
Parameters:
id - identifier of the node to remove

getPropertySet

public java.util.Properties getPropertySet()
Get storage properties

Specified by:
getPropertySet in interface Storage
Returns:

flush

public void flush()
Writes all dirty nodes to underlying disk storage.

Specified by:
flush in interface Storage

findUniqueInstance

public NodeIdentifier findUniqueInstance(NodeIdentifier id)
Finds the unique node identifier

Specified by:
findUniqueInstance in interface Storage

addFeatureType

public void addFeatureType(org.opengis.feature.type.FeatureType ft)
Adds a feature type to the storage

Specified by:
addFeatureType in interface Storage
Parameters:
ft - feature type to add

getFeatureTypes

public java.util.Collection<org.opengis.feature.type.FeatureType> getFeatureTypes()
Removes feature types from the store

Specified by:
getFeatureTypes in interface Storage

clearFeatureTypes

public void clearFeatureTypes()
Clears all feature types

Specified by:
clearFeatureTypes in interface Storage

getBounds

public ReferencedEnvelope getBounds()
gets the bounds of the store

Specified by:
getBounds in interface Storage
Returns:

setBounds

public void setBounds(ReferencedEnvelope bounds)
Sets the bounds of the data store.

Specified by:
setBounds in interface Storage


Copyright © 1996-2010 Geotools. All Rights Reserved.