com.mizar.metadata.utils
Class GeorasterJDBCUtils

java.lang.Object
  extended by com.mizar.metadata.utils.GeorasterJDBCUtils

public class GeorasterJDBCUtils
extends java.lang.Object


Constructor Summary
protected GeorasterJDBCUtils()
           
 
Method Summary
static void createGrantReadPermissions(java.lang.String url, java.lang.String systemPassword, java.lang.String targetUser)
           
static void createLayerTables(java.sql.Connection conn, java.lang.String layerName, java.lang.String tablespace, boolean secureFiles, boolean dropExisting)
           
static void dropLayer(java.sql.Connection conn, java.lang.String layerName)
           
static java.util.List<java.lang.String> findFiles(java.lang.String folder, java.lang.String localRoot, java.lang.String targetRoot, java.lang.String ext, java.util.List<java.lang.String> loadedFiles)
          The method finds files of type ext on the machine running the application and returns them in a List excluding those files with names matching those in loadedFiles.
static java.util.List<java.lang.String> getLoadedFiles(java.sql.Connection conn, java.lang.String layer)
           
static void grantReadPermissions(java.sql.Connection conn, java.lang.String user, java.lang.String path)
           
static void grantReadPermissions(java.sql.Connection conn, java.lang.String user, java.lang.String path, java.lang.String localRoot, java.lang.String targetRoot)
           
static boolean grantReadPermissionsExtant(java.sql.Connection conn)
           
static int insertSdoGeomMetadata(javax.persistence.EntityManager em, java.lang.String tableName, java.lang.String columnName, java.util.List<SdoDimElement> dimInfo, int srid)
           
static int insertSdoGeomMetadataGeographic(javax.persistence.EntityManager em, java.lang.String tableName, java.lang.String columnName)
           
static int insertSdoGeomMetadataGeographic(javax.persistence.EntityManager em, java.lang.String tableName, java.lang.String columnName, int srid)
           
static int insertSdoGeomMetadataUTM(javax.persistence.EntityManager em, java.lang.String tableName, java.lang.String columnName, int srid)
           
static void loadGeoTiffFile(java.sql.Connection conn, java.lang.String fullFilePathName, java.lang.String rasterTable)
           
static void loadGeoTiffFile(java.sql.Connection conn, java.lang.String fullFilePathName, java.lang.String rasterTable, java.lang.String rdtTable, java.lang.String rasterName, java.lang.String storageParameters, java.lang.String sequenceName)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeorasterJDBCUtils

protected GeorasterJDBCUtils()
Method Detail

createGrantReadPermissions

public static void createGrantReadPermissions(java.lang.String url,
                                              java.lang.String systemPassword,
                                              java.lang.String targetUser)
                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

grantReadPermissionsExtant

public static boolean grantReadPermissionsExtant(java.sql.Connection conn)
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

grantReadPermissions

public static void grantReadPermissions(java.sql.Connection conn,
                                        java.lang.String user,
                                        java.lang.String path,
                                        java.lang.String localRoot,
                                        java.lang.String targetRoot)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

grantReadPermissions

public static void grantReadPermissions(java.sql.Connection conn,
                                        java.lang.String user,
                                        java.lang.String path)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

dropLayer

public static void dropLayer(java.sql.Connection conn,
                             java.lang.String layerName)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

loadGeoTiffFile

public static void loadGeoTiffFile(java.sql.Connection conn,
                                   java.lang.String fullFilePathName,
                                   java.lang.String rasterTable)
                            throws java.sql.SQLException
Parameters:
conn - an open connection
fullFilePathName - the full path name of the file to load
rasterTable - the name of the raster layer table
Throws:
java.sql.SQLException
See Also:
loadGeoTiffFile(Connection conn, String fullFilePathName, String rasterTable, String rdtTable, String rasterName, String storageParameters, String sequenceName)

loadGeoTiffFile

public static void loadGeoTiffFile(java.sql.Connection conn,
                                   java.lang.String fullFilePathName,
                                   java.lang.String rasterTable,
                                   java.lang.String rdtTable,
                                   java.lang.String rasterName,
                                   java.lang.String storageParameters,
                                   java.lang.String sequenceName)
                            throws java.sql.SQLException
Parameters:
conn - an open connection
fullFilePathName - the full path name of the file to load
rasterTable - the name of the raster layer table
rdtTable - if null defaults to RDT_rasterTable
rasterName - if null defaults to just the filename and extention parts of fullFilePathName
storageParameters - if null defaults to blocksize=(512,512,3)
sequenceName - if null defaults to RASTER_SEQUENCE
Throws:
java.sql.SQLException

createLayerTables

public static void createLayerTables(java.sql.Connection conn,
                                     java.lang.String layerName,
                                     java.lang.String tablespace,
                                     boolean secureFiles,
                                     boolean dropExisting)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

getLoadedFiles

public static java.util.List<java.lang.String> getLoadedFiles(java.sql.Connection conn,
                                                              java.lang.String layer)
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

findFiles

public static java.util.List<java.lang.String> findFiles(java.lang.String folder,
                                                         java.lang.String localRoot,
                                                         java.lang.String targetRoot,
                                                         java.lang.String ext,
                                                         java.util.List<java.lang.String> loadedFiles)
                                                  throws java.io.IOException
The method finds files of type ext on the machine running the application and returns them in a List excluding those files with names matching those in loadedFiles. If the application is running on a different than the database being loaded the beginning of the folder path may be different. The optional parameters localRoot and targetRoot can be used to convert the absolute file path name to match that on the database machine.

Parameters:
folder - the folder to search for files. This folder will be local to the machine running the application.
localRoot - the part of the local file absolute path that is different from the target (database) absolute path. E.g. "Y:"
targetRoot - the part of the target (database) path that is different from the local absolute path. E.g. "/rasterFiles". If the first character of targetRoot is a forward slash, "/", then all backward slashes in the absolute path will be converted to forward slashes.
ext - the file type, typically "tif". This test is case insensitive and may or may not include a leading period "."
loadedFiles - the file names, including name and extension but not any folder path, of files already loaded
Returns:
Throws:
java.io.IOException

insertSdoGeomMetadataUTM

public static int insertSdoGeomMetadataUTM(javax.persistence.EntityManager em,
                                           java.lang.String tableName,
                                           java.lang.String columnName,
                                           int srid)

insertSdoGeomMetadataGeographic

public static int insertSdoGeomMetadataGeographic(javax.persistence.EntityManager em,
                                                  java.lang.String tableName,
                                                  java.lang.String columnName,
                                                  int srid)

insertSdoGeomMetadataGeographic

public static int insertSdoGeomMetadataGeographic(javax.persistence.EntityManager em,
                                                  java.lang.String tableName,
                                                  java.lang.String columnName)

insertSdoGeomMetadata

public static int insertSdoGeomMetadata(javax.persistence.EntityManager em,
                                        java.lang.String tableName,
                                        java.lang.String columnName,
                                        java.util.List<SdoDimElement> dimInfo,
                                        int srid)

main

public static void main(java.lang.String[] args)