com.isti.quakewatch.clientbase
Class QWClientBase

java.lang.Object
  extended by com.isti.util.ErrorMessageMgr
      extended by com.isti.util.ClientLogViaCfgProps
          extended by com.isti.quakewatch.clientbase.QWClientBase
All Implemented Interfaces:
ErrorMsgMgrIntf
Direct Known Subclasses:
QWTrackingClient

public class QWClientBase
extends ClientLogViaCfgProps

Class QWClientBase defines base functionality for a QuakeWatch client. QuakeWatch client classes should extend this class.


Field Summary
static java.lang.String CFG_PARAM_SPEC
          Name of parameter for specifying the client configuration file.
protected  java.lang.String clientNameString
           
protected  java.lang.String clientVerString
           
protected  QWConnectionMgr connectionManagerObj
           
protected  InitReqMsgsCallBack initReqMsgsCallBackObj
           
protected  java.lang.String initReqMsgsCancelString
           
protected  IstiDialogInterface initReqMsgsDialogObj
           
protected  ProgressIndicatorInterface initReqMsgsProgIndObj
           
protected  CfgPropItem prependDeclarationFlagProp
           
protected  java.lang.String prependDeclarationString
           
protected  CfgPropItem prependDeclarationTextProp
           
protected  DataChangedListener saveToConfigFileCallBackObj
           
protected  java.beans.PropertyEditor serverLoginPropEditorObj
           
protected  java.lang.String startupTimeString
           
protected  XmlConfigLoader xmlConfigLoaderObj
           
 
Fields inherited from class com.isti.util.ClientLogViaCfgProps
baseWriteDirStr, clientConsoleLevelProp, clientLogFileLevelProp, clientLogFileNameProp, consoleFilesMaxAgeInDays, consoleFilesSwitchIntvlDays, consoleRedirectFileNameProp, consoleRedirectStream, logFileProps, logFilesMaxAgeInDaysProp, logObj
 
Constructor Summary
QWClientBase()
          Creates the client base object.
 
Method Summary
protected  void addShutdownHookCleanupThreadObj()
          Installs the cleanup thread to be run at program termination.
 boolean clientSleepDelay(int delayMs)
          Convenience method for performing a sleep delay.
 byte[] getCertificateFileDataArr()
          Returns the certificate-file data that was fetched from the server at connect time.
 long getClientRunningStartTime()
          Gets the client running start time in milliseconds.
 long getClientRunningTime()
          Gets the amount of time the client has been running in milliseconds.
 QWConnectionMgr getConnManagerObj()
          Returns the connection-manager object.
 QWConnProperties getConnPropsObj()
          Returns the connection-configuration-properties manager object.
 LogFile getLogFileObj()
          Returns the log file object.
 CfgPropItem getMaxServerEventAgeDaysProp()
          Returns the local 'maxServerEventAgeDays' property item (if available).
static java.lang.String getOpenOrbVersionStr()
          Returns the OpenORB version string.
 java.lang.String getPrependDeclarationString()
          Returns the declaration string to be prepended to sent messages.
 XmlConfigLoader getXmlConfigLoader()
          Get the XML config loader.
protected  void interruptClientSleepDelay()
          Interrupts any 'clientSleepDelay()' in progress.
 boolean isClientRunning()
          Determines whether or not the client is running.
 boolean isClientTerminated()
          Determines whether or not the client has been terminated.
 boolean isConnectionValidated()
          Returns the status of whether or not the connection has been "validated" via the receipt of any server-alive messages.
 boolean isEventChannelConnected()
          Returns the connection status of the server event channel.
 boolean isReqServerMsgsAvailable()
          Returns an indicator of whether or not the 'requestMessages()' method is available via the 'QWServices' on the current server.
protected  void localExitCleanup()
          Performs "local" exit cleanup after calling 'performExitCleanup()'.
protected  void localExitCleanup(boolean systemExitFlag, int exitVal)
          Performs "local" exit cleanup after calling 'performExitCleanup()'.
