org.gridbus.broker.farming.alchemi
Class AlchemiXmljobwrapper

java.lang.Object
  extended byorg.gridbus.broker.farming.alchemi.AlchemiXmljobwrapper

public class AlchemiXmljobwrapper
extends java.lang.Object

This class represents the jobWrapper for an Alchemi Job

Author:
Rajiv Ranjan (rranjan@cs.mu.oz.au)

Constructor Summary
AlchemiXmljobwrapper()
          Default constructor
AlchemiXmljobwrapper(java.lang.String planfilepath)
          Constructor for this class
 
Method Summary
 java.lang.String Base64encoder(java.lang.String Fpath)
          Returns a file contents in Base64 format
 void closeinputxmltag()
          Closes the input start tag
 void closeouputxmltag()
          Creates the output end tag
 void closexmlwriter()
          Closes the Alchemi xml job writer and creates the job end tag
 java.lang.String Getfilename(java.lang.String absfilepath)
          Returns the file name from an absolute path
 void intializeinputxmltag()
          Creates the input start tag
 void intializeouputxmltag()
          Creates the output start tag
 void intializexmlwriter()
          Initialises the Alchemi xml job writer and creates the job start tag
 java.lang.String makejobxml(java.lang.String[] input, int i, java.lang.String[] output, int j, java.lang.String run, java.lang.String[] inputalias)
          Creates the job xml
 java.lang.String Planfilereader()
          Reads a plan file and generates the input, work, output xml nodes, by calling the appropriate methods to generate the xml nodes.
 void readinput(java.io.BufferedReader input)
          Creates the input xml nodes from the given input
 void readoutput(java.io.BufferedReader input)
          Creates the output xml nodes from the given input
 void readrun(java.io.BufferedReader input)
          Creates the work xml node from the given input
 void writeinputfilexmltag(java.lang.String filepath, java.lang.String actualname)
          Creates the input file xml node
 void writeoutputfilexmltag(java.lang.String filename)
          Creates the output file xml node
 void writeworkxmltag(java.lang.String runcmd)
          Creates the work xml node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlchemiXmljobwrapper

public AlchemiXmljobwrapper()
Default constructor


AlchemiXmljobwrapper

public AlchemiXmljobwrapper(java.lang.String planfilepath)
Constructor for this class

Parameters:
planfilepath - - the path of the plan file
Method Detail

intializexmlwriter

public void intializexmlwriter()
Initialises the Alchemi xml job writer and creates the job start tag


closexmlwriter

public void closexmlwriter()
Closes the Alchemi xml job writer and creates the job end tag


intializeinputxmltag

public void intializeinputxmltag()
Creates the input start tag


closeinputxmltag

public void closeinputxmltag()
Closes the input start tag


writeworkxmltag

public void writeworkxmltag(java.lang.String runcmd)
Creates the work xml node

Parameters:
runcmd - - the string representing the run command

writeinputfilexmltag

public void writeinputfilexmltag(java.lang.String filepath,
                                 java.lang.String actualname)
                          throws java.io.IOException,
                                 java.lang.NullPointerException
Creates the input file xml node

Parameters:
filepath - - the input file path
actualname - - actual name of the file
Throws:
java.io.IOException
java.lang.NullPointerException

writeoutputfilexmltag

public void writeoutputfilexmltag(java.lang.String filename)
                           throws java.io.IOException
Creates the output file xml node

Parameters:
filename - - name of the output file
Throws:
java.io.IOException

intializeouputxmltag

public void intializeouputxmltag()
Creates the output start tag


closeouputxmltag

public void closeouputxmltag()
                      throws java.io.IOException
Creates the output end tag

Throws:
java.io.IOException

readinput

public void readinput(java.io.BufferedReader input)
               throws java.io.IOException,
                      java.lang.NullPointerException
Creates the input xml nodes from the given input

Parameters:
input - - the input reader object from which input is read, to generate the xml nodes
Throws:
java.io.IOException
java.lang.NullPointerException

readrun

public void readrun(java.io.BufferedReader input)
             throws java.io.IOException,
                    java.lang.NullPointerException
Creates the work xml node from the given input

Parameters:
input - - the input reader object from which input is read, to generate the xml nodes
Throws:
java.io.IOException
java.lang.NullPointerException

readoutput

public void readoutput(java.io.BufferedReader input)
                throws java.io.IOException,
                       java.lang.NullPointerException
Creates the output xml nodes from the given input

Parameters:
input - - the input reader object from which input is read, to generate the xml nodes
Throws:
java.io.IOException
java.lang.NullPointerException

Getfilename

public java.lang.String Getfilename(java.lang.String absfilepath)
                             throws java.lang.NullPointerException
Returns the file name from an absolute path

Parameters:
absfilepath - - the absolute path of the file
Returns:
string - the filename part of the path
Throws:
java.lang.NullPointerException

Base64encoder

public java.lang.String Base64encoder(java.lang.String Fpath)
                               throws java.io.FileNotFoundException,
                                      java.io.IOException
Returns a file contents in Base64 format

Parameters:
Fpath - - file path
Returns:
- the contents of the file
Throws:
java.io.FileNotFoundException
java.io.IOException

Planfilereader

public java.lang.String Planfilereader()
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
Reads a plan file and generates the input, work, output xml nodes, by calling the appropriate methods to generate the xml nodes.

Returns:
- the generated xml
Throws:
java.io.FileNotFoundException
java.io.IOException

makejobxml

public java.lang.String makejobxml(java.lang.String[] input,
                                   int i,
                                   java.lang.String[] output,
                                   int j,
                                   java.lang.String run,
                                   java.lang.String[] inputalias)
                            throws java.io.IOException
Creates the job xml

Parameters:
input - - the input strings
i - - the count of input strings
output - - the output string
j - - the count of output strings
run - - the run command string
inputalias - - input alias strings
Returns:
job xml
Throws:
java.io.IOException