From 751680e7b2524e5b432a1c5864953a54d300ab90 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Thu, 17 Aug 2017 11:16:56 +0100 Subject: [PATCH] Moves more classes over to ToXContentObject/Fragment (elastic/x-pack-elasticsearch#2283) Original commit: elastic/x-pack-elasticsearch@73c6802523ff91eeaaa3da58d4da3eed8acddcda --- .../org/elasticsearch/license/PutLicenseResponse.java | 6 +++--- .../org/elasticsearch/xpack/graph/action/Vertex.java | 5 +++-- .../xpack/ml/action/DeleteDatafeedAction.java | 5 +++-- .../elasticsearch/xpack/ml/action/FlushJobAction.java | 3 +-- .../xpack/ml/action/IsolateDatafeedAction.java | 5 +++-- .../xpack/ml/action/PreviewDatafeedAction.java | 3 +-- .../elasticsearch/xpack/ml/action/UpdateJobAction.java | 5 +++-- .../xpack/ml/job/process/normalizer/Normalizable.java | 4 ++-- .../xpack/monitoring/exporter/MonitoringDoc.java | 5 +++-- .../xpack/notification/hipchat/HipChatMessage.java | 2 +- .../xpack/notification/hipchat/SentMessages.java | 4 +--- .../xpack/notification/pagerduty/IncidentEvent.java | 2 +- .../notification/pagerduty/IncidentEventContext.java | 3 +-- .../xpack/notification/slack/SentMessages.java | 4 +--- .../xpack/notification/slack/message/Field.java | 4 ++-- .../xpack/notification/slack/message/SlackMessage.java | 4 ++-- .../xpack/persistent/PersistentTasksCustomMetaData.java | 3 ++- .../xpack/security/action/role/PutRoleResponse.java | 5 +++-- .../action/rolemapping/PutRoleMappingResponse.java | 9 +++++---- .../org/elasticsearch/xpack/watcher/actions/Action.java | 3 ++- .../xpack/watcher/actions/ActionStatus.java | 3 +-- .../xpack/watcher/actions/ActionWrapper.java | 3 +-- .../xpack/watcher/client/WatchSourceBuilder.java | 2 +- .../elasticsearch/xpack/watcher/condition/Condition.java | 2 +- .../xpack/watcher/execution/QueuedWatch.java | 5 +++-- .../xpack/watcher/execution/TriggeredWatch.java | 5 +++-- .../elasticsearch/xpack/watcher/watch/WatchStatus.java | 3 +-- 27 files changed, 54 insertions(+), 53 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/license/PutLicenseResponse.java b/plugin/src/main/java/org/elasticsearch/license/PutLicenseResponse.java index 967bf9ef1be..236771cdb7b 100644 --- a/plugin/src/main/java/org/elasticsearch/license/PutLicenseResponse.java +++ b/plugin/src/main/java/org/elasticsearch/license/PutLicenseResponse.java @@ -8,17 +8,17 @@ package org.elasticsearch.license; import org.elasticsearch.action.support.master.AcknowledgedResponse; 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.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.license.LicensesStatus; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; -public class PutLicenseResponse extends AcknowledgedResponse implements ToXContent { +public class PutLicenseResponse extends AcknowledgedResponse implements ToXContentFragment { private LicensesStatus status; private Map acknowledgeMessages; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/graph/action/Vertex.java b/plugin/src/main/java/org/elasticsearch/xpack/graph/action/Vertex.java index 24f75bed1c9..ad5e6cd703a 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/graph/action/Vertex.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/graph/action/Vertex.java @@ -7,7 +7,8 @@ package org.elasticsearch.xpack.graph.action; 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.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import java.io.IOException; @@ -19,7 +20,7 @@ import java.io.IOException; * A vertex term could be a bank account number, an email address, a hashtag or any * other term that appears in documents and is interesting to represent in a network. */ -public class Vertex implements ToXContent { +public class Vertex implements ToXContentFragment { final String field; final String term; double weight; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedAction.java index 8db38fab786..c88b80f419e 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedAction.java @@ -28,7 +28,8 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; @@ -62,7 +63,7 @@ public class DeleteDatafeedAction extends Action implements ToXContent { + public static class Request extends AcknowledgedRequest implements ToXContentFragment { public static final ParseField FORCE = new ParseField("force"); diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/FlushJobAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/FlushJobAction.java index 2c585691ff1..337fdbba875 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/FlushJobAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/FlushJobAction.java @@ -22,7 +22,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -57,7 +56,7 @@ public class FlushJobAction extends Action implements ToXContent { + public static class Request extends TransportJobTaskAction.JobTaskRequest implements ToXContentObject { public static final ParseField CALC_INTERIM = new ParseField("calc_interim"); public static final ParseField START = new ParseField("start"); diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/IsolateDatafeedAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/IsolateDatafeedAction.java index 9bc235de1ba..aff1d628360 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/IsolateDatafeedAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/IsolateDatafeedAction.java @@ -28,7 +28,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.tasks.Task; @@ -73,7 +74,7 @@ public class IsolateDatafeedAction return new Response(); } - public static class Request extends BaseTasksRequest implements ToXContent { + public static class Request extends BaseTasksRequest implements ToXContentObject { public static ObjectParser PARSER = new ObjectParser<>(NAME, Request::new); diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedAction.java index ce82644a954..129dfce05e2 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedAction.java @@ -24,7 +24,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; @@ -67,7 +66,7 @@ public class PreviewDatafeedAction extends Action implements ToXContent { + public static class Request extends AcknowledgedRequest implements ToXContentObject { public static UpdateJobAction.Request parseRequest(String jobId, XContentParser parser) { JobUpdate update = JobUpdate.PARSER.apply(parser, null).setJobId(jobId).build(); diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java index 21784122ee5..606be98ae10 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java @@ -5,12 +5,12 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContentObject; import java.util.List; import java.util.Objects; -public abstract class Normalizable implements ToXContent { +public abstract class Normalizable implements ToXContentObject { public enum ChildType {BUCKET_INFLUENCER, RECORD, PARTITION_SCORE}; private final String indexName; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringDoc.java b/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringDoc.java index 05194d77808..9f194abca38 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringDoc.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringDoc.java @@ -12,7 +12,8 @@ import org.elasticsearch.common.inject.internal.Nullable; import org.elasticsearch.common.io.stream.StreamInput; 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.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; @@ -136,7 +137,7 @@ public class MonitoringDoc { * {@link Node} represents the node of the cluster from which the monitoring document * has been collected. */ - public static class Node implements Writeable,ToXContent { + public static class Node implements Writeable, ToXContentObject { private String uuid; private String host; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java b/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java index 2bb435afad9..d7f9bf8704b 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java @@ -135,7 +135,7 @@ public class HipChatMessage implements ToXContentObject { return builder.endObject(); } - public static class Template implements ToXContent { + public static class Template implements ToXContentObject { final TextTemplate body; @Nullable final TextTemplate[] rooms; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java b/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java index e2fd3900e6a..a49d95de923 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java @@ -6,10 +6,8 @@ package org.elasticsearch.xpack.notification.hipchat; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.xpack.common.http.HttpRequest; @@ -63,7 +61,7 @@ public class SentMessages implements ToXContentObject, Iterable implements Writeable, ToXContent { + public static class PersistentTask

implements Writeable, ToXContentObject { private final String id; private final long allocationId; private final String taskName; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/security/action/role/PutRoleResponse.java b/plugin/src/main/java/org/elasticsearch/xpack/security/action/role/PutRoleResponse.java index a7c26416356..46d6bdb6150 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/security/action/role/PutRoleResponse.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/security/action/role/PutRoleResponse.java @@ -8,7 +8,8 @@ package org.elasticsearch.xpack.security.action.role; import org.elasticsearch.action.ActionResponse; 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.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import java.io.IOException; @@ -17,7 +18,7 @@ import java.io.IOException; * Response when adding a role, includes a boolean for whether the role was * created or updated. */ -public class PutRoleResponse extends ActionResponse implements ToXContent { +public class PutRoleResponse extends ActionResponse implements ToXContentObject { private boolean created; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/PutRoleMappingResponse.java b/plugin/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/PutRoleMappingResponse.java index 1dc88e98283..fafd5f15602 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/PutRoleMappingResponse.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/PutRoleMappingResponse.java @@ -5,20 +5,21 @@ */ package org.elasticsearch.xpack.security.action.rolemapping; -import java.io.IOException; - import org.elasticsearch.action.ActionResponse; 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.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import java.io.IOException; + /** * Response when adding/updating a role-mapping. * * @see org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class PutRoleMappingResponse extends ActionResponse implements ToXContent { +public class PutRoleMappingResponse extends ActionResponse implements ToXContentObject { private boolean created; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/Action.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/Action.java index 50dae042514..5d8e8502bdb 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/Action.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/Action.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.logging.LoggerMessageFormat; import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -19,7 +20,7 @@ public interface Action extends ToXContentObject { String type(); - abstract class Result implements ToXContent { + abstract class Result implements ToXContentFragment { public enum Status implements ToXContent { SUCCESS, diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java index c253c1a6b66..6ca07e9759a 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.Nullable; import org.elasticsearch.common.ParseField; 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.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -408,7 +407,7 @@ public class ActionStatus implements ToXContentObject { } } - public static class Throttle implements ToXContent { + public static class Throttle implements ToXContentObject { private final DateTime timestamp; private final String reason; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java index 8498c7c1507..ace8d7cb947 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java @@ -11,7 +11,6 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -238,7 +237,7 @@ public class ActionWrapper implements ToXContentObject { return new ActionWrapper(actionId, throttler, condition, transform, action); } - public static class Result implements ToXContent { + public static class Result implements ToXContentObject { private final String id; @Nullable diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java index 7528c55d824..53ffe2e9582 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java @@ -29,7 +29,7 @@ import java.util.Map; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -public class WatchSourceBuilder extends ToXContentToBytes implements ToXContent { +public class WatchSourceBuilder extends ToXContentToBytes implements ToXContentObject { private Trigger trigger; private Input input = NoneInput.INSTANCE; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/condition/Condition.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/condition/Condition.java index a70699fe618..286467cde44 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/condition/Condition.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/condition/Condition.java @@ -40,7 +40,7 @@ public abstract class Condition implements ToXContentObject { return builder.startObject().endObject(); } - public static class Result implements ToXContent { // don't make this final - we can't mock final classes :( + public static class Result implements ToXContentObject { // don't make this final - we can't mock final classes :( public Map getResolvedValues() { return resolveValues; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/QueuedWatch.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/QueuedWatch.java index 7dd2f04f5a9..a945bc9a515 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/QueuedWatch.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/QueuedWatch.java @@ -8,14 +8,15 @@ package org.elasticsearch.xpack.watcher.execution; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Streamable; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import java.io.IOException; -public class QueuedWatch implements Streamable, ToXContent { +public class QueuedWatch implements Streamable, ToXContentObject { private String watchId; private String watchRecordId; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java index 29088894635..cd715e0d256 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java @@ -11,7 +11,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; @@ -20,7 +21,7 @@ import org.elasticsearch.xpack.watcher.trigger.TriggerService; import java.io.IOException; -public class TriggeredWatch implements ToXContent { +public class TriggeredWatch implements ToXContentObject { private final Wid id; private final TriggerEvent triggerEvent; diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java index 24027005324..75289d2de51 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Streamable; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -300,7 +299,7 @@ public class WatchStatus implements ToXContentObject, Streamable { return new WatchStatus(version, state, lastChecked, lastMetCondition, actions); } - public static class State implements ToXContent { + public static class State implements ToXContentObject { final boolean active; final DateTime timestamp;