org.optimizationservices.oscommon.representationparser
Class OSoLWriter

java.lang.Object
  extended by org.optimizationservices.oscommon.representationparser.OSgLWriter
      extended by org.optimizationservices.oscommon.representationparser.OSoLWriter

public class OSoLWriter
extends OSgLWriter

The OSoLWriter class is used to construct an instance that follows the OSoL format.

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.OSgLWriter
m_document
 
Constructor Summary
OSoLWriter()
          constructor.
 
Method Summary
 boolean addOtherOption(java.lang.String name, java.lang.String value, java.lang.String description)
          Add an other option element.
static void main(java.lang.String[] argv)
          main for test purposes.
 boolean setConstraintNumber(int constraintNumber)
          Set the constraint number.
 boolean setContactAddress(java.lang.String address)
          Set the contact address to respond to the requester.
 boolean setContactTransportType(java.lang.String transportType)
          Set the contact transport type to respond to the requester, smtp (for email), osp (for knocking back on the requester), etc.
 boolean setDirectoriesToDelete(java.lang.String[] paths)
          Set the directories to delete after running the job, which is a string array of paths.
 boolean setDirectoriesToMake(java.lang.String[] paths)
          Set the directories to make before running the job, which is a string array of paths.
 boolean setFilesToCreate(java.lang.String[] paths)
          Set the files to create before running the job, which is a string array of paths.
 boolean setFilesToDelete(java.lang.String[] paths)
          Set the files to delete after running the job, which is a string array of paths.
 boolean setInitialVariableValues(double[] initialVariableValues)
          Set initial variable values (double[]).
 boolean setInputFilesToCopyFrom(java.lang.String[] paths)
          Set the input files to copy from before running the job, which is a string array of paths.
 boolean setInputFilesToCopyTo(java.lang.String[] paths)
          Set the input files to copy to before running the job, which is a string array of paths.
 boolean setInputFilesToMoveFrom(java.lang.String[] paths)
          Set the input files to move from before running the job, which is a string array of paths.
 boolean setInputFilesToMoveTo(java.lang.String[] paths)
          Set the input files to move to before running the job, which is a string array of paths.
 boolean setInstanceAddress(java.lang.String address)
          Set the instance address to get the instance.
 boolean setInstanceLocationType(java.lang.String locationType)
          Set the instance location type to get the instance.
 boolean setInstanceName(java.lang.String instanceName)
          Set instance name.
 boolean setJobDependencies(java.lang.String[] jobIDs)
          Get the dependencies of the current job, which is a string array of ids of the jobs that have run before the current job.
 boolean setJobID(java.lang.String jobID)
          Set jobID.
 boolean setJobMaxTime(double maxTime)
          Set the maximum time before the job is terminated.
 boolean setJobScheduledStartTime(java.util.GregorianCalendar scheduledStartTime)
          Set the scheduled start time for the job.
 boolean setLicense(java.lang.String license)
          Set license.
 boolean setObjectiveNumber(int objectiveNumber)
          Set the objective number.
 boolean setOSOption(OSOption osOption)
          set the OSOption, a standard os option interface.
 boolean setOtherOptions(java.lang.String[] names, java.lang.String[] values, java.lang.String[] descriptions)
          Set the other options related elements.
 boolean setOutputFilesToCopyFrom(java.lang.String[] paths)
          Set the output files to copy from before running the job, which is a string array of paths.
 boolean setOutputFilesToCopyTo(java.lang.String[] paths)
          Set the output files to copy to before running the job, which is a string array of paths.
 boolean setOutputFilesToMoveFrom(java.lang.String[] paths)
          Set the output files to move from before running the job, which is a string array of paths.
 boolean setOutputFilesToMoveTo(java.lang.String[] paths)
          Set the output files to move to before running the job, which is a string array of paths.
 boolean setPassword(java.lang.String password)
          Set the password.
 boolean setProcessesToKill(java.lang.String[] processNames)
          Set the processes to kill after running the job, which is a string array of paths.
 boolean setRequiredDirectoriesAndFiles(java.lang.String[] paths)
          Set the required directories and files to run the job, which is a string array of paths.
 boolean setServiceName(java.lang.String serviceName)
          Set service name.
 boolean setServiceType(java.lang.String type)
          Set the service type.
 boolean setServiceURI(java.lang.String serviceURI)
          Set service uri.
 boolean setSystemMinCPUSpeed(double minCPUSpeed)
          Set the the system minimum cpu speed required to solve the job.
 boolean setSystemMinDiskSpace(double minDiskSpace)
          Set the the system minimum disk space required to solve the job.
 boolean setSystemMinMemorySize(double minMemorySize)
          Set the the system minimum memory size required to solve the job.
 boolean setUserName(java.lang.String userName)
          Set the user name.
 boolean setVariableNumber(int variableNumber)
          Set the variable number.
 
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter
getDocument, setDocument, writeToFile, writeToSring, writeToStandardOutput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSoLWriter

public OSoLWriter()
constructor.

Method Detail

setOSOption

public boolean setOSOption(OSOption osOption)
                    throws java.lang.Exception
set the OSOption, a standard os option interface.

Parameters:
osOption - holds the standard os option interface.
Returns:
whether the OSOption is set successfully.
Throws:
java.lang.Exception

setServiceURI

public boolean setServiceURI(java.lang.String serviceURI)
Set service uri.

Parameters:
serviceURI - holds the uri of the service.
Returns:
whether the service uri is set successfully.

setServiceName

public boolean setServiceName(java.lang.String serviceName)
Set service name.

Parameters:
serviceName - holds the name of the service.
Returns:
whether the service name is set successfully.

setInstanceName

public boolean setInstanceName(java.lang.String instanceName)
Set instance name.

Parameters:
instanceName - holds the name of the instance.
Returns:
whether the instance name is set successfully.

setInstanceLocationType

public boolean setInstanceLocationType(java.lang.String locationType)
Set the instance location type to get the instance.

Parameters:
locationType - holds the instance location type, e.g. local, http, ftp.
Returns:
whether the instance location type is set successfully.

setInstanceAddress

public boolean setInstanceAddress(java.lang.String address)
Set the instance address to get the instance.

Parameters:
address - holds the instance address.
Returns:
whether the instance address is set successfully.

setJobID

public boolean setJobID(java.lang.String jobID)
Set jobID.

Parameters:
jobID - holds the jobID.
Returns:
whether the jobID is set successfully.

setLicense

public boolean setLicense(java.lang.String license)
Set license.

Parameters:
license - holds the license required by the service.
Returns:
whether the license is set successfully.

setUserName

public boolean setUserName(java.lang.String userName)
Set the user name.

Parameters:
userName - holds the user name required by the service.
Returns:
whether the user name is set successfully.

setPassword

public boolean setPassword(java.lang.String password)
Set the password.

Parameters:
password - holds the password required by the service.
Returns:
whether the password is set successfully.

setContactTransportType

public boolean setContactTransportType(java.lang.String transportType)
Set the contact transport type to respond to the requester, smtp (for email), osp (for knocking back on the requester), etc.

Parameters:
transportType - holds the contact transport type.
Returns:
whether the contact transport type is set successfully.

setContactAddress

public boolean setContactAddress(java.lang.String address)
Set 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.

Parameters:
address - holds the contact address.
Returns:
whether the contact address is set successfully.

setSystemMinDiskSpace

public boolean setSystemMinDiskSpace(double minDiskSpace)
Set the the system minimum disk space required to solve the job.

Parameters:
minDiskSpace - holds the minimum disk space required to solve the job.
Returns:
whether the minimum disk space is set successfully.

setSystemMinMemorySize

public boolean setSystemMinMemorySize(double minMemorySize)
Set the the system minimum memory size required to solve the job.

Parameters:
minMemorySize - holds the minimum memory size required to solve the job.
Returns:
whether the minimum memory size is set successfully.

setSystemMinCPUSpeed

public boolean setSystemMinCPUSpeed(double minCPUSpeed)
Set the the system minimum cpu speed required to solve the job.

Parameters:
minCPUSpeed - holds the minimum cpu speed required to solve the job.
Returns:
whether the minimum cpu speed is set successfully.

setServiceType

public boolean setServiceType(java.lang.String type)
Set the service type.

Parameters:
type - holds the service type, which can be: solver, analyzer, scheduler, simulation, registry, modeler, agent
Returns:
whether the service type is set successfully or not.

setJobMaxTime

public boolean setJobMaxTime(double maxTime)
Set the maximum time before the job is terminated.

Parameters:
maxTime - holds the maximum time in seconds.
Returns:
whether the maximum time is set successfully.

setJobScheduledStartTime

