org.LexGrid.LexBIG.admin
Class Util

java.lang.Object
  extended by org.LexGrid.LexBIG.admin.Util

public class Util
extends java.lang.Object

Common utility functions required by admin tasks.

Author:
Thomas Johnson

Constructor Summary
Util()
           
 
Method Summary
static void displayAndLogError(java.lang.String message, java.lang.Throwable cause)
          Outputs messages to the error log and administration console, with additional tagging to assist servicability.
static void displayAndLogError(java.lang.Throwable cause)
          Outputs messages to the error log and administration console, with additional tagging to assist servicability.
static void displayCommandOptions(java.lang.String syntax, org.apache.commons.cli.Options options, java.lang.String example, java.lang.Throwable parseErr)
          Outputs a standard message to administration console indicating supported command line options.
static void displayExporterStatus(Exporter exporter)
          Displays any available status messages, polling periodically and returning when the export operation is complete.
static void displayLoaderStatus(Loader loader)
          Displays any available status messages, polling periodically and returning when the load operation is complete.
static void displayMessage(java.lang.String message)
          Displays a message to the administration console.
static void displayStatus(StatusReporter reporter)
          Displays any available status messages, polling periodically and returning when the export operation is complete.
static void displayTaggedMessage(java.lang.String message)
          Displays a message to the administration console, with additional tagging to assist servicability.
static void displayTaggedMessage(java.lang.String message, java.lang.Throwable cause, java.lang.String logID)
          Displays a message to the administration console, with additional tagging to assist servicability.
static char getConsoleCharacter()
          Read and return a single character based on user input to the Administration console.
static java.lang.String getPromptForSchemeHelp()
          Returns common text to append to displayed help for commands that allow the user to prompt for coding scheme information instead of providing urn and version information as parameters.
static CodingSchemeRendering getRenderingDetail(CodingSchemeSummary css)
          Returns rendering detail associated with the following coding scheme summary; null if not available.
static java.lang.String getURIHelp()
          Returns common text to append to displayed help for commands that accept URI parameters (e.g. how to deal with imbedded spaces).
static CodingSchemeSummary promptForCodeSystem()
          Display a list of available code systems and
static java.net.URI string2FileURI(java.lang.String s)
          Returns a file URI corresponding to the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

displayAndLogError

public static void displayAndLogError(java.lang.String message,
                                      java.lang.Throwable cause)
Outputs messages to the error log and administration console, with additional tagging to assist servicability.

Parameters:
message - The message to display.
cause - Error associated with the message.

displayAndLogError

public static void displayAndLogError(java.lang.Throwable cause)
Outputs messages to the error log and administration console, with additional tagging to assist servicability.

Parameters:
cause - Error associated with the message.

displayCommandOptions

public static void displayCommandOptions(java.lang.String syntax,
                                         org.apache.commons.cli.Options options,
                                         java.lang.String example,
                                         java.lang.Throwable parseErr)
Outputs a standard message to administration console indicating supported command line options.

Parameters:
syntax - Named syntax.
options - Provided options.
example - Example usage, if applicable.
parseErr - Error that occurred parsing the command line, if applicable.

displayStatus

public static void displayStatus(StatusReporter reporter)
Displays any available status messages, polling periodically and returning when the export operation is complete.

Parameters:
loader -

displayExporterStatus

public static void displayExporterStatus(Exporter exporter)
Displays any available status messages, polling periodically and returning when the export operation is complete.

Parameters:
loader -

displayLoaderStatus

public static void displayLoaderStatus(Loader loader)
Displays any available status messages, polling periodically and returning when the load operation is complete.

Parameters:
loader -

displayMessage

public static void displayMessage(java.lang.String message)
Displays a message to the administration console.

Parameters:
message - The message to display.

displayTaggedMessage

public static void displayTaggedMessage(java.lang.String message)
Displays a message to the administration console, with additional tagging to assist servicability.

Parameters:
message - The message to display.

displayTaggedMessage

public static void displayTaggedMessage(java.lang.String message,
                                        java.lang.Throwable cause,
                                        java.lang.String logID)
Displays a message to the administration console, with additional tagging to assist servicability.

Parameters:
message - The message to display.
cause - Optional error associated with the message.
logID - Optional identifier as registered in the LexBIG logs.

getConsoleCharacter

public static char getConsoleCharacter()
                                throws java.io.IOException
Read and return a single character based on user input to the Administration console.

Returns:
char
Throws:
java.io.IOException

getPromptForSchemeHelp

public static java.lang.String getPromptForSchemeHelp()
Returns common text to append to displayed help for commands that allow the user to prompt for coding scheme information instead of providing urn and version information as parameters.

Returns:
String

getRenderingDetail

public static CodingSchemeRendering getRenderingDetail(CodingSchemeSummary css)
Returns rendering detail associated with the following coding scheme summary; null if not available.

Parameters:
css -

getURIHelp

public static java.lang.String getURIHelp()
Returns common text to append to displayed help for commands that accept URI parameters (e.g. how to deal with imbedded spaces).

Returns:
String

promptForCodeSystem

public static CodingSchemeSummary promptForCodeSystem()
Display a list of available code systems and

Returns:
The coding scheme summary for the selected code system; null if no valid selection was made.

string2FileURI

public static java.net.URI string2FileURI(java.lang.String s)
                                   throws LBResourceUnavailableException
Returns a file URI corresponding to the given string.

Parameters:
s -
Returns:
java.net.URI
Throws:
LBResourceUnavailableException

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.