umich.cac.pbs
Class PbsToXml

java.lang.Object
  extended byumich.cac.pbs.PbsToXml

public class PbsToXml
extends java.lang.Object

This class converts PBS accounting log files into an XML representation.

Usage: java umich.cac.pbs.PbsToXml filename outputfilename

Version:
$Header: /cvsroot/pbsaccounting/pbsaccounting/src/umich/cac/pbs/PbsToXml.java,v 1.3 2003/04/30 15:49:29 rodmach Exp $
Author:
rmach@umich.edu

Constructor Summary
PbsToXml()
           
 
Method Summary
 java.lang.String convertToXml(java.lang.String filename)
          Convert PBS accounting file to its XML representation
static void main(java.lang.String[] args)
          Main class.
 java.lang.String processRecord(java.lang.String inputLine)
          Process a record from the PBS accounting file, and pass to the appropriate formatter to convert it to XML
 void setDTD(java.lang.String dtd)
          Set the DTD to use
 void setW3CSchema(java.lang.String w3Cschema)
          Set the W3C Schema to use
static void usage()
          Prints the usage to STDOUT and exits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PbsToXml

public PbsToXml()
Method Detail

usage

public static void usage()
Prints the usage to STDOUT and exits


setDTD

public void setDTD(java.lang.String dtd)
Set the DTD to use

Parameters:
dtd - name of the dtd to use, like linux_joblog.dtd. This dtd is added to XML file, if null then it won't be added to XML file. The file doesn't have to exist at creation time

setW3CSchema

public void setW3CSchema(java.lang.String w3Cschema)
Set the W3C Schema to use

Parameters:
w3Cschema - name of the W3C schema to use, like linux_joblog.xsd. This schema is added to XML file, if null then it won't be added to XML file. The file doesn't have to exist at creation time

main

public static void main(java.lang.String[] args)
Main class. Takes joblog as argument and prints out XML representation on STDOUT

Parameters:
args - The PBS accounting file to parse

processRecord

public java.lang.String processRecord(java.lang.String inputLine)
                               throws InvalidRecordException
Process a record from the PBS accounting file, and pass to the appropriate formatter to convert it to XML

Parameters:
inputLine - inputLine from PBS accounting file to parse
Returns:
XML representation of the record
Throws:
InvalidRecordException - If the record can not be parsed, or it doesn't have enough fields

convertToXml

public java.lang.String convertToXml(java.lang.String filename)
Convert PBS accounting file to its XML representation

Parameters:
filename - Name of the accounting file to parse
Returns:
XML representation of the file, or null if unable to open file