HiRISE

HiRISE.HiCat.HiVolume
Class PDS_Release

java.lang.Object
  extended by HiRISE.HiCat.HiVolume.PDS_Release
All Implemented Interfaces:
Releasable
Direct Known Subclasses:
Release_Anaglyphs, Release_DTM_Extras, Release_DTMs, Release_EDR_Extras, Release_EDRs, Release_RDR_Extras, Release_RDRs

public abstract class PDS_Release
extends Object
implements Releasable

PDS_Release is the superclass of the product releasers for the various types of products that are released into the HiRISE PDS Volume. This class partially implements the Releasable interface, subclasses will need to complete the implementation.

Version:
1.8
Author:
Rodney Heyd UA/HiRISE/PIRL
See Also:
Releasable

Field Summary
static String ID
          Class identifier
 SwingPropertyChangeSupport Property_Changer
           
 
Fields inherited from interface HiRISE.HiCat.HiVolume.Releasable
ABSOLUTE_MAXIMUM_ORBIT, ANAGLYPH_FILE_TYPES_TABLE_PARAMETER_NAME, ANAGLYPH_GROUP, ANAGLYPH_ROOT_PARAMETER_NAME, ANAGLYPH_TABLE_PARAMETER_NAME, ANAGLYPHS, DEFAULT_CONFIGURATION_FILE_NAME, DEFAULT_MAXIMUM_ORBIT_NUMBER, DEFAULT_MINIMUM_ORBIT_NUMBER, DTM, DTM_CUMINDEX_FILE_PARAMETER_NAME, DTM_CUMINDEX_LABEL_PARAMETER_NAME, DTM_EXTRAS, DTM_EXTRAS_FILE_TYPES_TABLE_PARAMETER_NAME, DTM_EXTRAS_PRODUCTS_TABLE_PARAMETER_NAME, DTM_EXTRAS_ROOT_PARAMETER_NAME, DTM_GROUP, DTM_INDEX_FILE_PARAMETER_NAME, DTM_INDEX_LABEL_PARAMETER_NAME, DTM_PRODUCTS_TABLE_PARAMETER_NAME, DTM_ROOT_PARAMETER_NAME, EDR, EDR_CUMINDEX_FILE_PARAMETER_NAME, EDR_CUMINDEX_LABEL_PARAMETER_NAME, EDR_EXTRAS, EDR_GROUP, EDR_INDEX_FILE_PARAMETER_NAME, EDR_INDEX_LABEL_PARAMETER_NAME, EDR_PRODUCTS_TABLE_PARAMETER_NAME, EDR_ROOT_PARAMETER_NAME, EXTRAS_FILE_TYPES_TABLE_PARAMETER_NAME, EXTRAS_GROUP, EXTRAS_PRODUCTS_TABLE_PARAMETER_NAME, EXTRAS_ROOT_PARAMETER_NAME, HIVOLUME_GROUP, INDEX_TABLE_UPDATE_PROPERTY_NAME, MAX_VERSION_ID_ALIAS, MAXIMUM_UPDATES_BEFORE_COMMIT, PDS_ANAGLYPH_ROOT_PARAMETER_NAME, PDS_DTM_EXTRAS_ROOT_PARAMETER_NAME, PDS_DTM_ROOT_PARAMETER_NAME, PDS_EDR_ROOT_PARAMETER_NAME, PDS_EXTRAS_ROOT_PARAMETER_NAME, PDS_RDR_ROOT_PARAMETER_NAME, PREPARE_STATUS_PROPERTY_NAME, PREPARE_STATUS_ROW_PROPERTY_NAME, PRODUCT_TABLES_GROUP, PROFFER_PRODUCT_PROPERTY_NAME, PROFFER_STATUS_COUNT_PROPERTY_NAME, PROFFERED_ANAGLYPH_PRODUCTS_TABLE_PARAMETER_NAME, PROFFERED_DTM_EXTRAS_PRODUCTS_TABLE_PARAMETER_NAME, PROFFERED_DTM_PRODUCTS_TABLE_PARAMETER_NAME, PROFFERED_EDR_PRODUCTS_TABLE_PARAMETER_NAME, PROFFERED_EXTRAS_PRODUCTS_TABLE_PARAMETER_NAME, PROFFERED_RDR_PRODUCTS_TABLE_PARAMETER_NAME, RDR, RDR_CUMINDEX_FILE_PARAMETER_NAME, RDR_CUMINDEX_LABEL_PARAMETER_NAME, RDR_EXTRAS, RDR_GROUP, RDR_INDEX_FILE_PARAMETER_NAME, RDR_INDEX_LABEL_PARAMETER_NAME, RDR_PRODUCTS_TABLE_PARAMETER_NAME, RDR_ROOT_PARAMETER_NAME, RELEASED_VERSION_COLUMN_ALIAS, SEARCH_STATUS_COMPILING_DATA, SEARCH_STATUS_COMPLETE, SEARCH_STATUS_CONSTRUCT, SEARCH_STATUS_EXECUTE, SEARCH_STATUS_PROPERTY_NAME, SEARCH_STATUS_START, SKIP_MISSION_PHASES_PARAMETER_NAME, Status_Hash, UNRELEASED_COLUMN_ALIAS, USER_REQUESTED_TABLE_UPDATE_PROPERTY
 
