g-Eclipse
Release 1.0.0

eu.geclipse.servicejob.parsers
Class GTDLWriter

java.lang.Object
  extended by eu.geclipse.servicejob.parsers.GTDLWriter

public class GTDLWriter
extends java.lang.Object

Helper class for writing to GTDL file.


Field Summary
static java.lang.String SKELETON_LOCATION
          Path (within plug-in location) to GTDL skeleton (file containing GTDL XML structure).
 
Constructor Summary
GTDLWriter()
           
 
Method Summary
static void addServiceJobResults(java.io.File file, java.util.List<IServiceJobResult> newResults)
          Method to put service job's result into GTDL file (to add new element output > result)
static java.io.InputStream getInitialInputStream(java.lang.String plugInID, java.util.List<java.lang.String> serviceJobResources, java.io.InputStream serviceJobInputData)
          Method that takes empty GTDL skeleton, files it out with plug-in specific content (plug-in id and initial service job's data) and transforms it to input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKELETON_LOCATION

public static final java.lang.String SKELETON_LOCATION
Path (within plug-in location) to GTDL skeleton (file containing GTDL XML structure).

See Also:
Constant Field Values
Constructor Detail

GTDLWriter

public GTDLWriter()
Method Detail

getInitialInputStream

public static java.io.InputStream getInitialInputStream(java.lang.String plugInID,
                                                        java.util.List<java.lang.String> serviceJobResources,
                                                        java.io.InputStream serviceJobInputData)
                                                 throws java.io.IOException,
                                                        javax.xml.parsers.ParserConfigurationException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerException
Method that takes empty GTDL skeleton, files it out with plug-in specific content (plug-in id and initial service job's data) and transforms it to input stream. Method transforms GTDL skeleton file (file containing GTDL XML structure)

Parameters:
plugInID - Id of a plug-in that provides service job's data.
serviceJobResources - List of resource's names on which this service job should run.
serviceJobInputData - Initial service job data (will be set as a text content of input > pluginData element).
Returns:
Input stream of a GTDL file filled up with plug-in specific data.
Throws:
java.io.IOException - In case there were problems with accessing the GTDL skeleton file or with input streams.
javax.xml.parsers.ParserConfigurationException - In case parser could not be initialized.
org.xml.sax.SAXException - In case GTDL skeleton file could not be parsed.
javax.xml.transform.TransformerException - In case there were problems transforming skeleton source to input stream.

addServiceJobResults

public static void addServiceJobResults(java.io.File file,
                                        java.util.List<IServiceJobResult> newResults)
                                 throws javax.xml.parsers.ParserConfigurationException,
                                        org.xml.sax.SAXException,
                                        java.io.IOException,
                                        javax.xml.transform.TransformerFactoryConfigurationError,
                                        javax.xml.transform.TransformerException
Method to put service job's result into GTDL file (to add new element output > result)

Parameters:
file - GTDL file to write to
newResults - results which will be serialized to GTDL file
Throws:
javax.xml.parsers.ParserConfigurationException - in case parser could not be initialized
org.xml.sax.SAXException - in case XML file could not be parsed
java.io.IOException - in case there were I/O problems with XML file
javax.xml.transform.TransformerFactoryConfigurationError - in case XML transformer could not be initialized
javax.xml.transform.TransformerException - in case results could not be transformed to XML file

g-Eclipse
Release 1.0.0