|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.util.OSParameter
public final class OSParameter
The OSParameter
class stores predefined parameters/options (public an d static)
used in other Optimization Services classes.
Field Summary | |
---|---|
static boolean |
ALLOW_IO_OPERATIONS_BY_USERS
ALLOW_IO_OPERATIONS_BY_USERS holds whether the users can carry out io operations (through option files). |
static boolean |
APPEND_PRINT_FILE
APPEND_PRINT_FILE holds whether to append or overwrite the PrintFile. |
static java.lang.String |
BACKUP_FOLDER
BACKUP_FOLDER holds the main system folder for backing up. |
static java.lang.String[] |
CLEAN_UP_FOLDERS
CLEAN_UP_FOLDERS holds the folder to clean up. |
static java.lang.String |
CODE_DRIVE
CODE_DRIVE holds the disk drive of the code installation. |
static java.lang.String |
CODE_HOME
CODE_HOME holds the home directory of home. |
static double |
CPU_SPEED
CPU_SPEED holds the cpu speed of the server. |
static int |
DEFAULT_OUTPUT
DEFAULT_OUTPUT holds the default output to print. |
static java.lang.String[] |
DIRECTORIES_TO_DELETE
DIRECTORIES_TO_DELETE holds the directories to delete after the solver's solve method is finished. |
static java.lang.String[] |
DIRECTORIES_TO_MAKE
DIRECTORIES_TO_MAKE holds the directories to make before invoking the solver's solve method. |
static double |
DISK_SPACE
DISK_SPACE holds the total disk space of the server. |
static java.lang.String[] |
FILES_TO_CREATE
FILES_TO_CREATE holds the files to create before invoking the solver's solve method. |
static java.lang.String[] |
FILES_TO_DELETE
FILES_TO_DELETE holds the files to delete after the solver's solve method is finished. |
static java.lang.String |
FML_PUBLIC_SITE
FML_PUBLIC_SITE holds the value of the FML schema public site. |
static java.lang.String |
FROM_EMAIL
FROM_EMAIL holds the from email address to send the email. |
static java.lang.String |
FROM_PASSWORD
FROM_PASSWORD holds the from email address to send the email. |
static java.lang.String[] |
INPUT_FILES_TO_COPY_FROM
INPUT_FILES_TO_COPY_FROM holds the names of the input files to copy from before invoking the solver's solve method. |
static java.lang.String[] |
INPUT_FILES_TO_COPY_TO
INPUT_FILES_TO_COPY_TO holds the names of the input files to copy to before invoking the solver's solve method. |
static java.lang.String[] |
INPUT_FILES_TO_MOVE_FROM
INPUT_FILES_TO_MOVE_FROM holds the names of the input files to move from before invoking the solver's solve method. |
static java.lang.String[] |
INPUT_FILES_TO_MOVE_TO
INPUT_FILES_TO_MOVE_TO holds the names of the input files to move to before invoking the solver's solve method. |
static long |
JOB_MAX_HOURS
JOB_MAX_HOUR holds the maximum hours allowed for a job. |
static long |
JOB_MAX_MINUTES
JOB_MAX_MINUTE holds the maximum minutes allowed for a job. |
static long |
JOB_MAX_SECONDS
JOB_MAX_SECOND holds the maximum seconds allowed for a job. |
static double |
JOB_MAX_TIME
JOB_MAX_TIME holds the maximum job time in seconds. |
static java.lang.String |
LOG_FILE
LOG_FILE holds the main system file for logging messages and errors. |
static java.lang.String |
LOG_FOLDER
LOG_FOLDER holds the main system folder for logging messages and errors. |
static java.lang.String |
MAIL_MESSAGE
MAIL_MESSAGE holds the email message body. |
static java.lang.String |
MAIL_SUBJECT
MAIL_SUBJECT holds the email subject. |
static int |
MAX_JOB_NUMBERS
MAX_JOB_NUMBERS holds the maximum number of running jobs allowed per service. |
static int |
MAX_JOBIDS_TO_KEEP
MAX_JOBIDS_TO_KEEP holds the maximum number of job ids to keep before deleting them. |
static int |
MAX_JOBS_PER_USER
MAX_JOBS_PER_USER holds the maximum number of active jobs a user can run. |
static long |
MAX_LOG_FILE_SIZE
MAX_LOG_FILE_SIZE holds the maximum size of the log file before it is backed up and started again. |
static int |
MAX_WAITING_NUMBERS
MAX_WAITING_NUMBERS holds the maximum number of waiting jobs allowed per service. |
static int |
MAXIMUM_TRIAL_NUMBER_FOR_SOLVE
MAXIMUM_TRIAL_NUMBER_FOR_SOLVE holds the maximum number of trials for a (failed) solve before the service terminates. |
static int |
MAXIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL
MAXIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL holds the maximum wait time (in milliseconds before the service tries another solve after the last solve. |
static double |
MEMORY_SIZE
MEMORY_SIZE holds the total physical memory of the server. |
static long |
MINIMUM_DISKSPACE_TRIGGER
MINIMUM_DISKSPACE_TRIGGER holds the minimum disk space before the automatic clean up is triggered to delete temporary files. |
static long |
MINIMUM_MEMORY_TRIGGER
MINIMUM_MEMORY_TRIGGER holds the minimum memory before the automatic clean up is triggered to get more memory. |
static int |
MINIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL
MINIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL holds the minimum wait time (in milliseconds before the service tries another solve after the last solve. |
static java.lang.String |
OS_REGISTRY_SITE
OS_REGISTRY_SITE holds the site of the OS Registry. |
static java.lang.String |
OS_SCHEDULER_SITE
OS_SCHEDULER_SITE holds the site of the OS scheduler. |
static java.lang.String |
OS_SCHEMA_SITE
OS_SCHEMA_SITE holds the value of the OSxL schema's public site. |
static java.lang.String |
OS_SERVICE_SITE
OS_SERVICE_SITE holds the main site of the OS services. |
static java.lang.String |
OS_SITE
OS_SITE holds the site of optimizationservices.org. |
static java.lang.String[] |
OUTPUT_FILES_TO_COPY_FROM
OUTPUT_FILES_TO_COPY_FROM holds the names of the output files to copy from after the solver's solve method is finished. |
static java.lang.String[] |
OUTPUT_FILES_TO_COPY_TO
OUTPUT_FILES_TO_COPY_TO holds the names of the output files to copy to after the solver's solve method is finished. |
static java.lang.String[] |
OUTPUT_FILES_TO_MOVE_FROM
OUTPUT_FILES_TO_MOVE_FROM holds the names of the output files to move from after the solver's solve method is finished. |
static java.lang.String[] |
OUTPUT_FILES_TO_MOVE_TO
OUTPUT_FILES_TO_MOVE_TO holds the names of the output files to move to after the solver's solve method is finished. |
static java.lang.String |
PARAMETER_FILE
PARAMETER_FILE holds the file that keeps the parameter information. |
static boolean |
PARSE_INSTANCE_INPUT
PARSE_INSTANCE_INPUT holds whether to parse the OSiL instance input arguments of the solve or send method. |
static java.lang.String |
PRINT_FILE
PRINT_FILE holds the main system file for printing a sting. |
static java.lang.String |
PRINT_FOLDER
PRINT_FOLDER holds the main system folder for printing a string. |
static java.io.StringWriter |
PRINT_STRING_WRITER
PRINT_STRING_WRITER holds the main system string writer for printing a string. |
static java.lang.String |
PROCESS_FILE
PROCESS_FILE holds the file that keeps the service process information in OSpL. |
static java.lang.String[] |
PROCESSES_TO_KILL
PROCESSES_TO_KILL holds the names of the processes to kill after tge sikver's solve method is finished. |
static java.lang.String |
REGISTRY_DETAILED_REPORT
REGISTRY_DETAILED_REPORT holds the file to log the registry detailed report. |
static java.lang.String |
REGISTRY_FILE
REGISTRY_FILE holds the file that keeps the registry information. |
static java.lang.String |
REGISTRY_LOG_FILE
REGISTRY_LOG_FILE holds the main registry file for logging registy related messages. |
static java.lang.String |
REGISTRY_LOG_FOLDER
REGISTRY_LOG_FOLDER holds the main registry folder for logging registy related messages. |
static java.lang.String |
REGISTRY_REGISTRATION_FILE
REGISTRY_REGISTRATION_FILE holds the main registry file for logging registration related messages. |
static java.lang.String |
REGISTRY_SUMMARY_REPORT
REGISTRY_SUMMARY_REPORT holds the file to log the registry summary report. |
static boolean |
REQUIRE_LICENSE
REQUIRE_LICENSE holds whether the service needs a license number for each user. |
static boolean |
REQUIRE_ONLY_JOB_ID_TO_KILL_JOB
REQUIRE_ONLY_JOB_ID_TO_KILL_JOB holds whether only the job id (no user name/password/license) is needed to kill a job. |
static boolean |
REQUIRE_ONLY_JOB_ID_TO_RETRIEVE_JOB_RESULT
REQUIRE_ONLY_JOB_ID_TO_RETRIEVE_JOB_RESULT holds whether only the job id (no user name/password/license) is needed to retrieve a job result. |
static boolean |
REQUIRE_PASSWORD
REQUIRE_PASSWORD holds whether the service needs a password for each user. |
static boolean |
REQUIRE_USER_NAME
REQUIRE_USER_NAME holds whether the service needs user name to be submitted. |
static java.lang.String[] |
REQUIRED_DIRECTORIES_AND_FILES
REQUIRED_DIRECTORIES_AND_FILES holds the required directories and files for invoking the solver's solve method. |
static boolean |
SAVE_INPUTS
SAVE_INPUTS holds whether to save the OSiL and OSoL input arguments of the solve or send method. |
static boolean |
SCHEDULER_WITH_REGISTRY
SCHEDULER_WITH_REGISTRY holds whether the scheduler service locally sits with the registry service in the same web application. |
static java.lang.String |
SERVICE_NAME
SERVICE_NAME holds the service name. |
static int |
SERVICE_POLLING_INTERVAL_LONG
SERVICE_POLLING_INTERVAL_LONG holds the number of milli-seconds that a service periodically carries out maintentance. |
static int |
SERVICE_POLLING_INTERVAL_MEDIUM
SERVICE_POLLING_INTERVAL_MEDIUM holds the number of milli-seconds that a service periodically carries out maintentance. |
static int |
SERVICE_POLLING_INTERVAL_SHORT
SERVICE_POLLING_INTERVAL_SHORT holds the number of milli-seconds that a service periodically carries out maintentance. |
static java.lang.String |
SERVICE_TYPE
SERVICE_TYPE holds the service type. |
static java.lang.String |
SERVICE_URI
SERVICE_URI holds the service uri. |
static java.lang.String |
SMTP_SERVER
SMTP_SERVER holds the smtp server address to send the email. |
static java.lang.String |
SOLVER_CLASS_NAME
SOLVER_CLASS_NAME holds the full class name (including name space) of the solver |
static java.lang.String |
SOLVER_LIBRARY
SOLVER_LIBRARY holds the library file of the solver class. |
static java.lang.String |
TEMP_FILE_FOLDER
TEMP_FILE_FOLDER holds the folder to save temporary files. |
static long |
TEMP_FILE_MAX_DAYS
TEMP_FILE_MAX_DAY holds the maximum days allowed to keep a temporary file. |
static long |
TEMP_FILE_MAX_HOURS
TEMP_FILE_MAX_HOUR holds the maximum hours allowed to keep a temporary file. |
static long |
TEMP_FILE_MAX_MINUTES
TEMP_FILE_MAX_MINUTE holds the maximum minutes allowed to keep a temporary file. |
static long |
TEMP_FILE_MAX_SECONDS
TEMP_FILE_MAX_SECOND holds the maximum seconds allowed to keep a temporary file. |
static long |
TEMP_FILE_MIN_DAYS
TEMP_FILE_MIN_DAY holds the minimum days allowed to keep a temporary file. |
static long |
TEMP_FILE_MIN_HOURS
TEMP_FILE_MIN_HOUR holds the minimum hours allowed to keep a temporary file. |
static long |
TEMP_FILE_MIN_MINUTES
TEMP_FILE_MIN_MINUTE holds the minimum minutes allowed to keep a temporary file. |
static long |
TEMP_FILE_MIN_SECONDS
TEMP_FILE_MIN_SECOND holds the minimum seconds allowed to keep a temporary file. |
static java.lang.String |
TO_EMAIL
TO_EMAIL holds the to email address to send the email. |
static java.lang.String[] |
USER_NAMES
USER_NAMES holds all the user names. |
static boolean |
VALIDATE
VALIDATE holds whether the parser should be validating against the xml schema or not. |
static java.lang.String |
XML_ENCODING_STYLE
XML_ENCODING_STYLE holds the xml encoding style. |
static boolean |
XML_INDENTING
XML_INDENTING holds whether to write out the xml indented. |
Constructor Summary | |
---|---|
OSParameter()
Default constructor. |
Method Summary | |
---|---|
static boolean |
checkLicense(java.lang.String userName,
java.lang.String license)
check license given a user name and license |
static boolean |
checkUserNameAndPassword(java.lang.String userName,
java.lang.String password)
check user name and password. |
static void |
main(java.lang.String[] args)
main for test purposes. |
static boolean |
readAndSetOSParameter(java.lang.String osParameter,
boolean isFile,
boolean validate)
read an osParameter file or string and and set the parameters. |
static java.lang.String |
writeOSParameter()
write the OSParameter to an xml string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CODE_DRIVE
public static java.lang.String CODE_HOME
public static java.lang.String PARAMETER_FILE
public static java.lang.String REGISTRY_FILE
public static java.lang.String PROCESS_FILE
public static java.lang.String TEMP_FILE_FOLDER
public static java.lang.String LOG_FOLDER
public static java.lang.String LOG_FILE
public static long MAX_LOG_FILE_SIZE
public static java.lang.String BACKUP_FOLDER
public static java.lang.String REGISTRY_LOG_FOLDER
public static java.lang.String REGISTRY_LOG_FILE
public static java.lang.String REGISTRY_REGISTRATION_FILE
public static java.lang.String REGISTRY_SUMMARY_REPORT
public static java.lang.String REGISTRY_DETAILED_REPORT
public static java.lang.String PRINT_FOLDER
public static java.lang.String PRINT_FILE
public static boolean APPEND_PRINT_FILE
public static java.io.StringWriter PRINT_STRING_WRITER
public static int DEFAULT_OUTPUT
public static long MINIMUM_DISKSPACE_TRIGGER
public static long MINIMUM_MEMORY_TRIGGER
public static java.lang.String[] CLEAN_UP_FOLDERS
public static int MAX_JOBIDS_TO_KEEP
public static long JOB_MAX_HOURS
public static long JOB_MAX_MINUTES
public static long JOB_MAX_SECONDS
public static double JOB_MAX_TIME
public static long TEMP_FILE_MAX_DAYS
public static long TEMP_FILE_MAX_HOURS
public static long TEMP_FILE_MAX_MINUTES
public static long TEMP_FILE_MAX_SECONDS
public static long TEMP_FILE_MIN_DAYS
public static long TEMP_FILE_MIN_HOURS
public static long TEMP_FILE_MIN_MINUTES
public static long TEMP_FILE_MIN_SECONDS
public static double CPU_SPEED
public static double MEMORY_SIZE
public static double DISK_SPACE
public static int MAX_JOB_NUMBERS
public static int MAX_WAITING_NUMBERS
public static int SERVICE_POLLING_INTERVAL_SHORT
public static int SERVICE_POLLING_INTERVAL_MEDIUM
public static int SERVICE_POLLING_INTERVAL_LONG
public static java.lang.String SOLVER_CLASS_NAME
public static java.lang.String SOLVER_LIBRARY
public static int MAXIMUM_TRIAL_NUMBER_FOR_SOLVE
public static int MINIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL
public static int MAXIMUM_WAIT_TIME_BEFORE_NEXT_TRIAL
public static java.lang.String[] REQUIRED_DIRECTORIES_AND_FILES
public static java.lang.String[] DIRECTORIES_TO_MAKE
public static java.lang.String[] FILES_TO_CREATE
public static boolean SAVE_INPUTS
public static boolean PARSE_INSTANCE_INPUT
public static java.lang.String[] INPUT_FILES_TO_MOVE_FROM
public static java.lang.String[] INPUT_FILES_TO_MOVE_TO
public static java.lang.String[] INPUT_FILES_TO_COPY_FROM
public static java.lang.String[] INPUT_FILES_TO_COPY_TO
public static java.lang.String[] OUTPUT_FILES_TO_COPY_FROM
public static java.lang.String[] OUTPUT_FILES_TO_COPY_TO
public static java.lang.String[] OUTPUT_FILES_TO_MOVE_FROM
public static java.lang.String[] OUTPUT_FILES_TO_MOVE_TO
public static java.lang.String[] FILES_TO_DELETE
public static java.lang.String[] DIRECTORIES_TO_DELETE
public static java.lang.String[] PROCESSES_TO_KILL
public static java.lang.String SERVICE_NAME
public static java.lang.String SERVICE_URI
public static java.lang.String SERVICE_TYPE
public static java.lang.String OS_SERVICE_SITE
public static java.lang.String OS_REGISTRY_SITE
public static java.lang.String OS_SCHEDULER_SITE
public static boolean SCHEDULER_WITH_REGISTRY
public static java.lang.String SMTP_SERVER
public static java.lang.String FROM_EMAIL
public static java.lang.String FROM_PASSWORD
public static java.lang.String TO_EMAIL
public static java.lang.String MAIL_SUBJECT
public static java.lang.String MAIL_MESSAGE
public static boolean REQUIRE_USER_NAME
public static boolean REQUIRE_PASSWORD
public static boolean REQUIRE_LICENSE
public static boolean REQUIRE_ONLY_JOB_ID_TO_RETRIEVE_JOB_RESULT
public static boolean REQUIRE_ONLY_JOB_ID_TO_KILL_JOB
public static int MAX_JOBS_PER_USER
public static java.lang.String[] USER_NAMES
public static boolean ALLOW_IO_OPERATIONS_BY_USERS
public static boolean VALIDATE
public static boolean XML_INDENTING
public static java.lang.String FML_PUBLIC_SITE
public static java.lang.String OS_SITE
public static java.lang.String OS_SCHEMA_SITE
public static java.lang.String XML_ENCODING_STYLE
Constructor Detail |
---|
public OSParameter()
Method Detail |
---|
public static boolean checkUserNameAndPassword(java.lang.String userName, java.lang.String password)
userName
- holds the user name; can be null if the service requires only the password.password
- holds the password to check; can be null if the service requires only the user name.
public static boolean checkLicense(java.lang.String userName, java.lang.String license)
userName
- holds the user name. can be null if the service requires only the license.license
- holds the license to check.
public static boolean readAndSetOSParameter(java.lang.String osParameter, boolean isFile, boolean validate) throws java.lang.Exception
osParameter
- holds the OS Parameter in a string which format follows the
OSParameter schema.isFile
- holds whether the osParameter string is a file name or a string that literally holds the osParameter contents.validate
- holds whether the reader should be validating against the schema or not.
java.lang.Exception
public static java.lang.String writeOSParameter() throws java.lang.Exception
java.lang.Exception
- if there are errors in writing the osParameter string.public static void main(java.lang.String[] args)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |