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

java.lang.Object
  extended by org.apache.hadoop.fs.http.server.HttpFSServer

@InterfaceAudience.Private
public class HttpFSServer
extends Object

Main class of HttpFSServer server.

The HttpFSServer class uses Jersey JAX-RS to binds HTTP requests to the different operations.


Constructor Summary
HttpFSServer()
           
 
Method Summary
protected  URI createUploadRedirectionURL(javax.ws.rs.core.UriInfo uriInfo, Enum<?> uploadOperation)
          Creates the URL for an upload operation (create or append).
 javax.ws.rs.core.Response delete(Principal user, String path, HttpFSParametersProvider.OperationParam op, Parameters params)
          Binding to handle DELETE requests.
 javax.ws.rs.core.Response get(Principal user, String path, HttpFSParametersProvider.OperationParam op, Parameters params)
          Binding to handle GET requests, supported operations are
 javax.ws.rs.core.Response getRoot(Principal user, HttpFSParametersProvider.OperationParam op, Parameters params)
          Special binding for '/' as it is not handled by the wildcard binding.
 javax.ws.rs.core.Response post(InputStream is, Principal user, javax.ws.rs.core.UriInfo uriInfo, String path, HttpFSParametersProvider.OperationParam op, Parameters params)
          Binding to handle POST requests.
 javax.ws.rs.core.Response put(InputStream is, Principal user, javax.ws.rs.core.UriInfo uriInfo, String path, HttpFSParametersProvider.OperationParam op, Parameters params)
          Binding to handle PUT requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpFSServer

public HttpFSServer()
Method Detail

getRoot

public javax.ws.rs.core.Response getRoot(@Context
                                         Principal user,
                                         HttpFSParametersProvider.OperationParam op,
                                         @Context
                                         Parameters params)
                                  throws IOException,
                                         FileSystemAccessException
Special binding for '/' as it is not handled by the wildcard binding.

Parameters:
user - the principal of the user making the request.
op - the HttpFS operation of the request.
params - the HttpFS parameters of the request.
Returns:
the request response.
Throws:
IOException - thrown if an IO error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.

get

public javax.ws.rs.core.Response get(@Context
                                     Principal user,
                                     String path,
                                     HttpFSParametersProvider.OperationParam op,
                                     @Context
                                     Parameters params)
                              throws IOException,
                                     FileSystemAccessException
Binding to handle GET requests, supported operations are

Parameters:
user - the principal of the user making the request.
path - the path for operation.
op - the HttpFS operation of the request.
params - the HttpFS parameters of the request.
Returns:
the request response.
Throws:
IOException - thrown if an IO error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.

delete

public javax.ws.rs.core.Response delete(@Context
                                        Principal user,
                                        String path,
                                        HttpFSParametersProvider.OperationParam op,
                                        @Context
                                        Parameters params)
                                 throws IOException,
                                        FileSystemAccessException
Binding to handle DELETE requests.

Parameters:
user - the principal of the user making the request.
path - the path for operation.
op - the HttpFS operation of the request.
params - the HttpFS parameters of the request.
Returns:
the request response.
Throws:
IOException - thrown if an IO error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.

post

public javax.ws.rs.core.Response post(InputStream is,
                                      @Context
                                      Principal user,
                                      @Context
                                      javax.ws.rs.core.UriInfo uriInfo,
                                      String path,
                                      HttpFSParametersProvider.OperationParam op,
                                      @Context
                                      Parameters params)
                               throws IOException,
                                      FileSystemAccessException
Binding to handle POST requests.

Parameters:
is - the inputstream for the request payload.
user - the principal of the user making the request.
uriInfo - the of the request.
path - the path for operation.
op - the HttpFS operation of the request.
params - the HttpFS parameters of the request.
Returns:
the request response.
Throws:
IOException - thrown if an IO error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.

createUploadRedirectionURL

protected URI createUploadRedirectionURL(javax.ws.rs.core.UriInfo uriInfo,
                                         Enum<?> uploadOperation)
Creates the URL for an upload operation (create or append).

Parameters:
uriInfo - uri info of the request.
uploadOperation - operation for the upload URL.
Returns:
the URI for uploading data.

put

public javax.ws.rs.core.Response put(InputStream is,
                                     @Context
                                     Principal user,
                                     @Context
                                     javax.ws.rs.core.UriInfo uriInfo,
                                     String path,
                                     HttpFSParametersProvider.OperationParam op,
                                     @Context
                                     Parameters params)
                              throws IOException,
                                     FileSystemAccessException
Binding to handle PUT requests.

Parameters:
is - the inputstream for the request payload.
user - the principal of the user making the request.
uriInfo - the of the request.
path - the path for operation.
op - the HttpFS operation of the request.
params - the HttpFS parameters of the request.
Returns:
the request response.
Throws:
IOException - thrown if an IO error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.