HiRISE

HiRISE.Pipeline_Utilities
Class Processing_Mode

java.lang.Object
  extended by HiRISE.Pipeline_Utilities.Processing_Mode

public class Processing_Mode
extends Object

Processing_Mode is an application for managing the "processing mode" of an individual observation running through the HiRISE pipelines.

In conjunction with a properly defined database table, this application can:

Version:
1.9
Author:
Ashley Ramsey UA/HiRISE, Rodney Heyd UA/HiRISE

Nested Class Summary
static class Processing_Mode.ExitCode
          Application exit status values.
static class Processing_Mode.ProcessingMode
          An enumeration of the allowed processing modes.
 
Field Summary
static String DEBUG_TABLE_OPTIONS
           
static String ID
           
static String UNSET_MODE_STRING
          This is the string that will be output if the queried observation has no mode setting currently defined for it.
 
Constructor Summary
Processing_Mode(Configuration con, String cat)
          Instantiate a Processing_Mode object with a specified configuration and database catalog param con - the Configuration
 
Method Summary
 Processing_Mode.ProcessingMode getMode(String observationId)
          Get the processing mode of the input observation id.
static void main(String[] args)
           
 boolean removeEntry(String id)
          Takes the given observation id and removes it's corresponding entry from the Processing_Modes table
 void setQueryMode(Processing_Mode.ProcessingMode mode)
          Set the processing mode to be utilized for this instance.
 boolean writeEntry(String id, Processing_Mode.ProcessingMode mode)
          The given observation id and mode are first checked to see if the mode is already set on the observation.
 
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
See Also:
Constant Field Values

DEBUG_TABLE_OPTIONS

public static final String DEBUG_TABLE_OPTIONS
See Also:
Constant Field Values

UNSET_MODE_STRING

public static final String UNSET_MODE_STRING
This is the string that will be output if the queried observation has no mode setting currently defined for it.

See Also:
Constant Field Values
Constructor Detail

Processing_Mode

public Processing_Mode(Configuration con,
                       String cat)
                throws Database_Exception,
                       Configuration_Exception
Instantiate a Processing_Mode object with a specified configuration and database catalog param con - the Configuration

Parameters:
cat - - the catalog in the database containing the processing mode table
Throws:
Database_Exception - if the database connection can not be established
Configuration_Exception - if there is missing or incomplete database connection information in the configuration
Method Detail

setQueryMode

public void setQueryMode(Processing_Mode.ProcessingMode mode)
Set the processing mode to be utilized for this instance.

Parameters:
mode - the processing mode
See Also:
Processing_Mode.ProcessingMode

getMode

public Processing_Mode.ProcessingMode getMode(String observationId)
                                       throws Database_Exception
Get the processing mode of the input observation id.

Parameters:
observationId - - the observation id to retrieve the processing mode for
Returns:
the ProcessingMode of the input observation or null if the processing mode isn't set
Throws:
Database_Exception
See Also:
Processing_Mode.ProcessingMode

writeEntry

public boolean writeEntry(String id,
                          Processing_Mode.ProcessingMode mode)
                   throws Database_Exception,
                          Exception
The given observation id and mode are first checked to see if the mode is already set on the observation. If the mode is already set this method will return a success value. If the mode is not already set, this method will attempt to set and return a true value. If the mode is already set, but differs from the input mode, an exception will be thrown.

Parameters:
id - - Observation id
mode - - String mode
Returns:
true if the mode was successfully set or already set to the input value
Throws:
Database_Exception - if a database error occurs
Exception - if the processing mode is already set to a mode different from the input mode

removeEntry

public boolean removeEntry(String id)
                    throws Database_Exception
Takes the given observation id and removes it's corresponding entry from the Processing_Modes table

Parameters:
id - - the observation id to be removed
Throws:
Database_Exception

main

public static void main(String[] args)
Parameters:
args -

HiRISE

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