diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/common/http/HttpProxy.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/common/http/HttpProxy.java index 7c72158d678..74fbf95c778 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/common/http/HttpProxy.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/common/http/HttpProxy.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.common.http; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.ParseField; -import org.elasticsearch.common.ParseFieldMatcher; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/notification/email/attachment/ReportingAttachmentParser.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/notification/email/attachment/ReportingAttachmentParser.java index b713d670ca4..fbfe9effb32 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/notification/email/attachment/ReportingAttachmentParser.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/notification/email/attachment/ReportingAttachmentParser.java @@ -8,8 +8,6 @@ package org.elasticsearch.xpack.notification.email.attachment; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.ParseField; -import org.elasticsearch.common.ParseFieldMatcher; -import org.elasticsearch.common.ParseFieldMatcherSupplier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.LoggerMessageFormat; @@ -49,10 +47,9 @@ public class ReportingAttachmentParser implements EmailAttachmentParser RETRIES_SETTING = Setting.intSetting("xpack.notification.reporting.retries", 40, 0, Setting.Property.NodeScope); - private static final ObjectParser PARSER = new ObjectParser<>("reporting_attachment"); - private static final ObjectParser PAYLOAD_PARSER = + private static final ObjectParser PARSER = new ObjectParser<>("reporting_attachment"); + private static final ObjectParser PAYLOAD_PARSER = new ObjectParser<>("reporting_attachment_kibana_payload", true, null); - private static final ParseFieldMatcherSupplier STRICT_PARSING = () -> ParseFieldMatcher.STRICT; static { PARSER.declareInt(Builder::retries, new ParseField("retries")); @@ -88,7 +85,7 @@ public class ReportingAttachmentParser implements EmailAttachmentParser, CertInfoParseContext> PARSER = new ObjectParser<>("certgen"); + private static final ObjectParser, Void> PARSER = new ObjectParser<>("certgen"); static { - ConstructingObjectParser instanceParser = + ConstructingObjectParser instanceParser = new ConstructingObjectParser<>("instances", a -> new CertificateInformation((String) a[0], (String) (a[1] == null ? a[0] : a[1]), (List) a[2], (List) a[3])); @@ -248,7 +242,7 @@ public class CertificateTool extends EnvironmentAwareCommand { try (Reader reader = Files.newBufferedReader(file)) { // EMPTY is safe here because we never use namedObject XContentParser xContentParser = XContentType.YAML.xContent().createParser(NamedXContentRegistry.EMPTY, reader); - return PARSER.parse(xContentParser, new ArrayList<>(), new CertInfoParseContext()); + return PARSER.parse(xContentParser, new ArrayList<>(), null); } } @@ -632,20 +626,6 @@ public class CertificateTool extends EnvironmentAwareCommand { } } - private static class CertInfoParseContext implements ParseFieldMatcherSupplier { - - private final ParseFieldMatcher parseFieldMatcher; - - CertInfoParseContext() { - this.parseFieldMatcher = ParseFieldMatcher.EMPTY; - } - - @Override - public ParseFieldMatcher getParseFieldMatcher() { - return parseFieldMatcher; - } - } - private interface Writer { void write(ZipOutputStream zipOutputStream, JcaPEMWriter pemWriter) throws Exception; }