use of datawave.webservice.result.QueryWizardStep3Response in project datawave by NationalSecurityAgency.
the class BasicQueryBean method showQueryWizardStep3.
/**
* Display the query plan and link to basic query results for a simple query web UI in the quickstart
*
* @HTTP 200 Success
* @return datawave.webservice.result.QueryWizardStep3Response
* @RequestHeader X-ProxiedEntitiesChain use when proxying request for user, by specifying a chain of DNs of the identities to proxy
* @RequestHeader X-ProxiedIssuersChain required when using X-ProxiedEntitiesChain, specify one issuer DN per subject DN listed in X-ProxiedEntitiesChain
* @ResponseHeader X-OperationTimeInMS time spent on the server performing the operation, does not account for network or result serialization
*/
@POST
@Produces({ "application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "text/html" })
@Path("/{logicName}/showQueryWizardStep3")
@GenerateQuerySessionId(cookieBasePath = "/DataWave/BasicQuery/")
@Interceptors({ ResponseInterceptor.class })
@Timed(name = "dw.query.showQueryWizardStep3", absolute = true)
public QueryWizardStep3Response showQueryWizardStep3(@Required("logicName") @PathParam("logicName") String logicName, MultivaluedMap<String, String> queryParameters, @Context HttpHeaders httpHeaders) {
CreateQuerySessionIDFilter.QUERY_ID.set(null);
GenericResponse<String> createResponse;
QueryWizardStep3Response queryWizardStep3Response = new QueryWizardStep3Response();
try {
createResponse = queryExecutor.createQuery(logicName, queryParameters, httpHeaders);
} catch (Exception e) {
queryWizardStep3Response.setErrorMessage(e.getMessage());
return queryWizardStep3Response;
}
String queryId = createResponse.getResult();
CreateQuerySessionIDFilter.QUERY_ID.set(queryId);
queryWizardStep3Response.setQueryId(queryId);
BaseQueryLogic logic = getQueryLogic(logicName);
if (logic != null && !(NO_PLAN_REQUIRED.contains(logic.getClass().getName()))) {
GenericResponse<String> planResponse;
try {
planResponse = queryExecutor.plan(queryId);
} catch (Exception e) {
queryWizardStep3Response.setErrorMessage(e.getMessage());
return queryWizardStep3Response;
}
queryWizardStep3Response.setQueryPlan(planResponse.getResult());
} else
queryWizardStep3Response.setQueryPlan("No plan required for this query");
return queryWizardStep3Response;
}
Aggregations