public class Elide extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Elide.Handler<DataStoreTransaction,User,HandlerResult>
A function that sets up the request handling objects.
|
protected static class |
Elide.HandlerResult
A wrapper to return multiple values, less verbose than Pair.
|
Modifier and Type | Field and Description |
---|---|
static String |
JSONAPI_CONTENT_TYPE |
static String |
JSONAPI_CONTENT_TYPE_WITH_JSON_PATCH_EXTENSION |
Constructor and Description |
---|
Elide(ElideSettings elideSettings)
Instantiates a new Elide instance.
|
Modifier and Type | Method and Description |
---|---|
protected ElideResponse |
buildErrorResponse(HttpStatusException error,
boolean isVerbose) |
protected ElideResponse |
buildResponse(org.apache.commons.lang3.tuple.Pair<Integer,com.fasterxml.jackson.databind.JsonNode> response) |
ElideResponse |
delete(String baseUrlEndPoint,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Map<String,List<String>> requestHeaders,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle DELETE.
|
ElideResponse |
delete(String baseUrlEndPoint,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle DELETE.
|
ElideResponse |
delete(String baseUrlEndPoint,
String path,
String jsonApiDocument,
User opaqueUser,
String apiVersion)
Handle DELETE.
|
ElideResponse |
get(String baseUrlEndPoint,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Map<String,List<String>> requestHeaders,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle GET.
|
ElideResponse |
get(String baseUrlEndPoint,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
User opaqueUser,
String apiVersion)
Handle GET.
|
ElideResponse |
get(String baseUrlEndPoint,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle GET.
|
protected ElideResponse |
handleRequest(boolean isReadOnly,
User user,
Supplier<DataStoreTransaction> transaction,
UUID requestId,
Elide.Handler<DataStoreTransaction,User,Elide.HandlerResult> handler)
Handle JSON API requests.
|
ElideResponse |
patch(String baseUrlEndPoint,
String contentType,
String accept,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Map<String,List<String>> requestHeaders,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle PATCH.
|
ElideResponse |
patch(String baseUrlEndPoint,
String contentType,
String accept,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle PATCH.
|
ElideResponse |
patch(String baseUrlEndPoint,
String contentType,
String accept,
String path,
String jsonApiDocument,
User opaqueUser,
String apiVersion)
Handle PATCH.
|
ElideResponse |
post(String baseUrlEndPoint,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Map<String,List<String>> requestHeaders,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle POST.
|
ElideResponse |
post(String baseUrlEndPoint,
String path,
String jsonApiDocument,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
User opaqueUser,
String apiVersion,
UUID requestId)
Handle POST.
|
ElideResponse |
post(String baseUrlEndPoint,
String path,
String jsonApiDocument,
User opaqueUser,
String apiVersion)
Handle POST.
|
protected void |
registerCustomSerde() |
protected void |
registerCustomSerde(Class<?> type,
Serde serde,
String name) |
protected void |
registerCustomSerdeInObjectMapper(Class<?> type,
Serde serde,
String name) |
protected Set<Class<?>> |
registerCustomSerdeScan() |
Elide.HandlerResult |
visit(String path,
RequestScope requestScope,
BaseVisitor visitor) |
public static final String JSONAPI_CONTENT_TYPE
public static final String JSONAPI_CONTENT_TYPE_WITH_JSON_PATCH_EXTENSION
public Elide(ElideSettings elideSettings)
elideSettings
- Elide settings objectprotected void registerCustomSerde()
protected void registerCustomSerdeInObjectMapper(Class<?> type, Serde serde, String name)
public ElideResponse get(String baseUrlEndPoint, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, User opaqueUser, String apiVersion)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathqueryParams
- the query paramsopaqueUser
- the opaque userapiVersion
- the API versionpublic ElideResponse get(String baseUrlEndPoint, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathqueryParams
- the query paramsopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse get(String baseUrlEndPoint, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Map<String,List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathqueryParams
- the query paramsrequestHeaders
- the request headersopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse post(String baseUrlEndPoint, String path, String jsonApiDocument, User opaqueUser, String apiVersion)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentopaqueUser
- the opaque userapiVersion
- the API versionpublic ElideResponse post(String baseUrlEndPoint, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse post(String baseUrlEndPoint, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Map<String,List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsrequestHeaders
- the request headersopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse patch(String baseUrlEndPoint, String contentType, String accept, String path, String jsonApiDocument, User opaqueUser, String apiVersion)
baseUrlEndPoint
- base URL with prefix endpointcontentType
- the content typeaccept
- the acceptpath
- the pathjsonApiDocument
- the json api documentopaqueUser
- the opaque userapiVersion
- the API versionpublic ElideResponse patch(String baseUrlEndPoint, String contentType, String accept, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointcontentType
- the content typeaccept
- the acceptpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse patch(String baseUrlEndPoint, String contentType, String accept, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Map<String,List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointcontentType
- the content typeaccept
- the acceptpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsrequestHeaders
- the request headersopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse delete(String baseUrlEndPoint, String path, String jsonApiDocument, User opaqueUser, String apiVersion)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentopaqueUser
- the opaque userapiVersion
- the API versionpublic ElideResponse delete(String baseUrlEndPoint, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic ElideResponse delete(String baseUrlEndPoint, String path, String jsonApiDocument, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Map<String,List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId)
baseUrlEndPoint
- base URL with prefix endpointpath
- the pathjsonApiDocument
- the json api documentqueryParams
- the query paramsrequestHeaders
- the request headersopaqueUser
- the opaque userapiVersion
- the API versionrequestId
- the request IDpublic Elide.HandlerResult visit(String path, RequestScope requestScope, BaseVisitor visitor)
protected ElideResponse handleRequest(boolean isReadOnly, User user, Supplier<DataStoreTransaction> transaction, UUID requestId, Elide.Handler<DataStoreTransaction,User,Elide.HandlerResult> handler)
isReadOnly
- if the transaction is read onlyuser
- the user object from the containertransaction
- a transaction supplierrequestId
- the Request IDhandler
- a function that creates the request scope and request handlerprotected ElideResponse buildErrorResponse(HttpStatusException error, boolean isVerbose)
protected ElideResponse buildResponse(org.apache.commons.lang3.tuple.Pair<Integer,com.fasterxml.jackson.databind.JsonNode> response)
Copyright © 2015–2021 Yahoo! Inc.. All rights reserved.