protected  void localExitCleanup(boolean systemExitFlag, int exitVal, boolean remShutdownHookFlag)
          Performs "local" exit cleanup after calling 'performExitCleanup()'.
protected  void localExitCleanup(int exitVal)
          Performs "local" exit cleanup after calling 'performExitCleanup()'.
protected  void performExitCleanup()
          Called in response to program termination ("Ctrl-C", kill, etc).
 boolean processConfiguration(java.lang.String cfgFileName, java.lang.String rootElementName, java.lang.String settingsElementName, boolean mustFlag, java.lang.String[] programArgs)
          Loads settings from the configuration file and sets up the log file and the console-redirect files (if enabled).
 boolean processConfiguration(java.lang.String cfgFileName, java.lang.String rootElementName, java.lang.String settingsElementName, boolean mustFlag, java.lang.String[] programArgs, boolean loadConfigFlag)
          Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled).
 boolean processConfiguration(java.lang.String cfgFileName, java.lang.String rootElementName, java.lang.String settingsElementName, boolean mustFlag, java.lang.String[] prgArgs, boolean loadConfigFlag, java.lang.String defaultCfgFName)
          Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled).
 boolean processConfiguration(java.lang.String cfgFileName, java.lang.String rootElementName, java.lang.String settingsElementName, boolean mustFlag, java.lang.String[] programArgs, java.lang.String defaultCfgFName)
          Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled).
 boolean reinitConnection()
          Closes and reopens the CORBA connection to the server.
protected  void removeShutdownHookCleanupThreadObj()
          Removes the cleanup thread run at program termination (if installed).
 boolean runClient(QWConnectionMgr connMgrObj)
          Runs the client.
 boolean runClient(QWConnectionMgr connMgrObj, boolean processingEnabledFlag)
          Runs the client.
protected  boolean runClient(QWConnectionMgr connMgrObj, QWDataMsgProcessor msgProcessorObj, ConnStatusInterface connStatusObj, boolean processingEnabledFlag)
          Runs the client.
 boolean runClient(QWDataMsgProcessor msgProcessorObj)
          Runs the client.
 boolean runClient(QWDataMsgProcessor msgProcessorObj, boolean processingEnabledFlag)
          Runs the client.
 boolean runClient(QWDataMsgProcessor msgProcessorObj, ConnStatusInterface connStatusObj)
          Runs the client.
 boolean runClient(QWDataMsgProcessor msgProcessorObj, ConnStatusInterface connStatusObj, boolean processingEnabledFlag)
          Runs the client.
 void setSaveToConfigFileCallBackObj(DataChangedListener listenerObj)
          Sets up the call-back object to be called when the connection configuration-property items should be saved to the config file.
 void setServerLoginPropertyEditor(java.beans.PropertyEditor propertyEditorObj)
          Enters the login-dialog property editor for the 'QWServerLoginInformation' object held by the "serverLogin" connection-property item.
 void setupClientInfoProps(java.lang.String clientNameStr, java.lang.String clientVerStr)
          Sets up the connection-information properties string to be sent when the client connects to the server.
 void setupClientInfoProps(java.lang.String clientNameStr, java.lang.String clientVerStr, java.lang.String startupTimeStr)
          Sets up the connection-information properties string to be sent when the client connects to the server.
 void setupConfiguration(CfgProperties userPropsObj, java.lang.Object connGroupSelObj)
          Sets up the client configuration by adding items to the configuration- properties object.
 void setupConfiguration(CfgProperties userPropsObj, java.lang.Object connGroupSelObj, boolean addPrependDeclFlag)
          Sets up the client configuration by adding items to the configuration- properties object.
 void setupConfiguration(CfgProperties userPropsObj, java.lang.Object connGroupSelObj, java.lang.Object logGroupSelObj)
          Sets up the client configuration by adding items to the configuration- properties object.
 void setupConfiguration(CfgProperties userPropsObj, java.lang.Object connGroupSelObj, java.lang.Object logGroupSelObj, boolean addPrependDeclFlag)
          Sets up the client configuration by adding items to the configuration- properties object.
 void setupConfiguration(CfgProperties userPropsObj, java.lang.Object connGroupSelObj, java.lang.Object logGroupSelObj, boolean addPrependDeclFlag, boolean localEventAgePropFlag)
          Sets up the client configuration by adding items to the configuration- properties object.
 void setupInitReqMsgsObjs(IstiDialogInterface initReqMsgsDialogObj, java.lang.String initReqMsgsCancelString, ProgressIndicatorInterface initReqMsgsProgIndObj, InitReqMsgsCallBack initReqMsgsCallBackObj)
          Sets up dialog, progress and call-back objects used by the connection manager's "initialRequestMessagesFromServer()" method.
 void stopClient()
          Shuts down the client and performs exit cleanup.
 void terminateProgram(int exitVal)
          Shuts down the client, performs exit cleanup and terminates the program.
 
