public class THEMIS_IR_Database_Loader extends Database_Loader
The information for the main operation of this class can be found
under the Load_Database()
method.
A label url can be specified for this class. This is used to load
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 URL for the label file.
|
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 |
---|
THEMIS_IR_Database_Loader()
|
THEMIS_IR_Database_Loader(java.lang.String url)
|
THEMIS_IR_Database_Loader(java.lang.String url,
java.lang.String label)
Creates the loader with the specified URL, the
default entry bytes, and the
specified label. |
THEMIS_IR_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 entry bytes.
|
THEMIS_IR_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 MOC 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 THEMIS_IR_Database_Loader() throws java.net.MalformedURLException
java.net.MalformedURLException
- Thrown if the creation of the URL fails.public THEMIS_IR_Database_Loader(java.lang.String url) throws java.net.MalformedURLException
url
- The specified URL as a String.java.net.MalformedURLException
- Thrown if the creation of the URL fails.public THEMIS_IR_Database_Loader(java.net.URL url)
url
- The specified URL as a URL object.public THEMIS_IR_Database_Loader(java.lang.String url, java.lang.String label) throws java.net.MalformedURLException
default
entry bytes, and the
specified label.
url
- The specified URL as a String.label
- The specified URL for the labeljava.net.MalformedURLException
- Thrown if the creation of the URL fails.public THEMIS_IR_Database_Loader(java.lang.String url, java.lang.String label, java.lang.String bytes) throws java.net.MalformedURLException, java.lang.NumberFormatException
url
- The specifed URL as a Stringlabel
- The specified URL for the label.bytes
- The specified number of bytes in an entry as a Stringjava.net.MalformedURLException
- thrown when the URL creation fails.java.lang.NumberFormatException
- thrown when the bytes is not a properly formated long.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 "OBSERVATION_ID". The fields are first cleared
from the database
so that they cannot be
added twice.
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 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 "START_TIME" and "STOP_TIME" fields are converted using the
PDS_To_MYSQL_Datetime
method.
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