|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.isi.pegasus.planner.parser.TransformationCatalogTextParser
public class TransformationCatalogTextParser
Parses the input stream and generates the TransformationStore as output. This parser is able to parse the Transformation Catalog specification in the following format
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| Field Summary | |
|---|---|
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 Summary | |
|---|---|
TransformationCatalogTextParser(Reader r,
LogManager logger)
Initializes the parser with an input stream to read from. |
|
| Method Summary | |
|---|---|
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 String |
getQuotedValue(String key)
Parses a quoted value and strips out the enclosing quotes. |
private String |
getSite()
Returns the site transformation for a site, and moves the scanner to hold the next TransformationCatalogReservedWord. |
private String |
getTransformation()
Returns the transformation name, and moves the scanner to hold the next TransformationCatalogReservedWord. |
private TransformationCatalogEntry |
getTransformationCatalogEntry(String transformation,
Profiles profiles,
boolean modifyFileURL)
Constructs a single transformation catalog entry and returns it. |
static void |
main(String[] args)
Test function. |
String |
niceString(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private TransformationCatalogTextScanner mScanner
private Token mLookAhead
private LogManager mLogger
| Constructor Detail |
|---|
public TransformationCatalogTextParser(Reader r,
LogManager logger)
throws IOException,
ScannerException
r - is the stream opened for reading.logger - the transformation to the logger.
IOException
ScannerException| Method Detail |
|---|
public TransformationStore parse(boolean modifyFileURL)
throws IOException,
ScannerException
modifyFileURL - Boolean indicating whether to modify the file URL or not
IOException
ScannerException
Exceptionorg.griphyn.cPlanner.classes.PoolConfigpublic String niceString(String input)
input - is a string which may have leading and trailing quotes
private TransformationCatalogEntry getTransformationCatalogEntry(String transformation,
Profiles profiles,
boolean modifyFileURL)
throws 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 not
- Returns:
- the transformation catalog entry object.
- Throws:
even - more mystery
IOException
ScannerException
private String getTransformation()
throws IOException,
ScannerException
TransformationCatalogReservedWord.
plenty
IOException
ScannerException
private String getSite()
throws IOException,
ScannerException
TransformationCatalogReservedWord.
plenty
IOException
ScannerException
private Profiles getProfilesForTransformation()
throws IOException,
ScannerException
IOException
ScannerException
private Profile getProfile()
throws ScannerException,
IOException
ScannerException
IOException
private String getQuotedValue(String key)
throws IOException
key - the key for which we need to associated the quoted value
IOException
public static void main(String[] args)
throws ScannerException
args -
ScannerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||