diff --git a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java index a736463e5ba..4f503f68073 100644 --- a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java +++ b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; @@ -315,23 +314,23 @@ public class License implements ToXContent { version = this.version; } if (restViewMode) { - builder.field(XFields.STATUS, status().label()); + builder.field(Fields.STATUS, status().label()); } - builder.field(XFields.UID, uid); - builder.field(XFields.TYPE, type); + builder.field(Fields.UID, uid); + builder.field(Fields.TYPE, type); if (version == VERSION_START) { - builder.field(XFields.SUBSCRIPTION_TYPE, subscriptionType); + builder.field(Fields.SUBSCRIPTION_TYPE, subscriptionType); } - builder.dateValueField(XFields.ISSUE_DATE_IN_MILLIS, XFields.ISSUE_DATE, issueDate); + builder.dateValueField(Fields.ISSUE_DATE_IN_MILLIS, Fields.ISSUE_DATE, issueDate); if (version == VERSION_START) { - builder.field(XFields.FEATURE, feature); + builder.field(Fields.FEATURE, feature); } - builder.dateValueField(XFields.EXPIRY_DATE_IN_MILLIS, XFields.EXPIRY_DATE, expiryDate); - builder.field(XFields.MAX_NODES, maxNodes); - builder.field(XFields.ISSUED_TO, issuedTo); - builder.field(XFields.ISSUER, issuer); + builder.dateValueField(Fields.EXPIRY_DATE_IN_MILLIS, Fields.EXPIRY_DATE, expiryDate); + builder.field(Fields.MAX_NODES, maxNodes); + builder.field(Fields.ISSUED_TO, issuedTo); + builder.field(Fields.ISSUER, issuer); if (!licenseSpecMode && !restViewMode && signature != null) { - builder.field(XFields.SIGNATURE, signature); + builder.field(Fields.SIGNATURE, signature); } if (restViewMode) { builder.humanReadable(previouslyHumanReadable); @@ -504,43 +503,27 @@ public class License implements ToXContent { return result; } - final static class Fields { - static final String STATUS = "status"; - static final String UID = "uid"; - static final String TYPE = "type"; - static final String SUBSCRIPTION_TYPE = "subscription_type"; - static final String ISSUE_DATE_IN_MILLIS = "issue_date_in_millis"; - static final String ISSUE_DATE = "issue_date"; - static final String FEATURE = "feature"; - static final String EXPIRY_DATE_IN_MILLIS = "expiry_date_in_millis"; - static final String EXPIRY_DATE = "expiry_date"; - static final String MAX_NODES = "max_nodes"; - static final String ISSUED_TO = "issued_to"; - static final String ISSUER = "issuer"; - static final String VERSION = "version"; - static final String SIGNATURE = "signature"; + public final static class Fields { + public static final String STATUS = "status"; + public static final String UID = "uid"; + public static final String TYPE = "type"; + public static final String SUBSCRIPTION_TYPE = "subscription_type"; + public static final String ISSUE_DATE_IN_MILLIS = "issue_date_in_millis"; + public static final String ISSUE_DATE = "issue_date"; + public static final String FEATURE = "feature"; + public static final String EXPIRY_DATE_IN_MILLIS = "expiry_date_in_millis"; + public static final String EXPIRY_DATE = "expiry_date"; + public static final String MAX_NODES = "max_nodes"; + public static final String ISSUED_TO = "issued_to"; + public static final String ISSUER = "issuer"; + public static final String VERSION = "version"; + public static final String SIGNATURE = "signature"; - static final String LICENSES = "licenses"; - static final String LICENSE = "license"; + public static final String LICENSES = "licenses"; + public static final String LICENSE = "license"; } - public interface XFields { - XContentBuilderString STATUS = new XContentBuilderString(Fields.STATUS); - XContentBuilderString UID = new XContentBuilderString(Fields.UID); - XContentBuilderString TYPE = new XContentBuilderString(Fields.TYPE); - XContentBuilderString SUBSCRIPTION_TYPE = new XContentBuilderString(Fields.SUBSCRIPTION_TYPE); - XContentBuilderString ISSUE_DATE_IN_MILLIS = new XContentBuilderString(Fields.ISSUE_DATE_IN_MILLIS); - XContentBuilderString ISSUE_DATE = new XContentBuilderString(Fields.ISSUE_DATE); - XContentBuilderString FEATURE = new XContentBuilderString(Fields.FEATURE); - XContentBuilderString EXPIRY_DATE_IN_MILLIS = new XContentBuilderString(Fields.EXPIRY_DATE_IN_MILLIS); - XContentBuilderString EXPIRY_DATE = new XContentBuilderString(Fields.EXPIRY_DATE); - XContentBuilderString MAX_NODES = new XContentBuilderString(Fields.MAX_NODES); - XContentBuilderString ISSUED_TO = new XContentBuilderString(Fields.ISSUED_TO); - XContentBuilderString ISSUER = new XContentBuilderString(Fields.ISSUER); - XContentBuilderString SIGNATURE = new XContentBuilderString(Fields.SIGNATURE); - } - private static long parseDate(XContentParser parser, String description, boolean endOfTheDay) throws IOException { if (parser.currentToken() == XContentParser.Token.VALUE_NUMBER) { return parser.longValue(); diff --git a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/action/GraphExploreResponse.java b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/action/GraphExploreResponse.java index 298b8a8a5cb..24dfe28a119 100644 --- a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/action/GraphExploreResponse.java +++ b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/action/GraphExploreResponse.java @@ -15,7 +15,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.graph.action.Connection.ConnectionId; import org.elasticsearch.graph.action.Vertex.VertexId; @@ -149,12 +148,12 @@ public class GraphExploreResponse extends ActionResponse implements ToXContent { } static final class Fields { - static final XContentBuilderString TOOK = new XContentBuilderString("took"); - static final XContentBuilderString TIMED_OUT = new XContentBuilderString("timed_out"); - static final XContentBuilderString INDICES = new XContentBuilderString("_indices"); - static final XContentBuilderString FAILURES = new XContentBuilderString("failures"); - static final XContentBuilderString VERTICES = new XContentBuilderString("vertices"); - static final XContentBuilderString CONNECTIONS = new XContentBuilderString("connections"); + static final String TOOK = "took"; + static final String TIMED_OUT = "timed_out"; + static final String INDICES = "_indices"; + static final String FAILURES = "failures"; + static final String VERTICES = "vertices"; + static final String CONNECTIONS = "connections"; } diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MonitoringDoc.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MonitoringDoc.java index e1be3f48510..5bf0295c3ca 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MonitoringDoc.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MonitoringDoc.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import java.io.IOException; import java.util.Collections; @@ -229,12 +228,12 @@ public class MonitoringDoc implements Writeable { } static final class Fields { - static final XContentBuilderString UUID = new XContentBuilderString("uuid"); - static final XContentBuilderString HOST = new XContentBuilderString("host"); - static final XContentBuilderString TRANSPORT_ADDRESS = new XContentBuilderString("transport_address"); - static final XContentBuilderString IP = new XContentBuilderString("ip"); - static final XContentBuilderString NAME = new XContentBuilderString("name"); - static final XContentBuilderString ATTRIBUTES = new XContentBuilderString("attributes"); + static final String UUID = "uuid"; + static final String HOST = "host"; + static final String TRANSPORT_ADDRESS = "transport_address"; + static final String IP = "ip"; + static final String NAME = "name"; + static final String ATTRIBUTES = "attributes"; } } } \ No newline at end of file diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolver.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolver.java index 698d22db650..add17936baa 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolver.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolver.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; @@ -128,9 +127,9 @@ public abstract class MonitoringIndexNameResolver { protected abstract void buildXContent(T document, XContentBuilder builder, ToXContent.Params params) throws IOException; public static final class Fields { - public static final XContentBuilderString CLUSTER_UUID = new XContentBuilderString("cluster_uuid"); - public static final XContentBuilderString TIMESTAMP = new XContentBuilderString("timestamp"); - public static final XContentBuilderString SOURCE_NODE = new XContentBuilderString("source_node"); + public static final String CLUSTER_UUID = "cluster_uuid"; + public static final String TIMESTAMP = "timestamp"; + public static final String SOURCE_NODE = "source_node"; } /** diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java index 1e85d67c2c7..407d3eb2659 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.hash.MessageDigests; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.license.core.License; import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; @@ -72,14 +71,14 @@ public class ClusterInfoResolver extends MonitoringIndexNameResolver.Data source = searchHit.sourceAsMap(); - assertNotNull(source.get(MonitoringBulkResolver.Fields.CLUSTER_UUID.value())); - assertNotNull(source.get(MonitoringBulkResolver.Fields.TIMESTAMP.value())); - assertNotNull(source.get(MonitoringBulkResolver.Fields.SOURCE_NODE.value())); + assertNotNull(source.get(MonitoringBulkResolver.Fields.CLUSTER_UUID)); + assertNotNull(source.get(MonitoringBulkResolver.Fields.TIMESTAMP)); + assertNotNull(source.get(MonitoringBulkResolver.Fields.SOURCE_NODE)); } } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java index bc4177cf787..4b540ced892 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java @@ -148,9 +148,9 @@ public abstract class MonitoringIndexNameResolverTestCase source = response.getSource(); - assertThat(source.get(MonitoringIndexNameResolver.Fields.CLUSTER_UUID.value()), notNullValue()); - assertThat(source.get(MonitoringIndexNameResolver.Fields.TIMESTAMP.value()), notNullValue()); - assertThat(source.get(MonitoringIndexNameResolver.Fields.SOURCE_NODE.value()), notNullValue()); - assertThat(source.get(ClusterInfoResolver.Fields.CLUSTER_NAME.value()), equalTo(cluster().getClusterName())); - assertThat(source.get(ClusterInfoResolver.Fields.VERSION.value()), equalTo(Version.CURRENT.toString())); + assertThat(source.get(MonitoringIndexNameResolver.Fields.CLUSTER_UUID), notNullValue()); + assertThat(source.get(MonitoringIndexNameResolver.Fields.TIMESTAMP), notNullValue()); + assertThat(source.get(MonitoringIndexNameResolver.Fields.SOURCE_NODE), notNullValue()); + assertThat(source.get(ClusterInfoResolver.Fields.CLUSTER_NAME), equalTo(cluster().getClusterName())); + assertThat(source.get(ClusterInfoResolver.Fields.VERSION), equalTo(Version.CURRENT.toString())); logger.debug("--> checking that the document contains license information"); - Object licenseObj = source.get(ClusterInfoResolver.Fields.LICENSE.value()); + Object licenseObj = source.get(ClusterInfoResolver.Fields.LICENSE); assertThat(licenseObj, instanceOf(Map.class)); Map license = (Map) licenseObj; assertThat(license, instanceOf(Map.class)); - String uid = (String) license.get(ClusterInfoResolver.Fields.UID.value()); + String uid = (String) license.get(ClusterInfoResolver.Fields.UID); assertThat(uid, not(isEmptyOrNullString())); - String type = (String) license.get(ClusterInfoResolver.Fields.TYPE.value()); + String type = (String) license.get(ClusterInfoResolver.Fields.TYPE); assertThat(type, not(isEmptyOrNullString())); - String status = (String) license.get(License.XFields.STATUS.value()); + String status = (String) license.get(License.Fields.STATUS); assertThat(status, not(isEmptyOrNullString())); - Long expiryDate = (Long) license.get(License.XFields.EXPIRY_DATE_IN_MILLIS.value()); + Long expiryDate = (Long) license.get(License.Fields.EXPIRY_DATE_IN_MILLIS); assertThat(expiryDate, greaterThan(0L)); // We basically recompute the hash here - String hkey = (String) license.get(ClusterInfoResolver.Fields.HKEY.value()); + String hkey = (String) license.get(ClusterInfoResolver.Fields.HKEY); String recalculated = ClusterInfoResolver.hash(status, uid, type, String.valueOf(expiryDate), clusterUUID); assertThat(hkey, equalTo(recalculated)); - assertThat((String) license.get(License.XFields.ISSUER.value()), not(isEmptyOrNullString())); - assertThat((String) license.get(License.XFields.ISSUED_TO.value()), not(isEmptyOrNullString())); - assertThat((Long) license.get(License.XFields.ISSUE_DATE_IN_MILLIS.value()), greaterThan(0L)); - assertThat((Integer) license.get(License.XFields.MAX_NODES.value()), greaterThan(0)); + assertThat((String) license.get(License.Fields.ISSUER), not(isEmptyOrNullString())); + assertThat((String) license.get(License.Fields.ISSUED_TO), not(isEmptyOrNullString())); + assertThat((Long) license.get(License.Fields.ISSUE_DATE_IN_MILLIS), greaterThan(0L)); + assertThat((Integer) license.get(License.Fields.MAX_NODES), greaterThan(0)); - Object clusterStats = source.get(ClusterInfoResolver.Fields.CLUSTER_STATS.value()); + Object clusterStats = source.get(ClusterInfoResolver.Fields.CLUSTER_STATS); assertNotNull(clusterStats); assertThat(clusterStats, instanceOf(Map.class)); assertThat(((Map) clusterStats).size(), greaterThan(0)); @@ -128,10 +128,10 @@ public class ClusterInfoTests extends MarvelIntegTestCase { .setTypes(ClusterInfoResolver.TYPE) .setQuery( QueryBuilders.boolQuery() - .should(QueryBuilders.matchQuery(License.XFields.STATUS.value(), License.Status.ACTIVE.label())) - .should(QueryBuilders.matchQuery(License.XFields.STATUS.value(), License.Status.INVALID.label())) - .should(QueryBuilders.matchQuery(License.XFields.STATUS.value(), License.Status.EXPIRED.label())) - .should(QueryBuilders.matchQuery(ClusterInfoResolver.Fields.CLUSTER_NAME.value(), + .should(QueryBuilders.matchQuery(License.Fields.STATUS, License.Status.ACTIVE.label())) + .should(QueryBuilders.matchQuery(License.Fields.STATUS, License.Status.INVALID.label())) + .should(QueryBuilders.matchQuery(License.Fields.STATUS, License.Status.EXPIRED.label())) + .should(QueryBuilders.matchQuery(ClusterInfoResolver.Fields.CLUSTER_NAME, cluster().getClusterName())) .minimumNumberShouldMatch(1) ).get(), 0L); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java index e58e13fd81c..41cdd6b314c 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java @@ -122,13 +122,13 @@ public class ClusterStateTests extends MarvelIntegTestCase { logger.debug("--> checking that every document contains the expected fields"); String[] filters = { - MonitoringIndexNameResolver.Fields.CLUSTER_UUID.value(), - MonitoringIndexNameResolver.Fields.TIMESTAMP.value(), - SOURCE_NODE.value(), - ClusterStateNodeResolver.Fields.STATE_UUID.value(), - ClusterStateNodeResolver.Fields.NODE.value(), - ClusterStateNodeResolver.Fields.NODE.value() + "." - + ClusterStateNodeResolver.Fields.ID.value(), + MonitoringIndexNameResolver.Fields.CLUSTER_UUID, + MonitoringIndexNameResolver.Fields.TIMESTAMP, + SOURCE_NODE, + ClusterStateNodeResolver.Fields.STATE_UUID, + ClusterStateNodeResolver.Fields.NODE, + ClusterStateNodeResolver.Fields.NODE + "." + + ClusterStateNodeResolver.Fields.ID, }; for (SearchHit searchHit : response.getHits().getHits()) { @@ -143,7 +143,7 @@ public class ClusterStateTests extends MarvelIntegTestCase { assertThat(client().prepareSearch().setSize(0) .setIndices(timestampedIndex) .setTypes(ClusterStateNodeResolver.TYPE) - .setQuery(QueryBuilders.matchQuery(SOURCE_NODE.value() + ".attributes.custom", randomInt)) + .setQuery(QueryBuilders.matchQuery(SOURCE_NODE + ".attributes.custom", randomInt)) .get().getHits().getTotalHits(), greaterThan(0L)); logger.debug("--> cluster state nodes successfully collected"); @@ -167,18 +167,18 @@ public class ClusterStateTests extends MarvelIntegTestCase { logger.debug("--> checking that every document contains the expected fields"); String[] filters = { - MonitoringIndexNameResolver.Fields.CLUSTER_UUID.value(), - MonitoringIndexNameResolver.Fields.TIMESTAMP.value(), - MonitoringIndexNameResolver.Fields.SOURCE_NODE.value(), - DiscoveryNodeResolver.Fields.NODE.value(), - DiscoveryNodeResolver.Fields.NODE.value() + "." - + DiscoveryNodeResolver.Fields.ID.value(), - DiscoveryNodeResolver.Fields.NODE.value() + "." - + DiscoveryNodeResolver.Fields.NAME.value(), - DiscoveryNodeResolver.Fields.NODE.value() + "." - + DiscoveryNodeResolver.Fields.ATTRIBUTES.value(), - DiscoveryNodeResolver.Fields.NODE.value() + "." - + DiscoveryNodeResolver.Fields.TRANSPORT_ADDRESS.value(), + MonitoringIndexNameResolver.Fields.CLUSTER_UUID, + MonitoringIndexNameResolver.Fields.TIMESTAMP, + MonitoringIndexNameResolver.Fields.SOURCE_NODE, + DiscoveryNodeResolver.Fields.NODE, + DiscoveryNodeResolver.Fields.NODE + "." + + DiscoveryNodeResolver.Fields.ID, + DiscoveryNodeResolver.Fields.NODE + "." + + DiscoveryNodeResolver.Fields.NAME, + DiscoveryNodeResolver.Fields.NODE + "." + + DiscoveryNodeResolver.Fields.ATTRIBUTES, + DiscoveryNodeResolver.Fields.NODE + "." + + DiscoveryNodeResolver.Fields.TRANSPORT_ADDRESS, }; for (SearchHit searchHit : response.getHits().getHits()) { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java index 1f15944cf66..b270f6c7acd 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java @@ -80,12 +80,12 @@ public class IndexRecoveryTests extends MarvelIntegTestCase { logger.debug("--> checking that every document contains the expected fields"); String[] filters = { - MonitoringIndexNameResolver.Fields.CLUSTER_UUID.value(), - MonitoringIndexNameResolver.Fields.TIMESTAMP.value(), - MonitoringIndexNameResolver.Fields.SOURCE_NODE.value(), - IndexRecoveryResolver.Fields.INDEX_RECOVERY.value(), - IndexRecoveryResolver.Fields.INDEX_RECOVERY.value() + "." - + IndexRecoveryResolver.Fields.SHARDS.value(), + MonitoringIndexNameResolver.Fields.CLUSTER_UUID, + MonitoringIndexNameResolver.Fields.TIMESTAMP, + MonitoringIndexNameResolver.Fields.SOURCE_NODE, + IndexRecoveryResolver.Fields.INDEX_RECOVERY, + IndexRecoveryResolver.Fields.INDEX_RECOVERY + "." + + IndexRecoveryResolver.Fields.SHARDS, }; for (SearchHit searchHit : response.getHits().getHits()) { diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java index b71456d7dbe..d5445dd5cc7 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java @@ -41,7 +41,6 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.node.Node; @@ -937,25 +936,25 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail, Cl } interface Field { - XContentBuilderString TIMESTAMP = new XContentBuilderString("@timestamp"); - XContentBuilderString NODE_NAME = new XContentBuilderString("node_name"); - XContentBuilderString NODE_HOST_NAME = new XContentBuilderString("node_host_name"); - XContentBuilderString NODE_HOST_ADDRESS = new XContentBuilderString("node_host_address"); - XContentBuilderString LAYER = new XContentBuilderString("layer"); - XContentBuilderString TYPE = new XContentBuilderString("event_type"); - XContentBuilderString ORIGIN_ADDRESS = new XContentBuilderString("origin_address"); - XContentBuilderString ORIGIN_TYPE = new XContentBuilderString("origin_type"); - XContentBuilderString PRINCIPAL = new XContentBuilderString("principal"); - XContentBuilderString RUN_AS_PRINCIPAL = new XContentBuilderString("run_as_principal"); - XContentBuilderString RUN_BY_PRINCIPAL = new XContentBuilderString("run_by_principal"); - XContentBuilderString ACTION = new XContentBuilderString("action"); - XContentBuilderString INDICES = new XContentBuilderString("indices"); - XContentBuilderString REQUEST = new XContentBuilderString("request"); - XContentBuilderString REQUEST_BODY = new XContentBuilderString("request_body"); - XContentBuilderString URI = new XContentBuilderString("uri"); - XContentBuilderString REALM = new XContentBuilderString("realm"); - XContentBuilderString TRANSPORT_PROFILE = new XContentBuilderString("transport_profile"); - XContentBuilderString RULE = new XContentBuilderString("rule"); + String TIMESTAMP = new String("@timestamp"); + String NODE_NAME = new String("node_name"); + String NODE_HOST_NAME = new String("node_host_name"); + String NODE_HOST_ADDRESS = new String("node_host_address"); + String LAYER = new String("layer"); + String TYPE = new String("event_type"); + String ORIGIN_ADDRESS = new String("origin_address"); + String ORIGIN_TYPE = new String("origin_type"); + String PRINCIPAL = new String("principal"); + String RUN_AS_PRINCIPAL = new String("run_as_principal"); + String RUN_BY_PRINCIPAL = new String("run_by_principal"); + String ACTION = new String("action"); + String INDICES = new String("indices"); + String REQUEST = new String("request"); + String REQUEST_BODY = new String("request_body"); + String URI = new String("uri"); + String REALM = new String("realm"); + String TRANSPORT_PROFILE = new String("transport_profile"); + String RULE = new String("rule"); } public enum State { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/actions/hipchat/service/SentMessages.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/actions/hipchat/service/SentMessages.java index a21b2c45eba..fd9b0443032 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/actions/hipchat/service/SentMessages.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/actions/hipchat/service/SentMessages.java @@ -8,7 +8,6 @@ package org.elasticsearch.watcher.actions.hipchat.service; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderString; import org.elasticsearch.watcher.support.http.HttpRequest; import org.elasticsearch.watcher.support.http.HttpResponse; @@ -65,7 +64,7 @@ public class SentMessages implements ToXContent, Iterable