| java.lang.Object org.griphyn.vdl.directive.Directive org.griphyn.vdl.directive.ParseKickstart
ParseKickstart | public class ParseKickstart extends Directive (Code) | | Main objective of this class is to extract the exit status from
the invocation record returned by kickstart. The expected usage
is another Java class passing a filename, and obtaining the
cooked exit status for the parse. All other details, like removing
non-XML header and tailers, de-concatenation, are handled internally.
Usage of the class is divided into typically three steps. The first
step is to obtain an instance of the the parser, and configure it
to fit your needs.
ParseKickstart pks = new ParseKickstart();
... // set flags
pks.setDatabaseSchema( ptcschema );
The next step can be executed multiple times, and parse one or more
kickstart output files.
List result = null;
try {
result = pks.parseFile( file );
} catch ( FriendlyNudge fn ) {
// handle failures
}
Once you are definitely done, it is recommend to dis-associate yourself
from the active database connection.
pks.close();
pks = null;
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: org.griphyn.vdl.toolkit.ExitCode See Also: org.griphyn.vdl.parser.InvocationParser |
ParseKickstart | public ParseKickstart(DatabaseSchema dbschema, boolean emptyFail) throws IOException, MissingResourceException(Code) | | C'tor which permits the setting of a PTC connection.
Parameters: dbschema - is the database schema to use for the PTC. Parameters: emptyFail - determines, if empty input files are error or OK. |
close | public void close() throws SQLException(Code) | | Closes the associated database backend and invalidates the schema.
|
determineExitStatus | public int determineExitStatus(InvocationRecord ivr)(Code) | | Determines the exit code of an invocation record. Currently,
we will determine the exit code from all jobs until failure
or no more jobs. However, set-up and clean-up jobs are ignored.
Parameters: ivr - is the invocation record to put into the database the status code as exit code to signal failure etc. 0 regular exit with exit code 01 regular exit with exit code > 02 failure to run program from kickstart3 application had died on signal4 application was suspended (should not happen)5 failure in exit code parsing6 impossible case |
extractToMemory | public List extractToMemory(java.io.File input) throws FriendlyNudge(Code) | | Extracts records from the given input file. Since there may be
more than one record per file, especially in the case of MPI,
multiple results are possible, though traditionally only one
will be used.
Parameters: input - is the name of the file that contains the records a list of strings, each representing one invocation record.The result should not be empty (exception will be thrown). throws: FriendlyNudge - , if the input format was invalid.The caller has to assume failure to parse the record provided. |
getNoDBase | public boolean getNoDBase()(Code) | | Gets the variable to permit connections to the PTC, or
use parse-only mode.
true, if the PTC is intended to be used, false forparse-only mode. See Also: ParseKickstart.setNoDBase(boolean) |
parseFile | public List parseFile(String arg0) throws FriendlyNudge, IOException, SQLException(Code) | | Parses the contents of a kickstart output file, and returns a
list of exit codes obtains from the records.
Parameters: arg0 - is the name of the file to read a list with one or more exit code, one for each record. throws: FriendlyNudge - , if parsing of the file goes hay-wire. throws: IOException - if something happens while reading propertiesto instantiate the XML parser. throws: SQLException - if accessing the database fails. |
setDatabaseSchema | public void setDatabaseSchema(DatabaseSchema dbschema)(Code) | | Sets the database schema.
Parameters: dbschema - is a database schema instance for the PTC. |
setEmptyFail | public void setEmptyFail(boolean emptyFail)(Code) | | Sets the fail-on-empty-file value.
Parameters: emptyFail - contains the new value, if to fail on empty files. See Also: ParseKickstart.getEmptyFail() |
setIgnoreDBFail | public void setIgnoreDBFail(boolean ignore)(Code) | | Sets the dont-fail-on-dbase-errors mode.
Parameters: ignore - is true to render database error non-fatal. See Also: ParseKickstart.getIgnoreDBFail() |
setNoDBase | public void setNoDBase(boolean noDBase)(Code) | | Sets the parse-only versus PTC mode.
Parameters: noDBase - is true to use the parse-only mode. See Also: ParseKickstart.getNoDBase() |
|
|