wt.sysadm
Class HttpRequestLogUtil

java.lang.Object
  extended bywt.sysadm.HttpRequestLogUtil

public class HttpRequestLogUtil
extends Object

HttppRequestLogUtil is intended to help find the resouces, .class, .ser, etc files, that should have been included in jar files, but were not. It will look through the specified log file and provide a sorted list of all the resources that appear to need to be placed in jar files.


Field Summary
private static boolean DEBUG
          DEBUG - Used to print debug messages.
private  String[] FILE_EXTENTIONS
          FILE_EXTENTIONS - The file extentions that will be looked for in the log.
private  ArrayList IGNORABLE_ERROR_CODES
          IGNORABLE_ERROR_CODES - The error codes, e.g.
private static String LOG_UTIL_RESOURCE_LINE
          LOG_UTIL_RESOURCE_LINE - The line in the web server log inidicating the start of the log utility.
private  String logFilePath
          logFilePath - The path to the log file.
private  TreeMap resources
          resources - Holds all the resources that appear to need to be placed in jar files.
private  String WEBAPP_NAME
          WEBAPP_NAME - The webapp name displayed in the log, e.g.
 
Constructor Summary
HttpRequestLogUtil(String[] fileExtentions, ArrayList ignorableErrorCodes, String webAppName)
          Constructs the utility with the correct log file.
 
Method Summary
static boolean isSysadmAdmin(String userName)
          Determines whether or not userName is a member of sysadm administrators group.
static void main(String[] args)
          A simple main for testing.
 Object[] searchLog(String clientIP)
          Finds the resources that appear to need to be included in jar files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static boolean DEBUG
DEBUG - Used to print debug messages.


LOG_UTIL_RESOURCE_LINE

private static final String LOG_UTIL_RESOURCE_LINE
LOG_UTIL_RESOURCE_LINE - The line in the web server log inidicating the start of the log utility.

See Also:
Constant Field Values

FILE_EXTENTIONS

private String[] FILE_EXTENTIONS
FILE_EXTENTIONS - The file extentions that will be looked for in the log.


IGNORABLE_ERROR_CODES

private ArrayList IGNORABLE_ERROR_CODES
IGNORABLE_ERROR_CODES - The error codes, e.g. '404', that can be ignored when searching the log file.


WEBAPP_NAME

private String WEBAPP_NAME
WEBAPP_NAME - The webapp name displayed in the log, e.g. '/Windchill/'.


logFilePath

private String logFilePath
logFilePath - The path to the log file.


resources

private TreeMap resources
resources - Holds all the resources that appear to need to be placed in jar files.

Constructor Detail

HttpRequestLogUtil

public HttpRequestLogUtil(String[] fileExtentions,
                          ArrayList ignorableErrorCodes,
                          String webAppName)
                   throws IOException
Constructs the utility with the correct log file.

Parameters:
fileExtentions - - A String array of file extentions to look for. If fileExtentions is null or empty, default fileExtentions will be used.
ignorableErrorCodes - - An ArrayList of error codes to ignore in the log file. If ignorableErrorCodes is null, default values will be used.
webAppName - - The webAppName.
Throws:
Throughs - IOException if there is a problem finding the log path.
IOException
Method Detail

searchLog

public Object[] searchLog(String clientIP)
Finds the resources that appear to need to be included in jar files.

Parameters:
clientIP - - The client IP to track. If clientIP is null, we will find for all users.
Returns:
Object[] - A sorted array of the resources found in the log file that should be included in jar files.

isSysadmAdmin

public static boolean isSysadmAdmin(String userName)
                             throws IOException
Determines whether or not userName is a member of sysadm administrators group.

Parameters:
userName - - The user name to check for.
Returns:
true if userName is in the sysadm administrators group. Otherwise false.
Throws:
Throws - IOException if there is a problem accessing wt.properties.
IOException

main

public static void main(String[] args)
A simple main for testing. User must provide the path to an Apache log file to search. Optional, user can provide an IP address and the utility will only search for resources accessed by that IP address.

Parameters:
args - - The path to a log file. Optional, the client IP.