org.optimizationservices.oscommon.representationparser
Class OSoLReader

java.lang.Object
  extended by org.optimizationservices.oscommon.representationparser.OSgLReader
      extended by org.optimizationservices.oscommon.representationparser.OSoLReader

public class OSoLReader
extends OSgLReader

The OSoLReader class parses an OSoL instance into a DOM tree and provides a set of "get" methods that can be used to retrieve different pieces of information of the instance.

Since:
OS 1.0
Version:
1.0, 03/14/2004
Author:
Robert Fourer, Jun Ma, Kipp Martin

Field Summary
 
Fields inherited from class org.optimizationservices.oscommon.representationparser.OSgLReader
m_document
 
Constructor Summary
OSoLReader()
          Default constructor.
OSoLReader(boolean validate)
          constructor.
 
Method Summary
 int getConstraintNumber()
          Get constraint number.
 java.lang.String getContactAddress()
          Get the contact address to respond to the requester.
 java.lang.String getContactTransportType()
          Get the contact transport type to respond to the requester, smtp (for email), osp (for knocking back on the requester), etc.
 java.lang.String[] getDirectoriesToDelete()
          Get the directories to delete after running the job, which is a string array of paths.
 java.lang.String[] getDirectoriesToMake()
          Get the directories to make before running the job, which is a string array of paths.
 java.lang.String[] getFilesToCreate()
          Get the files to create before running the job, which is a string array of paths.
 java.lang.String[] getFilesToDelete()
          Get the files to delete after running the job, which is a string array of paths.
 double[] getInitialVariableValues()
          get initial variable values (double[]).
 java.lang.String[] getInputFilesToCopyFrom()
          Get the input files to copy from before running the job, which is a string array of paths.
 java.lang.String[] getInputFilesToCopyTo()
          Get the input files to copy to before running the job, which is a string array of paths.
 java.lang.String[] getInputFilesToMoveFrom()
          Get the input files to move from before running the job, which is a string array of paths.
 java.lang.String[] getInputFilesToMoveTo()
          Get the input files to move to before running the job, which is a string array of paths.
 java.lang.String getInstanceAddress()
          Get the instance address to get the instance.
 java.lang.String getInstanceLocationType()
          Get the instance location type to get the instance.
 java.lang.String getInstanceName()
          Get instance name.
 java.lang.String[] getJobDependencies()
          Get the dependencies of the current job, which is a string array of ids of the jobs that have run before the current job.
 java.lang.String getJobID()
          get the job ID
 double getJobMaxTime()
          Get the maximum time (in seconds) before the job is terminated.
 java.util.GregorianCalendar getJobScheduledStartTime()
          Get the scheduled start time for the job.
 java.lang.String getLicense()
          Get license.
 int getObjectiveNumber()
          Get objective number.
 OSOption getOSOption()
          get the standard OSOption, a local interface for storing Optimization Services option.
 java.lang.String getOtherOptionDescriptionByName(java.lang.String name)
          Get the string value from the other option hash map.
 java.lang.String[] getOtherOptionDescriptions()
          Get the descriptions of all other options.
 java.lang.String[] getOtherOptionNames()
          Get the names of all other options.
 int getOtherOptionNumber()
          Get the number of other options.
 java.util.HashMap getOtherOptions()
          Get the hash map of other options.
 java.lang.String getOtherOptionValueByName(java.lang.String name)
          Get the string value from the other option hash map.
 java.lang.String[] getOtherOptionValues()
          Get the values of all other options.
 java.lang.String[] getOutputFilesToCopyFrom()
          Get the output files to copy from before running the job, which is a string array of paths.
 java.lang.String[] getOutputFilesToCopyTo()
          Get the output files to copy to before running the job, which is a string array of paths.
 java.lang.String[] getOutputFilesToMoveFrom()
          Get the output files to move from before running the job, which is a string array of paths.
 java.lang.String[] getOutputFilesToMoveTo()
          Get the output files to move to before running the job, which is a string array of paths.
 java.lang.String getPassword()
          Get the password.
 java.lang.String[] getProcessesToKill()
          Get the processes to kill after running the job, which is a string array of process names.
 java.lang.String[] getRequiredDirectoriesAndFiles()
          Get the required directories and files to run the job, which is a string array of paths.
 java.lang.String getServiceName()
          Get service name.
 java.lang.String getServiceType()
          Get the service type, which can be: solver, analyzer, scheduler, simulation, registry, modeler, agent
 java.lang.String getServiceURI()
          Get service uri.
 double getSystemMinCPUSpeed()
          Get the system minimum cpu speed required to solve the job.
 double getSystemMinDiskSpace()
          Get the system minimum disk space required to solve the job.
 double getSystemMinMemorySize()
          Get the system minimum memory size required to solve the job.
 java.lang.String getUserName()
          Get the userName.
 int getVariableNumber()
          Get variable number.
