org.shiwa.fgi.iwir
Class IWIR

java.lang.Object
  extended by org.shiwa.fgi.iwir.IWIR

public class IWIR
extends java.lang.Object

The Class IWIR represents an IWIR workflow.


Constructor Summary
IWIR()
          Instantiates a new empty IWIR object.
IWIR(java.io.File file)
          Instantiates a new IWIR from a given file.
IWIR(java.lang.String wfname)
          Instantiates a new IWIR object with the standard version and standard XML namespace.
IWIR(java.lang.String wfname, AbstractTask task)
          Instantiates a new IWIR object with the standard version and standard XML namespace.
IWIR(java.lang.String version, java.lang.String wfname, java.lang.String xmlns)
          Instantiates a new IWIR object.
 
Method Summary
 void asXMLFile(java.io.File file)
          Writes the XML representation of the IWIR object into a file.
 java.lang.String asXMLString()
          Returns the XML representation of the IWIR object as String.
 java.util.Set<Task> getAtomicTasks()
          Gets all atomic tasks.
 java.util.Set<java.lang.String> getAtomicTaskTypes()
          Gets all distinct task types of the atomic tasks.
 java.io.File getImage(java.lang.String dotLocation, java.lang.String extension, java.lang.String tmpFolder)
          Returns a graphical representation of the workflow as a File object.
 AbstractTask getTask()
          Gets the task of the IWIR workflow.
 java.lang.String getVersion()
          Gets the version of the IWIR workflow.
 java.lang.String getWfname()
          Gets the workflow name.
 java.lang.String getXmlns()
          Gets the XML namespace.
 void replaceSubWorkflows()
           
 void setTask(AbstractTask task)
          Sets the task of the IWIR workflow.
 void setVersion(java.lang.String version)
          Sets the version of the IWIR workflow.
 void setWfname(java.lang.String wfname)
          Sets the workflow name.
 void setXmlns(java.lang.String xmlns)
          Sets the XML namespace.
 java.lang.String toString()
           
 void validate()
          Validate an IWIR object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IWIR

public IWIR(java.lang.String version,
            java.lang.String wfname,
            java.lang.String xmlns)
Instantiates a new IWIR object.

Parameters:
version - the IWIR version
wfname - the IWIR workflow name
xmlns - the IWIR xmlns

IWIR

public IWIR(java.lang.String wfname)
Instantiates a new IWIR object with the standard version and standard XML namespace.

Parameters:
wfname - the IWIR workflow name

IWIR

public IWIR()
Instantiates a new empty IWIR object.


IWIR

public IWIR(java.lang.String wfname,
            AbstractTask task)
Instantiates a new IWIR object with the standard version and standard XML namespace.

Parameters:
wfname - the workflow name
task - the task

IWIR

public IWIR(java.io.File file)
     throws java.io.FileNotFoundException,
            NotWellFormedException
Instantiates a new IWIR from a given file. The IWIR object will be validated during construction.

Parameters:
file - the file
Throws:
java.io.FileNotFoundException - the file not found exception
NotWellFormedException - if the work flow is not well formed
Method Detail

getImage

public java.io.File getImage(java.lang.String dotLocation,
                             java.lang.String extension,
                             java.lang.String tmpFolder)
Returns a graphical representation of the workflow as a File object.

Parameters:
dotLocation - the path to the executable of dot
extension - the type of file that should be produced
tmpFolder - the directory where the image is stored. If its the empty string or null the image is stored in /tmp.
Returns:
the file containing the graphical representation

getTask

public AbstractTask getTask()
Gets the task of the IWIR workflow.

Returns:
the task of the IWIR workflow

setTask

public void setTask(AbstractTask task)
Sets the task of the IWIR workflow.

Parameters:
task - the new task of the IWIR workflow

getVersion

public java.lang.String getVersion()
Gets the version of the IWIR workflow.

Returns:
the version of the IWIR workflow

setVersion

public void setVersion(java.lang.String version)
Sets the version of the IWIR workflow.

Parameters:
version - the new version of the IWIR workflow

getWfname

public java.lang.String getWfname()
Gets the workflow name.

Returns:
the workflow name

setWfname

public void setWfname(java.lang.String wfname)
Sets the workflow name.

Parameters:
wfname - the new workflow name

getXmlns

public java.lang.String getXmlns()
Gets the XML namespace.

Returns:
the XML namespace

setXmlns

public void setXmlns(java.lang.String xmlns)
Sets the XML namespace.

Parameters:
xmlns - the new XML namespace

getAtomicTasks

public java.util.Set<Task> getAtomicTasks()
Gets all atomic tasks.

Returns:
atomic tasks of the workflow

getAtomicTaskTypes

public java.util.Set<java.lang.String> getAtomicTaskTypes()
Gets all distinct task types of the atomic tasks.

Returns:
distinct atomic task types of the workflow

validate

public void validate()
              throws NotWellFormedException
Validate an IWIR object. Additionally checks some properties,like the correct construction of an IfTask data flow.

Throws:
NotWellFormedException - if an error occurs

replaceSubWorkflows

public void replaceSubWorkflows()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

asXMLString

public java.lang.String asXMLString()
                             throws NotWellFormedException
Returns the XML representation of the IWIR object as String. See XMLHandler.writeString(IWIR) for more information.

Returns:
the xml string
Throws:
NotWellFormedException - if the workflow is not well formed

asXMLFile

public void asXMLFile(java.io.File file)
               throws java.io.FileNotFoundException,
                      java.io.IOException,
                      NotWellFormedException
Writes the XML representation of the IWIR object into a file. See XMLHandler.writeFile(IWIR, File) for more information.

Parameters:
file - the file
Throws:
java.io.FileNotFoundException - the file not found exception
java.io.IOException - Signals that an I/O exception has occurred.
NotWellFormedException - if the workflow is not well formed