uk.ac.soton.itinnovation.grid.service.types.metadata
Class ApplicationMetadata

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.types.metadata.ApplicationMetadata

public class ApplicationMetadata
extends Object

Class used for parsing and maintaining an in-memory representation of application metadata XML files. Both 5.1 and 5.2 metadata formats are supported, and methods provided for converting between the two.


Nested Class Summary
static class ApplicationMetadata.Version
           
 
Field Summary
static String APP_NS
           
 
Constructor Summary
ApplicationMetadata(Document doc)
          Parses the given application metadata document.
 
Method Summary
 boolean getDataStagerExists(String name)
          Utility method to find out whether a data stager with the given name exists.
 Document getDocument(ApplicationMetadata.Version version)
          Returns the application metadata as a DOM document.
 ApplicationInfo getInfo()
          Returns an object containing information about the application.
 boolean getInputExists(String name)
          Utility method to find out whether an input stager with the given name exists.
 List<DataStager> getInputs()
          Returns a list of input DataStager objects representing the input stagers specified in the application metadata.
 boolean getOutputExists(String name)
          Utility method to find out whether an output stager with the given name exists.
 List<DataStager> getOutputs()
          Returns a list of output DataStager objects representing the output stagers specified in the application metadata.
 List<Parameter> getParameters()
           
 String[] getRequiredInputStagerNames(ApplicationMetadata.Version version)
          Utility method that returns a list of stager names that must be provided when creating a job.
 String[] getRequiredOutputStagerNames(ApplicationMetadata.Version version)
          Utility method that returns a list of stager names that must be provided when creating a job.
 DataStager getStager(String name)
          Returns the data stager with the given name.
 ApplicationMetadata.Version getVersion()
          Returns the metadata format version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_NS

public static final String APP_NS
See Also:
Constant Field Values
Constructor Detail

ApplicationMetadata

public ApplicationMetadata(Document doc)
Parses the given application metadata document. Both the old 5.1 and new 5.2 metadata formats are recognised and supported.

Method Detail

getInputs

public List<DataStager> getInputs()
Returns a list of input DataStager objects representing the input stagers specified in the application metadata.


getOutputs

public List<DataStager> getOutputs()
Returns a list of output DataStager objects representing the output stagers specified in the application metadata.


getInfo

public ApplicationInfo getInfo()
Returns an object containing information about the application. This corresponds to the <Application> element in the metadata.


getVersion

public ApplicationMetadata.Version getVersion()
Returns the metadata format version.


getDocument

public Document getDocument(ApplicationMetadata.Version version)
                     throws GridFailureException
Returns the application metadata as a DOM document. The metadata can be requested in either 5.1 or 5.2 format - conversions are done automatically if necessary.

Throws:
GridFailureException

getDataStagerExists

public boolean getDataStagerExists(String name)
Utility method to find out whether a data stager with the given name exists. Equivalent to (getStager(String) != null).


getStager

public DataStager getStager(String name)
Returns the data stager with the given name. Null is returned if no such stager exists.


getInputExists

public boolean getInputExists(String name)
Utility method to find out whether an input stager with the given name exists. Similar to getDataStagerExists(String), but restricted to inputs only.


getOutputExists

public boolean getOutputExists(String name)
Utility method to find out whether an output stager with the given name exists. Similar to getDataStagerExists(String), but restricted to outputs only.


getRequiredInputStagerNames

public String[] getRequiredInputStagerNames(ApplicationMetadata.Version version)
Utility method that returns a list of stager names that must be provided when creating a job. 5.1 clients cannot vary the number of stagers they create for inputs that are optional or arrays, so in this case the defaultSize attribute is used to determine which stagers must be provided.


getRequiredOutputStagerNames

public String[] getRequiredOutputStagerNames(ApplicationMetadata.Version version)
Utility method that returns a list of stager names that must be provided when creating a job.


getParameters

public List<Parameter> getParameters()


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.