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

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

public class Selenium1RequestHandler
extends RequestHandler

Handler processing the selenium1 based requests. Each request body has to be read to get the sessionId at least.


Method Summary
 Map<String,Object> extractDesiredCapability()
          Parse the request to extract the desiredCapabilities.
 RequestType extractRequestType()
           
 ExternalSessionKey extractSession()
          Extract the session from the request.
 ExternalSessionKey forwardNewSessionRequestAndUpdateRegistry(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
 

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 Map<String,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.

forwardNewSessionRequestAndUpdateRegistry

public ExternalSessionKey forwardNewSessionRequestAndUpdateRegistry(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:
forwardNewSessionRequestAndUpdateRegistry in class RequestHandler
Returns:
the external key sent by the remote.
Throws:
NewSessionException - in case anything wrong happens during the new session process.


Copyright © 2012. All Rights Reserved.