|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--webtester.packages.threads.fastProxyHandler
Used for proxying HTTP requests as quickly as possible. No data is recorded in this thread.
Field Summary | |
private java.util.ArrayList |
aExcludeList
Contains a list of regular expressions to exclude while recording. |
private java.util.ArrayList |
aRegexes
Contains regular expressions recorded with a test case. |
private boolean |
bEndProxy
Inidicates whether the proxy has finished recording. |
private boolean |
bPostRedirect
Indicates whether a POST request resulted in a redirect request. |
private boolean |
bRecord
Indicates whether the proxy is recording a test case. |
private boolean |
bSSL
Indicates whether the user attempted to make an SSL connection. |
private java.util.HashMap |
hHeaders
Contains HTTP headers sent by the browser. |
private java.util.HashMap |
hServerTypes
Indicates the type of webserver being accessed. |
private static int |
iAllowedTries
The number of allowed tries for reading data from a socket. |
private static int |
iDefaultPort
The default port to use for HTTP connections. |
private static int |
iDefaultTimeout
The default timeout value for HTTP connections. |
private static int |
iHeaderLimit
The minimum allowed length for http headers before they will be parsed. |
private static int |
iHttpError
The value at which HTTP return codes indicate an error. |
private static int |
iHttpPort
The default port for HTTP connections. |
private static int |
iMinTokenLength
The minimum length for a token to be recorded as a regular expression. |
private java.io.DataInputStream |
input
Used to retrieve information from the browser. |
private static int |
iNumTries
The number of times to attempt to read an http response. |
private static int |
iPostRedirect
HTTP status code which indicates a POST redirect. |
private static int |
iRequestLineLimit
The number of lines to read from an incoming HTTP response for header info. |
private static int |
iReturnCodeIndex
The index to use when retrieving the HTTP status code. |
private static int |
iSleepTime
How long to wait between attempts to read an http response. |
private static int |
iSocketTimeout
The default timeout for http connections. |
private static int |
iSSLPort
The default port for SSL connections. |
private static int |
iTestCaseIndex
The starting index to use when parsing the test case name. |
private static int |
iURLStartIndex
The starting index to use when parsing URLs. |
private java.io.PrintStream |
output
Used to send information to the browser. |
private java.lang.String |
sConfigFile
The configuration file being written. |
private java.lang.String |
sData
The data sent with the URL accessed. |
private java.lang.String |
sExcludeFile
A file which contains a list of regexes to be excluded while recording. |
private java.lang.String |
sHost
The host being contacted for the HTTP request. |
private java.lang.String |
sMethod
The method associated with the URL accessed. |
private java.lang.String |
sParsedHeaders
Contains the HTTP header information. |
private java.lang.String |
sSeparator
The path separator for the OS on which this application is executing. |
private java.lang.String |
sTestcaseName
The name of the test case being accessed. |
private java.lang.String |
sURL
The URL being accessed. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
fastProxyHandler()
The default constructor for the class, which takes no arguments. |
|
fastProxyHandler(java.io.InputStream in,
java.io.OutputStream out)
Get the input/output streams for the browser. |
Method Summary | |
private java.lang.String |
fixHeaders(java.lang.String sHeader)
Fix the HTTP headers so that microsoft webservers won't return errors. |
boolean |
getEndProxy()
A boolean value which determines whether or not the proxy should exit and generate a config file. |
java.lang.String |
getParsedHeaders()
Return the headers that were set previously. |
boolean |
getPostRedirect()
Retrieve the value which indicates if a POST redirect request was encountered. |
boolean |
getRecordOn()
Indicates whether a testcase is currently being recorded. |
private boolean |
getServerType()
Determine the server type. |
java.util.HashMap |
getServerTypes()
Return the server type information. |
boolean |
getSSL()
Indicates whether the user tried to access an SSL connection. |
java.lang.String |
getTestcaseName()
Return the currently assigned testcase name. |
java.lang.String |
getURL()
Return the last URL accessed. |
private void |
parseHeaders(java.lang.String sStr)
Parse the request headers into a hashmap. |
void |
run()
The method used to start this thread. |
private void |
sendRequest(byte[] b)
Send the browser request to the specified host, then read the response data. |
void |
setData(java.lang.String sVal)
Set the data that will be used to generate the config file. |
void |
setExcludeFile(java.lang.String sFile)
Set the name of the file which needs to be read to determine regexes that should NOT appear. |
void |
setParsedHeaders(java.lang.String sStr)
Set the HTTP headers. |
void |
setPostRedirect(boolean bVal)
Set the value which indicates if a POST redirect request was encountered. |
void |
setRecordOn(boolean bVal)
Sets the value to indicate whether a testcase is being recorded. |
void |
setSeparator(java.lang.String sVal)
Set the path separator so that the correct classpath can be displayed to the user. |
void |
setServerTypes(java.util.HashMap hData)
Set the server type information. |
void |
setTestcaseName(java.lang.String sStr)
Assign the current test case name a new value. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.io.DataInputStream input
private java.io.PrintStream output
private java.util.HashMap hHeaders
private java.util.HashMap hServerTypes
private java.lang.String sHost
private java.lang.String sMethod
private java.lang.String sData
private java.lang.String sURL
private java.lang.String sParsedHeaders
private java.lang.String sTestcaseName
private java.lang.String sExcludeFile
private java.lang.String sConfigFile
private java.lang.String sSeparator
private java.util.ArrayList aRegexes
private java.util.ArrayList aExcludeList
private boolean bRecord
private boolean bEndProxy
private boolean bPostRedirect
private boolean bSSL
private static final int iDefaultTimeout
private static final int iAllowedTries
private static final int iDefaultPort
private static final int iRequestLineLimit
private static final int iReturnCodeIndex
private static final int iHttpError
private static final int iPostRedirect
private static final int iMinTokenLength
private static final int iHttpPort
private static final int iSocketTimeout
private static final int iNumTries
private static final int iSleepTime
private static final int iURLStartIndex
private static final int iTestCaseIndex
private static final int iHeaderLimit
private static final int iSSLPort
Constructor Detail |
public fastProxyHandler(java.io.InputStream in, java.io.OutputStream out)
in
- the browser input streamout
- the browser output streampublic fastProxyHandler()
Method Detail |
public java.lang.String getTestcaseName()
public boolean getPostRedirect()
public void setPostRedirect(boolean bVal)
bVal
- the boolean value to use for assignmentpublic void setTestcaseName(java.lang.String sStr)
sStr
- the current test case namepublic boolean getEndProxy()
public boolean getRecordOn()
public boolean getSSL()
public void setSeparator(java.lang.String sVal)
sVal
- the value for the path separatorpublic void setRecordOn(boolean bVal)
bVal
- the value for the parameterpublic void setExcludeFile(java.lang.String sFile)
sFile
- the name of the exclude filepublic void setData(java.lang.String sVal)
sVal
- the data used to generate the config filepublic java.lang.String getURL()
public java.util.HashMap getServerTypes()
public void setServerTypes(java.util.HashMap hData)
hData
- contains information on webserver typespublic java.lang.String getParsedHeaders()
public void setParsedHeaders(java.lang.String sStr)
sStr
- the HTTP header valuesprivate void parseHeaders(java.lang.String sStr)
sStr
- the header data represented as a Stringprivate boolean getServerType()
private void sendRequest(byte[] b)
b
- an array of bytes to send to the webserverprivate java.lang.String fixHeaders(java.lang.String sHeader)
sHeader
- the header data from the browser
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |