public final class RestUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RestUtils.ErrorResponse
Error response when
RestUtils.RestCallable.call() throws an exception. |
static interface |
RestUtils.RestCallable<T>
An interface representing a callable.
|
Modifier and Type | Method and Description |
---|---|
static <T> javax.ws.rs.core.Response |
call(RestUtils.RestCallable<T> callable,
AlluxioConfiguration alluxioConf)
Call response.
|
static <T> javax.ws.rs.core.Response |
call(RestUtils.RestCallable<T> callable,
AlluxioConfiguration alluxioConf,
Map<String,Object> headers)
Calls the given
RestUtils.RestCallable and handles any exceptions thrown. |
static javax.ws.rs.core.Response.ResponseBuilder |
makeCORS(javax.ws.rs.core.Response.ResponseBuilder responseBuilder)
Makes the responseBuilder CORS compatible, assumes default methods.
|
static javax.ws.rs.core.Response.ResponseBuilder |
makeCORS(javax.ws.rs.core.Response.ResponseBuilder responseBuilder,
String returnMethod)
Makes the responseBuilder CORS compatible.
|
public static <T> javax.ws.rs.core.Response call(RestUtils.RestCallable<T> callable, AlluxioConfiguration alluxioConf, @Nullable Map<String,Object> headers)
RestUtils.RestCallable
and handles any exceptions thrown.T
- the return type of the callablecallable
- the callable to callalluxioConf
- Alluxio configurationheaders
- the headerspublic static <T> javax.ws.rs.core.Response call(RestUtils.RestCallable<T> callable, AlluxioConfiguration alluxioConf)
T
- the type parametercallable
- the callablealluxioConf
- the alluxio confpublic static javax.ws.rs.core.Response.ResponseBuilder makeCORS(javax.ws.rs.core.Response.ResponseBuilder responseBuilder, String returnMethod)
responseBuilder
- the response builderreturnMethod
- the modified response builderpublic static javax.ws.rs.core.Response.ResponseBuilder makeCORS(javax.ws.rs.core.Response.ResponseBuilder responseBuilder)
responseBuilder
- the modified response builderCopyright © 2023. All Rights Reserved.