Methods inherited from class com.isti.util.ClientLogViaCfgProps
addLogFilePropItems, addLogFilePropItems, closeConsoleRedirectStream, closeLogFile, createLogFile, fromBaseDir, fromBaseDir, getBaseWriteDirStr, getConsoleRedirectStreamObj, setBaseWriteDirStr, setGroupSelObj
 
Methods inherited from class com.isti.util.ErrorMessageMgr
clearErrorMessageString, clearFetchedErrorMessage, enterErrorMessageString, getErrorMessageFlag, getErrorMessageString, getUnfetchedMessageFlag, setErrorMessageString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CFG_PARAM_SPEC

public static final java.lang.String CFG_PARAM_SPEC
Name of parameter for specifying the client configuration file.

See Also:
Constant Field Values

connectionManagerObj

protected QWConnectionMgr connectionManagerObj

xmlConfigLoaderObj

protected final XmlConfigLoader xmlConfigLoaderObj

clientNameString

protected java.lang.String clientNameString

clientVerString

protected java.lang.String clientVerString

startupTimeString

protected java.lang.String startupTimeString

initReqMsgsDialogObj

protected IstiDialogInterface initReqMsgsDialogObj

initReqMsgsCancelString

protected java.lang.String initReqMsgsCancelString

initReqMsgsProgIndObj

protected ProgressIndicatorInterface initReqMsgsProgIndObj

initReqMsgsCallBackObj

protected InitReqMsgsCallBack initReqMsgsCallBackObj

serverLoginPropEditorObj

protected java.beans.PropertyEditor serverLoginPropEditorObj

saveToConfigFileCallBackObj

protected DataChangedListener saveToConfigFileCallBackObj

prependDeclarationString

protected java.lang.String prependDeclarationString

prependDeclarationFlagProp

protected final CfgPropItem prependDeclarationFlagProp

prependDeclarationTextProp

protected final CfgPropItem prependDeclarationTextProp
Constructor Detail

QWClientBase

public QWClientBase()
Creates the client base object. A default value is loaded into the 'startupTimeString' instance variable.

Method Detail

setupConfiguration

public void setupConfiguration(CfgProperties userPropsObj,
                               java.lang.Object connGroupSelObj,
                               java.lang.Object logGroupSelObj,
                               boolean addPrependDeclFlag,
                               boolean localEventAgePropFlag)
Sets up the client configuration by adding items to the configuration- properties object. Other items may be added before and after calling this method.

Parameters:
userPropsObj - the configuration-properties object to add items to, or null to create a new configuration-properties object.
connGroupSelObj - the configuration-group-selection object to use for connection items, or null for none.
logGroupSelObj - the configuration-group-selection object to use for log-file items, or null for none.
addPrependDeclFlag - true to add "prependDeclaration..." items to configuration.
localEventAgePropFlag - if true then a local 'maxServerEventAgeDays' property item is created and used.

setupConfiguration

public void setupConfiguration(CfgProperties userPropsObj,
                               java.lang.Object connGroupSelObj,
                               java.lang.Object logGroupSelObj,
                               boolean addPrependDeclFlag)
Sets up the client configuration by adding items to the configuration- properties object. Other items may be added before and after calling this method. A local 'maxServerEventAgeDays' property item is created and used.