Constructor Summary
PDS_Release()
          Constructs and initializes the PDS_Release class, and sets up the resources of the implemented methods that are needed for the subclasses.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          As a product release processes a list of products, property change events are fired to indicate the products currently being processed.
abstract  Vector<String> Column_Names()
          This method returns the column names to be displayed in the JTable of the HiVolume GUI, this method needs to be implemented by the subclass.
 void Create_PDS_Volume_Link(Vector<Vector<String>> file_maps)
          This method performs the task of creating the symbolic links to the actual data products within the PDS Volume.
static String Escape_Underscores(String text)
          A utility method for escaping underscore characters: '_' The input string is returned with all underscores replaced with backslashed under scores.
abstract  Vector<Vector<String>> Find_Products(String observation_id, int minimum_orbit, int maximum_orbit, boolean retrieve_released)
          This method should create a list of released and unreleased products that are available.
 void Init_Tagger(Configuration configuration, Database database)
          Initializes the tagger object that will be used to update the status tags for the products being released.
abstract  Vector<Vector<String>> Link_Map(Product product)
          A Vector of Vector Strings containing one or more mappings of symbolic links.
abstract  Product Product_Data(String product_id, String version, String product_type)
          This method should retrieve information from the database to create a product object that can be used by the release class to proffer and release a data product into the HiRISE PDS volume.
abstract  void Proffer_Products(Vector<Product> products)
          The Proffer_Products method is the primary method used to release products into the HiRISE PDS Volume and update the HiCat database to indicate the product is available to the PDS.
 HashMap<String,Integer> Search_Status_Hash()
          Returns the list of status values that are fired as property changes during the release process.
 String Strip_Version_Dir(String pathname)
          Strips the text: /Version_XXX from the input string, if it exists.
 void Update_Status_Tag(Product product)
          This is a stub method for setting the status tag on a product to "Released"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identifier

See Also:
Constant Field Values

Property_Changer

public SwingPropertyChangeSupport Property_Changer
Constructor Detail

PDS_Release

public PDS_Release()
            throws Configuration_Exception
Constructs and initializes the PDS_Release class, and sets up the resources of the implemented methods that are needed for the subclasses.

Throws:
Configuration_Exception - if the tagsonomy configuration file cannot be read.
Method Detail

Init_Tagger

public void Init_Tagger(Configuration configuration,
                        Database database)
Initializes the tagger object that will be used to update the status tags for the products being released.

Parameters:
configuration -
database -

Strip_Version_Dir

public String Strip_Version_Dir(String pathname)
Strips the text: /Version_XXX from the input string, if it exists. This is useful to all the PDS_Release subclasses that need to remove the version portion of the product path prior to creating the symbolic link in the PDS Volume. This is not an abstract method and can be used by all subclasses.

Parameters:
pathname - - a pathname String containing a version specifier that needs to be stripped.
Returns:
a String with the /Version_XXX removed from it.

Escape_Underscores

public static String Escape_Underscores(String text)

A utility method for escaping underscore characters: '_' The input string is returned with all underscores replaced with backslashed under scores.

Eg: PSP_123456_1234 -> PSP\_123456\_1234

This method is useful for escaping underscores in observation ID's and product ID's prior to using them as conditions with the SQL 'LIKE' function.

Parameters:
text - - the text containing underscores to be escaped
Returns:
the same text with the underscores escaped with a backslash character

Create_PDS_Volume_Link

public void Create_PDS_Volume_Link(Vector<Vector<String>> file_maps)
                            throws IOException,
                                   InterruptedException
This method performs the task of creating the symbolic links to the actual data products within the PDS Volume. This is not an abstract method and does not need to be implemented in subclasses.

Specified by:
Create_PDS_Volume_Link in interface Releasable
Parameters:
file_maps - - A vector of string containing the source and destination file paths for the symbolic link to be created.
Throws:
IOException - if a file access error occurs during the link creation process
InterruptedException - if a problem occurs during the system call to the symblic link creation utility (ln -s source_path destination_path)

Update_Status_Tag

public void Update_Status_Tag(Product product)
                       throws SQLException
This is a stub method for setting the status tag on a product to "Released"

Parameters:
product - - The product that needs a status update.
Throws:
SQLException

Search_Status_Hash

public HashMap<String,Integer> Search_Status_Hash()
Returns the list of status values that are fired as property changes during the release process.

Returns:
The set of release status values as a hash.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
As a product release processes a list of products, property change events are fired to indicate the products currently being processed. A GUI application can add itself as a listener for these events to update a status bar.

Parameters:
listener -

Column_Names

public abstract Vector<String> Column_Names()
This method returns the column names to be displayed in the JTable of the HiVolume GUI, this method needs to be implemented by the subclass.

Specified by:
Column_Names in interface Releasable
Returns:
A vector of strings that are table column headings to match the output from Find_Products, will return a null vector if Find_Products has not been called first.
See Also:
Releasable

Find_Products

public abstract Vector<Vector<String>> Find_Products(String observation_id,
                                                     int minimum_orbit,
                                                     int maximum_orbit,
                                                     boolean retrieve_released)
                                              throws Database_Exception
This method should create a list of released and unreleased products that are available. This list is primarily used by the HiVolume gui to display and allow the selection of products to be released.

Specified by:
Find_Products in interface Releasable
Parameters:
observation_id - - A string containing a full or partial observation_id that can be used to search for products to release.
minimum_orbit - - An integer holding the minimum orbit to search for products
maximum_orbit - - An integer holding the maximum orbit to search for products
retrieve_released - - a boolean value indicating weather or not released products should also be returned (the default should be false).
Returns:
- A Vector of Vectors holding the data for available products.
Throws:
Database_Exception - if the find procedure fails.
See Also:
Releasable.Column_Names()

Product_Data

public abstract Product Product_Data(String product_id,
                                     String version,
                                     String product_type)
                              throws Database_Exception
This method should retrieve information from the database to create a product object that can be used by the release class to proffer and release a data product into the HiRISE PDS volume.

Specified by:
Product_Data in interface Releasable
Parameters:
product_id - - A string form of the PRODUCT_ID to gather information for
version - - The version of the product
product_type - - This value should be EDR, RDR, or one of the PRODUCT_TYPE string from the Anaglyph_File_Types or Extras_File_Types tables.
Returns:
A Product object
Throws:
Database_Exception - if a query or database access problem occurs

Proffer_Products

public abstract void Proffer_Products(Vector<Product> products)
                               throws Database_Exception,
                                      IOException,
                                      InterruptedException
The Proffer_Products method is the primary method used to release products into the HiRISE PDS Volume and update the HiCat database to indicate the product is available to the PDS.

Specified by:
Proffer_Products in interface Releasable
Parameters:
products - - A Vector of Products to be proffered within the HiCat database and linked into the HiRISE PDS Volume.
Throws:
Database_Exception - if the proffering procedure fails on the database.
IOException - if a problem occurs while creating the symbolic link in the PDS Volume
InterruptedException - if the symbolic link procedure (a system call) fails

Link_Map

public abstract Vector<Vector<String>> Link_Map(Product product)
A Vector of Vector Strings containing one or more mappings of symbolic links.

Specified by:
Link_Map in interface Releasable
Parameters:
product - - the product to generate source and destination paths for
Returns:
a two element vector containing the source and destination paths
See Also:
Releasable.Create_PDS_Volume_Link(Vector)

HiRISE

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