public boolean setJobScheduledStartTime(java.util.GregorianCalendar scheduledStartTime)
Set the scheduled start time for the job.

Parameters:
scheduledStartTime - holds the scheduled start time for the job.
Returns:
whether the scheduled start time is set successfully.

setJobDependencies

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

Parameters:
jobIDs - holds a string array of ids of the jobs that have run before the current job.
Returns:
whether the job dependencies are set successfully.

setRequiredDirectoriesAndFiles

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

Parameters:
paths - holds a string array of directory/file paths required to run the job.
Returns:
whether the required directories and files are set successfully.

setDirectoriesToMake

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

Parameters:
paths - holds a string array of directories to make before running the job.
Returns:
whether the directories to make are set successfully.

setFilesToCreate

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

Parameters:
paths - holds a string array of files to create before running the job.
Returns:
whether the files to create are set successfully.

setInputFilesToCopyFrom

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

Parameters:
paths - holds a string array of input files to copy from before running the job.
Returns:
whether the input files to copy from are set successfully.

setInputFilesToCopyTo

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

Parameters:
paths - holds a string array of input files to copy to before running the job.
Returns:
whether the input files to copy to are set successfully.

setInputFilesToMoveFrom

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

Parameters:
paths - holds a string array of input files to move from before running the job.
Returns:
whether the input files to move from are set successfully.

setInputFilesToMoveTo

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

Parameters:
paths - holds a string array of input files to move to before running the job.
Returns:
whether the input files to move to are set successfully.

setOutputFilesToCopyFrom

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

Parameters:
paths - holds a string array of output files to copy from before running the job.
Returns:
whether the output files to copy from are set successfully.

setOutputFilesToCopyTo

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

Parameters:
paths - holds a string array of output files to copy to before running the job.
Returns:
whether the output files to copy to are set successfully.

setOutputFilesToMoveFrom

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

Parameters:
paths - holds a string array of output files to move from before running the job.
Returns:
whether the output files to move from are set successfully.

setOutputFilesToMoveTo

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

Parameters:
paths - holds a string array of output files to move to before running the job.
Returns:
whether the output files to move to are set successfully.

setFilesToDelete

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

Parameters:
paths - holds a string array of file paths to delete after running the job.
Returns:
whether the files to delete are set successfully.

setDirectoriesToDelete

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

Parameters:
paths - holds a string array of directory paths to delete after running the job.
Returns:
whether the directories to delete are set successfully.

setProcessesToKill

public boolean setProcessesToKill(java.lang.String[] processNames)
Set the processes to kill after running the job, which is a string array of paths.

Parameters:
processNames - holds a string array of process names to kill after running the job.
Returns:
whether the processes to kill are set successfully.

setVariableNumber

public boolean setVariableNumber(int variableNumber)
Set the variable number.

Parameters:
variableNumber - holds the number of variables
Returns:
whether the variable number is set successfully or not.

setObjectiveNumber

public boolean setObjectiveNumber(int objectiveNumber)
Set the objective number.

Parameters:
objectiveNumber - holds the number of objectives
Returns:
whether the objective number is set successfully or not.

setConstraintNumber

public boolean setConstraintNumber(int constraintNumber)
Set the constraint number.

Parameters:
constraintNumber - holds the number of constraints
Returns:
whether the constraint number is set successfully or not.

setInitialVariableValues

public boolean setInitialVariableValues(double[] initialVariableValues)
Set initial variable values (double[]). Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods are recommended to be called first.

Parameters:
initialVariableValues - holds a double array of initial variable values.
Returns:
whether the initial variable values are set successfully or not.

setOtherOptions

public boolean setOtherOptions(java.lang.String[] names,
                               java.lang.String[] values,
                               java.lang.String[] descriptions)
Set the other options related elements.

Parameters:
names - holds the names of the other options. It is required.
values - holds the values of the other options, empty string "" if no value for an option.
descriptions - holds the descriptions of the other options, empty string "" if no value for an option, null for the entire array if none of the options have descriptions.
Returns:
whether the other options element construction is successful.

addOtherOption

public boolean addOtherOption(java.lang.String name,
                              java.lang.String value,
                              java.lang.String description)
Add an other option element.

Parameters:
name - holds the name of the other option element. It is required.
value - holds the value of the other option element, empty string "" if none.
description - holds the description of the other option element, empty string "" if none.
Returns:
whether the other option element is added successfully.

main

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

Parameters:
argv - command line arguments.