Parameters:
userPropsObj - the configuration-properties object to add items to, or null to create a new configuration-properties object.
connGroupSelObj - the configuration-group-selection object to use for connection items, or null for none.
logGroupSelObj - the configuration-group-selection object to use for log-file items, or null for none.
addPrependDeclFlag - true to add "prependDeclaration..." items to configuration.

setupConfiguration

public void setupConfiguration(CfgProperties userPropsObj,
                               java.lang.Object connGroupSelObj,
                               java.lang.Object logGroupSelObj)
Sets up the client configuration by adding items to the configuration- properties object. Other items may be added before and after calling this method. A local 'maxServerEventAgeDays' property item is created and used.

Parameters:
userPropsObj - the configuration-properties object to add items to, or null to create a new configuration-properties object.
connGroupSelObj - the configuration-group-selection object to use for connection items, or null for none.
logGroupSelObj - the configuration-group-selection object to use for log-file items, or null for none.

setupConfiguration

public void setupConfiguration(CfgProperties userPropsObj,
                               java.lang.Object connGroupSelObj,
                               boolean addPrependDeclFlag)
Sets up the client configuration by adding items to the configuration- properties object. Other items may be added before and after calling this method. A local 'maxServerEventAgeDays' property item is created and used.

Parameters:
userPropsObj - the configuration-properties object to add items to, or null to create a new configuration-properties object.
connGroupSelObj - the configuration-group-selection object to use for connection items, or null for none.
addPrependDeclFlag - true to add "prependDeclaration..." items to configuration.

setupConfiguration

public void setupConfiguration(CfgProperties userPropsObj,
                               java.lang.Object connGroupSelObj)
Sets up the client configuration by adding items to the configuration- properties object. Other items may be added before and after calling this method. A local 'maxServerEventAgeDays' property item is created and used.

Parameters:
userPropsObj - the configuration-properties object to add items to, or null to create a new configuration-properties object.
connGroupSelObj - the configuration-group-selection object to use for connection items, or null for none.

processConfiguration

public boolean processConfiguration(java.lang.String cfgFileName,
                                    java.lang.String rootElementName,
                                    java.lang.String settingsElementName,
                                    boolean mustFlag,
                                    java.lang.String[] prgArgs,
                                    boolean loadConfigFlag,
                                    java.lang.String defaultCfgFName)
Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled). A shutdown hook is installed that calls 'performExitCleanup()' in response to program termination ("Ctrl-C", kill, etc). If a configuration filename is specified via the command-line parameter "--configFile" then it will be used instead of the filename specified via the method parameter 'cfgFileName'.

Parameters:
cfgFileName - the name of the XML file to load.
rootElementName - the expected name of the root element in the XML file, or null to accept any name.
settingsElementName - the name of the "Settings" element whose text contains the "name = value" items.
mustFlag - if true and a configuration file with a "Settings" element is not found then an error will be generated and the method will return 'false'.
prgArgs - string array of command-line parameters to be processed, or null for none.
loadConfigFlag - false to skip loading from the configuration file and setting up the program-termination shutdown hook; true to process normally.
defaultCfgFName - the name of an XML file containing configuration default values to be loaded before the configuration file is loaded, or null for none.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the console and may be fetched via the 'getErrorMessageString()' method).

processConfiguration

public boolean processConfiguration(java.lang.String cfgFileName,
                                    java.lang.String rootElementName,
                                    java.lang.String settingsElementName,
                                    boolean mustFlag,
                                    java.lang.String[] programArgs,
                                    boolean loadConfigFlag)
Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled). A shutdown hook is installed that calls 'performExitCleanup()' in response to program termination ("Ctrl-C", kill, etc). If a configuration filename is specified via the command-line parameter "--configFile" then it will be used instead of the filename specified via the method parameter 'cfgFileName'.

Parameters:
cfgFileName - the name of the XML file to load.
rootElementName - the expected name of the root element in the XML file, or null to accept any name.
settingsElementName - the name of the "Settings" element whose text contains the "name = value" items.
mustFlag - if true and a configuration file with a "Settings" element is not found then an error will be generated and the method will return 'false'.
programArgs - string array of command-line parameters to be processed, or null for none.
loadConfigFlag - false to skip loading from the configuration file and setting up the program-termination shutdown hook; true to process normally.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the console and may be fetched via the 'getErrorMessageString()' method).

