org.openqa.selenium.remote.server.rest
Class ResultConfig

java.lang.Object
  extended by org.openqa.selenium.remote.server.rest.ResultConfig

public class ResultConfig
extends Object


Constructor Summary
ResultConfig(String url, Class<? extends Handler> handlerClazz, DriverSessions sessions, Logger log)
           
 
Method Summary
protected  void addHandlerAttributesToRequest(javax.servlet.http.HttpServletRequest request, Handler handler)
           
 boolean equals(Object o)
           
 Handler getHandler(String url, org.openqa.selenium.remote.SessionId sessionId)
           
 Throwable getRootExceptionCause(Throwable originalException)
           
 void handle(String pathInfo, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 int hashCode()
           
 boolean isFor(String urlToMatch)
           
 ResultConfig on(ResultType resultType, Renderer renderer)
          Configures this instance to handle a particular type of result with the given renderer.
 ResultConfig on(ResultType success, Renderer renderer, String mimeType)
           
 ResultConfig on(ResultType type, Result result)
          Configures how this instance will handle specific types of results.
protected  Handler populate(Handler handler, String pathString)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultConfig

public ResultConfig(String url,
                    Class<? extends Handler> handlerClazz,
                    DriverSessions sessions,
                    Logger log)
Method Detail

getHandler

public Handler getHandler(String url,
                          org.openqa.selenium.remote.SessionId sessionId)
                   throws Exception
Throws:
Exception

isFor

public boolean isFor(String urlToMatch)

populate

protected Handler populate(Handler handler,
                           String pathString)

on

public ResultConfig on(ResultType resultType,
                       Renderer renderer)
Configures this instance to handle a particular type of result with the given renderer. This result handler will be registered with an empty mime-type. Accordingly, it will only be used if there are no other handlers registered with an exact mime-type match.

Parameters:
resultType - The type of result to configure.
renderer - The renderer to use.
Returns:
A self reference for fluency.
See Also:
on(ResultType, Result)

on

public ResultConfig on(ResultType success,
                       Renderer renderer,
                       String mimeType)

on

public ResultConfig on(ResultType type,
                       Result result)
Configures how this instance will handle specific types of results. Each ResultType may be handled by multiple Results. Upon rendering a response, this instance will select the first Result that is an exact mime-type match for the original HTTP request (results are checked in the order registered). There may only be one Result registered for each mime-type.

Parameters:
type - The type of result to configure for.
result - The handler for the given result type.
Returns:
A self reference for fluency.

handle

public void handle(String pathInfo,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws Exception
Throws:
Exception

addHandlerAttributesToRequest

protected void addHandlerAttributesToRequest(javax.servlet.http.HttpServletRequest request,
                                             Handler handler)
                                      throws Exception
Throws:
Exception

getRootExceptionCause

public Throwable getRootExceptionCause(Throwable originalException)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.