deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs.configuration.deegree.db
Class CRSRemover

java.lang.Object
  extended by org.deegree.crs.configuration.deegree.db.CRSRemover

public class CRSRemover
extends Object

The CRSRemover class deletes a CRS from the database. The provided CRS if first identified with the one in the database via its code (every CRS needs to have a code). Identifiable objects other than CRSs (axes, datums, ellipsoids, etc.) happen to not have codes all the time and thus will not be identified ( hence removed) in these cases. Before an object is removed, a check that no other object references it is done.

Version:
$Revision: $, $Date: $
Author:
Andrei Ionita, last edited by: $Author: ionita $

Field Summary
(package private)  Connection connection
           
 
Constructor Summary
CRSRemover()
          CRSRemover constructor
 
Method Summary
 void closeConnection()
          Close the database connection
(package private)  int getInternalID(CRSIdentifiable identifiable)
          Determines the database internal ID of the provided CRSIdentifiable object based on the CRSCodeType that it has
static void main(String[] args)
          Command-line tool for removing a CRS from the CRS db.
(package private)  void removeAxis(Axis axis)
          Removes from the database the provided axis object
(package private)  void removeCRS(CoordinateSystem crs)
          Removes a CRS from the database.
 void removeCRSList(List<CoordinateSystem> crsList)
          Removes all the crs's provided as the arguments list
(package private)  void removeEllipsoid(Ellipsoid ellipsoid)
          Deletes the provided ellipsoid object from the database.
(package private)  void removeGeodeticDatum(GeodeticDatum datum)
          Removes from the database the geodetic datum provided
(package private)  void removeHelmert(Helmert helmert)
          Deletes the provided Helmert transformation object from the database.
(package private)  void removeIdentifiableAttributes(int internalID)
          Deletes the database table attributes: code, name, version, description, area.
(package private)  void removePrimeMeridian(PrimeMeridian pm)
          Deletes the provided prime meridian object from the database.
(package private)  void removeProjection(Projection projection)
          Removes from the database the provided projection
(package private)  void removeVerticalDatum(VerticalDatum verticalDatum)
          Removes from the database the vertical datum provided
 void setConnection(Connection conn)
          Set the connection locally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

Connection connection
Constructor Detail

CRSRemover

public CRSRemover()
CRSRemover constructor

Method Detail

getInternalID

int getInternalID(CRSIdentifiable identifiable)
            throws SQLException
Determines the database internal ID of the provided CRSIdentifiable object based on the CRSCodeType that it has

Parameters:
identifiable - the CRSIdentifiable object
Returns:
the database internal ID
Throws:
SQLException - if an SQLException occurs

removeIdentifiableAttributes

void removeIdentifiableAttributes(int internalID)
                            throws SQLException
Deletes the database table attributes: code, name, version, description, area.

Parameters:
internalID - the internal database ID
Throws:
SQLException - if an SQLException occurs

removeEllipsoid

void removeEllipsoid(Ellipsoid ellipsoid)
               throws SQLException
Deletes the provided ellipsoid object from the database.

Parameters:
ellipsoid - the Ellipsoid object
Throws:
SQLException - if an SQLException occurs

removePrimeMeridian

void removePrimeMeridian(PrimeMeridian pm)
                   throws SQLException
Deletes the provided prime meridian object from the database.

Parameters:
pm - the PrimeMeridian object
Throws:
SQLException - if an SQLException occurs

removeHelmert

void removeHelmert(Helmert helmert)
             throws SQLException
Deletes the provided Helmert transformation object from the database.

Parameters:
helmert - the Helmert transformation object
Throws:
SQLException - if an SQLException occurs

removeGeodeticDatum

void removeGeodeticDatum(GeodeticDatum datum)
                   throws SQLException
Removes from the database the geodetic datum provided

Parameters:
datum - the GeodeticDatum object
Throws:
SQLException - if an SQLException exception occurs

removeVerticalDatum

void removeVerticalDatum(VerticalDatum verticalDatum)
                   throws SQLException
Removes from the database the vertical datum provided

Parameters:
verticalDatum - the VerticalDatum object
Throws:
SQLException - if an SQLException occurs

removeProjection

void removeProjection(Projection projection)
                throws SQLException
Removes from the database the provided projection

Parameters:
projection - the Projection object
Throws:
SQLException - if an SQLException occurs

removeAxis

void removeAxis(Axis axis)
          throws SQLException
Removes from the database the provided axis object

Parameters:
axis - the Axis object
Throws:
SQLException - if an SQLException exception occurs

removeCRS

void removeCRS(CoordinateSystem crs)
         throws SQLException
Removes a CRS from the database. Before deleting a crs, it is checked if any identifiables are referencing it (with the exception of the referencing object that is given as parameter).

Parameters:
crs - to be removed
Throws:
SQLException - if an SQLException occurs

removeCRSList

public void removeCRSList(List<CoordinateSystem> crsList)
                   throws SQLException
Removes all the crs's provided as the arguments list

Parameters:
crsList - the list of s that will be removed from db
Throws:
SQLException - if an SQLException occurs

setConnection

public void setConnection(Connection conn)
Set the connection locally.

Parameters:
conn - the database Connection

closeConnection

public void closeConnection()
                     throws SQLException
Close the database connection

Throws:
SQLException

main

public static void main(String[] args)
                 throws Exception
Command-line tool for removing a CRS from the CRS db. It can be a given in WKT form (in a file), or as a reference to the xml crs file. Hence the argument list can be either To run this you have to set the environment variable CRS_DB_URL to jdbc:derby:${your-workspace-path}/d3_core/src/META-INF/deegreeCRS, otherwise the database will be accessed read-only, hence no changes will be possible.

Parameters:
args -
Throws:
Exception
Exception

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>