|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.latka.http.RequestImpl
An implementation of a Latka Request interface based on the Jakarta Commons HttpClient package.
Field Summary | |
static int |
HTTP_PORT
Standard HTTP Port |
static int |
HTTPS_PORT
Standard HTTPS Port |
Fields inherited from interface org.apache.commons.latka.http.Request |
HTTP_METHOD_GET, HTTP_METHOD_HEAD, HTTP_METHOD_POST |
Method Summary | |
Response |
execute()
Execute this HTTP request. |
java.lang.String |
getLabel()
Assigns a text label to this request. |
int |
getRequestTiming()
The amount of time it took to execute the request in milliseconds, or -1 if the request has not been executed successfully |
Session |
getSession()
Retrieve the session associated with this request. |
java.net.URL |
getURL()
Gets the URL that Latka will attempt to contact. |
void |
setCredentials(java.lang.String userName,
java.lang.String password)
Sets the basic authentication credentials for this request, if any. |
void |
setHeader(java.lang.String headerName,
java.lang.String headerValue)
Set a header in the request |
void |
setParameter(java.lang.String name,
java.lang.String value)
Associate a parameter with this request. |
void |
setParameters(java.util.Map parameters)
Associate a group of parameters with this request. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HTTP_PORT
public static final int HTTPS_PORT
Method Detail |
public Response execute() throws java.io.IOException
Request
execute
in interface Request
org.apache.commons.latka.http.Request
java.io.IOException
- if the remote server could not be reachedpublic java.lang.String getLabel()
Request
getLabel
in interface Request
org.apache.commons.latka.http.Request
public int getRequestTiming()
Request
getRequestTiming
in interface Request
public Session getSession()
getSession
in interface Request
Session
objectpublic java.net.URL getURL()
Request
getURL
in interface Request
org.apache.commons.latka.http.Request
public void setCredentials(java.lang.String userName, java.lang.String password)
Request
setCredentials
in interface Request
org.apache.commons.latka.http.Request
userName
- user namepassword
- user's passwordpublic void setHeader(java.lang.String headerName, java.lang.String headerValue)
setHeader
in interface Request
headerName
- name of any HTTP request headerheaderValue
- value of that headerpublic void setParameter(java.lang.String name, java.lang.String value)
setParameter
in interface Request
name
- the lvalue of the parametername
- the rvalue of the parameterjava.lang.IllegalArgumentException
- if a parameter is nullpublic void setParameters(java.util.Map parameters)
setParameters
in interface Request
parameters
- a map of parameters (lvalues -> rvalues)java.lang.IllegalArgumentException
- if a parameter is null or not a String
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |