HiRISE

HiRISE.HiCat.Utilities
Class CRISM_Database_Loader

java.lang.Object
  extended by HiRISE.HiCat.Utilities.Database_Loader
      extended by HiRISE.HiCat.Utilities.CRISM_Database_Loader

public class CRISM_Database_Loader
extends Database_Loader

This class specifies the logic behind loading a CRISM database from a PDS data volume.

The CRISM database is stored in multiple index.tab files, instead of one single cumindex.tab file.

The information for the main operation of this class can be found under the Load_Database() and Load_Fields() methods.

Version:
1.5
Author:
Sean Whitsitt - UA/PIRL
See Also:
PIRL.Configuration, Loaded_Database, CRISM_Shapefile_Loader

Field Summary
static String DEFAULT_DIRECTORY
          The Default FTP directory if one is not otherwise specified
static long DEFAULT_ENTRY_BYTES
          The default number of bytes in an entry
static String DEFAULT_PASSWORD
          The Default FTP Password if one is not otherwise specified
static String DEFAULT_SERVER
          The Default FTP Server if one is not otherwise specified
static String DEFAULT_USERNAME
          The Default FTP Username if one is not otherwise specified
static String ID
          The Class identification with revision number
 
Fields inherited from class HiRISE.HiCat.Utilities.Database_Loader
Current_Entry, database, DEFAULT_CONFIG_FILENAME, DEFAULT_MAX_ENTRIES, ERROR, Error_Message, FINISHED, Max_Entries, OUT_OF_MEMORY, Status, UNFINISHED
 
Constructor Summary
CRISM_Database_Loader()
          Creates the loader with default values.
CRISM_Database_Loader(String server)
          Creates the loader with default values and a specified server.
CRISM_Database_Loader(String server, String directory)
          Creates the loader with default values and a specified server and directory.
CRISM_Database_Loader(String server, String directory, String username)
          Creates the loader with default values and a specified server, directory, and username.
CRISM_Database_Loader(String server, String directory, String username, String password)
          Creates the loader with a specified server, directory, username, and password.
 
Method Summary
 void Load_Database()
          This method adds information to the database.
 void Load_Fields()
          This method adds fields to the database.
static String PDS_To_MYSQL_Datetime(String pds)
          This method will convert a pds datetime to a mysql datetime
 
Methods inherited from class HiRISE.HiCat.Utilities.Database_Loader
Clear_Data, Get_Current_Entry, Get_Data, Get_Error_Message, Get_Fields, Get_Max_Entries, Get_Status, Initialize, Initialize, Initialize, Initialize, Remove_Data, Set_Configuration, Set_Configuration, Set_Current_Entry, Set_Max_Entries, Validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
The Class identification with revision number

See Also:
Constant Field Values

DEFAULT_SERVER

public static final String DEFAULT_SERVER
The Default FTP Server if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_DIRECTORY

public static final String DEFAULT_DIRECTORY
The Default FTP directory if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_USERNAME

public static final String DEFAULT_USERNAME
The Default FTP Username if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_PASSWORD

public static final String DEFAULT_PASSWORD
The Default FTP Password if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_ENTRY_BYTES

public static final long DEFAULT_ENTRY_BYTES
The default number of bytes in an entry

See Also:
Constant Field Values
Constructor Detail

CRISM_Database_Loader

public CRISM_Database_Loader()
Creates the loader with default values.

Default Values:
   DEFAULT_SERVER    DEFAULT_DIRECTORY    DEFAULT_USERNAME    DEFAULT_PASSWORD    DEFAULT_ENTRY_BYTES


CRISM_Database_Loader

public CRISM_Database_Loader(String server)
Creates the loader with default values and a specified server.

Default Values:
   DEFAULT_DIRECTORY    DEFAULT_USERNAME    DEFAULT_PASSWORD    DEFAULT_ENTRY_BYTES

Parameters:
server - The specified FTP server.


CRISM_Database_Loader

public CRISM_Database_Loader(String server,
                             String directory)
Creates the loader with default values and a specified server and directory.

Default Values:
   DEFAULT_USERNAME    DEFAULT_PASSWORD    DEFAULT_ENTRY_BYTES

Parameters:
server - The specified FTP server.
directory - The specified start directory on the FTP server.


CRISM_Database_Loader

public CRISM_Database_Loader(String server,
                             String directory,
                             String username)
Creates the loader with default values and a specified server, directory, and username.

Default Values:
   DEFAULT_PASSWORD    DEFAULT_ENTRY_BYTES

Parameters:
server - The specified FTP server.
directory - The specified start directory on the FTP server.
username - The specified username to log in with.


CRISM_Database_Loader

public CRISM_Database_Loader(String server,
                             String directory,
                             String username,
                             String password)
Creates the loader with a specified server, directory, username, and password. Uses a default number of bytes for entries.

Default Value:
   DEFAULT_ENTRY_BYTES

Parameters:
server - The specified FTP server.
directory - The specified start directory on the FTP server.
username - The specified username to log in with.
password - The specified password to log in with.

Method Detail

PDS_To_MYSQL_Datetime

public static String PDS_To_MYSQL_Datetime(String pds)
This method will convert a pds datetime to a mysql datetime

The format seen in the PDS imaging data volumes is "yyyy-mm-ddThh:mm:ss.sss" which this method converts to the format "yyyy-mm-dd hh:mm:ss"

Parameters:
pds - The PDS datetime String
Returns:
The mysql datetime String

Load_Database

public void Load_Database()
This method adds information to the database.

If a label file is not currently loaded this method will load a new one if one is available. If no label file is available then the method will exit and set the status to FINISHED.

This method adds entries line by line to the database. The GIS information for the CENTER and FOOTPRINT fields are created from the longitude/latitude data stored in the PDS data volume. The method should only fail if an IOException is caught or if there are no fields at the time it is run. Then it sets the loader's status to ERROR and puts the message from the exception into the error message.

Note: The field "LINES" from the PDS data volume has been changed to "IMAGE_LINES" and many of the fields from the PDS data volume are not included in the local CRISM catalog. These alterations should be stored in the configuration file that gets passed to this class in its initialization. See the abstract loader class for more information.

Specified by:
Load_Database in class Database_Loader

Load_Fields

public void Load_Fields()
This method adds fields to the database.

For this Class fields are loaded in the Load_Database() method since it must load multiple label and table files.

Specified by:
Load_Fields in class Database_Loader

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona