getLogger().error("Splunk request status code:" + e.getStatus() + " Retrying the request."); splunkService.logout(); splunkService = createSplunkService(context);
throw HttpException.create(response);
message = message + " -- " + detail; return new HttpException(status, message, detail);
/** * Query Splunk for SPL queries corresponding to this pivot. * * @return a Pivot object encapsulating the returned queries. */ public Pivot pivot() { Service service = this.dataModelObject.getDataModel().getService(); Args args = new Args(); args.put("pivot_json", toJson()); if (this.accelerationNamespace != null) { args.put("namespace", this.accelerationNamespace); } ResponseMessage response = service.get( "datamodel/pivot/" + this.dataModelObject.getDataModel().getName(), args ); if (response.getStatus() != 200) { throw HttpException.create(response); } else { return Pivot.parseStream(service, response.getContent()); } } }
/** * Stops the current search and deletes the result cache. * * @return The search job. */ public Job cancel() { try { return control("cancel"); } catch (HttpException e) { if (e.getStatus() == 404) { // Already cancelled; cancel is a nop. } else { throw e; } } return this; }
if (e.getStatus() == 404) continue; throw e;