public class VDS2PegasusProperties extends Executable
org.griphyn.common.util.VDSProperties
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern[] |
mCompiledPatterns
Stores compiled patterns at first use, quasi-Singleton.
|
private java.lang.String |
mInputFile
The input directory containing the kickstart records.
|
private java.lang.String |
mOutputDir
The output directory where to generate the ploticus output.
|
private static java.lang.String[] |
mRegexExpression
Store the regular expressions necessary to match the * properties.
|
private static java.lang.String[][] |
mStarReplacements
Replacement 2 D Array for the above properties.
|
private static java.util.Map |
mTXFERImplTable
An internal table that resolves the old transfer mode property, to
the corresponding transfer implementation.
|
private static java.util.Map |
mTXFERRefinerTable
An internal table that resolves the old transfer mode property, to
the corresponding transfer refiner.
|
private static java.util.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(java.lang.String vdsProperty,
java.lang.String pegasusProperty)
Associates a VDS property with the new pegasus property.
|
java.lang.String |
convert(java.lang.String input,
java.lang.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(java.lang.String[] opts)
Initialize the executable object
|
void |
loadProperties()
Loads all the properties that would be needed by the Toolkit classes.
|
static void |
main(java.lang.String[] args)
The main test program.
|
protected java.lang.String |
matchForStarProperties(java.lang.String vds)
Returns a matching pegasus property for a VDS star property.
|
java.util.Properties |
matchingSubset(java.util.Properties properties,
java.lang.String prefix,
boolean keepPrefix)
Extracts a specific property key subset from the known properties.
|
void |
parseCommandLineArguments(java.lang.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(java.io.File dir)
Checks the destination location for existence, if it can
be created, if it is writable etc.
|
private static java.util.Map |
transferImplementationTable()
Singleton access to the transfer implementation table.
|
private static java.util.Map |
transferRefinerTable()
Singleton access to the transfer refiner table.
|
private static java.util.Map |
vdsToPegasusPropertiesTable()
Singleton access to the transfer implementation table.
|
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
private static java.util.Map mVDSToPegasusPropertiesTable
private static java.util.Map mTXFERImplTable
private static java.util.Map mTXFERRefinerTable
private static final java.lang.String[] mRegexExpression
private static final java.lang.String[][] mStarReplacements
private static java.util.regex.Pattern[] mCompiledPatterns
private java.lang.String mInputFile
private java.lang.String mOutputDir
public VDS2PegasusProperties()
public void initialize(java.lang.String[] opts)
Executable
initialize
in class Executable
opts
- the command line argument passed to the executableprivate static java.util.Map transferImplementationTable()
private static java.util.Map transferRefinerTable()
private static java.util.Map vdsToPegasusPropertiesTable()
public java.lang.String convert(java.lang.String input, java.lang.String directory) throws java.io.IOException
input
- the path to the VDS Properties file.directory
- the directory where the Pegasus properties file needs to be written out to.java.io.IOException
protected java.lang.String matchForStarProperties(java.lang.String vds)
vds
- the vds property.public static void main(java.lang.String[] args)
args
- the arguments to the program.public void executeCommand()
args
- the command line options.public void parseCommandLineArguments(java.lang.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(java.io.File dir) throws java.io.IOException
dir
- is the new base directory to optionally create.java.io.IOException
- in case of error while writing out files.public java.util.Properties matchingSubset(java.util.Properties properties, java.lang.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.private static void associate(java.lang.String vdsProperty, java.lang.String pegasusProperty)
vdsProperty
- the old VDS property.pegasusProperty
- the new Pegasus property.