static void main(java.lang.String[] argv)
          main for test purposes.
 
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLReader
getDocument, getRootElement, isValidate, readFile, readString, setDocument, setRootElement, setValidate, writeToFile, writeToSring, writeToStandardOutput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSoLReader

public OSoLReader(boolean validate)
constructor.

Parameters:
validate - holds whether the reader should be validating against the schema or not.

OSoLReader

public OSoLReader()
Default constructor.

Method Detail

getOSOption

public OSOption getOSOption()
                     throws java.lang.Exception
get the standard OSOption, a local interface for storing Optimization Services option.

Returns:
the OSOption.
Throws:
java.lang.Exception - if there are errors getting the OSOption.

getServiceURI

public java.lang.String getServiceURI()
Get service uri.

Returns:
the service uri.

getServiceName

public java.lang.String getServiceName()
Get service name.

Returns:
the service name.

getInstanceName

public java.lang.String getInstanceName()
Get instance name.

Returns:
the instance name.

getInstanceLocationType

public java.lang.String getInstanceLocationType()
Get the instance location type to get the instance. e.g. local, http, ftp.

Returns:
the instance location type, null or empty string if none.

getInstanceAddress

public java.lang.String getInstanceAddress()
Get the instance address to get the instance.

Returns:
the instance address, null or empty string if none.

getJobID

public java.lang.String getJobID()
get the job ID

Returns:
the Job ID

getLicense

public java.lang.String getLicense()
Get license.

Returns:
the license, null or empty string if none.

getUserName

public java.lang.String getUserName()
Get the userName.

Returns:
the user name, null or empty string if none.

getPassword

public java.lang.String getPassword()
Get the password.

Returns:
the password, null or empty string if none.

getContactTransportType

public java.lang.String getContactTransportType()
Get the contact transport type to respond to the requester, smtp (for email), osp (for knocking back on the requester), etc.

Returns:
the contact trasport type, null or empty string if none.

getContactAddress

public java.lang.String getContactAddress()
Get the contact address to respond to the requester. For example it can be an email address if the contact transport type is smtp or a http uri if the contact transport type is osp (for knocking back on the requester), etc.

Returns:
the contact trasport address, null or empty string if none.

getSystemMinDiskSpace

public double getSystemMinDiskSpace()
Get the system minimum disk space required to solve the job.

Returns:
the system minimum disk space, 0.0 if none.

getSystemMinMemorySize

public double getSystemMinMemorySize()
Get the system minimum memory size required to solve the job.

Returns:
the system minimum memory size, 0.0 if none.

getSystemMinCPUSpeed

public double getSystemMinCPUSpeed()
Get the system minimum cpu speed required to solve the job.

Returns:
the system minimum cpu speed, 0.0 if none.

getServiceType

public java.lang.String getServiceType()
Get the service type, which can be: solver, analyzer, scheduler, simulation, registry, modeler, agent

Returns:
the service type; null or empty string if none.

getJobMaxTime

public double getJobMaxTime()
Get the maximum time (in seconds) before the job is terminated.

Returns:
the maximum time, Double.POSITIVE_INFINITY if none.

getJobScheduledStartTime

public java.util.GregorianCalendar getJobScheduledStartTime()
Get the scheduled start time for the job.

Returns:
the scheduled start time for the job, null or UNIX time (1970/1/1) if none.

getJobDependencies

public java.lang.String[] getJobDependencies()
Get the dependencies of the current job, which is a string array of ids of the jobs that have run before the current job.

Returns:
a string array of ids of the jobs that have run before the current job, null if none.

getRequiredDirectoriesAndFiles

public java.lang.String[] getRequiredDirectoriesAndFiles()
Get the required directories and files to run the job, which is a string array of paths.

Returns:
a string array of direcotry/file paths required to run the job.

getDirectoriesToMake

public java.lang.String[] getDirectoriesToMake()
Get the directories to make before running the job, which is a string array of paths.

Returns:
a string array of direcotry paths to make.

getFilesToCreate

public java.lang.String[] getFilesToCreate()
Get the files to create before running the job, which is a string array of paths.

Returns:
a string array of file paths to create.

getInputFilesToCopyFrom

public java.lang.String[] getInputFilesToCopyFrom()
Get the input files to copy from before running the job, which is a string array of paths.

Returns:
a string array of file paths to copy from.

getInputFilesToCopyTo

public java.lang.String[] getInputFilesToCopyTo()
Get the input files to copy to before running the job, which is a string array of paths.

Returns:
a string array of file paths to copy to.

getInputFilesToMoveFrom

public java.lang.String[] getInputFilesToMoveFrom()
Get the input files to move from before running the job, which is a string array of paths.

Returns:
a string array of file paths to move from.

getInputFilesToMoveTo

public java.lang.String[] getInputFilesToMoveTo()
Get the input files to move to before running the job, which is a string array of paths.

Returns:
a string array of file paths to move to.

getOutputFilesToCopyFrom

public java.lang.String[] getOutputFilesToCopyFrom()
Get the output files to copy from before running the job, which is a string array of paths.

Returns:
a string array of file paths to copy from.

getOutputFilesToCopyTo

public java.lang.String[] getOutputFilesToCopyTo()
Get the output files to copy to before running the job, which is a string array of paths.

Returns:
a string array of file paths to copy to.

getOutputFilesToMoveFrom

public java.lang.String[] getOutputFilesToMoveFrom()
Get the output files to move from before running the job, which is a string array of paths.

Returns:
a string array of file paths to move from.

getOutputFilesToMoveTo

public java.lang.String[] getOutputFilesToMoveTo()
Get the output files to move to before running the job, which is a string array of paths.

Returns:
a string array of file paths to move to.

getFilesToDelete

public java.lang.String[] getFilesToDelete()
Get the files to delete after running the job, which is a string array of paths.

Returns:
a string array of file paths to delete.

getDirectoriesToDelete

public java.lang.String[] getDirectoriesToDelete()
Get the directories to delete after running the job, which is a string array of paths.

Returns:
a string array of directory paths to delete.

getProcessesToKill

public java.lang.String[] getProcessesToKill()
Get the processes to kill after running the job, which is a string array of process names.

Returns:
a string array of process names to kill.

getVariableNumber

public int getVariableNumber()
Get variable number.

Returns:
variable number, -1 if no information.

getObjectiveNumber

public int getObjectiveNumber()
Get objective number.

Returns:
objective number, -1 if no information.

getConstraintNumber

public int getConstraintNumber()
Get constraint number.

Returns:
constraint number, -1 if no information.

getInitialVariableValues

public double[] getInitialVariableValues()
get initial variable values (double[]).

Returns:
a double array of the initial variable values, null if none.

getOtherOptions

public java.util.HashMap getOtherOptions()
Get the hash map of other options.

Returns:
the hash map of other options.

getOtherOptionNumber

public int getOtherOptionNumber()
Get the number of other options.

Returns:
the number of other options.

getOtherOptionValueByName

public java.lang.String getOtherOptionValueByName(java.lang.String name)
Get the string value from the other option hash map.

Parameters:
name - holds the name of option to get.
Returns:
string value from the other option hash map, null if none.

getOtherOptionDescriptionByName

public java.lang.String getOtherOptionDescriptionByName(java.lang.String name)
Get the string value from the other option hash map.

Parameters:
name - holds the name of option to get.
Returns:
string value from the other option hash map, null if none.

getOtherOptionNames

public java.lang.String[] getOtherOptionNames()
Get the names of all other options.

Returns:
the names of all other options.

getOtherOptionValues

public java.lang.String[] getOtherOptionValues()
Get the values of all other options.

Returns:
the values of all other options.

getOtherOptionDescriptions

public java.lang.String[] getOtherOptionDescriptions()
Get the descriptions of all other options.

Returns:
the descriptions of all other options.

main

public static void main(java.lang.String[] argv)
main for test purposes.

Parameters:
argv - command line arguments.