use of com.yahoo.elide.jsonapi.parser.GetVisitor in project elide by yahoo.
the class Elide method get.
/**
* Handle GET.
*
* @param baseUrlEndPoint base URL with prefix endpoint
* @param path the path
* @param queryParams the query params
* @param requestHeaders the request headers
* @param opaqueUser the opaque user
* @param apiVersion the API version
* @param requestId the request ID
* @return Elide response object
*/
public ElideResponse get(String baseUrlEndPoint, String path, MultivaluedMap<String, String> queryParams, Map<String, List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId) {
if (elideSettings.isStrictQueryParams()) {
try {
verifyQueryParams(queryParams);
} catch (BadRequestException e) {
return buildErrorResponse(e, false);
}
}
return handleRequest(true, opaqueUser, dataStore::beginReadTransaction, requestId, (tx, user) -> {
JsonApiDocument jsonApiDoc = new JsonApiDocument();
RequestScope requestScope = new RequestScope(baseUrlEndPoint, path, apiVersion, jsonApiDoc, tx, user, queryParams, requestHeaders, requestId, elideSettings);
requestScope.setEntityProjection(new EntityProjectionMaker(elideSettings.getDictionary(), requestScope).parsePath(path));
BaseVisitor visitor = new GetVisitor(requestScope);
return visit(path, requestScope, visitor);
});
}
Aggregations