HiRISE

HiRISE.HiCat.Utilities
Class MOC_Database_Loader

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

Deprecated. The USGS has reprocessed the MOC data to improve the geometry parameters. The PDS data has been superceded by the USGS processing, therefore this class isn't needed, but is being included in case it proves useful at some point in the future.

public class MOC_Database_Loader
extends Database_Loader

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

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

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

Field Summary
static long DEFAULT_ENTRY_BYTES
          Deprecated. The default number of bytes in an entry.
static String DEFAULT_LABEL
          Deprecated. The Default Label URL if one is not otherwise specified
static String DEFAULT_URL
          Deprecated. The Default URL if one is not otherwise specified
static String ID
          Deprecated. 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
MOC_Database_Loader()
          Deprecated. Creates the loader with the default URL, the default label, and the default entry bytes.
MOC_Database_Loader(String url)
          Deprecated. Creates the loader with the specified URL, the default label, and the default entry bytes.
MOC_Database_Loader(String url, String label)
          Deprecated. Creates the loader with the specified URL, the specified label, and the default entry bytes.
MOC_Database_Loader(String url, String label, String bytes)
          Deprecated. Creates the loader with the specified URL, the specified label, and the specified entry bytes.
MOC_Database_Loader(URL url)
          Deprecated. Creates the loader with the specified URL, the default label, and the default entry bytes.
 
Method Summary
 URL Get_URL()
          Deprecated. Gets the current URL object.
 void Load_Database()
          Deprecated. Loads the MOC database from the PDS data volume at the currently specified URL.
 void Load_Fields()
          Deprecated. This method adds fields to the database.
static String PDS_To_MYSQL_Datetime(String pds)
          Deprecated. This method will convert a pds datetime to a mysql datetime
 void Set_URL(String url)
          Deprecated. Sets the URL to a new URL.
 void Set_URL(URL url)
          Deprecated. Sets the URL to a new URL.
 
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
Deprecated. 
The Class identification with revision number

See Also:
Constant Field Values

DEFAULT_URL

public static final String DEFAULT_URL
Deprecated. 
The Default URL if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_LABEL

public static final String DEFAULT_LABEL
Deprecated. 
The Default Label URL if one is not otherwise specified

See Also:
Constant Field Values

DEFAULT_ENTRY_BYTES

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

See Also:
Constant Field Values
Constructor Detail

MOC_Database_Loader

public MOC_Database_Loader()
                    throws MalformedURLException
Deprecated. 
Creates the loader with the default URL, the default label, and the default entry bytes.

Throws:
MalformedURLException - Thrown if the creation of the URL fails.

MOC_Database_Loader

public MOC_Database_Loader(String url)
                    throws MalformedURLException
Deprecated. 
Creates the loader with the specified URL, the default label, and the default entry bytes.

Parameters:
url - The specified URL as a String.
Throws:
MalformedURLException - Thrown if the creation of the URL fails.

MOC_Database_Loader

public MOC_Database_Loader(URL url)
Deprecated. 
Creates the loader with the specified URL, the default label, and the default entry bytes.

Parameters:
url - The specified URL as a URL object.

MOC_Database_Loader

public MOC_Database_Loader(String url,
                           String label)
                    throws MalformedURLException
Deprecated. 
Creates the loader with the specified URL, the specified label, and the default entry bytes.

Parameters:
url - The specified URL as a String.
label - The specified Label URL as a String.
Throws:
MalformedURLException - Thrown if the creation of the URL fails.

MOC_Database_Loader

public MOC_Database_Loader(String url,
                           String label,
                           String bytes)
                    throws MalformedURLException,
                           NumberFormatException
Deprecated. 
Creates the loader with the specified URL, the specified label, and the specified entry bytes.

Parameters:
url - The specifed URL as a String
label - The specified Label URL as a String.
bytes - The specified number of bytes in an entry as a String
Throws:
MalformedURLException - thrown when the URL creation fails.
NumberFormatException - thrown when the bytes is not a properly formated long.
Method Detail

Set_URL

public void Set_URL(String url)
             throws MalformedURLException
Deprecated. 
Sets the URL to a new URL.

Parameters:
url - The new URL as a String.
Throws:
MalformedURLException - Thrown if the creation of the URL fails.

Set_URL

public void Set_URL(URL url)
Deprecated. 
Sets the URL to a new URL.

Parameters:
url - The new URL as a URL object.

Get_URL

public URL Get_URL()
Deprecated. 
Gets the current URL object.

Returns:
The current URL object.

PDS_To_MYSQL_Datetime

public static String PDS_To_MYSQL_Datetime(String pds)
Deprecated. 
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_Fields

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

This method adds fields to the database then sets the Unique Key to "PRODUCT_ID". The fields are first cleared from the database so that they cannot be added twice.

Note: The field "LINES" from the PDS data volume has been changed to "IMAGE_LINES".

Specified by:
Load_Fields in class Database_Loader

Load_Database

public void Load_Database()
Deprecated. 
Loads the MOC database from the PDS data volume at the currently specified URL.

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 in the database when 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 "IMAGE_TIME" field is converted using the PDS_To_MYSQL_Datetime method.

Specified by:
Load_Database 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