org.openqa.grid.web.servlet.handler
Class WebDriverRequestHandler

java.lang.Object
  extended by org.openqa.grid.web.servlet.handler.RequestHandler
      extended by org.openqa.grid.web.servlet.handler.WebDriverRequestHandler
All Implemented Interfaces:
java.lang.Comparable<RequestHandler>

public class WebDriverRequestHandler
extends RequestHandler

Handles an individual request, scope is a single request and hence a single thread.


Constructor Summary
protected WebDriverRequestHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Registry registry)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> extractDesiredCapability()
          Parse the request to extract the desiredCapabilities.
 RequestType extractRequestType()
           
 ExternalSessionKey extractSession()
          Extract the session from the request.
 ExternalSessionKey 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.
 
Methods inherited from class org.openqa.grid.web.servlet.handler.RequestHandler
bindSession, compareTo, createHandler, debug, equals, forwardRequest, getDesiredCapabilities, getRegistry, getRequest, getRequestBody, getRequestType, getResponse, getServerSession, getSession, hashCode, process, setDesiredCapabilities, setRequestType, setSession, stop, toString, waitForSessionBound
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebDriverRequestHandler

protected WebDriverRequestHandler(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  Registry registry)
Method Detail

extractRequestType

public RequestType extractRequestType()
Specified by:
extractRequestType in class RequestHandler
Returns:
the type of the request.

extractSession

public ExternalSessionKey extractSession()
Description copied from class: RequestHandler
Extract the session from the request. This only works for a request that has a session already assigned. It shouldn't be called for a new session request.

Specified by:
extractSession in class RequestHandler
Returns:
the external session id sent by the remote. Null is the session cannot be found.

extractDesiredCapability

public java.util.Map<java.lang.String,java.lang.Object> extractDesiredCapability()
Description copied from class: RequestHandler
Parse the request to extract the desiredCapabilities. For non web driver protocol ( selenium1 ) some mapping will be necessary

Specified by:
extractDesiredCapability in class RequestHandler
Returns:
the desired capabilities requested by the client.

forwardNewSessionRequest

public ExternalSessionKey forwardNewSessionRequest(TestSession session)
                                            throws NewSessionException
Description copied from class: RequestHandler
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.

Specified by:
forwardNewSessionRequest in class RequestHandler
Returns:
the external key sent by the remote.
Throws:
NewSessionException - in case anything wrong happens during the new session process.


Copyright © 2011. All Rights Reserved.