@POST @Path("/audit") @Consumes("*/*") @Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf", "application/x-protostuff"}) @GZIP public VoidResponse auditRest(MultivaluedMap<String,String> parameters) { VoidResponse response = new VoidResponse(); try { auditService.audit(auditParameterBuilder.validate(parameters)); return response; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.AUDITING_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode); } }
public void setError(Throwable t) { if (t.getCause() instanceof QueryException) { QueryException qe = (QueryException) t.getCause(); this.setErrorCode(qe.getErrorCode()); this.setErrorMessage(qe.getMessage()); } else { this.setErrorMessage(t.getCause() != null ? t.getCause().getMessage() : t.getMessage()); } }
qe = new QueryException(message, e); if (null != cause) { qe.setStackTrace(cause.getStackTrace()); } else { qe.setStackTrace(e.getStackTrace()); qe.setErrorCode(Integer.toString(Response.Status.BAD_REQUEST.getStatusCode()) + "-1"); } else if ((e.getClass() == javax.ejb.EJBAccessException.class) && (message.equals("Caller unauthorized"))) { qe.setErrorCode(Integer.toString(Response.Status.FORBIDDEN.getStatusCode()) + "-1"); } else if (e instanceof EJBAccessException && message.startsWith("WFLYEJB0364:")) { qe.setErrorCode(Integer.toString(Response.Status.FORBIDDEN.getStatusCode()) + "-1"); } else { qe.setErrorCode(DatawaveErrorCode.UNKNOWN_SERVER_ERROR.getErrorCode()); response.addException(qe.getBottomQueryException()); ResponseBuilder r = Response.status(qe.getBottomQueryException().getStatusCode()).entity(response) .header(Constants.RESPONSE_ORIGIN, RESPONSE_ORIGIN);
QueryException qe = new QueryException(DatawaveErrorCode.MODEL_NAME_LIST_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); throw new DatawaveWebApplicationException(qe, response); } finally {
private static int readUByte(InputStream in) throws InvalidDocumentHeader { int b; try { b = in.read(); } catch (IOException e) { QueryException qe = new QueryException(DatawaveErrorCode.BUFFER_READ_ERROR, e); throw new InvalidDocumentHeader(qe); } if (b == -1) { QueryException qe = new QueryException(DatawaveErrorCode.INVALID_BYTE); throw new InvalidDocumentHeader(qe); } return b; }
sid = datawavePrincipal.getShortName(); } else { QueryException qe = new QueryException(DatawaveErrorCode.UNEXPECTED_PRINCIPAL_ERROR, MessageFormat.format("Class: {0}", p.getClass().getName())); response.addException(qe); throw new DatawaveWebApplicationException(qe, response); job.validateWorkflowParameter(oozieConf, mapReduceConfiguration); } catch (QueryException qe) { log.error(qe.getMessage(), qe); response.addException(qe); throw new DatawaveWebApplicationException(qe, response); } catch (Exception e) { log.error(e.getMessage(), e); response.addException(new QueryException(e.getMessage(), e)); throw new DatawaveWebApplicationException(e, response); } finally { jobID = oozieClient.run(oozieConf); } catch (Exception e) { throw new QueryException(DatawaveErrorCode.OOZIE_JOB_START_ERROR, e); mapReduceState.create(id, job.getHdfsUri(), job.getJobTracker(), jobDir.toString(), jobID, jobResultstDir, parameters, workFlow); } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.MAPREDUCE_STATE_PERSISTENCE_ERROR, e); response.addException(qe.getBottomQueryException()); try { oozieClient.kill(jobID); throw new QueryException(DatawaveErrorCode.MAPREDUCE_JOB_KILL_ERROR, e2);
} catch (QueryException e) { log.error("Error removing job state information", e); response.addException(e.getBottomQueryException()); throw new DatawaveWebApplicationException(e, response);
QueryException qe = new QueryException(DatawaveErrorCode.RESPONSE_POPULATION_ERROR, ioe); log.error(qe); result.addException(qe); return result; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_SETUP_ERROR, e); log.error(qe); result.addException(qe.getBottomQueryException()); return result; } finally {
private Query getQueryById(String id) throws QueryException { RunningQuery runningQuery = runningQueryCache.get(id); if (null != runningQuery) { return runningQuery.getSettings(); } else { List<Query> queries = persister.findById(id); if (null == queries || queries.isEmpty()) throw new QueryException("No query object matches this id", Response.Status.NOT_FOUND.getStatusCode()); if (queries.size() > 1) throw new QueryException("More than one query object matches the id", Response.Status.NOT_FOUND.getStatusCode()); return queries.get(0); } }
cbAuths.addAll(datawavePrincipal.getAuthorizations()); } else { QueryException qe = new QueryException(DatawaveErrorCode.UNEXPECTED_PRINCIPAL_ERROR, MessageFormat.format("Class: {0}", p.getClass().getName())); response.addException(qe); throw new DatawaveWebApplicationException(qe, response); throw waEx; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.LOGIC_CONFIGURATION_ERROR, e); log.error(qe.getMessage(), e); response.addException(qe.getBottomQueryException()); throw new DatawaveWebApplicationException(qe, response); ifClass = j.getInputFormatClass(); } catch (ClassNotFoundException e1) { QueryException qe = new QueryException(DatawaveErrorCode.INPUT_FORMAT_CLASS_ERROR, e1); log.error(qe); response.addException(qe); IllegalArgumentException e = new IllegalArgumentException("Invalid input format class specified. Must use one of " + this.mapReduceConfiguration.getValidInputFormats()); QueryException qe = new QueryException(DatawaveErrorCode.INVALID_FORMAT, e); log.error(qe); response.addException(qe.getBottomQueryException()); throw new DatawaveWebApplicationException(qe, response); j.submit(); } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.MAPREDUCE_JOB_START_ERROR, e);
return response; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_CACHE_PURGE_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode);
return response; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.MAPRED_UPDATE_STATUS_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); throw new DatawaveWebApplicationException(qe, response);
@Override public Object visit(ASTAssignment node, Object data) { QueryException qe = new QueryException(DatawaveErrorCode.ASSIGNMENT_NODE_PROCESSING_ERROR, MessageFormat.format("Node: {0}", PrintingVisitor .formattedQueryString(node).replace('\n', ' '))); throw new InvalidFieldIndexQueryFatalQueryException(qe); }
throw e; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_GET_ERROR, e, MessageFormat.format("queryID: {0}", id)); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode);
return result; } catch (IOException ioe) { QueryException qe = new QueryException(DatawaveErrorCode.RESPONSE_POPULATION_ERROR, ioe); log.error(qe); result.addException(qe); return result; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_SETUP_ERROR, e); log.error(qe); result.addException(qe.getBottomQueryException()); return result; } finally {
@Override public Object visit(ASTNRNode node, Object data) { QueryException qe = new QueryException(DatawaveErrorCode.NOT_EQUALS_REGEX_NODE_PROCESSING_ERROR, MessageFormat.format("Node: {0}", PrintingVisitor .formattedQueryString(node).replace('\n', ' '))); throw new InvalidFieldIndexQueryFatalQueryException(qe); }
throw e; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_LISTING_ERROR, e, MessageFormat.format("UserId: {0}", userId)); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode);
} catch (Exception e) { VoidResponse response = new VoidResponse(); QueryException qe = new QueryException(DatawaveErrorCode.COLLECTION_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); throw new DatawaveWebApplicationException(qe, response); } finally {
@Override public Object visit(ASTERNode node, Object data) { QueryException qe = new QueryException(DatawaveErrorCode.EQUALS_REGEX_NODE_PROCESSING_ERROR, MessageFormat.format("Node: {0}", PrintingVisitor .formattedQueryString(node).replace('\n', ' '))); throw new InvalidFieldIndexQueryFatalQueryException(qe); }
throw e; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.QUERY_LISTING_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode);