public abstract class Product_CleanUp extends java.lang.Object implements CleanUp
The Product_CleanUp class partially implements the CleanUp interface and provides some convenience methods to allow subclasses to more quickly initialize themselves.
Subclasses need to implement the Clean_Up_Products(Vector)
,
Column_Names()
, Find_Products(String, int, int)
, and
Product_Data(String, String, String)
methods of the CleanUp interface.
Note: Each instance of this class (or subclass) will instantiate it's own database connection. This allows multiple intances to operate independently of each other at the same time.
CleanUp
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CONFIGURATION_FILE |
static java.lang.String |
ID |
protected boolean |
isCLI |
javax.swing.event.SwingPropertyChangeSupport |
Property_Changer |
protected boolean |
Verbose |
ABSOLUTE_MAXIMUM_ORBIT_NUMBER, ANAGLYPH, DEFAULT_MAXIMUM_ORBIT_NUMBER, DEFAULT_MINIMUM_ORBIT_NUMBER, EDR, EDR_EXTRAS, IDLE_STATUS_MESSAGE, INDEX_TABLE_UPDATE_PROPERTY_NAME, MAXIMUM_UPDATES_BEFORE_COMMIT, OLD_VERSION_ID_ALIAS, PREPARE_STATUS_PROPERTY_NAME, PREPARE_STATUS_ROW_PROPERTY_NAME, RDR, RDR_EXTRAS, RELEASED_VERSION_ID_ALIAS, REMOVAL_STATUS_COUNT_PROPERTY_NAME, REMOVING_PRODUCT_PROPERTY_NAME, SEARCH_STATUS_COMPILING_DATA, SEARCH_STATUS_COMPLETE, SEARCH_STATUS_CONSTRUCT, SEARCH_STATUS_EXECUTE, SEARCH_STATUS_PROPERTY_NAME, SEARCH_STATUS_START, Status_Hash
Constructor and Description |
---|
Product_CleanUp()
The default constructor.
|
Product_CleanUp(PIRL.Configuration.Configuration configuration)
Construct a new Product_CleanUp object with a configuration object, useful for
gui wrappers.
|
Product_CleanUp(java.lang.String configuration_file)
Construct a new Product_CleanUp object specifing the configuration file to use
as a string.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
As a CleanUp class processes a list of products, property change events
are fired to indicate the products currently being processed.
|
abstract void |
Clean_Up_Products(java.util.Vector<Product> products)
Subclasses need to implement this method for the particular type of product
that is to be cleaned up.
|
abstract java.util.Vector<java.lang.String> |
Column_Names()
A convenience function allowing other applications, particularly gui's, easy
access to the list of columns retrieved from the database during the
Find_Products(String, int, int) method call. |
protected void |
File_Status_Tests(java.io.File test_file)
A utility method for outputting various file status values to aid in
determining file access or deletion problems in the subclassess of this
class.
|
abstract java.util.Vector<java.util.Vector<java.lang.String>> |
Find_Products(java.lang.String observation_id,
int start_orbit,
int end_orbit)
This method should retrieve a list of products from the database that can
be removed from the file system because newer versions of these products have
been released.
|
java.lang.String |
Get_Catalog()
Get the database catalog specified within the configuration.
|
PIRL.Configuration.Configuration |
Get_Configuration()
Get the configuration object used to initialize the class
|
PIRL.Database.Database |
Get_Database()
Get the Database object created upon the construction of an instance of
this class
|
boolean |
isCLI()
Gets the current command line state of the class.
|
void |
isCLI(boolean cli)
Sets command line mode.
|
protected static void |
Print_Progress(double progress,
int total_width,
boolean finished) |
abstract Product |
Product_Data(java.lang.String product_id,
java.lang.String version,
java.lang.String type)
This method should create a Product instance by retrieving the product
information from the database.
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
Search_Status_Hash()
Returns the list of status values that are fired as property changes during
the search process.
|
boolean |
Verbose()
Returns the current verbosity setting.
|
void |
Verbose(boolean verbose)
Set verbose to true.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Create_Archive_Table, Drop_Archive_Table
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILE
protected boolean Verbose
protected boolean isCLI
public javax.swing.event.SwingPropertyChangeSupport Property_Changer
public Product_CleanUp() throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception
DEFAULT_CONFIGURATION_FILE
for the configuration file
to use.PIRL.Configuration.Configuration_Exception
- if a problem with the configuration file is encounteredPIRL.Database.Database_Exception
- if a problem initializing the database connection is encounteredpublic Product_CleanUp(java.lang.String configuration_file) throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception
configuration_file
- - the configuration to use to configure the database
connectionPIRL.Configuration.Configuration_Exception
- if a problem with the configuration file is encounteredPIRL.Database.Database_Exception
- if a problem initializing the database connection is encountered.public Product_CleanUp(PIRL.Configuration.Configuration configuration) throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception
configuration
- - the configuration object to use containing database
connection parametersPIRL.Configuration.Configuration_Exception
- if a missing or invalid parameter is foundPIRL.Database.Database_Exception
- if a problem establishing a database connection occurs.public PIRL.Configuration.Configuration Get_Configuration()
public java.lang.String Get_Catalog()
public PIRL.Database.Database Get_Database()
public java.util.HashMap<java.lang.String,java.lang.Integer> Search_Status_Hash()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- - A property change listenerpublic void Verbose(boolean verbose)
verbose
- - a boolean value, set to true to turn verbosity on.public boolean Verbose()
public void isCLI(boolean cli)
cli
- - a boolean indicating if the calling program is a command line
application rather than a gui.public boolean isCLI()
protected void File_Status_Tests(java.io.File test_file)
test_file
- - a File object to report status on.protected static void Print_Progress(double progress, int total_width, boolean finished)
public abstract void Clean_Up_Products(java.util.Vector<Product> products) throws PIRL.Database.Database_Exception, java.io.IOException
Clean_Up_Products
in interface CleanUp
products
- - A vector of products to be removedPIRL.Database.Database_Exception
- if a database error occurrs during the deletion or
archive processjava.io.IOException
- if the file can not be accessed.public abstract java.util.Vector<java.lang.String> Column_Names()
Find_Products(String, int, int)
method call.Column_Names
in interface CleanUp
CleanUp.Find_Products(String, int, int)
products has not yet been called.public abstract java.util.Vector<java.util.Vector<java.lang.String>> Find_Products(java.lang.String observation_id, int start_orbit, int end_orbit) throws PIRL.Database.Database_Exception
Find_Products
in interface CleanUp
PIRL.Database.Database_Exception
- if a database error occurs during the searchpublic abstract Product Product_Data(java.lang.String product_id, java.lang.String version, java.lang.String type) throws PIRL.Database.Database_Exception
Product_Data
in interface CleanUp
product_id
- - the product_id to retrieve information forversion
- - the version of the producttype
- - the type of productPIRL.Database.Database_Exception
- - if an error occurs while retrieving product
information from the database.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona