HiRISE

HiRISE.HiCat.CleanUp
Interface CleanUp

All Known Implementing Classes:
EDR_CleanUp, Product_CleanUp, RDR_CleanUp, RDR_Extras_CleanUp

public interface CleanUp

The CleanUp interface defines the methods that can be used to search for and retrieve information about HiRISE products that can be cleaned from the file system. Once such products are found, this interface can be used to cleanly remove and/or archive these products, depending on the specifics of the classes that implement this interface.

Generally speaking the clean up procedure entails searching for products that are able to be removed as a result of newer versions of these products being publicly released. Once the set of removable products has been determined, the products can be selected passed to the Clean_Up_Products() methods to remove and archive the products and any associated database records.

Version:
1.9
Author:
Rodney Heyd UA/HiRISE

Field Summary
static int ABSOLUTE_MAXIMUM_ORBIT_NUMBER
          Default orbit search parameters for the gui
static String ANAGLYPH
          Supported Product Types
static int DEFAULT_MAXIMUM_ORBIT_NUMBER
          Default orbit search parameters for the gui
static int DEFAULT_MINIMUM_ORBIT_NUMBER
          Default orbit search parameters for the gui
static String EDR
          Supported Product Types
static String EDR_EXTRAS
          Supported Product Types
static String ID
          Class identifier
static String IDLE_STATUS_MESSAGE
          Search status property names and values.
static String INDEX_TABLE_UPDATE_PROPERTY_NAME
          Additional status properties that may be fired by the cleanup classes.
static int MAXIMUM_UPDATES_BEFORE_COMMIT
          The classes that implement this interface are expected to run their database updates as transactions.
static String OLD_VERSION_ID_ALIAS
          Column aliases used to make the columns consistent across the different clean up procedures
static String PREPARE_STATUS_PROPERTY_NAME
          Additional status properties that may be fired by the cleanup classes.
static String PREPARE_STATUS_ROW_PROPERTY_NAME
          Additional status properties that may be fired by the cleanup classes.
static String RDR
          Supported Product Types
static String RDR_EXTRAS
          Supported Product Types
static String RELEASED_VERSION_ID_ALIAS
          Column aliases used to make the columns consistent across the different clean up procedures
static String REMOVAL_STATUS_COUNT_PROPERTY_NAME
          Properties that indicate the number of products removed, and the current product being processed.
static String REMOVING_PRODUCT_PROPERTY_NAME
          Properties that indicate the number of products removed, and the current product being processed.
static String SEARCH_STATUS_COMPILING_DATA
          Search status property names and values.
static String SEARCH_STATUS_COMPLETE
          Search status property names and values.
static String SEARCH_STATUS_CONSTRUCT
          Search status property names and values.
static String SEARCH_STATUS_EXECUTE
          Search status property names and values.
static String SEARCH_STATUS_PROPERTY_NAME
          Search status property names and values.
static String SEARCH_STATUS_START
          Search status property names and values.
static HashMap<String,Integer> Status_Hash
           
 
Method Summary
 void Clean_Up_Products(Vector<Product> products)
          This method performs the clean up operation on a list of products.
 Vector<String> Column_Names()
          Retrieve the list of "column" names retrieved during the Find_Products() step.
 void Create_Archive_Table()
          A convenience method useful during the testing process, as the mysql's archive engine has a number of limitations that are easier to program into this method than to deal with manually.
 void Drop_Archive_Table()
          Drops the archive table for the product, and allows the archive table to be recreated using the Create_Archive_Table() method.
 Vector<Vector<String>> Find_Products(String observation_id, int start_orbit, int end_orbit)
          Search for products available for clean up.
 Product Product_Data(String product_id, String version, String type)
          Create a Product object for the given product.
 

Field Detail

ID

static final String ID
Class identifier

See Also:
Constant Field Values

EDR

static final String EDR
Supported Product Types

See Also:
Constant Field Values

RDR

static final String RDR
Supported Product Types

See Also:
Constant Field Values

EDR_EXTRAS

static final String EDR_EXTRAS
Supported Product Types

See Also:
Constant Field Values

RDR_EXTRAS

static final String RDR_EXTRAS
Supported Product Types

See Also:
Constant Field Values

ANAGLYPH

static final String ANAGLYPH
Supported Product Types

See Also:
Constant Field Values

Status_Hash

static final HashMap<String,Integer> Status_Hash

DEFAULT_MINIMUM_ORBIT_NUMBER

static final int DEFAULT_MINIMUM_ORBIT_NUMBER
Default orbit search parameters for the gui

See Also:
Constant Field Values

DEFAULT_MAXIMUM_ORBIT_NUMBER

static final int DEFAULT_MAXIMUM_ORBIT_NUMBER
Default orbit search parameters for the gui

See Also:
Constant Field Values

ABSOLUTE_MAXIMUM_ORBIT_NUMBER

static final int ABSOLUTE_MAXIMUM_ORBIT_NUMBER
Default orbit search parameters for the gui

See Also:
Constant Field Values

SEARCH_STATUS_PROPERTY_NAME

static final String SEARCH_STATUS_PROPERTY_NAME
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

SEARCH_STATUS_START

static final String SEARCH_STATUS_START
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

SEARCH_STATUS_CONSTRUCT

static final String SEARCH_STATUS_CONSTRUCT
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

SEARCH_STATUS_EXECUTE

static final String SEARCH_STATUS_EXECUTE
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

SEARCH_STATUS_COMPILING_DATA

static final String SEARCH_STATUS_COMPILING_DATA
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

SEARCH_STATUS_COMPLETE

static final String SEARCH_STATUS_COMPLETE
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

IDLE_STATUS_MESSAGE

static final String IDLE_STATUS_MESSAGE
Search status property names and values. A property change event should be fired by the classes that implement this interface to notify gui listeners of the status of the database search.

See Also:
Constant Field Values

OLD_VERSION_ID_ALIAS

static final String OLD_VERSION_ID_ALIAS
Column aliases used to make the columns consistent across the different clean up procedures

See Also:
Constant Field Values

RELEASED_VERSION_ID_ALIAS

static final String RELEASED_VERSION_ID_ALIAS
Column aliases used to make the columns consistent across the different clean up procedures

See Also:
Constant Field Values

PREPARE_STATUS_PROPERTY_NAME

static final String PREPARE_STATUS_PROPERTY_NAME
Additional status properties that may be fired by the cleanup classes.

See Also:
Constant Field Values

PREPARE_STATUS_ROW_PROPERTY_NAME

static final String PREPARE_STATUS_ROW_PROPERTY_NAME
Additional status properties that may be fired by the cleanup classes.

See Also:
Constant Field Values

INDEX_TABLE_UPDATE_PROPERTY_NAME

static final String INDEX_TABLE_UPDATE_PROPERTY_NAME
Additional status properties that may be fired by the cleanup classes.

See Also:
Constant Field Values

REMOVAL_STATUS_COUNT_PROPERTY_NAME

static final String REMOVAL_STATUS_COUNT_PROPERTY_NAME
Properties that indicate the number of products removed, and the current product being processed.

See Also:
Constant Field Values

REMOVING_PRODUCT_PROPERTY_NAME

static final String REMOVING_PRODUCT_PROPERTY_NAME
Properties that indicate the number of products removed, and the current product being processed.

See Also:
Constant Field Values

MAXIMUM_UPDATES_BEFORE_COMMIT

static final int MAXIMUM_UPDATES_BEFORE_COMMIT
The classes that implement this interface are expected to run their database updates as transactions. This constant indicates the number of updates the class should perform before committing the updates to the database. Setting this number too low negates the speed up that transactions provide, but setting it too high can leave records in a table locked for too long, and may require too much backtracking if one product in a big release fails.

See Also:
Constant Field Values
Method Detail

Find_Products

Vector<Vector<String>> Find_Products(String observation_id,
                                     int start_orbit,
                                     int end_orbit)
                                     throws Database_Exception
Search for products available for clean up. These are products in which a newer version of a product has been released to the PDS, and the older version can be removed.

Returns:
- A list of products that can be removed from the system, and database records archived.
Throws:
Database_Exception - if a database error occurs during the search

Clean_Up_Products

void Clean_Up_Products(Vector<Product> products)
                       throws Database_Exception,
                              IOException
This method performs the clean up operation on a list of products. The clean up operation generally consists of the removal of the product data file and the associated label file, if the product is a standard PDS product with a detached label. In addition, the method should also remove the product's entry in the database, and archive the the database record into an archive table when it is appropriate to do so. The exact details of this operation are left to the classes implementing this interface. In addition, the parent directories of containing the products can be deleted as well, if the directories are empty.

Parameters:
products - - A vector of products to be removed
Throws:
Database_Exception - if a database error occurrs during the deletion or archive process
IOException - if the file can not be accessed.

Column_Names

Vector<String> Column_Names()
Retrieve the list of "column" names retrieved during the Find_Products() step. Useful for getting the column names to display in a JTable.

Returns:
a Vector containing the column names as elements or null if Find_Products(String, int, int) products has not yet been called.

Product_Data

Product Product_Data(String product_id,
                     String version,
                     String type)
                     throws Database_Exception
Create a Product object for the given product. This is especially useful for working with PDS products with detached labels.

Parameters:
product_id - - the product_id to retrieve information for
version - - the version of the product
type - - the type of product
Returns:
A product instance containing product metadata.
Throws:
Database_Exception - - if an error occurs while retrieving product information from the database.

Create_Archive_Table

void Create_Archive_Table()
                          throws Database_Exception
A convenience method useful during the testing process, as the mysql's archive engine has a number of limitations that are easier to program into this method than to deal with manually. This method shouldn't be used within the production environment. This method should not perform any any action when working with products for which no archive table is needed.

Throws:
Database_Exception - if an sql error or database access problem occurs.

Drop_Archive_Table

void Drop_Archive_Table()
                        throws Database_Exception
Drops the archive table for the product, and allows the archive table to be recreated using the Create_Archive_Table() method. This method should not perform any action when working with products for which no archive table is needed.

Throws:
Database_Exception - if the database operation can not be executed.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona