org.deegree.services.wpvs.io.db
Class DBBackend<G>

java.lang.Object
  extended by org.deegree.services.wpvs.io.ModelBackend<G>
      extended by org.deegree.services.wpvs.io.db.DBBackend<G>
Type Parameters:
G - the Geometry type used to create the envelope from.
All Implemented Interfaces:
org.deegree.rendering.r3d.persistence.RenderableStore
Direct Known Subclasses:
PostgisBackend

public abstract class DBBackend<G>
extends ModelBackend<G>

The DBBackend provides methods for connections to the wpvs model in a database.

Version:
$Revision: 24230 $, $Date: 2010-05-07 15:31:49 +0200 (Fr, 07. Mai 2010) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deegree.services.wpvs.io.ModelBackend
ModelBackend.Type
 
Method Summary
 BackendResult delete(java.lang.String uuid, ModelBackend.Type objectType, int qualityLevel, java.lang.String sqlWhere)
          Delete some data from the backend.
 void flush()
          flush any cached data to the backend and close the connections.
 ModelBackendInfo getBackendInfo(ModelBackend.Type type)
          Retrieve some information on the number of vertices and texture coordinates used in the backend.
 java.sql.Connection getConnection()
           
protected abstract  org.deegree.geometry.Envelope getDatasetEnvelope(java.sql.Connection con, java.lang.String tableName, java.lang.String geomColumn)
          Should return the envelope in WPVS scene coordinates, not in world coordinates.
 java.lang.Object getDeSerializedObjectForUUID(ModelBackend.Type objectType, java.lang.String uuid)
          Retrieves and deserializes an object from the given type.
 java.util.List<java.lang.Object> getDeSerializedObjectsForSQL(ModelBackend.Type objectType, java.lang.String sqlWhere)
          Retrieves and deserializes objects from the given type.
<P extends org.deegree.commons.index.PositionableModel>
BackendResult
insert(java.util.List<DataObjectInfo<P>> model, ModelBackend.Type objectType)
          Insert given data into the backend.
 boolean isBillboard()
           
 void loadBuildings(org.deegree.rendering.r3d.opengl.rendering.model.manager.BuildingRenderer bm, org.deegree.cs.CRS baseCRS)
          Retrieves the WorldRenderable objects from the backend.
 void loadEntities(org.deegree.rendering.r3d.opengl.rendering.model.manager.RenderableManager<?> renderer, org.deegree.cs.CRS baseCRS)
           
 java.util.List<org.deegree.rendering.r3d.opengl.rendering.model.prototype.RenderablePrototype> loadProtoTypes(org.deegree.rendering.r3d.opengl.rendering.model.geometry.DirectGeometryBuffer geometryBuffer, org.deegree.cs.CRS baseCRS)
          Retrieves the WorldRenderable objects from the prototypes table in the database.
 void loadTrees(org.deegree.rendering.r3d.opengl.rendering.model.manager.TreeRenderer tm, org.deegree.cs.CRS baseCRS)
          Retrieves the Billboard objects from the backend.
 
Methods inherited from class org.deegree.services.wpvs.io.ModelBackend
createBackendEnvelope, createEnvelope, getBaseCRS, getBuildingSerializer, getDriverPrefix, getInstance, getPrototypeSerializer, getSerializerForType, getTreeSerializer, getWPVSTranslationVector, setWPVSBaseCRS, setWPVSTranslationVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadProtoTypes

public java.util.List<org.deegree.rendering.r3d.opengl.rendering.model.prototype.RenderablePrototype> loadProtoTypes(org.deegree.rendering.r3d.opengl.rendering.model.geometry.DirectGeometryBuffer geometryBuffer,
                                                                                                                     org.deegree.cs.CRS baseCRS)
Description copied from class: ModelBackend
Retrieves the WorldRenderable objects from the prototypes table in the database.

Specified by:
loadProtoTypes in interface org.deegree.rendering.r3d.persistence.RenderableStore
Specified by:
loadProtoTypes in class ModelBackend<G>
baseCRS - the crs of the WPVS scene
Returns:
the list of prototypes or the empty list if an error occurred, never null.

