public class Description_Check
extends java.lang.Object
Since the main method is expected to be be called within the context of a cron job, a configuration file is needed to specify database connection parameters as well as logging locations and where notification emails should be sent.
The configuration file should be a PVL file containing database connection parameters, a Log_Dir parameter specifying the location to create log files, and a notify parameter containing a list of email addresses that should be notified when mismatched descriptions are found.
Product label checking via http has been implemented to work around single
threaded nfs problems. Label checking via http is now the default label
checking method, to check label using the local file system use the
runLabelChecksLocally(boolean)
method.
Checking labels via http assumes a url path that matches the HiRISE
file system layout such that http:/host/HiRISE/Data/
Several system properties may be enabled to output different sorts of
debugging information during program execution. The system property
names are defined by the various DEBUG* static variables defined below.System Properties and Debugging
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
Bad_Characters_List
This is the list of regexp character names that should not appear within
the Rationale_Desc fields of HiRISE Images.
|
static java.lang.String |
DEBUG_DISABLE_LABEL_PARSING
System properties related to debugging.
|
static java.lang.String |
DEBUG_HTTP_PROPERTY
System properties related to debugging.
|
static java.lang.String |
DEBUG_LABEL_PROPERTY
System properties related to debugging.
|
static java.lang.String |
DEBUG_QUERIES_PROPERTY
System properties related to debugging.
|
static java.lang.String |
DEBUG_QUEUES_PROPERTY
System properties related to debugging.
|
static java.lang.String |
DEFAULT_BASE_URL
The base URL to use for http label queries
|
static java.lang.String |
DEFAULT_CONFIGURATION_FILENAME |
static java.lang.String |
DEFAULT_FROM_ADDRESS |
static int |
DEFAULT_RETRY_COUNT
The default number of times to attempt to read a product label if the first
attempt fails due to an IO error of some kind.
|
static java.lang.String |
ID |
Constructor and Description |
---|
Description_Check(PIRL.Configuration.Configuration configuration)
Instantiate a Description_Check object to perform checks on the product
descriptions of HiRISE products.
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector<java.util.Vector<java.lang.String>> |
Check_EDR_Rationale_Desc(java.lang.String observation_id)
Checks the RATIONALE_DESC field in the EDR_Products table against the
STL_DESCRIPTION field in the Suggested_Observations table.
|
java.util.Vector<java.util.Vector<java.lang.String>> |
Check_Product_Label_Desc(java.lang.String observation_id) |
java.util.Vector<java.util.Vector<java.lang.String>> |
Check_RDR_Rationale_Desc(java.lang.String observation_id)
Checks the RATIONALE_DESC field in the RDR_Products table against the
STL_DESCRIPTION field in the Suggested_Observations table.
|
java.util.Vector<java.util.Vector<java.lang.String>> |
Check_STL_Descriptions(boolean all_descriptions,
boolean cal_descriptions,
java.lang.String observation_id)
Checks the Suggested_Observations.STL_DESCRIPTION field for bad characters.
|
void |
checkEDRProductsLabels(boolean label_check)
This setting controls whether or not the EDR Product labels will be checked.
|
int |
Checker_Threads()
Get the current number of threads that will be created to check the
RATIONALE_DESC parameter in the product label files.
|
void |
Checker_Threads(int thread_number)
Sets the number of threads to use when checking product labels.
|
void |
checkRDRProductLabels(boolean label_check)
This setting controls whether or not the RDR Product labels are to be
checked.
|
static void |
main(java.lang.String[] arguments)
Check the descriptions of HiRISE Products.
|
int |
productErrorCount() |
void |
runLabelChecksLocally(boolean local)
Should the label check operation be performed on local files? If set to
true, then the label check operations will be performed using locally mounted
file systems.
|
static void |
Usage(int status)
Prints command line usage syntax
|
boolean |
Verbose()
Get the current verbose status
|
void |
Verbose(boolean verbose)
Turn verbose status to true or false.
|
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILENAME
public static final java.lang.String DEFAULT_BASE_URL
public static final java.lang.String DEFAULT_FROM_ADDRESS
public static final java.lang.String DEBUG_HTTP_PROPERTY
public static final java.lang.String DEBUG_QUERIES_PROPERTY
public static final java.lang.String DEBUG_LABEL_PROPERTY
public static final java.lang.String DEBUG_QUEUES_PROPERTY
public static final java.lang.String DEBUG_DISABLE_LABEL_PARSING
public static final int DEFAULT_RETRY_COUNT
public static final java.lang.String[] Bad_Characters_List
public Description_Check(PIRL.Configuration.Configuration configuration) throws PIRL.Database.Database_Exception, PIRL.Configuration.Configuration_Exception
configuration
- A Configuration containing database connection parametersPIRL.Database.Database_Exception
- - if a database connection connot be establishedPIRL.Configuration.Configuration_Exception
- - if the configuration does not contain the
required connection parameterspublic java.util.Vector<java.util.Vector<java.lang.String>> Check_STL_Descriptions(boolean all_descriptions, boolean cal_descriptions, java.lang.String observation_id) throws PIRL.Database.Database_Exception
all_descriptions
- if true, then all suggestions will be checked. If
false, then only suggestions associated with acquired observations will be
checked.cal_descriptions
- if true, the suggestions with a TARGET_NAME of CAL will
be checked.observation_id
- if this a non-null value, then this will restrict the
checked suggestions to RETIRING_OBSERVATION_IDs that match this value. If the
value is null, then this restriction will not be applied.PIRL.Database.Database_Exception
- - if the database query could not be executed.public java.util.Vector<java.util.Vector<java.lang.String>> Check_EDR_Rationale_Desc(java.lang.String observation_id) throws PIRL.Database.Database_Exception
observation_id
- If the observation_id is a non-null value, only EDRs with
observation ids matching this value will be checked. If null, then no
observation id restriction will be applied.PIRL.Database.Database_Exception
public java.util.Vector<java.util.Vector<java.lang.String>> Check_RDR_Rationale_Desc(java.lang.String observation_id) throws PIRL.Database.Database_Exception
observation_id
- If the observation_id is a non-null value, only EDRs with
observation ids matching this value will be checked. If null, then no
observation id restriction will be applied.PIRL.Database.Database_Exception
public java.util.Vector<java.util.Vector<java.lang.String>> Check_Product_Label_Desc(java.lang.String observation_id) throws PIRL.Database.Database_Exception
PIRL.Database.Database_Exception
public void Verbose(boolean verbose)
verbose
- - a boolean value, if true then extra status information is
printed to standard out.public boolean Verbose()
public void Checker_Threads(int thread_number)
Check_Product_Label_Desc(String)
method.thread_number
- - the number of parallel threads to use to speed up label
checkingpublic int Checker_Threads()
public void checkEDRProductsLabels(boolean label_check)
label_check
- public void checkRDRProductLabels(boolean label_check)
label_check
- public void runLabelChecksLocally(boolean local)
local
- - boolean, if true, then label checks will be performed locally.public int productErrorCount()
public static void main(java.lang.String[] arguments)
The command line syntax is described by the Usage
method.
Each filename specified will be unretired, some suggestions may need to be cloned rather than simply unretired.
Exit Status Values
0 - Success
1 - Configuration Error
2 - Database Error
3 - Command Line Syntax Error
arguments
- an array of command line argumentspublic static final void Usage(int status)
Usage: Description_Check <Options> Options: - [-Configuration <filename>] [-EDR_Descriptions_Check] [-File_Checks_Run_Locally] [-Help] [-Iclude_Cal_Descriptions] [-Log_to_file] [-Mail_report] [-NE] negate EDR Product checks [-NR] negate RDR Product checks [-Product_Descriptions_Check] [-RDR_Descriptions_Check] [-STL_Descriptions_Check] [-Threads <number of threads>] [-Verbose]
status
- - the exit status to returnCopyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona