Class SwingClient

java.lang.Object
  extended by SwingClient
All Implemented Interfaces:
ClientMessageWriter, ClientShutdownListener, java.awt.event.ActionListener, java.util.EventListener, javax.swing.event.ChangeListener

public class SwingClient
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, ClientMessageWriter, ClientShutdownListener

This class provides a GUI front-end to the SLAMD client interface using the Java Swing interface.

Author:
Neil A. Wilson

Field Summary
static java.lang.String EOL
          The end-of-line marker that should be used on this platform.
static java.lang.String PROPERTY_AGGREGATE
          The name of the configuration property that specifies whether to aggregate client thread data.
static java.lang.String PROPERTY_AUTH_ID
          The name of the configuration property that specifies the authentication ID.
static java.lang.String PROPERTY_AUTH_PW
          The name of the configuration property that specifies the authentication password.
static java.lang.String PROPERTY_BLIND_TRUST
          The name of the configuration property that specifies whether to blindly trust any certificate.
static java.lang.String PROPERTY_DISABLE_CL
          The name of the configuration property that specifies whether to disable the custom class loader.
static java.lang.String PROPERTY_ENABLE_PERSISTENCE
          The name of the configuration property that specifies whether to enable stat persistence.
static java.lang.String PROPERTY_ENABLE_RT
          The name of the configuration property that specifies whether to enable real-time statistics tracking.
static java.lang.String PROPERTY_KEY_PASS
          The name of the configuration property that specifies the password for the SSL keystore.
static java.lang.String PROPERTY_KEY_STORE
          The name of the configuration property that specifies the path to the SSL keystore.
static java.lang.String PROPERTY_PERSISTENCE_DIR
          The name of the configuration property that specifies the directory for stat persistence data.
static java.lang.String PROPERTY_PERSISTENCE_INTERVAL
          The name of the configuration property that specifies the stat persistence interval.
static java.lang.String PROPERTY_RESTRICTED_MODE
          The name of the configuration property that specifies whether to operate in restricted mode.
static java.lang.String PROPERTY_RT_INTERVAL
          The name of the configuration property that specifies the interval for reporting real-time statistics.
static java.lang.String PROPERTY_SLAMD_ADDRESS
          The name of the configuration property that specifies the address of the SLAMD server.
static java.lang.String PROPERTY_SLAMD_PORT
          The name of the configuration property that specifies the client port for the SLAMD server.
static java.lang.String PROPERTY_SLAMD_STAT_PORT
          The name of the configuration property that specifies the stat port for the SLAMD server.
static java.lang.String PROPERTY_TRUST_PASS
          The name of the configuration property that specifies the password for the SSL trust store.
static java.lang.String PROPERTY_TRUST_STORE
          The name of the configuration property that specifies the path to the SSL trust store.
static java.lang.String PROPERTY_USE_SSL
          The name of the configuration property that specifies whether to use SSL.
static java.lang.String PROPERTY_VERBOSE
          The name of the configuration property that specifies whether to enable verbose mode.
 
Constructor Summary
SwingClient(java.lang.String[] args)
          Creates a new instance of this swing client using the provided set of command-line arguments.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Detects an action event (i.e., button click) and performs the appropriate task.
 void clientDisconnected()
          Indicates that the client has disconnected from the server and that the client may wish to take whatever action is appropriate.
 void createConnectDialog()
          Creates the dialog that collects the information necessary to connect to the SLAMD server.
 void displayUsage()
          Displays usage information for this program.
static void main(java.lang.String[] args)
          Launches the swing client with the provided set of command-line arguments.
 void processConfigFile(java.lang.String configFile)
          Processes the contents of the specified config file.
 void stateChanged(javax.swing.event.ChangeEvent event)
          Detects a change event (i.e., checkbox selection/deselection) and performs the appropriate task.
 boolean usingVerboseMode()
          Indicates whether the message writer is using verbose mode and therefore will display messages written with the writeVerbose method.
 void writeMessage(java.lang.String message)
          Writes the provided message to the message text area.
 void writeVerbose(java.lang.String message)
          Writes the provided message to the message text area if verbose mode is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_SLAMD_ADDRESS

public static final java.lang.String PROPERTY_SLAMD_ADDRESS
The name of the configuration property that specifies the address of the SLAMD server.

See Also:
Constant Field Values

PROPERTY_SLAMD_PORT

public static final java.lang.String PROPERTY_SLAMD_PORT
The name of the configuration property that specifies the client port for the SLAMD server.

See Also:
Constant Field Values

PROPERTY_SLAMD_STAT_PORT

public static final java.lang.String PROPERTY_SLAMD_STAT_PORT
The name of the configuration property that specifies the stat port for the SLAMD server.

See Also:
Constant Field Values

PROPERTY_ENABLE_RT

public static final java.lang.String PROPERTY_ENABLE_RT
The name of the configuration property that specifies whether to enable real-time statistics tracking.

See Also:
Constant Field Values

PROPERTY_RT_INTERVAL

public static final java.lang.String PROPERTY_RT_INTERVAL
The name of the configuration property that specifies the interval for reporting real-time statistics.

See Also:
Constant Field Values

PROPERTY_ENABLE_PERSISTENCE

public static final java.lang.String PROPERTY_ENABLE_PERSISTENCE
The name of the configuration property that specifies whether to enable stat persistence.

See Also:
Constant Field Values

PROPERTY_PERSISTENCE_DIR

public static final java.lang.String PROPERTY_PERSISTENCE_DIR
The name of the configuration property that specifies the directory for stat persistence data.

See Also:
Constant Field Values

PROPERTY_PERSISTENCE_INTERVAL

public static final java.lang.String PROPERTY_PERSISTENCE_INTERVAL
The name of the configuration property that specifies the stat persistence interval.

See Also:
Constant Field Values

PROPERTY_AUTH_ID

public static final java.lang.String PROPERTY_AUTH_ID
The name of the configuration property that specifies the authentication ID.

See Also:
Constant Field Values

PROPERTY_AUTH_PW

public static final java.lang.String PROPERTY_AUTH_PW
The name of the configuration property that specifies the authentication password.

See Also:
Constant Field Values

PROPERTY_USE_SSL

public static final java.lang.String PROPERTY_USE_SSL
The name of the configuration property that specifies whether to use SSL.

See Also:
Constant Field Values

PROPERTY_BLIND_TRUST

public static final java.lang.String PROPERTY_BLIND_TRUST
The name of the configuration property that specifies whether to blindly trust any certificate.

See Also:
Constant Field Values

PROPERTY_KEY_STORE

public static final java.lang.String PROPERTY_KEY_STORE
The name of the configuration property that specifies the path to the SSL keystore.

See Also:
Constant Field Values

PROPERTY_KEY_PASS

public static final java.lang.String PROPERTY_KEY_PASS
The name of the configuration property that specifies the password for the SSL keystore.

See Also:
Constant Field Values

PROPERTY_TRUST_STORE

public static final java.lang.String PROPERTY_TRUST_STORE
The name of the configuration property that specifies the path to the SSL trust store.

See Also:
Constant Field Values

PROPERTY_TRUST_PASS

public static final java.lang.String PROPERTY_TRUST_PASS
The name of the configuration property that specifies the password for the SSL trust store.

See Also:
Constant Field Values

PROPERTY_AGGREGATE

public static final java.lang.String PROPERTY_AGGREGATE
The name of the configuration property that specifies whether to aggregate client thread data.

See Also:
Constant Field Values

PROPERTY_RESTRICTED_MODE

public static final java.lang.String PROPERTY_RESTRICTED_MODE
The name of the configuration property that specifies whether to operate in restricted mode.

See Also:
Constant Field Values

PROPERTY_DISABLE_CL

public static final java.lang.String PROPERTY_DISABLE_CL
The name of the configuration property that specifies whether to disable the custom class loader.

See Also:
Constant Field Values

PROPERTY_VERBOSE

public static final java.lang.String PROPERTY_VERBOSE
The name of the configuration property that specifies whether to enable verbose mode.

See Also:
Constant Field Values

EOL

public static java.lang.String EOL
The end-of-line marker that should be used on this platform.

Constructor Detail

SwingClient

public SwingClient(java.lang.String[] args)
Creates a new instance of this swing client using the provided set of command-line arguments.

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

main

public static void main(java.lang.String[] args)
Launches the swing client with the provided set of command-line arguments.

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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Detects an action event (i.e., button click) and performs the appropriate task.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The action event that occurred.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Detects a change event (i.e., checkbox selection/deselection) and performs the appropriate task.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
event - The change event that occurred.

createConnectDialog

public void createConnectDialog()
Creates the dialog that collects the information necessary to connect to the SLAMD server.


writeMessage

public void writeMessage(java.lang.String message)
Writes the provided message to the message text area.

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

writeVerbose

public void writeVerbose(java.lang.String message)
Writes the provided message to the message text area if verbose mode is enabled.

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

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.

clientDisconnected

public void clientDisconnected()
Indicates that the client has disconnected from the server and that the client may wish to take whatever action is appropriate.

Specified by:
clientDisconnected in interface ClientShutdownListener

processConfigFile

public void processConfigFile(java.lang.String configFile)
Processes the contents of the specified config file.

Parameters:
configFile - The path to the configuration file to process.

displayUsage

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