public class CTX_Database_Loader extends Database_Loader
The information for the main operation of this class can be found
under the Load_Database()
and Load_Fields()
methods.
PIRL.Configuration
,
Loaded_Database
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ENTRY_BYTES
The default number of bytes in an entry
|
static java.lang.String |
DEFAULT_LABEL
The Default Label URL if one is not otherwise specified
|
static java.lang.String |
DEFAULT_URL
The Default URL if one is not otherwise specified
|
static java.lang.String |
ID
The Class identification with revision number
|
Current_Entry, database, DEFAULT_CONFIG_FILENAME, DEFAULT_MAX_ENTRIES, ERROR, Error_Message, FINISHED, Max_Entries, OUT_OF_MEMORY, Status, UNFINISHED
Constructor and Description |
---|
CTX_Database_Loader()
|
CTX_Database_Loader(java.lang.String url)
|
CTX_Database_Loader(java.lang.String url,
java.lang.String label)
Creates the loader with the specified URL, the specified Label and the
default number of bytes in an entry. |
CTX_Database_Loader(java.lang.String url,
java.lang.String label,
java.lang.String bytes)
Creates the loader with the specified URL, the specified label, and the specified bytes per entry.
|
CTX_Database_Loader(java.net.URL url)
|
Modifier and Type | Method and Description |
---|---|
java.net.URL |
Get_URL()
Gets the current URL object.
|
void |
Load_Database()
Loads the CTX database from the PDS data volume at the currently specified URL.
|
void |
Load_Fields()
This method adds fields to the database.
|
static java.lang.String |
PDS_To_MYSQL_Datetime(java.lang.String pds)
This method will convert a pds datetime to a mysql datetime
|
void |
Set_URL(java.lang.String url)
Sets the URL to a new URL.
|
void |
Set_URL(java.net.URL url)
Sets the URL to a new URL.
|
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
public static final java.lang.String ID
public static final java.lang.String DEFAULT_URL
public static final java.lang.String DEFAULT_LABEL
public static final long DEFAULT_ENTRY_BYTES
public CTX_Database_Loader() throws java.net.MalformedURLException
default
URL, the default
number of bytes in an entry, and the default
label URL..
java.net.MalformedURLException
- Thrown if the creation of the URL fails.public CTX_Database_Loader(java.lang.String url) throws java.net.MalformedURLException
default
number of bytes in an entry, and the default
label URL.
url
- The specified URL as a String.java.net.MalformedURLException
- Thrown if the creation of the URL fails.public CTX_Database_Loader(java.net.URL url)
default
number of bytes in an entry, and the default
label URL..
url
- The specified URL as a URL object and the default
number of bytes in an entry.public CTX_Database_Loader(java.lang.String url, java.lang.String label) throws java.net.MalformedURLException
default
number of bytes in an entry.
url
- The specified URL as a Stringlabel
- The specified label URL as a Stringjava.net.MalformedURLException
- Thrown if the creation of the URL fails.public CTX_Database_Loader(java.lang.String url, java.lang.String label, java.lang.String bytes) throws java.net.MalformedURLException, java.lang.NumberFormatException
url
- The specified URL as a String.label
- The specified label URL as a Stringbytes
- The specified bytes per entry as a Stringjava.net.MalformedURLException
- Thrown if the creation of the URL fails.java.lang.NumberFormatException
- Thrown if the conversion of the bytes fails.public void Set_URL(java.lang.String url) throws java.net.MalformedURLException
url
- The new URL as a String.java.net.MalformedURLException
- Thrown if the creation of the URL fails.public void Set_URL(java.net.URL url)
url
- The new URL as a URL object.public java.net.URL Get_URL()
public static java.lang.String PDS_To_MYSQL_Datetime(java.lang.String pds)
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"
pds
- The PDS datetime Stringpublic void Load_Fields()
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" and the fields "ORIGINAL_PRODUCT_ID" and "INSTRUMENT_ID" are not
included in the data placed into the database
.
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.
Load_Fields
in class Database_Loader
public void Load_Database()
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 "IMAGE_TIME" field is converted using the PDS_To_MYSQL_Datetime
method. It is important to note that this action does not
occur because of information in the configuration file.
Load_Database
in class Database_Loader
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona