ilog.views.maps.format.oracle
Class IlvSDOTileLoader

java.lang.Object
  extended by ilog.views.maps.format.oracle.IlvSDOTileLoader
All Implemented Interfaces:
IlvPersistentObject, IlvTileLoader
Direct Known Subclasses:
IlvDefaultObjectSDOTileLoader, IlvDefaultSDOTileLoader

public abstract class IlvSDOTileLoader
extends Object
implements IlvTileLoader

The base class to implement tile loaders for Oracle SDO.

See Also:
IlvSDOLayer

Constructor Summary
protected IlvSDOTileLoader(IlvInputStream stream)
          Reads the tile loader from an IlvInputStream
protected IlvSDOTileLoader(IlvSDOConnection connection)
          Initializes an instance of IlvSDOTileLoader
 
Method Summary
 void connectionRestored()
          This method is called by the IlvSDOLayer when it is read from an .ivl file, after the connection to an SDO database has been restored.
protected  ResultSet executeQuery(String query)
          Executes the specified query and prints a trace if the SQL traces are enabled.
 IlvSDOConnection getConnection()
          Returns the connection to the Oracle database.
abstract  ResultSet getResultSet(IlvTile tile)
          Returns the ResultSet containing the SDO geometries that intersect the specified tile.
abstract  IlvRect getSize()
          Returns the bounding box of the data set managed by the tile loader.
abstract  IlvRect getTileOrigin()
          Returns the coordinates of the origin tile used by the load-on demand mechanism.
 boolean isPersistent()
          Returns true.
 void load(IlvTile tile)
          Loads a tile from the Oracle database and adds the graphic objects to the layer of the tile.
 void release(IlvTile tile)
          Releases the content of a tile when required by the cache of the layer.
 void write(IlvOutputStream stream)
          Writes the tile loader to a JViews file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvSDOTileLoader

protected IlvSDOTileLoader(IlvSDOConnection connection)
Initializes an instance of IlvSDOTileLoader

Parameters:
connection - The connection to an Oracle database

IlvSDOTileLoader

protected IlvSDOTileLoader(IlvInputStream stream)
                    throws IlvReadFileException
Reads the tile loader from an IlvInputStream

Parameters:
stream - the input stream
Throws:
IlvReadFileException - if an error occurs while reading.
Method Detail

getTileOrigin

public abstract IlvRect getTileOrigin()
                               throws SQLException
Returns the coordinates of the origin tile used by the load-on demand mechanism.

Throws:
SQLException

getResultSet

public abstract ResultSet getResultSet(IlvTile tile)
                                throws SQLException
Returns the ResultSet containing the SDO geometries that intersect the specified tile. This method is called by load(IlvTile tile) when a tile needs to be loaded.

Parameters:
tile - The tile to be filled with the SDO geometries
Throws:
SQLException
See Also:
load(ilog.views.tiling.IlvTile)

getSize

public abstract IlvRect getSize()
                         throws SQLException
Returns the bounding box of the data set managed by the tile loader. If the bounding box cannot be computed, this method can return a null value. The IlvSDOLayer using this object will have an undefined size.

Throws:
SQLException
See Also:
IlvTiledLayer.getSize()

connectionRestored

public void connectionRestored()
                        throws SQLException
This method is called by the IlvSDOLayer when it is read from an .ivl file, after the connection to an SDO database has been restored.

Throws:
SQLException

load

public void load(IlvTile tile)
          throws Exception
Loads a tile from the Oracle database and adds the graphic objects to the layer of the tile. This method calls getResultSet to get the SDO geometries, transforms them into graphic objects using the renderer of the layer, and then adds the objects to the layer.

Specified by:
load in interface IlvTileLoader
Parameters:
tile - The tile to load
Throws:
Exception - if an error occurs while loading the tile.
See Also:
getResultSet(ilog.views.tiling.IlvTile)

release

public void release(IlvTile tile)
Releases the content of a tile when required by the cache of the layer.

Specified by:
release in interface IlvTileLoader
Parameters:
tile - The tile to release.

executeQuery

protected ResultSet executeQuery(String query)
                          throws SQLException
Executes the specified query and prints a trace if the SQL traces are enabled.

Parameters:
query - The SQL query
Throws:
SQLException - if an SQL error occurs.
See Also:
IlvSDOUtil.EnableSQLTraces(boolean)

getConnection

public IlvSDOConnection getConnection()
Returns the connection to the Oracle database.


write

public void write(IlvOutputStream stream)
           throws IOException
Writes the tile loader to a JViews file.

Specified by:
write in interface IlvPersistentObject
Specified by:
write in interface IlvTileLoader
Parameters:
stream - The output stream
Throws:
IOException - if a write exception occurs.

isPersistent

public boolean isPersistent()
Returns true.

Specified by:
isPersistent in interface IlvTileLoader


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.