org.deegree.services.wpvs.io.file
Class FileBackend

java.lang.Object
  extended by org.deegree.services.wpvs.io.ModelBackend<org.deegree.geometry.Envelope>
      extended by org.deegree.services.wpvs.io.file.FileBackend
All Implemented Interfaces:
org.deegree.rendering.r3d.persistence.RenderableStore

public class FileBackend
extends ModelBackend<org.deegree.geometry.Envelope>

The FileBackend is the access to the model in files on the local file system.

Version:
$Revision: 24769 $, $Date: 2010-06-08 17:35:30 +0200 (Di, 08. Jun 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
 
Constructor Summary
FileBackend(java.io.File billboardFile)
           
FileBackend(java.io.File entityFile, java.io.File prototypeFile)
           
 
Method Summary
 org.deegree.geometry.Envelope createBackendEnvelope(org.deegree.geometry.Envelope geometry, int dimension)
           
 org.deegree.geometry.Envelope createEnvelope(org.deegree.geometry.Envelope someGeometry)
          Create an envelope from the given Geometry type.
 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.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.
protected  java.lang.String getDriverPrefix()
           
static void initFiles(java.io.File entityFile)
           
<P extends org.deegree.commons.index.PositionableModel>
BackendResult
insert(java.util.List<DataObjectInfo<P>> objects, 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
getBaseCRS, getBuildingSerializer, 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
 

Constructor Detail

FileBackend

public FileBackend(java.io.File billboardFile)
            throws java.io.IOException
Parameters:
billboardFile -
Throws:
java.io.IOException

FileBackend

public FileBackend(java.io.File entityFile,
                   java.io.File prototypeFile)
            throws java.io.IOException
Parameters:
entityFile -
prototypeFile -
Throws:
java.io.IOException
Method Detail

createBackendEnvelope

public org.deegree.geometry.Envelope createBackendEnvelope(org.deegree.geometry.Envelope geometry,
                                                           int dimension)
Specified by:
createBackendEnvelope in class ModelBackend<org.deegree.geometry.Envelope>
dimension - of the result geometry
Returns:
an envelope created from the given geometry

createEnvelope

public org.deegree.geometry.Envelope createEnvelope(org.deegree.geometry.Envelope someGeometry)
Description copied from class: ModelBackend
Create an envelope from the given Geometry type.

Specified by:
createEnvelope in class ModelBackend<org.deegree.geometry.Envelope>
Returns:
the envelope

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<org.deegree.geometry.Envelope>
uuid - of the object
Returns:
the deserialized object or null if given uuid did not match.
Throws:
java.io.IOException

getDriverPrefix

protected java.lang.String getDriverPrefix()
Specified by:
getDriverPrefix in class ModelBackend<org.deegree.geometry.Envelope>
Returns:
the prefix of the backend, which should be prefixed to the hosturl.

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<org.deegree.geometry.Envelope>
Parameters:
bm - to add the building to
baseCRS - the crs of the WPVS scene

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<org.deegree.geometry.Envelope>
baseCRS - the crs of the WPVS scene
Returns:
the list of prototypes or the empty list if an error occurred, never null.

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<org.deegree.geometry.Envelope>
Parameters:
tm - to add the trees to.
baseCRS - the crs of the WPVS scene

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<org.deegree.geometry.Envelope>
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>> objects,
                                                                                    ModelBackend.Type objectType)
                     throws java.io.IOException
Description copied from class: ModelBackend
Insert given data into the backend.

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

flush

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

Specified by:
flush in class ModelBackend<org.deegree.geometry.Envelope>
Throws:
java.io.IOException - if flushing was not successful

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<org.deegree.geometry.Envelope>
Returns:
some information on the backend.

getDeSerializedObjectsForSQL

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

Specified by:
getDeSerializedObjectsForSQL in class ModelBackend<org.deegree.geometry.Envelope>
sqlWhere - to select the objects to retrieve
Returns:
the list of deserialized object or the emtpy list if no results matched.

loadEntities

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

isBillboard

public boolean isBillboard()

initFiles

public static void initFiles(java.io.File entityFile)
                      throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.