com.plumtree.uiinfrastructure.diagnostic
Class DiagnosticRunner

java.lang.Object
  extended by com.plumtree.uiinfrastructure.diagnostic.DiagnosticRunner
All Implemented Interfaces:
IStartupNotification

public class DiagnosticRunner
extends java.lang.Object
implements IStartupNotification

This class connects to uiinfrastructure's appwarmup via a notification interface and factory that allows us to "listen in" on the warmup cycle, receiving detailed notifications on not only the individual tasks status, but the steps within each task. This allows for extremely detailed diagnostics of potential startup problems. Execute the following tests: 1. Check for bad database hostname+port, or database type+username+password combo. Tricky to even get that level of detail but I do have it. 2. Check for bad PT_HOME environment variable, or bad pthome.xml file, or bad directory structure under the application home 3. Check for bad or missing settings files, with feedback on the specific file. This happens sometimes when customers edit their XML. 4. Check for bad or missing dynamic discovery files (badly formed XML). 5. Check for a bad class in one of the dynamically discovered JAR or DLL files, or a situation where the JAR/DLL is in the lib directory but not in the war/webhome directory (dynamic discovery, as implemented, requires two copies of the same file in different places). 6. Check for bad language files. 7. Check for bad imageserver settings for HTTP connectivity, or missing resources on that imageserver (this test is inherently somewhat limited, see "diagnostic page"). 8. Checking the values in the main portal settings file for validity. These tests include: a. do the http settings have valid http url's? b. do the URL rewrite rules make sense / form valid HTTP urls under normal practice? c. do the security mode settings and URL mapping settings make sense? (Note: very difficult) d. based on security settings and URL rewrites, is the IsInvitationURLSecure setting right? e. does the webhome point to a valid directory and allow referencing of a valid file? f. is adminsitebaseurl an absolute or relative url? (must be absolute) g. are the http port and secureport valid and functional? 9. Check version information. Is the database the right version? If not, how should it be corrected? Print out version information on the UI as well (it's not possible to "verify" these values, but printing them helps support). 10. Check the JDK / .NET SDK version compatibility 11. Check all the config varpacks for validity, including custom varpacks 12. Verify the automation server varpack: connect top the host and port 13. Verify the gateway and search directory settings and check for file validity 14. Verify the search locales loading sequence 15. Verify the document types loading sequence

Author:
DavidP

Method Summary
static void create()
           
 boolean executeAllTests()
          Executes the appwarmup directly in uiinfrastructure, then pauses at the end.
 boolean executeAllTestsWithoutPause()
          Executes the appwarmup directly in uiinfrastructure.
 java.lang.String[] getReport()
          Used to retrieve a comprehensive report of startup errors from the run.
 EventLog[] getReportEventLogs()
          Used to retrieve a comprehensive report of startup errors from the run.
 boolean init()
          delay static instance init until construction for speed and debuggability
static DiagnosticRunner instance()
          Singleton instance accessor
 void runEnd(ReturnValue initRet)
          Called when the startup process completes.
 boolean runStart()
           
 boolean runStart(int numTasks)
          Called at the beginning of the startup process.
 void setReportEventLogs(EventLog[] eventVector, XPArrayList reportLog)
          Used to override generated results.
 boolean taskBegin(int taskLoop, java.lang.String taskName, int taskID)
          Called at the beginning of the task.
 boolean taskEnd(int taskLoop, java.lang.String taskName, int taskID, ReturnValue initRet, IMessage msgArray)
          Called at the end of a specific task.
 boolean taskInitComplete(int taskLoop, java.lang.String taskName, int taskID, int totalNumSteps, ReturnValue initRet, IMessage msgArray)
          Called once task initialization is complete.
 boolean taskStepBegin(int taskLoop, java.lang.String taskName, int taskID, int stepLoop)
          Called before a specific task step begins.
 boolean taskStepEnd(int taskLoop, java.lang.String taskName, int taskID, int stepLoop, ReturnValue initRet, IMessage msgArray)
          Called at the end of an individual tasks' step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static void create()

init

public boolean init()
delay static instance init until construction for speed and debuggability


instance

public static DiagnosticRunner instance()
Singleton instance accessor

Returns:

executeAllTestsWithoutPause

public boolean executeAllTestsWithoutPause()
Executes the appwarmup directly in uiinfrastructure.


executeAllTests

public boolean executeAllTests()
Executes the appwarmup directly in uiinfrastructure, then pauses at the end.


runStart

public boolean runStart(int numTasks)
Called at the beginning of the startup process. Here we instantiate reporting classes and all other objects used to track startup.

Specified by:
runStart in interface IStartupNotification
Parameters:
number - of tasks to execute overall
Returns:
true to continue; false to halt immediately

runStart

public boolean runStart()

runEnd

public void runEnd(ReturnValue initRet)
Called when the startup process completes. Always called, via finally.

Specified by:
runEnd in interface IStartupNotification

taskBegin

public boolean taskBegin(int taskLoop,
                         java.lang.String taskName,
                         int taskID)
Called at the beginning of the task. Simple start notification.

Specified by:
taskBegin in interface IStartupNotification
Parameters:
taskLoop -
taskName -
taskID -
Returns:
true to continue; false to halt immediately

taskInitComplete

public boolean taskInitComplete(int taskLoop,
                                java.lang.String taskName,
                                int taskID,
                                int totalNumSteps,
                                ReturnValue initRet,
                                IMessage msgArray)
Called once task initialization is complete. Returns the number of steps in this task. The ReturnValue contains any errors or exceptions that may have occurred during initialization.

Specified by:
taskInitComplete in interface IStartupNotification
Parameters:
taskLoop -
taskName -
taskID -
totalNumSteps -
initRet -
Returns:
true to continue; false to halt immediately

taskStepBegin

public boolean taskStepBegin(int taskLoop,
                             java.lang.String taskName,
                             int taskID,
                             int stepLoop)
Called before a specific task step begins. Simply a notifier.

Specified by:
taskStepBegin in interface IStartupNotification
Parameters:
taskLoop -
taskName -
taskID -
stepLoop -
Returns:
true to continue; false to halt immediately

taskStepEnd

public boolean taskStepEnd(int taskLoop,
                           java.lang.String taskName,
                           int taskID,
                           int stepLoop,
                           ReturnValue initRet,
                           IMessage msgArray)
Called at the end of an individual tasks' step. Always called, with a finally. Exceptions and error return values in the ReturnValue object.

Specified by:
taskStepEnd in interface IStartupNotification
Parameters:
taskLoop -
taskName -
taskID -
stepLoop -
initRet -
Returns:
true to continue; false to halt immediately

taskEnd

public boolean taskEnd(int taskLoop,
                       java.lang.String taskName,
                       int taskID,
                       ReturnValue initRet,
                       IMessage msgArray)
Called at the end of a specific task. Always called, with a finally. The ReturnValue here contains the final result of that task: the integer result code holds what the systemn feels the final result is. Notice that an individual step could fail with error, but the overall task simply show a warning.

Specified by:
taskEnd in interface IStartupNotification
Parameters:
taskLoop -
taskName -
taskID -
initRet -
Returns:
true to continue; false to halt immediately

getReport

public java.lang.String[] getReport()
Description copied from interface: IStartupNotification
Used to retrieve a comprehensive report of startup errors from the run.

Specified by:
getReport in interface IStartupNotification
Returns:
Ordered array of strings that form a comprehensive startup report

getReportEventLogs

public EventLog[] getReportEventLogs()
Description copied from interface: IStartupNotification
Used to retrieve a comprehensive report of startup errors from the run.

Specified by:
getReportEventLogs in interface IStartupNotification
Returns:
Ordered array of eventlogs that form a comprehensive startup ERROR report

setReportEventLogs

public void setReportEventLogs(EventLog[] eventVector,
                               XPArrayList reportLog)
Description copied from interface: IStartupNotification
Used to override generated results. Use this to leverage the diagnostic page for non-diagnostic uses such as special error handling

Specified by:
setReportEventLogs in interface IStartupNotification



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.