public class Archive_DTM
extends java.lang.Object
The configuration file needs to contain references to several resources that aid in the ingestion of product metadata into the database. The configuration file should look something like this:
@INCLUDE = "/HiRISE/Configuration/HiROC.conf" Server = HiCat Group = DTM ORTHO_MAP = "PVL_to_DB.ORTHO" DTM_MAP = "PVL_to_DB.DTM" EXTRA_MAP = "Added_Params.map" DTM_ROOT_DIR = "/HiRISE/Data/DTM" DTM_EXTRAS_ROOT_DIR = "/HiRISE/Data/Extras/DTM" EndGroup End
The ORTHO_MAP, DTM_MAP, and EXTRA_MAP parameters refer to PVL_to_DB
map files which are used to map product metadata from various products and
files that are created during the DTM production procedure into the database.
The DTM_ROOT_DIR and DTM_EXTRAS_ROOT_DIR parameters specify the archive locations on the filesystem for the different DTM product types. Note: This directories are not the location of the staging area where products might be stored prior to archiving.
TODO:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEBUG_ARCHIVE_PROPERTY |
static java.lang.String |
DEBUG_EXTRA_SOURCE_PROPERTY |
static java.lang.String |
DEBUG_EXTRAS_PROPERTY |
static java.lang.String |
DEBUG_LABEL_SOURCE_PROPERTY |
static java.lang.String |
DEBUG_MAIN_PROPERTY |
static java.lang.String |
DEBUG_MAP_PROPERTY |
static java.lang.String |
DEBUG_PRODUCT_TYPE_PROPERTY |
static java.lang.String |
DEFAULT_CONFIGURATION_FILENAME |
static int |
EXIT_COMMAND_LINE_SYNTAX_ERROR |
static int |
EXIT_CONFIGURATION_ERROR |
static int |
EXIT_DATABASE_ERROR |
static int |
EXIT_IO_ERROR |
static int |
EXIT_MAP_SYNTAX_ERROR |
static int |
EXIT_MISSING_FILE_ERROR |
static int |
EXIT_PARSE_ERROR |
static int |
EXIT_PVL_ERROR |
static int |
EXIT_SUCCESS |
static int |
EXIT_UNRESOLVED_REFERENCE_ERROR |
static java.lang.String |
ID
Class identifier
|
Constructor and Description |
---|
Archive_DTM(java.lang.String configurationFile)
Instantiate the archiver
|
Modifier and Type | Method and Description |
---|---|
void |
archiveExtrasProducts(java.lang.String data_dir)
Archive the extras products found in the given data directory and ingest
the file metadata into a database.
|
void |
archiveProducts(java.lang.String data_dir)
Archive the standard PDS products found in the given data directory and
ingest the product metadata into a database.
|
java.lang.String |
getBaseDir()
Get the base directory, ie the working directory for the application.
|
static java.lang.String |
getDTMProductType(java.lang.String product_id)
A convenience method to aid in determining the type of standard product
based on the information encoded in the product ID.
|
java.util.Vector<java.io.File> |
getExtrasFiles(java.lang.String basedir)
Get a list of extras files found in the given directory.
|
boolean |
getNoop()
Get the noop flag setting.
|
java.lang.String |
getOrbitDirectory(PIRL.PVL.Parameter product_id,
PIRL.PVL.Parameter source_products) |
boolean |
getOverWriteFiles() |
java.lang.String |
getProductDir(PIRL.PVL.Parameter product_id,
PIRL.PVL.Parameter source_products)
Get the product directory the input product should be stored in
|
java.util.Vector<java.io.File> |
getProductFiles(java.lang.String basedir)
Get the list of product files to be found in the given base directory.
|
int |
getSequenceNumber(PIRL.PVL.Parameter product_id) |
boolean |
getVerbose()
Get the current verbose setting.
|
static void |
main(java.lang.String[] arguments)
Archive HiRISE DTM PDS products and associated extras.
|
void |
setBaseDir(java.lang.String basedir)
Set the base directory location.
|
void |
setNoop(boolean noop)
Set the noop flag, if noop is true, then no operations will be performed.
|
void |
setOverWriteFiles(boolean overwrite) |
void |
setVerbose(boolean verbose)
Output additional status information while archiving.
|
static void |
Usage()
Prints the command line usage syntax.
|
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILENAME
public static final int EXIT_SUCCESS
public static final int EXIT_CONFIGURATION_ERROR
public static final int EXIT_DATABASE_ERROR
public static final int EXIT_PVL_ERROR
public static final int EXIT_IO_ERROR
public static final int EXIT_PARSE_ERROR
public static final int EXIT_MAP_SYNTAX_ERROR
public static final int EXIT_UNRESOLVED_REFERENCE_ERROR
public static final int EXIT_COMMAND_LINE_SYNTAX_ERROR
public static final int EXIT_MISSING_FILE_ERROR
public static final java.lang.String DEBUG_MAP_PROPERTY
public static final java.lang.String DEBUG_EXTRA_SOURCE_PROPERTY
public static final java.lang.String DEBUG_LABEL_SOURCE_PROPERTY
public static final java.lang.String DEBUG_EXTRAS_PROPERTY
public static final java.lang.String DEBUG_PRODUCT_TYPE_PROPERTY
public static final java.lang.String DEBUG_ARCHIVE_PROPERTY
public static final java.lang.String DEBUG_MAIN_PROPERTY
public Archive_DTM(java.lang.String configurationFile) throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception, PIRL.PVL.PVL_Exception
configurationFile
- The configuration file namePIRL.Configuration.Configuration_Exception
- If the configuration file is malformed or does
not existPIRL.Database.Database_Exception
- if a database connection cannot be establishedPIRL.PVL.PVL_Exception
- if any of the map files listed in the configuration
file are missing or unreadable.public void setBaseDir(java.lang.String basedir)
public java.lang.String getBaseDir()
public java.lang.String getProductDir(PIRL.PVL.Parameter product_id, PIRL.PVL.Parameter source_products) throws Invalid_Argument_Exception, PIRL.PVL.PVL_Exception
product_id
- source_products
- Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
public java.lang.String getOrbitDirectory(PIRL.PVL.Parameter product_id, PIRL.PVL.Parameter source_products) throws PIRL.PVL.PVL_Exception, java.lang.NumberFormatException, Out_of_Range_Exception, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
java.lang.NumberFormatException
Out_of_Range_Exception
Invalid_Argument_Exception
public int getSequenceNumber(PIRL.PVL.Parameter product_id) throws Invalid_Argument_Exception, PIRL.PVL.PVL_Exception
Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
public java.util.Vector<java.io.File> getProductFiles(java.lang.String basedir) throws java.io.IOException, PIRL.PVL.PVL_Exception, PIRL.Database.Database_Exception
basedir
- - the directory containing the product files.java.io.IOException
- if any of the products in the file list can't be accessed.PIRL.PVL.PVL_Exception
- if the pvl file containing extra metadata cannot be read.PIRL.Database.Database_Exception
public java.util.Vector<java.io.File> getExtrasFiles(java.lang.String basedir) throws java.io.IOException
basedir
- - the directory containing the list of extras files to be archived.java.io.IOException
- if any of the files cannot be accessed.public static java.lang.String getDTMProductType(java.lang.String product_id)
product_id
- - product id to use to determine the product type.public void archiveProducts(java.lang.String data_dir) throws java.io.IOException, PIRL.PVL.PVL_Exception, PIRL.Configuration.Configuration_Exception, java.text.ParseException, PIRL.Database.Database_Exception, PIRL.PVL.Invalid_Map_Syntax, PIRL.Conductor.Unresolved_Reference, java.lang.InterruptedException, Invalid_Argument_Exception, java.lang.NumberFormatException, Out_of_Range_Exception
data_dir
- - a staging directory containing PDS products to be archived.java.io.IOException
PIRL.PVL.PVL_Exception
PIRL.Configuration.Configuration_Exception
java.text.ParseException
PIRL.Database.Database_Exception
PIRL.PVL.Invalid_Map_Syntax
PIRL.Conductor.Unresolved_Reference
java.lang.InterruptedException
Invalid_Argument_Exception
Out_of_Range_Exception
java.lang.NumberFormatException
public void archiveExtrasProducts(java.lang.String data_dir) throws java.io.IOException, PIRL.Database.Database_Exception, java.lang.InterruptedException
data_dir
- - the directory containing the extras files.java.io.IOException
PIRL.Database.Database_Exception
java.lang.InterruptedException
public void setOverWriteFiles(boolean overwrite)
public boolean getOverWriteFiles()
public void setNoop(boolean noop)
noop
- - the noop flag, set to true to test the operations without
archiving or ingesting any metadata.public boolean getNoop()
public void setVerbose(boolean verbose)
verbose
- public boolean getVerbose()
public static void main(java.lang.String[] arguments)
Command line syntax is described in the Usage()
method.
Exit status values:
0 - Success 1 - Configuration Error 2 - Database Error 3 - PVL Syntax Error 4 - Input/Output Error 5 - Parsing Error (pvl parsing error) 6 - Map Error (pvl to db map error) 7 - Unresolved Reference Error 8 - Command line Syntax Error 9 - Missing File Error
arguments
- - command line argumentsUsage()
public static void Usage()
Usage: HiTList <Options> Options - [-Configuration <filename>] (default: /HiRISE/Configuration/DTM/DTM.conf) [-Data_dir <directory>] [-Extras_dir <directory>] [-Help] [-Overwrite_Extras] [-Verbose]
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona