net.sourceforge.hatbox
Class RTreeSessionDb

java.lang.Object
  extended by net.sourceforge.hatbox.RTreeSessionDb
All Implemented Interfaces:
RTreeSession

public class RTreeSessionDb
extends java.lang.Object
implements RTreeSession

Author:
Peter Yuill

Constructor Summary
RTreeSessionDb(java.sql.Connection con, RTreeDml dml, boolean write)
          The general use constructor for short transactions.
RTreeSessionDb(java.sql.Connection con, RTreeDml dml, int commitInterval)
          A special purpose constructor to support index creation.
 
Method Summary
 void closeAll()
           
 void deleteNode(Node node)
           
 java.sql.Connection getCon()
           
 Node getNode(long id)
           
 long getRootId()
           
 byte[] getWKB(long id)
           
 long insertNode(Node node)
           
 void setCon(java.sql.Connection con)
           
 void setRootId(long id)
           
 void updateNode(Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTreeSessionDb

public RTreeSessionDb(java.sql.Connection con,
                      RTreeDml dml,
                      int commitInterval)
               throws java.sql.SQLException
A special purpose constructor to support index creation.

Assumes that the connection is *not* nested (ie it can be committed explicitly). and a lock is not required because the index status has already been set to 'BUILDING'

Parameters:
con -
dml -
nodeMap -
Throws:
java.sql.SQLException

RTreeSessionDb

public RTreeSessionDb(java.sql.Connection con,
                      RTreeDml dml,
                      boolean write)
               throws java.sql.SQLException
The general use constructor for short transactions.

This constructor creates a Lock which acts on the index meta node.

Parameters:
con - The database connection to use
dml - The database and index specific DML to use
write - Is the session going to write to the index
Throws:
java.sql.SQLException
Method Detail

getRootId

public long getRootId()
               throws java.sql.SQLException
Specified by:
getRootId in interface RTreeSession
Throws:
java.sql.SQLException

setRootId

public void setRootId(long id)
               throws java.sql.SQLException
Specified by:
setRootId in interface RTreeSession
Throws:
java.sql.SQLException

getCon

public java.sql.Connection getCon()

setCon

public void setCon(java.sql.Connection con)

closeAll

public void closeAll()

getNode

public Node getNode(long id)
             throws java.sql.SQLException
Specified by:
getNode in interface RTreeSession
Throws:
java.sql.SQLException

insertNode

public long insertNode(Node node)
                throws java.sql.SQLException
Specified by:
insertNode in interface RTreeSession
Throws:
java.sql.SQLException

updateNode

public void updateNode(Node node)
                throws java.sql.SQLException
Specified by:
updateNode in interface RTreeSession
Throws:
java.sql.SQLException

deleteNode

public void deleteNode(Node node)
                throws java.sql.SQLException
Specified by:
deleteNode in interface RTreeSession
Throws:
java.sql.SQLException

getWKB

public byte[] getWKB(long id)
              throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2010. All Rights Reserved.