Class CommandLineJobScheduler

java.lang.Object
  extended by CommandLineJobScheduler

public class CommandLineJobScheduler
extends java.lang.Object

This class defines a utility that may be used to schedule SLAMD jobs from the command line. It does this by communicating with the SLAMD administrative interface over HTTP to ensure that the scheduler is properly updated, that all appropriate validity checking is performed, and that any required authentication is honored.

Author:
Neil A. Wilson

Constructor Summary
CommandLineJobScheduler(java.lang.String configFile, java.lang.String slamdHost, int slamdPort, boolean useSSL, java.lang.String authID, java.lang.String authPW, java.lang.String postURI, java.lang.String dependencyID, java.lang.String jobClassName, boolean optimizingJob, OptimizationAlgorithm optimizationAlgorithm, boolean verboseMode)
          Creates a new instance of this command-line scheduler with the provided information.
 
Method Summary
 void debug(java.lang.String message)
          Prints the provided message if the program is operating in verbose mode.
static void displayUsage()
          Displays usage information for this program.
 void generateConfigFile()
          Generates a configuration file to use to schedule the job.
static void main(java.lang.String[] args)
          Invokes the constructor and provides it with the command-line arguments.
 boolean parseConfigFile()
          Parses the configuration file and assigns its contents to instance variables.
 java.lang.String scheduleJob()
          Handles all processing required to schedule a job for execution.
 java.lang.String scheduleOptimizingJob()
          Handles all processing required to schedule an optimizing job for execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineJobScheduler

public CommandLineJobScheduler(java.lang.String configFile,
                               java.lang.String slamdHost,
                               int slamdPort,
                               boolean useSSL,
                               java.lang.String authID,
                               java.lang.String authPW,
                               java.lang.String postURI,
                               java.lang.String dependencyID,
                               java.lang.String jobClassName,
                               boolean optimizingJob,
                               OptimizationAlgorithm optimizationAlgorithm,
                               boolean verboseMode)
Creates a new instance of this command-line scheduler with the provided information.

Parameters:
configFile - The path to the configuration file to use.
slamdHost - The address to use for the SLAMD server.
slamdPort - The port of the SLAMD server's HTTP administration interface.
useSSL - Indicates whether to use SSL to communicate with the SLAMD server.
authID - The user ID to use to authenticate to the server.
authPW - The password to use to authenticate to the server.
postURI - The URI in the SLAMD server to which the request should be posted.
dependencyID - The job ID of the job on which to make the new job dependent.
jobClassName - The name of the job class for which to generate the configuration.
optimizingJob - Indicates whether the configuration generated should be an optimizing job.
optimizationAlgorithm - The optimization algorithm that should be used to create the optimizing job.
verboseMode - Indicates whether the scheduler should operate in verbose mode.
Method Detail

main

public static void main(java.lang.String[] args)
Invokes the constructor and provides it with the command-line arguments.

Parameters:
args - The command-line arguments provided to this program.

generateConfigFile

public void generateConfigFile()
Generates a configuration file to use to schedule the job.


parseConfigFile

public boolean parseConfigFile()
Parses the configuration file and assigns its contents to instance variables.

Returns:
true if the file was parsed successfully and the job configuration is valid, or false if there was a problem of some kind.

scheduleJob

public java.lang.String scheduleJob()
Handles all processing required to schedule a job for execution.

Returns:
The job ID of the job that was scheduled, or null if an error occurred to prevent the job from being scheduled properly.

scheduleOptimizingJob

public java.lang.String scheduleOptimizingJob()
Handles all processing required to schedule an optimizing job for execution.

Returns:
The job ID of the optimizing job that was scheduled, or null if an error occurred to prevent the job from being scheduled properly.

debug

public void debug(java.lang.String message)
Prints the provided message if the program is operating in verbose mode.

Parameters:
message - The message to be printed.

displayUsage

public static void displayUsage()
Displays usage information for this program.