public class VDS2PegasusProperties extends Executable
org.griphyn.common.util.VDSProperties
Modifier and Type | Field and Description |
---|---|
private static Pattern[] |
mCompiledPatterns
Stores compiled patterns at first use, quasi-Singleton.
|
private String |
mInputFile
The input directory containing the kickstart records.
|
private String |
mOutputDir
The output directory where to generate the ploticus output.
|
private static String[] |
mRegexExpression
Store the regular expressions necessary to match the * properties.
|
private static String[][] |
mStarReplacements
Replacement 2 D Array for the above properties.
|
private static Map |
mTXFERImplTable
An internal table that resolves the old transfer mode property, to
the corresponding transfer implementation.
|
private static Map |
mTXFERRefinerTable
An internal table that resolves the old transfer mode property, to
the corresponding transfer refiner.
|
private static Map |
mVDSToPegasusPropertiesTable
The handle to the internal map, that maps vds properties to pegasus
properties.
|
mLogger, mLogMsg, mProps, mVersion
Constructor and Description |
---|
VDS2PegasusProperties()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
private static void |
associate(String vdsProperty,
String pegasusProperty)
Associates a VDS property with the new pegasus property.
|
String |
convert(String input,
String directory)
Convert a VDS Properties file to Pegasus properties.
|
void |
executeCommand()
Executes the command on the basis of the options specified.
|
gnu.getopt.LongOpt[] |
generateValidOptions()
Tt generates the LongOpt which contain the valid options that the command
will accept.
|
void |
initialize(String[] opts)
Initialize the executable object
|
void |
loadProperties()
Loads all the properties that would be needed by the Toolkit classes.
|
static void |
main(String[] args)
The main test program.
|
protected String |
matchForStarProperties(String vds)
Returns a matching pegasus property for a VDS star property.
|
Properties |
matchingSubset(Properties properties,
String prefix,
boolean keepPrefix)
Extracts a specific property key subset from the known properties.
|
void |
parseCommandLineArguments(String[] args)
Parses the command line arguments using GetOpt and returns a
PlannerOptions contains all the options passed by the
user at the command line. |
void |
printLongVersion()
Prints the long description, displaying in detail what the various options
to the command stand for.
|
void |
printShortVersion()
Prints out a short description of what the command does.
|
protected static void |
sanityCheck(File dir)
Checks the destination location for existence, if it can
be created, if it is writable etc.
|
private static Map |
transferImplementationTable()
Singleton access to the transfer implementation table.
|
private static Map |
transferRefinerTable()
Singleton access to the transfer refiner table.
|
private static Map |
vdsToPegasusPropertiesTable()
Singleton access to the transfer implementation table.
|
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
private static Map mVDSToPegasusPropertiesTable
private static Map mTXFERImplTable
private static Map mTXFERRefinerTable
private static final String[] mRegexExpression
private static final String[][] mStarReplacements
private static Pattern[] mCompiledPatterns
private String mInputFile
private String mOutputDir
public VDS2PegasusProperties()
public void initialize(String[] opts)
Executable
initialize
in class Executable
opts
- the command line argument passed to the executableprivate static Map transferImplementationTable()
private static Map transferRefinerTable()
private static Map vdsToPegasusPropertiesTable()
public String convert(String input, String directory) throws IOException
input
- the path to the VDS Properties file.directory
- the directory where the Pegasus properties file needs to be written out to.IOException
protected String matchForStarProperties(String vds)
vds
- the vds property.public static void main(String[] args)
args
- the arguments to the program.public void executeCommand()
args
- the command line options.public void parseCommandLineArguments(String[] args)
PlannerOptions
contains all the options passed by the
user at the command line.args
- the arguments passed by the user at command line.public gnu.getopt.LongOpt[] generateValidOptions()
generateValidOptions
in class Executable
LongOpt
objects , corresponding to the valid
optionspublic void printShortVersion()
printShortVersion
in class Executable
public void printLongVersion()
printLongVersion
in class Executable
public void loadProperties()
loadProperties
in class Executable
protected static void sanityCheck(File dir) throws IOException
dir
- is the new base directory to optionally create.IOException
- in case of error while writing out files.public Properties matchingSubset(Properties properties, String prefix, boolean keepPrefix)
properties
- is the properties from where to get the subset.prefix
- is the key prefix to filter the properties by.keepPrefix
- if true, the key prefix is kept in the resulting
dictionary. As side-effect, a key that matches the prefix
exactly will also be copied. If false, the resulting
dictionary's keys are shortened by the prefix. An
exact prefix match will not be copied, as it would
result in an empty string key.Copyright © 2011 The University of Southern California. All Rights Reserved.