processConfiguration

public boolean processConfiguration(java.lang.String cfgFileName,
                                    java.lang.String rootElementName,
                                    java.lang.String settingsElementName,
                                    boolean mustFlag,
                                    java.lang.String[] programArgs,
                                    java.lang.String defaultCfgFName)
Loads settings from the configuration file and sets up the log file and the console-redirect file (if enabled). A shutdown hook is installed that calls 'performExitCleanup()' in response to program termination ("Ctrl-C", kill, etc). If a configuration filename is specified via the command-line parameter "--configFile" then it will be used instead of the filename specified via the method parameter 'cfgFileName'.

Parameters:
cfgFileName - the name of the XML file to load.
rootElementName - the expected name of the root element in the XML file, or null to accept any name.
settingsElementName - the name of the "Settings" element whose text contains the "name = value" items.
mustFlag - if true and a configuration file with a "Settings" element is not found then an error will be generated and the method will return 'false'.
programArgs - string array of command-line parameters to be processed, or null for none.
defaultCfgFName - the name of an XML file containing configuration default values to be loaded before the configuration file is loaded, or null for none.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the console and may be fetched via the 'getErrorMessageString()' method).

processConfiguration

public boolean processConfiguration(java.lang.String cfgFileName,
                                    java.lang.String rootElementName,
                                    java.lang.String settingsElementName,
                                    boolean mustFlag,
                                    java.lang.String[] programArgs)
Loads settings from the configuration file and sets up the log file and the console-redirect files (if enabled). A shutdown hook is installed that calls 'performExitCleanup()' in response to program termination ("Ctrl-C", kill, etc). If a configuration filename is specified via the command-line parameter "--configFile" then it will be used instead of the filename specified via the method parameter 'cfgFileName'.

Parameters:
cfgFileName - the name of the XML file to load.
rootElementName - the expected name of the root element in the XML file, or null to accept any name.
settingsElementName - the name of the "Settings" element whose text contains the "name = value" items.
mustFlag - if true and the "Settings" element is not found then an error will be generated; if false and the "Settings" element is not found then this method will simply return 'true'.
programArgs - string array of command-line parameters to be processed, or null for none.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the console and may be fetched via the 'getErrorMessageString()' method).

setupClientInfoProps

public void setupClientInfoProps(java.lang.String clientNameStr,
                                 java.lang.String clientVerStr,
                                 java.lang.String startupTimeStr)
Sets up the connection-information properties string to be sent when the client connects to the server.

Parameters:
clientNameStr - the client program name to use, or null for none.
clientVerStr - the client version string to use, or null for none.
startupTimeStr - the client startup time string to use, or null for the default value entered via the client-base class.

setupClientInfoProps

public void setupClientInfoProps(java.lang.String clientNameStr,
                                 java.lang.String clientVerStr)
Sets up the connection-information properties string to be sent when the client connects to the server.

Parameters:
clientNameStr - the client program name to use, or null for none.
clientVerStr - the client version string to use, or null for none.

setupInitReqMsgsObjs

public void setupInitReqMsgsObjs(IstiDialogInterface initReqMsgsDialogObj,
                                 java.lang.String initReqMsgsCancelString,
                                 ProgressIndicatorInterface initReqMsgsProgIndObj,
                                 InitReqMsgsCallBack initReqMsgsCallBackObj)
Sets up dialog, progress and call-back objects used by the connection manager's "initialRequestMessagesFromServer()" method.

Parameters:
initReqMsgsDialogObj - dialog-popup object.
initReqMsgsCancelString - 'Cancel' string for dialog-popup object.
initReqMsgsProgIndObj - for progress-indicator object.
initReqMsgsCallBackObj - call-back object.

setServerLoginPropertyEditor

