Package edu.isi.pegasus.planner.client
Class SCClient
- java.lang.Object
-
- edu.isi.pegasus.planner.client.Executable
-
- edu.isi.pegasus.planner.client.SCClient
-
public class SCClient extends Executable
A client to convert site catalog between different formats.- Version:
- $Revision$
- Author:
- Karan Vahi, Gaurang Mehta gmehta@isi.edu
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>mInputFilesThe input files.private java.lang.StringmInputFormatThe input format for the site catalog.private intmLoggingLevelDenotes the logging level that is to be used for logging the messages.private java.lang.StringmOutputFileThe output file that is written out.private java.lang.StringmOutputFormatThe output format for the site catalog.private static java.lang.StringXML_NAMESPACEprivate static java.lang.StringXML_VERSION-
Fields inherited from class edu.isi.pegasus.planner.client.Executable
mLogger, mLogMsg, mProps, mVersion
-
-
Constructor Summary
Constructors Constructor Description SCClient()The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecrementLogging()Decrements the logging level by 1.voidexecuteCommand()Call the correct commands depending on options.gnu.getopt.LongOpt[]generateValidOptions()Generates an array of validLongOptobjects which contain all the valid options to the Executable.intgetLoggingLevel()Returns the logging level.PoolConfiggetTextToPoolConfig(java.lang.String file)Generates the old site catalog object reading in from text file.voidincrementLogging()Increments the logging level by 1.voidinitialize(java.lang.String[] opts)Initialize the executable objectvoidloadProperties()Loads all the properties that would be needed by the Toolkit classesstatic voidmain(java.lang.String[] args)java.lang.StringparseInputFiles(java.util.List<java.lang.String> inputFiles, java.lang.String inputFormat, java.lang.String outputFormat)Parses the input files in the input format and returns a String in the output format.voidprintLongVersion()This method is used to print the long version of the command.voidprintShortVersion()Returns the short help.protected voidsetupLogging()Sets up the logging options for this class.voidtoFile(java.lang.String filename, java.lang.String output)Writes out to a file, a string.java.lang.StringtoMultiLine(PoolConfig cfg)Returns the String description of the contents ofPoolConfigobject passed.java.lang.StringtoXML(PoolConfig cfg)Returns the XML description of the contents ofPoolConfigobject passed, conforming to pool config schema found at http://pegasus.isi.edu/schema/sc-2.0.xsd.-
Methods inherited from class edu.isi.pegasus.planner.client.Executable
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
-
-
-
-
Field Detail
-
XML_NAMESPACE
private static final java.lang.String XML_NAMESPACE
- See Also:
- Constant Field Values
-
XML_VERSION
private static final java.lang.String XML_VERSION
- See Also:
- Constant Field Values
-
mInputFiles
private java.util.List<java.lang.String> mInputFiles
The input files.
-
mOutputFile
private java.lang.String mOutputFile
The output file that is written out.
-
mOutputFormat
private java.lang.String mOutputFormat
The output format for the site catalog.
-
mInputFormat
private java.lang.String mInputFormat
The input format for the site catalog.
-
mLoggingLevel
private int mLoggingLevel
Denotes the logging level that is to be used for logging the messages.
-
-
Method Detail
-
initialize
public void initialize(java.lang.String[] opts)
Description copied from class:ExecutableInitialize the executable object- Overrides:
initializein classExecutable- Parameters:
opts- the command line argument passed to the executable
-
setupLogging
protected void setupLogging()
Sets up the logging options for this class. Looking at the properties file, sets up the appropriate writers for output and stderr.
-
loadProperties
public void loadProperties()
Loads all the properties that would be needed by the Toolkit classes- Specified by:
loadPropertiesin classExecutable
-
generateValidOptions
public gnu.getopt.LongOpt[] generateValidOptions()
Description copied from class:ExecutableGenerates an array of validLongOptobjects which contain all the valid options to the Executable.- Specified by:
generateValidOptionsin classExecutable
-
executeCommand
public void executeCommand() throws java.io.IOExceptionCall the correct commands depending on options.- Parameters:
opts- Command options- Throws:
java.io.IOException
-
incrementLogging
public void incrementLogging()
Increments the logging level by 1.
-
decrementLogging
public void decrementLogging()
Decrements the logging level by 1.
-
getLoggingLevel
public int getLoggingLevel()
Returns the logging level.- Returns:
- the logging level.
-
parseInputFiles
public java.lang.String parseInputFiles(java.util.List<java.lang.String> inputFiles, java.lang.String inputFormat, java.lang.String outputFormat) throws java.io.IOExceptionParses the input files in the input format and returns a String in the output format.- Parameters:
inputFiles- list of input files that need to be convertedinputFormat- input format of the input filesoutputFormat- output format of the output file- Returns:
- String in output format
- Throws:
java.io.IOException
-
printShortVersion
public void printShortVersion()
Returns the short help.- Specified by:
printShortVersionin classExecutable
-
printLongVersion
public void printLongVersion()
Description copied from class:ExecutableThis method is used to print the long version of the command.- Specified by:
printLongVersionin classExecutable
-
getTextToPoolConfig
public PoolConfig getTextToPoolConfig(java.lang.String file)
Generates the old site catalog object reading in from text file.- Parameters:
file- text file to parse.- Returns:
- PoolConfig
-
toXML
public java.lang.String toXML(PoolConfig cfg)
Returns the XML description of the contents ofPoolConfigobject passed, conforming to pool config schema found at http://pegasus.isi.edu/schema/sc-2.0.xsd.- Parameters:
cfg- thePoolConfigobject whose xml description is desired.- Returns:
- the xml description.
-
toMultiLine
public java.lang.String toMultiLine(PoolConfig cfg)
Returns the String description of the contents ofPoolConfigobject passed.- Parameters:
cfg- thePoolConfigobject whose description is desired.- Returns:
- the String description.
-
toFile
public void toFile(java.lang.String filename, java.lang.String output) throws java.io.IOExceptionWrites out to a file, a string.- Parameters:
filename- the fully qualified path name to the file.output- the text that needs to be written to the file.- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-