Class StandaloneClient

java.lang.Object
  extended by StandaloneClient
All Implemented Interfaces:
ClientMessageWriter

public class StandaloneClient
extends java.lang.Object
implements ClientMessageWriter

This class defines a SLAMD client that may execute SLAMD jobs without the need for a SLAMD server to be running. It allows a single client to execute a job from the command line with output sent to standard output and standard error. The configuration for the job should be specified in a configuration file.

Author:
Neil A. Wilson

Constructor Summary
StandaloneClient(java.lang.String[] args)
          Create a new standalone client instance, process the configuration, and run the specified job.
 
Method Summary
 void displayUsage()
          Writes usage information for this program to standard error.
 void generateConfigFile()
          Generates a configuration file that can be used to run the specified job.
static void main(java.lang.String[] args)
          Create a new standalone client instance and pass all the arguments to it.
 boolean usingVerboseMode()
          Indicates whether the message writer is using verbose mode and therefore will display messages written with the writeVerbose method.
 void writeComment(java.io.BufferedWriter writer, java.lang.String comment)
          Writes the provided comment to the generated configuration file, wrapping long lines if necessary.
 void writeMessage(java.lang.String message)
          Writes information logged during job processing to standard output.
 void writeVerbose(java.lang.String message)
          Writes verbose information logged during job processing to standard output (if verbose logging is enabled).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneClient

public StandaloneClient(java.lang.String[] args)
Create a new standalone client instance, process the configuration, and run the specified job.

Parameters:
args - The set of arguments provided on the command line.
Method Detail

main

public static void main(java.lang.String[] args)
Create a new standalone client instance and pass all the arguments to it.

Parameters:
args - The set of arguments provided on the command line.

generateConfigFile

public void generateConfigFile()
Generates a configuration file that can be used to run the specified job.


writeComment

public void writeComment(java.io.BufferedWriter writer,
                         java.lang.String comment)
                  throws java.io.IOException
Writes the provided comment to the generated configuration file, wrapping long lines if necessary.

Parameters:
writer - The buffered writer used to write information to the configuration file.
comment - The comment to be written to the file.
Throws:
java.io.IOException - If a problem occurs while writing the comment to the configuration file.

displayUsage

public void displayUsage()
Writes usage information for this program to standard error.


writeMessage

public void writeMessage(java.lang.String message)
Writes information logged during job processing to standard output.

Specified by:
writeMessage in interface ClientMessageWriter
Parameters:
message - The message to be written to standard output.

writeVerbose

public void writeVerbose(java.lang.String message)
Writes verbose information logged during job processing to standard output (if verbose logging is enabled).

Specified by:
writeVerbose in interface ClientMessageWriter
Parameters:
message - The message to be written to standard output.

usingVerboseMode

public boolean usingVerboseMode()
Indicates whether the message writer is using verbose mode and therefore will display messages written with the writeVerbose method.

Specified by:
usingVerboseMode in interface ClientMessageWriter
Returns:
true if the message writer is using verbose mode, or false if not.