public class TransformationCatalogTextParser
extends java.lang.Object
tr example::keg:1.0 {
#specify profiles that apply for all the sites for the transformation
#in each site entry the profile can be overriden
profile env "APP_HOME" "/tmp/karan"
profile env "JAVA_HOME" "/bin/java.1.5"
site isi {
profile env "me" "with"
profile condor "more" "test"
profile env "JAVA_HOME" "/bin/java.1.6"
pfn "/path/to/keg"
arch "x86"
os "linux"
osrelease "fc"
osversion "4"
type "installed"
}
site wind {
profile env "me" "with"
profile condor "more" "test"
pfn "/path/to/keg"
arch "x86"
os "linux"
osrelease "fc"
osversion "4"
type "STAGEABLE"
}
}
TransformationCatalogTextScanner| Modifier and Type | Field and Description |
|---|---|
private LogManager |
mLogger
The transformation to the logger used to log messages.
|
private Token |
mLookAhead
Stores the look-ahead symbol.
|
private TransformationCatalogTextScanner |
mScanner
The access to the lexical scanner is stored here.
|
| Constructor and Description |
|---|
TransformationCatalogTextParser(java.io.Reader r,
LogManager logger)
Initializes the parser with an input stream to read from.
|
| Modifier and Type | Method and Description |
|---|---|
private Profile |
getProfile()
Parses a single line and returns a profile.
|
private Profiles |
getProfilesForTransformation()
Returns a list of profiles that have to be applied to the entries for
all the sites corresponding to a transformation.
|
private java.lang.String |
getQuotedValue(java.lang.String key)
Parses a quoted value and strips out the enclosing quotes.
|
private java.lang.String |
getSite()
Returns the site transformation for a site, and moves the scanner to hold the next
TransformationCatalogReservedWord. |
private java.lang.String |
getTransformation()
Returns the transformation name, and moves the scanner to hold the next
TransformationCatalogReservedWord. |
private TransformationCatalogEntry |
getTransformationCatalogEntry(java.lang.String transformation,
Profiles profiles,
boolean modifyFileURL)
Constructs a single transformation catalog entry and returns it.
|
static void |
main(java.lang.String[] args)
Test function.
|
java.lang.String |
niceString(java.lang.String input)
Remove potential leading and trainling quotes from a string.
|
TransformationStore |
parse(boolean modifyFileURL)
Parses the complete input stream, into the PoolConfig data object that
holds the contents of all the sites referred to in the stream.
|
private TransformationCatalogTextScanner mScanner
private Token mLookAhead
private LogManager mLogger
public TransformationCatalogTextParser(java.io.Reader r,
LogManager logger)
throws java.io.IOException,
ScannerException
r - is the stream opened for reading.logger - the transformation to the logger.java.io.IOExceptionScannerExceptionpublic TransformationStore parse(boolean modifyFileURL) throws java.io.IOException, ScannerException
modifyFileURL - Boolean indicating whether to modify the file URL or notjava.io.IOExceptionScannerExceptionjava.lang.Exceptionorg.griphyn.cPlanner.classes.PoolConfigpublic java.lang.String niceString(java.lang.String input)
input - is a string which may have leading and trailing quotesprivate TransformationCatalogEntry getTransformationCatalogEntry(java.lang.String transformation, Profiles profiles, boolean modifyFileURL) throws java.io.IOException, ScannerException
entry - the TransformationCatalogEntry object that is to be populated.profiles - the profiles that apply to all the entriesmodifyFileURL - Boolean indicating whether to modify the file URL or noteven - more mysteryjava.io.IOExceptionScannerExceptionprivate java.lang.String getTransformation()
throws java.io.IOException,
ScannerException
TransformationCatalogReservedWord.plentyjava.io.IOExceptionScannerExceptionprivate java.lang.String getSite()
throws java.io.IOException,
ScannerException
TransformationCatalogReservedWord.plentyjava.io.IOExceptionScannerExceptionprivate Profiles getProfilesForTransformation() throws java.io.IOException, ScannerException
java.io.IOExceptionScannerExceptionprivate Profile getProfile() throws ScannerException, java.io.IOException
ScannerExceptionjava.io.IOExceptionprivate java.lang.String getQuotedValue(java.lang.String key)
throws java.io.IOException
key - the key for which we need to associated the quoted valuejava.io.IOExceptionpublic static void main(java.lang.String[] args)
throws ScannerException
args - ScannerException