public void setServerLoginPropertyEditor(java.beans.PropertyEditor propertyEditorObj)
Enters the login-dialog property editor for the 'QWServerLoginInformation' object held by the "serverLogin" connection-property item. GUI clients that want to be able to display the login dialog should call this method with "new LoginPropertyEditor()" as the parameter.

Parameters:
propertyEditorObj - the property-editor object to enter.

setSaveToConfigFileCallBackObj

public void setSaveToConfigFileCallBackObj(DataChangedListener listenerObj)
Sets up the call-back object to be called when the connection configuration-property items should be saved to the config file.

Parameters:
listenerObj - The 'DataChangedListener' to use, or null for none.

runClient

protected boolean runClient(QWConnectionMgr connMgrObj,
                            QWDataMsgProcessor msgProcessorObj,
                            ConnStatusInterface connStatusObj,
                            boolean processingEnabledFlag)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
connMgrObj - connection-manager object to use, or null to have this method create one.
msgProcessorObj - the message-processor object to use for processsing received messages.
connStatusObj - connection-status panel object, or null for none.
processingEnabledFlag - sets the state of the initial processing-enabled flag.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWDataMsgProcessor msgProcessorObj,
                         ConnStatusInterface connStatusObj,
                         boolean processingEnabledFlag)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
msgProcessorObj - the message-processor object to use for processsing received messages.
connStatusObj - connection-status panel object, or null for none.
processingEnabledFlag - sets the state of the initial processing-enabled flag.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWDataMsgProcessor msgProcessorObj,
                         ConnStatusInterface connStatusObj)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
msgProcessorObj - the message-processor object to use for processsing received messages.
connStatusObj - connection-status panel object, or null for none.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWDataMsgProcessor msgProcessorObj,
                         boolean processingEnabledFlag)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
msgProcessorObj - the message-processor object to use for processsing received messages.
processingEnabledFlag - sets the state of the initial processing-enabled flag.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWDataMsgProcessor msgProcessorObj)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
msgProcessorObj - the message-processor object to use for processsing received messages.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWConnectionMgr connMgrObj,
                         boolean processingEnabledFlag)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
connMgrObj - connection-manager object to use, or null to have this method create one.
processingEnabledFlag - sets the state of the initial processing-enabled flag.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

runClient

public boolean runClient(QWConnectionMgr connMgrObj)
Runs the client. The 'processConfiguration()' method must be executed before this method.

Parameters:
connMgrObj - connection-manager object to use, or null to have this method create one.
Returns:
'true' if successful, false if an error occurred (in which case an error message will be sent to the log file and may be fetched via the 'getErrorMessageString()' method).

reinitConnection

public boolean reinitConnection()
Closes and reopens the CORBA connection to the server. The connection-status popup is shown, a separate thread is used, and the connection-reinit-via-user-input flag is set.

Returns:
true if reinitialization attempt made, false if aborted because connect or disconnect already in progress.

getClientRunningStartTime

public long getClientRunningStartTime()
Gets the client running start time in milliseconds.

Returns:
the client running start time or 0 if the client is not running.

getClientRunningTime

public long getClientRunningTime()
Gets the amount of time the client has been running in milliseconds.

Returns:
the amount of time the client has been running or 0 if the client is not running.

isClientRunning

public boolean isClientRunning()
Determines whether or not the client is running. The client is considered to be running if the 'runClient()' method has been successfully executed and the 'stopClient()' method has not been called.

Returns:
true if the client is running; false if not.

isClientTerminated

public boolean isClientTerminated()
Determines whether or not the client has been terminated. The client is considered terminated if the 'stopClient()' method has been called.

Returns:
true if the client has been terminated; false if not.

getLogFileObj

public LogFile getLogFileObj()
Returns the log file object.

Overrides:
getLogFileObj in class ClientLogViaCfgProps
Returns:
The 'LogFile' object used by this class, or null if the log file has not been setup.

getPrependDeclarationString

public java.lang.String getPrependDeclarationString()
Returns the declaration string to be prepended to sent messages.

Returns:
The declaration string to be prepended to sent messages, or null if none.

getConnPropsObj

