|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.grid.web.servlet.handler.RequestHandler
public abstract class RequestHandler
Base stuff to handle the request coming from a remote. Ideally, there should be only 1 concrete class, but to support both legacy selenium1 and web driver, 2 classes are needed.
Selenium1RequestHandler
for the part specific to selenium1 protocol
WebDriverRequestHandler
for the part specific to webdriver protocol
Constructor Summary | |
---|---|
protected |
RequestHandler(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Registry registry)
|
Method Summary | |
---|---|
void |
bindSession(TestSession session)
|
int |
compareTo(RequestHandler o)
|
static RequestHandler |
createHandler(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Registry registry)
Detect what kind of protocol ( selenium1 vs webdriver ) is used by the request and create the associated handler. |
String |
debug()
|
boolean |
equals(Object obj)
|
abstract Map<String,Object> |
extractDesiredCapability()
Parse the request to extract the desiredCapabilities. |
abstract RequestType |
extractRequestType()
|
abstract String |
extractSession()
Extract the session from the request. |
abstract String |
forwardNewSessionRequest(TestSession session)
Forward the new session request to the TestSession that has been assigned, and parse the response to extract and return the external key assigned by the remote. |
protected void |
forwardRequest(TestSession session,
RequestHandler handler)
|
long |
getCreated()
|
Map<String,Object> |
getDesiredCapabilities()
|
Registry |
getRegistry()
|
javax.servlet.http.HttpServletRequest |
getRequest()
the HttpServletRequest this hanlder is processing. |
protected String |
getRequestBody()
reads the input stream of the request and returns its content. |
protected RequestType |
getRequestType()
|
javax.servlet.http.HttpServletResponse |
getResponse()
the HttpServletResponse the handler is writing to. |
String |
getServerSession()
return the session from the server ( = opaque handle used by the server to determine where to route session-specific commands fro mthe JSON wire protocol ). will be null until the request has been processed. |
protected TestSession |
getSession()
|
int |
hashCode()
|
void |
process()
forwards the request to the remote, allocating / releasing the resources if necessary. |
protected void |
setDesiredCapabilities(Map<String,Object> desiredCapabilities)
|
protected void |
setRequestType(RequestType requestType)
|
protected void |
setSession(TestSession session)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RequestHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Registry registry)
Method Detail |
---|
public static RequestHandler createHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Registry registry)
request
- response
- registry
-
public abstract RequestType extractRequestType()
public abstract String extractSession()
public abstract Map<String,Object> extractDesiredCapability()
public abstract String forwardNewSessionRequest(TestSession session)
session
-
IOException
protected void forwardRequest(TestSession session, RequestHandler handler) throws IOException
IOException
public void process()
protected String getRequestBody()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public Map<String,Object> getDesiredCapabilities()
protected void setDesiredCapabilities(Map<String,Object> desiredCapabilities)
public int compareTo(RequestHandler o)
compareTo
in interface Comparable<RequestHandler>
protected RequestType getRequestType()
protected void setRequestType(RequestType requestType)
protected void setSession(TestSession session)
public void bindSession(TestSession session)
protected TestSession getSession()
public String getServerSession()
public String toString()
toString
in class Object
public String debug()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public long getCreated()
public Registry getRegistry()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |