public class TCConverter extends Executable
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DATABASE_FORMAT
The database format.
|
private static java.lang.String |
DEFAULT_DATABASE
The default database .
|
private static java.lang.String |
FILE_FORMAT
The File format.
|
private java.lang.String |
mDatabase
The database type.
|
private java.lang.String |
mDatabaseHost
The database host .
|
private java.lang.String |
mDatabaseName
The database name.
|
private java.lang.String |
mDatabasePassword
The database user password.
|
private java.lang.String |
mDatabaseURL
The database type.
|
private java.lang.String |
mDatabaseUserName
The database user name.
|
private java.util.List<java.lang.String> |
mInputFiles
The input files.
|
private java.lang.String |
mInputFormat
The input format for the transformation catalog.
|
private int |
mLoggingLevel
Denotes the logging level that is to be used for logging the messages.
|
private java.lang.String |
mOutputFile
The output file that is written out.
|
private java.lang.String |
mOutputFormat
The output format for the transformation catalog.
|
private static java.lang.String[] |
SUPPORTED_TRANSFORMATION_FORMAT
The supported transformation formats.
|
private static java.lang.String[] |
TC_INITIALIZATION_FILES
List of sql initialization files
|
private static java.lang.String |
TEXT_FORMAT
The textual format.
|
mLogger, mLogMsg, mProps, mVersion
Constructor and Description |
---|
TCConverter()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
convertTC()
Converts transformation catalog from one format to another
|
private TransformationStore |
convertTCEntryFrom(java.util.List<java.lang.String> inputFiles,
java.lang.String inputFormat)
Parses the input files in the input format and returns the output as a TransformationStore instance
|
private void |
convertTCEntryTo(TransformationStore output,
java.lang.String format,
java.lang.String filename)
Converts Transformation store to the given output format.
|
void |
decrementLogging()
Decrements the logging level by 1.
|
void |
executeCommand()
Call the correct commands depending on options.
|
gnu.getopt.LongOpt[] |
generateValidOptions()
Generates the list of valid options for the tc-converter client
|
int |
getLoggingLevel()
Returns the logging level.
|
void |
incrementLogging()
Increments the logging level by 1.
|
protected void |
initialize(java.lang.String[] opts)
Initialize the executable object
|
private boolean |
isSupportedFormat(java.lang.String format)
Checks if it is a supported transformation catalog format
|
void |
loadProperties()
Loads all the properties
that would be needed
by the Toolkit classes
|
static void |
main(java.lang.String[] args)
The main function
|
private java.util.List<TransformationCatalogEntry> |
parseTC(PegasusProperties pegasusProperties)
Parses the input format specified in the properties file and returns list of TransfromationCatalogEntry
|
void |
printLongVersion()
This method is used to print the long version of the command.
|
void |
printShortVersion()
Prints the short help.
|
protected void |
setupLogging()
Sets up the logging options for this class.
|
convertException, convertException, getCommandLineOptions, getEnvValue, getGVDSVersion, initialize, log, lookupConfProperty, sanityCheckOnProperties, setupLogging
private static java.lang.String DEFAULT_DATABASE
private static java.lang.String DATABASE_FORMAT
private static java.lang.String FILE_FORMAT
private static java.lang.String TEXT_FORMAT
private static final java.lang.String[] SUPPORTED_TRANSFORMATION_FORMAT
private static final java.lang.String[] TC_INITIALIZATION_FILES
private java.util.List<java.lang.String> mInputFiles
private java.lang.String mOutputFile
private java.lang.String mOutputFormat
private java.lang.String mInputFormat
private java.lang.String mDatabaseURL
private java.lang.String mDatabase
private java.lang.String mDatabaseName
private java.lang.String mDatabaseUserName
private java.lang.String mDatabasePassword
private java.lang.String mDatabaseHost
private int mLoggingLevel
protected void initialize(java.lang.String[] opts)
Executable
initialize
in class Executable
opts
- the command line argument passed to the executableprotected void setupLogging()
public void loadProperties()
loadProperties
in class Executable
public gnu.getopt.LongOpt[] generateValidOptions()
generateValidOptions
in class Executable
public void executeCommand() throws java.io.IOException
opts
- Command optionsjava.io.IOException
public void incrementLogging()
public void decrementLogging()
public int getLoggingLevel()
private void convertTC() throws java.io.IOException
java.io.IOException
private TransformationStore convertTCEntryFrom(java.util.List<java.lang.String> inputFiles, java.lang.String inputFormat) throws java.io.IOException
inputFiles
- list of input files that need to be convertedinputFormat
- input format of the input filesjava.io.IOException
private java.util.List<TransformationCatalogEntry> parseTC(PegasusProperties pegasusProperties)
pegasusProperties
- input format specified in the properties fileprivate boolean isSupportedFormat(java.lang.String format)
format
- the formatpublic void printShortVersion()
printShortVersion
in class Executable
public void printLongVersion()
Executable
printLongVersion
in class Executable
private void convertTCEntryTo(TransformationStore output, java.lang.String format, java.lang.String filename) throws java.io.IOException
output
- the reference to TransformationStore objectfilename
- the given output format.output
- the given output file name, null if the format is database.java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- arguments passed at runtimejava.lang.Exception