@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
sb.append("Who am i:"+System.lineSeparator()); final WhoAmIResponse whoAmIRes = tc.execute(WhoAmIAction.INSTANCE, new WhoAmIRequest()).actionGet(); sb.append(Strings.toString(whoAmIRes,true, true)); } catch (Exception e1) { sb.append(ExceptionsHelper.stackTrace(e1)); sb.append("License:"+System.lineSeparator()); LicenseInfoResponse res = tc.execute(LicenseInfoAction.INSTANCE, new LicenseInfoRequest()).actionGet(); sb.append(Strings.toString(res,true, true)); } catch (Exception e1) { sb.append(ExceptionsHelper.stackTrace(e1)); sb.append("ClusterHealthRequest:"+System.lineSeparator()); ClusterHealthResponse nir = tc.admin().cluster().health(new ClusterHealthRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) { sb.append(ExceptionsHelper.stackTrace(e1)); sb.append(System.lineSeparator()+"NodesInfoResponse:"+System.lineSeparator()); NodesInfoResponse nir = tc.admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) { sb.append(ExceptionsHelper.stackTrace(e1)); sb.append(System.lineSeparator()+"NodesStatsRequest:"+System.lineSeparator()); NodesStatsResponse nir = tc.admin().cluster().nodesStats(new NodesStatsRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) { sb.append(ExceptionsHelper.stackTrace(e1));
String configurationType = configTypes.iterator().next(); Map<String, String> fields = new HashMap<String, String>(); fields.put(configurationType, Strings.toString(retVal.get(configurationType).v2())); auditLog.logDocumentRead(this.searchguardIndex, configurationType, null, fields, complianceConfig);
private static String convertToYaml(String type, BytesReference bytes, boolean prettyPrint) throws IOException { try (XContentParser parser = JsonXContent.jsonXContent.createParser(NamedXContentRegistry.EMPTY, SearchGuardDeprecationHandler.INSTANCE, bytes.streamInput())) { parser.nextToken(); parser.nextToken(); if(!type.equals((parser.currentName()))) { return null; } parser.nextToken(); XContentBuilder builder = XContentFactory.yamlBuilder(); if (prettyPrint) { builder.prettyPrint(); } builder.rawValue(new ByteArrayInputStream(parser.binaryValue()), XContentType.YAML); return Strings.toString(builder); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, false); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this, true, true); } }
@Override public String toString() { return Strings.toString(this); } }
@Override public String toString() { return Strings.toString(this); } }
@Override public String toString() { return Strings.toString(this); } }
@Override public String toString() { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); XContentBuilder builder = new XContentBuilder(JsonXContent.jsonXContent, baos); toXContent(builder, ToXContent.EMPTY_PARAMS, false); return Strings.toString(builder); } catch (IOException e) { throw new IllegalStateException(e); //should not be possible here } }
@Override public String toString() { try { final XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); builder.startObject(); toXContent(builder, EMPTY_PARAMS); builder.endObject(); return Strings.toString(builder); } catch (final IOException e) { return "{ \"error\" : \"" + e.getMessage() + "\"}"; } }
@Override public String toString() { try (XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent())) { builder.startObject(); toXContent(builder, new MapParams(Collections.singletonMap("flat_settings", "true"))); builder.endObject(); return Strings.toString(builder); } catch (IOException e) { throw new UncheckedIOException(e); } }
NameOrDefinition(Map<String, ?> definition) { this.name = null; Objects.requireNonNull(definition); try { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); builder.map(definition); this.definition = Settings.builder().loadFromSource(Strings.toString(builder), builder.contentType()).build(); } catch (IOException e) { throw new IllegalArgumentException("Failed to parse [" + definition + "]", e); } }
@Override public String toString() { try { XContentBuilder builder = XContentFactory.jsonBuilder(); builder.prettyPrint(); toXContent(builder, EMPTY_PARAMS); return Strings.toString(builder); } catch (Exception e) { return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}"; } }