org.apache.hadoop.fs.http.server
Class HttpFSExceptionProvider

java.lang.Object
  extended by org.apache.hadoop.lib.wsrs.ExceptionProvider
      extended by org.apache.hadoop.fs.http.server.HttpFSExceptionProvider
All Implemented Interfaces:
javax.ws.rs.ext.ExceptionMapper<Throwable>

@Provider
@InterfaceAudience.Private
public class HttpFSExceptionProvider
extends ExceptionProvider

JAX-RS ExceptionMapper implementation that maps HttpFSServer's exceptions to HTTP status codes.


Constructor Summary
HttpFSExceptionProvider()
           
 
Method Summary
protected  void log(javax.ws.rs.core.Response.Status status, Throwable throwable)
          Logs the HTTP status code and exception in HttpFSServer's log.
 javax.ws.rs.core.Response toResponse(Throwable throwable)
          Maps different exceptions thrown by HttpFSServer to HTTP status codes.
 
Methods inherited from class org.apache.hadoop.lib.wsrs.ExceptionProvider
createResponse, getOneLineMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpFSExceptionProvider

public HttpFSExceptionProvider()
Method Detail

toResponse

public javax.ws.rs.core.Response toResponse(Throwable throwable)
Maps different exceptions thrown by HttpFSServer to HTTP status codes.

Specified by:
toResponse in interface javax.ws.rs.ext.ExceptionMapper<Throwable>
Overrides:
toResponse in class ExceptionProvider
Parameters:
throwable - exception thrown.
Returns:
mapped HTTP status code

log

protected void log(javax.ws.rs.core.Response.Status status,
                   Throwable throwable)
Logs the HTTP status code and exception in HttpFSServer's log.

Overrides:
log in class ExceptionProvider
Parameters:
status - HTTP status code.
throwable - exception thrown.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.