|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object HiRISE.HiCat.Utilities.Product_Version
public class Product_Version
A class for getting and generating new Product Version ID's.
Given a HiRISE Product_ID, and an appropriate database, a set of PVL parameters is generated which returns the Product_ID, the maximum version number of a product that exists in the HiCat database, the version id of the currently proffered product, and the version id that should be used to create a new version of a product. The version id is expected to be an integer, and only integers will be accepted as possible version id's.
The default versioning policy works as follows: The value of the Next_Version parameter will be determined by the Max_Version parameter and the Proffered_Version parameter. The Next_Version parameter will always be the larger of the Proffered_Version + 1, or the Max_Version. For example, if the Max_Version equals the Proffered_Version, then the Next_Version will be the Proffered_Version + 1. However, if the Max_Version is greater than the Proffered_Version, then the Next_Version will be the Max_Version.
The default method can be over-ridden in two ways. The next version id can be
forced to be a given ID using the -Use_version option on the command line, or
by using the -No_increment option which will cause the next ID to be the
same as the currently proffered id. See Usage()
Parameter Output
The pvl parameter set returned by this utility looks something like this:
Software_ID = "HiRISE.HiCat.Utilities.Product_Version (1.18 2008/10/09 20:52:44)" GROUP = Version_Data Product_ID = PSP_003639_1345_RED4_0 Max_Version = 1 Proffered_Version = 1 Next_Version = 2 END_GROUP
Field Summary | |
---|---|
static String |
DEFAULT_CONFIGURATION_FILENAME
|
static String |
DEFAULT_CONFIGURATION_PATH
|
static int |
EXIT_CONFIGURATION_ERROR
|
static int |
EXIT_DATABASE_ERROR
|
static int |
EXIT_INVALID_COMMAND_LINE_SYNTAX
|
static int |
EXIT_IO_ERROR
|
static int |
EXIT_PVL_ERROR
|
static int |
EXIT_SUCCESS
|
static String |
ID
|
Constructor Summary | |
---|---|
Product_Version(Database database,
String catalog)
Construct a Product_Version object given a database and catalog. |
|
Product_Version(Database database,
String catalog,
boolean increment_version)
Construct a Product_Version object |
Method Summary | |
---|---|
int |
Force_Version_ID()
Get the current forced version_id being used. |
int |
Force_Version_ID(int version_id)
Forces the value of the next version parameter to be the argument to this method. |
boolean |
Increment_Version()
Get the current status of the Increment_Version rule. |
boolean |
Increment_Version(boolean increment_version)
Sets the increment version rule. |
static void |
main(String[] arguments)
Command line usage. |
static String |
Product_ID_Check(String product_string)
Checks to see if the input string can be parsed into a standard HiRISE PDS Product ID. |
static void |
Usage()
Prints the command line usage syntax. |
Parameter |
Version_Information(String product_id)
Gets the version information for the specified product_id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ID
public static final String DEFAULT_CONFIGURATION_FILENAME
public static final String DEFAULT_CONFIGURATION_PATH
public static final int EXIT_SUCCESS
public static final int EXIT_INVALID_COMMAND_LINE_SYNTAX
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
Constructor Detail |
---|
public Product_Version(Database database, String catalog) throws Database_Exception
database
- The database object to query for product data.catalog
- The database catalog containing the appropriate tables.
Database_Exception
Database
public Product_Version(Database database, String catalog, boolean increment_version) throws Database_Exception
database
- The Database object to query for product data.catalog
- The database catalog containing the appropriate tablesincrement_version
- boolean value, if true, the next version parameter
will be incremented by 1 above the proffered version.
Database_Exception
Database
Method Detail |
---|
public Parameter Version_Information(String product_id) throws Database_Exception, PVL_Exception
product_id
- the product_id for which version information is desired.
Database_Exception
PVL_Exception
public static String Product_ID_Check(String product_string) throws Invalid_Argument_Exception, Out_of_Range_Exception
**Note: It is likely that this method will eventually be moved into a subclass of HiRISE.libHiRISE.Observation_ID
product_string
- a string containing a HiRISE product ID
Invalid_Argument_Exception
Out_of_Range_Exception
Observation_ID
public int Force_Version_ID(int version_id)
version_id
- the version_id to be returned in the parameter set.
public int Force_Version_ID()
public boolean Increment_Version(boolean increment_version)
increment_version
- If false, the next version will be the same as the
currently proffered version. If true, the next version will be incremented by
one above the proffered version.
public boolean Increment_Version()
Increment_Version(boolean)
public static void main(String[] arguments)
The exit status will be one of the following:
arguments
- Usage()
public static void Usage()
Usage: Product_Version <Options> Options - [-Catalog <Catalog_Name> [-Configuration <filename> (default: HIROC.conf) [-No_increment] [-Product_ID <ID String>] [-Use_version <integer>] [-Verbose] [-Help]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |