HiRISE

HiRISE.HiVali
Class Tagger

java.lang.Object
  extended by HiRISE.HiVali.TagService
      extended by HiRISE.HiVali.Tagger

public class Tagger
extends TagService

Tagging

  1. Create Tag instances
  2. Add them to a Tagger instance
  3. Create and add Observations or Products
  4. Add them to the Tagger instance
  5. invoke tag()

Printing Observations or Products with tags

  1. Create Tag instances
  2. Add them to a Tagger instance
  3. invoke print()

Printing Tags for Observations or Products

  1. Create Observation or Product instances
  2. Add them to a Tagger instance
  3. invoke print()

Deleting Tags for Observations or Products

  1. Create Observation or Product instances
  2. Add them to a Tagger instance
  3. Create Tag instances
  4. Add them to a Tagger instance
  5. invoke delete()


Field Summary
static String DEFAULT_CATALOG
          default catalog if unspecified
static String DEFAULT_CONFIG
          default config file if unspecified
static String ID
          CVS ID
static String TAGSONOMY_ROOT
          The group name that contains the tags
 
Fields inherited from class HiRISE.HiVali.TagService
observations, products, tags
 
Constructor Summary
Tagger()
           
 
Method Summary
static Tag find(Configuration config, String path)
          Convenience method to locate a named tag in the tagsonomy defined in a configuration file.
 String getCatalog()
          Get the name of the database catalog name we're work with.
 Configuration getConfiguration()
          Get the Configuration we're using.
 Database getDatabase()
          Get our database.
 Tagsonomy getTagsonomy()
          Get the tag definitions loaded in the initialization step
 void init()
          Perform one-time per-instance setup.
 void init(Configuration config)
          Perform one-time per-instance setup.
 void init(Configuration config, Database database)
          Perform one-time per-instance setup.
 boolean isQuiet()
          Get quiet setting.
 boolean isVerbose()
          Get verbose setting.
static void main(String[] args)
          Command-line interface
protected static void printUsage(PrintStream out)
          Print the usage help text to a stream.
 void reset()
          Resets the Tagger to it's empty but initialized state.
 void setCatalog(String catalog)
          Set the name of the database catalog name to work with.
 void setQuiet(boolean quiet)
          Set quiet on or off
 void setVerbose(boolean verbose)
          Set verboseness on or off.
 
Methods inherited from class HiRISE.HiVali.TagService
addObservation, addProduct, addTag, delete, get, getObservations, getProducts, getTags, init, print, tag, track
 
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
CVS ID

See Also:
Constant Field Values

DEFAULT_CONFIG

public static String DEFAULT_CONFIG
default config file if unspecified


TAGSONOMY_ROOT

public static String TAGSONOMY_ROOT
The group name that contains the tags


DEFAULT_CATALOG

public static final String DEFAULT_CATALOG
default catalog if unspecified

See Also:
Constant Field Values
Constructor Detail

Tagger

public Tagger()
Method Detail

init

public void init()
          throws Database_Exception,
                 Configuration_Exception,
                 SQLException
Perform one-time per-instance setup.

Throws:
Configuration_Exception - Invalid default configuration, no Database
Database_Exception - Could not Connect to database
SQLException

init

public void init(Configuration config)
          throws Database_Exception,
                 Configuration_Exception,
                 SQLException
Perform one-time per-instance setup.

Parameters:
config - The configuration instance
Throws:
Configuration_Exception - Invalid config file, no Database
Database_Exception - Could not Connect to database
SQLException

init

public void init(Configuration config,
                 Database database)
          throws Database_Exception,
                 Configuration_Exception,
                 SQLException
Perform one-time per-instance setup. The database may be opened already.

Parameters:
config - The configuration instance
database - The database instance
Throws:
Configuration_Exception - Invalid configuration file, no Database
Database_Exception - Could not Connect to database
SQLException

find

public static Tag find(Configuration config,
                       String path)
                throws IllegalArgumentException
Convenience method to locate a named tag in the tagsonomy defined in a configuration file.

Parameters:
config - file
path - tag name or path
Returns:
tag instance
Throws:
IllegalArgumentException - Tag could not be located

reset

public void reset()
Resets the Tagger to it's empty but initialized state. All tags will be cleared, along with all observations and products that have been added.


getTagsonomy

public Tagsonomy getTagsonomy()
Get the tag definitions loaded in the initialization step

Returns:
tag definition instance

setCatalog

public void setCatalog(String catalog)
Set the name of the database catalog name to work with.

Parameters:
catalog - Catalog name

getCatalog

public String getCatalog()
Get the name of the database catalog name we're work with.

Returns:
Catalog name

getConfiguration

public Configuration getConfiguration()
Get the Configuration we're using. May be null if init() has not been called.

Returns:
Configuration instance or null

getDatabase

public Database getDatabase()
Get our database. May be null if init() has not bee called.

Returns:
Database instance or null

setQuiet

public void setQuiet(boolean quiet)
Set quiet on or off

Parameters:
quiet - If true, all logging will be disabled

setVerbose

public void setVerbose(boolean verbose)
Set verboseness on or off.

Parameters:
verbose - If true, all logging will be enabled.

isQuiet

public boolean isQuiet()
Get quiet setting.

Returns:
true if quiet

isVerbose

public boolean isVerbose()
Get verbose setting.

Returns:
true if verbose

printUsage

protected static void printUsage(PrintStream out)
Print the usage help text to a stream.

Parameters:
out - Stream to print to.

main

public static void main(String[] args)
Command-line interface

Parameters:
args - Command line arguments

HiRISE

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