public QWConnProperties getConnPropsObj()
Returns the connection-configuration-properties manager object.

Returns:
The connection-configuration-properties manager object, or null if it has not been created.

getMaxServerEventAgeDaysProp

public CfgPropItem getMaxServerEventAgeDaysProp()
Returns the local 'maxServerEventAgeDays' property item (if available).

Returns:
The local 'maxServerEventAgeDays' property item, or null if not in use.

getConnManagerObj

public QWConnectionMgr getConnManagerObj()
Returns the connection-manager object.

Returns:
The connection-manager object, or null if it has not been created.

isEventChannelConnected

public boolean isEventChannelConnected()
Returns the connection status of the server event channel.

Returns:
true if the connection to the event channel is active, false if not.

isReqServerMsgsAvailable

public boolean isReqServerMsgsAvailable()
Returns an indicator of whether or not the 'requestMessages()' method is available via the 'QWServices' on the current server.

Returns:
true if the 'requestServerMessages()' method is available, false if not.

isConnectionValidated

public boolean isConnectionValidated()
Returns the status of whether or not the connection has been "validated" via the receipt of any server-alive messages.

Returns:
true if any server-alive messages have been received since the last connect-to-server attempt, false if not.

getCertificateFileDataArr

public byte[] getCertificateFileDataArr()
Returns the certificate-file data that was fetched from the server at connect time.

Returns:
The certificate-file data that was fetched from the server at connect time, or null if none was fetched.

getXmlConfigLoader

public XmlConfigLoader getXmlConfigLoader()
Get the XML config loader.

Returns:
the XML config loader.

clientSleepDelay

public boolean clientSleepDelay(int delayMs)
Convenience method for performing a sleep delay. If the client is terminated then the delay will be interrupted.

Parameters:
delayMs - number of milliseconds to delay.
Returns:
true if the full delay was performed; false if the client was terminated.

interruptClientSleepDelay

protected void interruptClientSleepDelay()
Interrupts any 'clientSleepDelay()' in progress.


terminateProgram

public void terminateProgram(int exitVal)
Shuts down the client, performs exit cleanup and terminates the program. The 'System.exit()' method is called after cleanup actions are performed.

Parameters:
exitVal - the exit status code to use.

stopClient

public void stopClient()
Shuts down the client and performs exit cleanup. The 'System.exit()' method is not called.


localExitCleanup

protected void localExitCleanup(boolean systemExitFlag,
                                int exitVal,
                                boolean remShutdownHookFlag)
Performs "local" exit cleanup after calling 'performExitCleanup()'.

Parameters:
systemExitFlag - if true then 'System.exit()' will be called.
exitVal - the exit status code to use.
remShutdownHookFlag - if true then the shutdown-hook cleanup thread will be removed.

localExitCleanup

protected void localExitCleanup(boolean systemExitFlag,
                                int exitVal)
Performs "local" exit cleanup after calling 'performExitCleanup()'.

Parameters:
systemExitFlag - if true then 'System.exit()' will be called.
exitVal - the exit status code to use.

localExitCleanup

protected void localExitCleanup(int exitVal)
Performs "local" exit cleanup after calling 'performExitCleanup()'. The 'System.exit()' method is called after the cleanup.

Parameters:
exitVal - the exit status code to use.

localExitCleanup

protected void localExitCleanup()
Performs "local" exit cleanup after calling 'performExitCleanup()'. The 'System.exit()' method is not called.


performExitCleanup

protected void performExitCleanup()
Called in response to program termination ("Ctrl-C", kill, etc). Subclasses may override this method to have custom cleanup routines executed at program termination. The version of the method in this class does nothing.


getOpenOrbVersionStr

public static java.lang.String getOpenOrbVersionStr()
Returns the OpenORB version string.

Returns:
The OpenORB version string.

addShutdownHookCleanupThreadObj

protected void addShutdownHookCleanupThreadObj()
Installs the cleanup thread to be run at program termination.


removeShutdownHookCleanupThreadObj

protected void removeShutdownHookCleanupThreadObj()
Removes the cleanup thread run at program termination (if installed).