loadBuildings

public void loadBuildings(org.deegree.rendering.r3d.opengl.rendering.model.manager.BuildingRenderer bm,
                          org.deegree.cs.CRS baseCRS)
Description copied from class: ModelBackend
Retrieves the WorldRenderable objects from the backend.

Specified by:
loadBuildings in class ModelBackend<G>
Parameters:
bm - to add the building to
baseCRS - the crs of the WPVS scene

loadTrees

public void loadTrees(org.deegree.rendering.r3d.opengl.rendering.model.manager.TreeRenderer tm,
                      org.deegree.cs.CRS baseCRS)
Description copied from class: ModelBackend
Retrieves the Billboard objects from the backend.

Specified by:
loadTrees in class ModelBackend<G>
Parameters:
tm - to add the trees to.
baseCRS - the crs of the WPVS scene

getDeSerializedObjectForUUID

public java.lang.Object getDeSerializedObjectForUUID(ModelBackend.Type objectType,
                                                     java.lang.String uuid)
                                              throws java.io.IOException
Description copied from class: ModelBackend
Retrieves and deserializes an object from the given type.

Specified by:
getDeSerializedObjectForUUID in class ModelBackend<G>
uuid - of the object
Returns:
the deserialized object or null if given uuid did not match.
Throws:
java.io.IOException

getDeSerializedObjectsForSQL

public java.util.List<java.lang.Object> getDeSerializedObjectsForSQL(ModelBackend.Type objectType,
                                                                     java.lang.String sqlWhere)
                                                              throws java.io.IOException
Description copied from class: ModelBackend
Retrieves and deserializes objects from the given type.

Specified by:
getDeSerializedObjectsForSQL in class ModelBackend<G>
sqlWhere - to select the objects to retrieve
Returns:
the list of deserialized object or the emtpy list if no results matched.
Throws:
java.io.IOException

delete

public BackendResult delete(java.lang.String uuid,
                            ModelBackend.Type objectType,
                            int qualityLevel,
                            java.lang.String sqlWhere)
                     throws java.io.IOException
Description copied from class: ModelBackend
Delete some data from the backend.

Specified by:
delete in class ModelBackend<G>
Parameters:
uuid - the id of the object to delete.
objectType - defining the type of object.
Returns:
the number of records deleted by the given id.
Throws:
java.io.IOException

insert

public <P extends org.deegree.commons.index.PositionableModel> BackendResult insert(java.util.List<DataObjectInfo<P>> model,
                                                                                    ModelBackend.Type objectType)
                     throws java.io.IOException
Description copied from class: ModelBackend
Insert given data into the backend.

Specified by:
insert in class ModelBackend<G>
Type Parameters:
P - type of the positionable
objectType - defining the type of the dataModel
Returns:
information about the inserted objects.
Throws:
java.io.IOException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Returns:
a connection to the database
Throws:
java.sql.SQLException

getBackendInfo

public ModelBackendInfo getBackendInfo(ModelBackend.Type type)
Description copied from class: ModelBackend
Retrieve some information on the number of vertices and texture coordinates used in the backend.

Specified by:
getBackendInfo in class ModelBackend<G>
Returns:
some information on the backend.

flush

public void flush()
Description copied from class: ModelBackend
flush any cached data to the backend and close the connections.

Specified by:
flush in class ModelBackend<G>

loadEntities

public void loadEntities(org.deegree.rendering.r3d.opengl.rendering.model.manager.RenderableManager<?> renderer,
                         org.deegree.cs.CRS baseCRS)

isBillboard

public boolean isBillboard()

getDatasetEnvelope

protected abstract org.deegree.geometry.Envelope getDatasetEnvelope(java.sql.Connection con,
                                                                    java.lang.String tableName,
                                                                    java.lang.String geomColumn)
                                                             throws java.sql.SQLException
Should return the envelope in WPVS scene coordinates, not in world coordinates.

Parameters:
con -
tableName -
geomColumn -
Returns:
the envelope of the given dataset.
Throws:
java.sql.SQLException


Copyright © 2011. All Rights Reserved.