Skip to content

Commit

Permalink
Add skeleton query validation endpoint
Browse files Browse the repository at this point in the history
Add a skeleton implementation of a query validation endpoint to allow
partners to begin implementation.

Part of work for #2585
  • Loading branch information
lbschanno committed Oct 4, 2024
1 parent 3cadd26 commit 448e9c1
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public GenericResponse<String> planQuery(@Required("logicName") @PathParam("logi
QueryData qd = validateQuery(queryLogicName, queryParameters, null);

GenericResponse<String> response = new GenericResponse<>();

Query q = null;
AccumuloClient client = null;
AccumuloConnectionFactory.Priority priority;
Expand Down Expand Up @@ -2996,7 +2996,7 @@ private void updateQueryParams(Query q, String queryLogicName, String query, Dat
q.setParameters(params);
}
}

/**
* @param queryLogicName
* the logic name
Expand All @@ -3006,16 +3006,17 @@ private void updateQueryParams(Query q, String queryLogicName, String query, Dat
*/
@POST
@Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf",
"application/x-protostuff"})
"application/x-protostuff"})
@Path("/{logicName}/validateQuery")
@Interceptors({RequiredInterceptor.class, ResponseInterceptor.class})
@Timed(name = "dw.query.validateQuery", absolute = true)
public GenericResponse<String> validateQuery(@Required("logicName") @PathParam("logicName") String queryLogicName,
MultivaluedMap<String,String> queryParameters) {
GenericResponse<String> response = new GenericResponse<>();
throw new DatawaveWebApplicationException(new UnsupportedOperationException("Query validator coming soon."), response, 501);
response.setMessages(Collections.singletonList("Query validator coming soon."));
throw new DatawaveWebApplicationException(new UnsupportedOperationException("Query validator not implemented"), response, 501);
}

/**
* <strong>Administrator credentials required.</strong> Returns list of queries for some other user
*
Expand Down

0 comments on commit 448e9c1

Please sign in to comment.