|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.util.KMethod
com.cometway.httpd.HTTPCheckKMethod
public class HTTPCheckKMethod
This KMethod checks a web server by sending it a request for a URL. After the KMethod has been executed, the connection, request, and request latency is recorded in public fields. This method requires a host, port and request. An optional timeout field can be set if needed.
| Field Summary | |
|---|---|
static int |
CONNECT_ERROR
A connection error occured |
static int |
CONNECTED
The connection to the host and port was established |
static int |
CONNECTION_REFUSED
The connection to the host and port was refused |
int |
connectionResult
This is set after the method has been executed and will contain the connection result |
java.lang.String |
host
|
static int |
NO_ROUTE_TO_HOST
No route was available to the host and port |
int |
port
|
java.lang.String |
request
|
static int |
REQUEST_DENIED
A request was successful but the server denied access |
static int |
REQUEST_ERROR
A request error occured after connecting. |
static int |
REQUEST_NOT_FOUND
A request was successful but the page was not found, this is a 404 HTTP error |
static int |
REQUEST_REDIRECTED
A request was successful but the server returned a redirect |
static int |
REQUEST_SUCCESSFUL
A request was successful and a page was returned |
static int |
REQUEST_TIMEOUT
A request timed out. |
static int |
REQUESTED_EMPTY_PAGE
A request was successful but an empty page was returned |
long |
requestLatency
This is set after the method has been executed and will contain the latency of the request |
java.lang.String |
requestPage
This is set after the method has been executed and will contain the page returned from the server |
int |
requestResult
This is set after the method has been executed and will contain the request result |
int |
timeout
Set this variable if you care about the timeout (in milliseconds), default is 60 seconds |
static int |
UNKNOWN_HOST
The host was unknown, there was no dns entry for this host |
| Fields inherited from class com.cometway.util.KMethod |
|---|
args, debugName, method, obj, print_errors, run, verbose |
| Constructor Summary | |
|---|---|
HTTPCheckKMethod(java.lang.String host,
int port,
java.lang.String request)
Sets host, port, and request fields. |
|
| Method Summary | |
|---|---|
void |
execute()
Tests website for connection, request, and latency information. |
java.lang.String |
toString()
Returns a String containing connection, request, and latency information. |
| Methods inherited from class com.cometway.util.KMethod |
|---|
error, error, print |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CONNECT_ERROR
public static final int CONNECTION_REFUSED
public static final int NO_ROUTE_TO_HOST
public static final int UNKNOWN_HOST
public static final int CONNECTED
public static final int REQUEST_ERROR
public static final int REQUEST_SUCCESSFUL
public static final int REQUEST_TIMEOUT
public static final int REQUESTED_EMPTY_PAGE
public static final int REQUEST_REDIRECTED
public static final int REQUEST_NOT_FOUND
public static final int REQUEST_DENIED
public int connectionResult
public int requestResult
public long requestLatency
public java.lang.String requestPage
public java.lang.String request
public java.lang.String host
public int port
public int timeout
| Constructor Detail |
|---|
public HTTPCheckKMethod(java.lang.String host,
int port,
java.lang.String request)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void execute()
execute in class KMethod
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||