From 240a052cbf2530a2850edf916fbe94ea00e458d9 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 29 Jul 2016 13:43:02 -0400 Subject: [PATCH] Stop using isCreated and isFound These are going away in core and being replaced by `getOperation`. Original commit: elastic/x-pack-elasticsearch@d02e7453181d31daceed284dbb8b395cd9c148fb --- .../security/authc/esnative/NativeUsersStore.java | 15 +++++++++------ .../security/authz/store/NativeRolesStore.java | 10 ++++++---- .../integration/BulkUpdateTests.java | 13 ++++++------- .../integration/ClearRolesCacheTests.java | 5 +++-- .../integration/DateMathExpressionIntegTests.java | 5 +++-- .../integration/KibanaUserRoleIntegTests.java | 5 +++-- .../MultipleIndicesPermissionsTests.java | 9 +++++---- .../ldap/AbstractAdLdapRealmTestCase.java | 4 +++- .../org/elasticsearch/license/LicensingTests.java | 5 +++-- .../authc/pki/PkiAuthenticationTests.java | 3 ++- .../xpack/watcher/WatcherService.java | 5 ++--- .../actions/index/ExecutableIndexAction.java | 4 +++- .../delete/TransportDeleteWatchAction.java | 5 +++-- .../actions/put/TransportPutWatchAction.java | 4 +++- .../xpack/watcher/WatcherServiceTests.java | 7 ++++--- .../actions/TimeThrottleIntegrationTests.java | 3 ++- .../watcher/test/integration/WatchAckTests.java | 7 ++++--- 17 files changed, 64 insertions(+), 45 deletions(-) diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java index 1134d0d10a8..2e162d26308 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java @@ -13,6 +13,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.LatchedActionListener; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteResponse; @@ -325,7 +326,7 @@ public class NativeUsersStore extends AbstractComponent implements ClusterStateL .execute(new ActionListener() { @Override public void onResponse(UpdateResponse updateResponse) { - assert updateResponse.isCreated() == false; + assert updateResponse.getOperation() == DocWriteResponse.Operation.INDEX; clearRealmCache(request.username(), listener, null); } @@ -401,7 +402,7 @@ public class NativeUsersStore extends AbstractComponent implements ClusterStateL .execute(new ActionListener() { @Override public void onResponse(UpdateResponse updateResponse) { - assert updateResponse.isCreated() == false; + assert updateResponse.getOperation() == DocWriteResponse.Operation.INDEX; clearRealmCache(putUserRequest.username(), listener, false); } @@ -442,12 +443,13 @@ public class NativeUsersStore extends AbstractComponent implements ClusterStateL @Override public void onResponse(IndexResponse indexResponse) { // if the document was just created, then we don't need to clear cache - if (indexResponse.isCreated()) { - listener.onResponse(indexResponse.isCreated()); + boolean created = indexResponse.getOperation() == DocWriteResponse.Operation.CREATE; + if (created) { + listener.onResponse(true); return; } - clearRealmCache(putUserRequest.username(), listener, indexResponse.isCreated()); + clearRealmCache(putUserRequest.username(), listener, created); } @Override @@ -471,7 +473,8 @@ public class NativeUsersStore extends AbstractComponent implements ClusterStateL client.delete(request, new ActionListener() { @Override public void onResponse(DeleteResponse deleteResponse) { - clearRealmCache(deleteUserRequest.username(), listener, deleteResponse.isFound()); + clearRealmCache(deleteUserRequest.username(), listener, + deleteResponse.getOperation() == DocWriteResponse.Operation.DELETE); } @Override diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java index 6324b4d8e5a..0bc1181374d 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java @@ -22,6 +22,7 @@ import java.util.function.Function; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.LatchedActionListener; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteResponse; @@ -273,7 +274,7 @@ public class NativeRolesStore extends AbstractComponent implements RolesStore, C client.delete(request, new ActionListener() { @Override public void onResponse(DeleteResponse deleteResponse) { - clearRoleCache(deleteRoleRequest.name(), listener, deleteResponse.isFound()); + clearRoleCache(deleteRoleRequest.name(), listener, deleteResponse.getOperation() == DocWriteResponse.Operation.DELETE); } @Override @@ -303,11 +304,12 @@ public class NativeRolesStore extends AbstractComponent implements RolesStore, C .execute(new ActionListener() { @Override public void onResponse(IndexResponse indexResponse) { - if (indexResponse.isCreated()) { - listener.onResponse(indexResponse.isCreated()); + boolean created = indexResponse.getOperation() == DocWriteResponse.Operation.CREATE; + if (created) { + listener.onResponse(true); return; } - clearRoleCache(role.getName(), listener, indexResponse.isCreated()); + clearRoleCache(role.getName(), listener, created); } @Override diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java index 201850afa2c..f0a6f4f4016 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java @@ -10,9 +10,9 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicHeader; import org.apache.http.util.EntityUtils; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Response; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; @@ -28,7 +28,6 @@ import java.util.Collections; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; public class BulkUpdateTests extends SecurityIntegTestCase { @@ -42,7 +41,8 @@ public class BulkUpdateTests extends SecurityIntegTestCase { } public void testThatBulkUpdateDoesNotLoseFields() { - assertThat(client().prepareIndex("index1", "type").setSource("{\"test\": \"test\"}").setId("1").get().isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, + client().prepareIndex("index1", "type").setSource("{\"test\": \"test\"}").setId("1").get().getOperation()); GetResponse getResponse = internalCluster().transportClient().prepareGet("index1", "type", "1").setFields("test").get(); assertThat(getResponse.getField("test").getValue(), equalTo("test")); @@ -51,9 +51,8 @@ public class BulkUpdateTests extends SecurityIntegTestCase { } // update with a new field - boolean created = internalCluster().transportClient().prepareUpdate("index1", "type", "1").setDoc("{\"not test\": \"not test\"}") - .get().isCreated(); - assertThat(created, is(false)); + assertEquals(DocWriteResponse.Operation.INDEX, internalCluster().transportClient().prepareUpdate("index1", "type", "1") + .setDoc("{\"not test\": \"not test\"}").get().getOperation()); getResponse = internalCluster().transportClient().prepareGet("index1", "type", "1").setFields("test", "not test").get(); assertThat(getResponse.getField("test").getValue(), equalTo("test")); assertThat(getResponse.getField("not test").getValue(), equalTo("not test")); @@ -65,7 +64,7 @@ public class BulkUpdateTests extends SecurityIntegTestCase { // do it in a bulk BulkResponse response = internalCluster().transportClient().prepareBulk().add(client().prepareUpdate("index1", "type", "1") .setDoc("{\"bulk updated\": \"bulk updated\"}")).get(); - assertThat(((UpdateResponse)response.getItems()[0].getResponse()).isCreated(), is(false)); + assertEquals(DocWriteResponse.Operation.INDEX, response.getItems()[0].getResponse().getOperation()); getResponse = internalCluster().transportClient().prepareGet("index1", "type", "1"). setFields("test", "not test", "bulk updated").get(); assertThat(getResponse.getField("test").getValue(), equalTo("test")); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java index 1c3a9b5e6d5..e09530128e3 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.integration; import org.apache.http.message.BasicHeader; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Client; @@ -119,7 +120,7 @@ public class ClearRolesCacheTests extends NativeRealmIntegTestCase { .setDoc("run_as", new String[] { role }) .setRefreshPolicy(refresh ? IMMEDIATE : NONE) .get(); - assertThat(response.isCreated(), is(false)); + assertEquals(DocWriteResponse.Operation.INDEX, response.getOperation()); logger.debug("--> updated role [{}] with run_as", role); } @@ -161,7 +162,7 @@ public class ClearRolesCacheTests extends NativeRealmIntegTestCase { .prepareDelete(SecurityTemplateService.SECURITY_INDEX_NAME, NativeRolesStore.ROLE_DOC_TYPE, role) .setRefreshPolicy(refresh ? IMMEDIATE : NONE) .get(); - assertThat(response.isFound(), is(true)); + assertEquals(DocWriteResponse.Operation.DELETE, response.getOperation()); assertBusy(new Runnable() { @Override diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java index 2f2003db155..db89d13dc23 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.integration; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; import org.elasticsearch.action.get.GetResponse; @@ -69,7 +70,7 @@ public class DateMathExpressionIntegTests extends SecurityIntegTestCase { IndexResponse response = client.prepareIndex(expression, "type").setSource("foo", "bar") .setRefreshPolicy(refeshOnOperation ? IMMEDIATE : NONE).get(); - assertThat(response.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, response.getOperation()); assertThat(response.getIndex(), containsString(expectedIndexName)); if (refeshOnOperation == false) { @@ -89,7 +90,7 @@ public class DateMathExpressionIntegTests extends SecurityIntegTestCase { .setDoc("new", "field") .setRefreshPolicy(refeshOnOperation ? IMMEDIATE : NONE) .get(); - assertThat(updateResponse.isCreated(), is(false)); + assertEquals(DocWriteResponse.Operation.INDEX, updateResponse.getOperation()); if (refeshOnOperation == false) { client.admin().indices().prepareRefresh(expression).get(); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java index 0fd125570a1..4f0f223818d 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.integration; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.get.GetIndexResponse; import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; @@ -186,13 +187,13 @@ public class KibanaUserRoleIntegTests extends SecurityIntegTestCase { .setSource("foo", "bar") .setRefreshPolicy(IMMEDIATE) .get(); - assertThat(response.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, response.getOperation()); DeleteResponse deleteResponse = client() .filterWithHeader(singletonMap("Authorization", UsernamePasswordToken.basicAuthHeaderValue("kibana_user", USERS_PASSWD))) .prepareDelete(index, "dashboard", response.getId()) .get(); - assertThat(deleteResponse.isFound(), is(true)); + assertEquals(DocWriteResponse.Operation.DELETE, deleteResponse.getOperation()); } // TODO: When we have an XPackIntegTestCase, this should test that we can send MonitoringBulkActions diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java index a5425d3355f..db23824df60 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.integration; import org.elasticsearch.ElasticsearchSecurityException; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.action.search.SearchResponse; @@ -75,14 +76,14 @@ public class MultipleIndicesPermissionsTests extends SecurityIntegTestCase { .startObject() .field("name", "value") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); indexResponse = index("test1", "type", jsonBuilder() .startObject() .field("name", "value1") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); refresh(); @@ -150,13 +151,13 @@ public class MultipleIndicesPermissionsTests extends SecurityIntegTestCase { .startObject() .field("name", "value_a") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); indexResponse = index("b", "type", jsonBuilder() .startObject() .field("name", "value_b") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); refresh(); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java index f1334c374de..2409b696d95 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java @@ -6,6 +6,7 @@ package org.elasticsearch.integration.ldap; import org.elasticsearch.ElasticsearchSecurityException; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; @@ -132,7 +133,8 @@ public abstract class AbstractAdLdapRealmTestCase extends SecurityIntegTestCase .endObject()) .execute().actionGet(); - assertThat("user " + user + " should have write access to index " + index, indexResponse.isCreated(), is(true)); + assertEquals("user " + user + " should have write access to index " + index, + DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); refresh(); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/license/LicensingTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/license/LicensingTests.java index aa77d6a1ac4..446067e4301 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/license/LicensingTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/license/LicensingTests.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.Collection; import org.elasticsearch.ElasticsearchSecurityException; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsIndices; @@ -114,14 +115,14 @@ public class LicensingTests extends SecurityIntegTestCase { .startObject() .field("name", "value") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); indexResponse = index("test1", "type", jsonBuilder() .startObject() .field("name", "value1") .endObject()); - assertThat(indexResponse.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, indexResponse.getOperation()); refresh(); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java index 22229227eef..f8ca672d46a 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java @@ -10,6 +10,7 @@ import org.apache.http.client.methods.HttpPut; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.client.transport.TransportClient; @@ -79,7 +80,7 @@ public class PkiAuthenticationTests extends SecurityIntegTestCase { try (TransportClient client = createTransportClient(settings)) { client.addTransportAddress(randomFrom(internalCluster().getInstance(Transport.class).boundAddress().boundAddresses())); IndexResponse response = client.prepareIndex("foo", "bar").setSource("pki", "auth").get(); - assertThat(response.isCreated(), is(true)); + assertEquals(DocWriteResponse.Operation.CREATE, response.getOperation()); } } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java index 88836a6448e..be2331308f7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.watcher; import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.bytes.BytesReference; @@ -15,7 +16,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.engine.VersionConflictEngineException; -import org.elasticsearch.xpack.common.stats.Counters; import org.elasticsearch.xpack.watcher.execution.ExecutionService; import org.elasticsearch.xpack.watcher.support.WatcherIndexTemplateRegistry; import org.elasticsearch.xpack.support.clock.Clock; @@ -29,7 +29,6 @@ import org.joda.time.DateTimeZone; import org.joda.time.PeriodType; import java.io.IOException; -import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; @@ -122,7 +121,7 @@ public class WatcherService extends AbstractComponent { } try { WatchStore.WatchDelete delete = watchStore.delete(id, force); - if (delete.deleteResponse().isFound()) { + if (delete.deleteResponse().getOperation() == DocWriteResponse.Operation.DELETE) { triggerService.remove(id); } return delete; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java index b5703c18ff1..5b60481b21c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.xpack.watcher.actions.index; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; @@ -116,7 +117,8 @@ public class ExecutableIndexAction extends ExecutableAction { static void indexResponseToXContent(XContentBuilder builder, IndexResponse response) throws IOException { builder.startObject() - .field("created", response.isCreated()) + .field("created", response.getOperation() == DocWriteResponse.Operation.CREATE) + .field("operation", response.getOperation().getLowercase()) .field("id", response.getId()) .field("version", response.getVersion()) .field("type", response.getType()) diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/TransportDeleteWatchAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/TransportDeleteWatchAction.java index 742491c23ad..b7305566f6a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/TransportDeleteWatchAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/TransportDeleteWatchAction.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.watcher.transport.actions.delete; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.cluster.service.ClusterService; @@ -56,8 +57,8 @@ public class TransportDeleteWatchAction extends WatcherTransportAction