From a7aa18aa17c304730b2e2de53340d96108ceff29 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Wed, 1 Jun 2016 14:31:22 -0400 Subject: [PATCH] move trigger package to top-level x-pack Original commit: elastic/x-pack-elasticsearch@4f955a0c4a4f8efb85d4b7cbe934aa82fdd534a8 --- .../messy/tests/ExecutionVarsIT.java | 4 +- .../messy/tests/GroovyManualExecutionIT.java | 8 +-- .../HistoryTemplateTransformMappingsIT.java | 4 +- .../messy/tests/IndexActionIT.java | 20 ++++---- .../messy/tests/ScriptConditionTests.java | 2 +- .../messy/tests/TransformIT.java | 4 +- .../messy/tests/HipChatServiceIT.java | 4 +- .../messy/tests/NoMasterNodeIT.java | 6 +-- .../messy/tests/PagerDutyServiceIT.java | 4 +- .../messy/tests/SearchInputIT.java | 6 +-- .../messy/tests/SearchTransformIT.java | 8 +-- .../messy/tests/SlackServiceIT.java | 4 +- .../elasticsearch/messy/tests/WatchAckIT.java | 4 +- .../xpack/common/http/HttpContentType.java | 2 +- .../xpack/common/http/HttpRequest.java | 6 +-- .../common/http/HttpRequestTemplate.java | 6 +-- .../common/http/auth/HttpAuthRegistry.java | 2 +- .../notification/email/DataAttachment.java | 2 +- .../xpack/support/DateTimeUtils.java} | 6 +-- .../xpack}/support/Exceptions.java | 2 +- .../elasticsearch/xpack}/support/Strings.java | 2 +- .../xpack}/trigger/AbstractTriggerEngine.java | 2 +- .../elasticsearch/xpack}/trigger/Trigger.java | 2 +- .../xpack}/trigger/TriggerBuilders.java | 6 +-- .../xpack}/trigger/TriggerEngine.java | 4 +- .../xpack}/trigger/TriggerEvent.java | 6 +-- .../xpack}/trigger/TriggerModule.java | 6 +-- .../xpack}/trigger/TriggerService.java | 4 +- .../xpack}/trigger/manual/ManualTrigger.java | 4 +- .../trigger/manual/ManualTriggerEngine.java | 12 ++--- .../trigger/manual/ManualTriggerEvent.java | 10 ++-- .../xpack}/trigger/schedule/Cron.java | 4 +- .../xpack}/trigger/schedule/CronSchedule.java | 2 +- .../trigger/schedule/CronnableSchedule.java | 2 +- .../trigger/schedule/DailySchedule.java | 4 +- .../trigger/schedule/HourlySchedule.java | 6 +-- .../trigger/schedule/IntervalSchedule.java | 4 +- .../trigger/schedule/MonthlySchedule.java | 4 +- .../xpack}/trigger/schedule/Schedule.java | 2 +- .../trigger/schedule/ScheduleModule.java | 8 +-- .../trigger/schedule/ScheduleRegistry.java | 2 +- .../trigger/schedule/ScheduleTrigger.java | 4 +- .../schedule/ScheduleTriggerEngine.java | 18 +++---- .../schedule/ScheduleTriggerEvent.java | 16 +++--- .../xpack}/trigger/schedule/Schedules.java | 2 +- .../trigger/schedule/WeeklySchedule.java | 4 +- .../trigger/schedule/YearlySchedule.java | 4 +- .../SchedulerScheduleTriggerEngine.java | 12 ++--- .../engine/TickerScheduleTriggerEngine.java | 14 ++--- .../trigger/schedule/support/DayOfWeek.java | 2 +- .../trigger/schedule/support/DayTimes.java | 6 +-- .../trigger/schedule/support/Month.java | 2 +- .../trigger/schedule/support/MonthTimes.java | 6 +-- .../trigger/schedule/support/Times.java | 2 +- .../trigger/schedule/support/WeekTimes.java | 4 +- .../trigger/schedule/support/YearTimes.java | 6 +-- .../trigger/schedule/tool/CronEvalTool.java | 4 +- .../xpack/common/text/TextTemplateTests.java | 2 +- .../email/EmailSecretsIntegrationTests.java | 8 +-- .../xpack/support/DateTimeUtilsTests.java} | 30 ++++++----- .../elasticsearch/xpack/watcher/Watcher.java | 4 +- .../xpack/watcher/WatcherService.java | 8 +-- .../xpack/watcher/actions/ActionStatus.java | 4 +- .../xpack/watcher/actions/ActionWrapper.java | 4 +- .../actions/index/ExecutableIndexAction.java | 12 ++--- .../watcher/actions/index/IndexAction.java | 4 +- .../actions/throttler/AckThrottler.java | 2 +- .../watcher/client/WatchSourceBuilder.java | 4 +- .../AbstractExecutableCompareCondition.java | 6 +-- .../condition/compare/LenientCompare.java | 4 +- .../script/ExecutableScriptCondition.java | 2 +- .../execution/ActionExecutionMode.java | 2 +- .../execution/AsyncTriggerListener.java | 6 +-- .../watcher/execution/CurrentExecutions.java | 2 +- .../watcher/execution/ExecutionModule.java | 2 +- .../watcher/execution/ExecutionService.java | 2 +- .../execution/ManualExecutionContext.java | 2 +- .../execution/SyncTriggerListener.java | 6 +-- .../execution/TriggeredExecutionContext.java | 2 +- .../watcher/execution/TriggeredWatch.java | 4 +- .../execution/TriggeredWatchStore.java | 4 +- .../execution/WatchExecutionContext.java | 2 +- .../execution/WatchExecutionResult.java | 4 +- .../xpack/watcher/execution/Wid.java | 2 +- .../xpack/watcher/history/HistoryStore.java | 3 +- .../xpack/watcher/history/WatchRecord.java | 2 +- .../watcher/input/search/SearchInput.java | 4 +- .../rest/action/RestExecuteWatchAction.java | 2 +- .../support/SearchRequestEquivalence.java | 2 +- .../xpack/watcher/support/WatcherUtils.java | 2 +- .../validation/WatcherSettingsValidation.java | 2 +- .../script/ExecutableScriptTransform.java | 2 +- .../transform/search/SearchTransform.java | 4 +- .../actions/execute/ExecuteWatchRequest.java | 2 +- .../execute/ExecuteWatchRequestBuilder.java | 2 +- .../execute/TransportExecuteWatchAction.java | 8 +-- .../xpack/watcher/watch/Watch.java | 12 ++--- .../xpack/watcher/watch/WatchLockService.java | 2 +- .../xpack/watcher/watch/WatchStatus.java | 10 ++-- .../xpack/watcher/watch/WatchStore.java | 2 +- .../integration/HistoryIntegrationTests.java | 4 +- .../trigger/ScheduleTriggerEngineMock.java | 14 ++--- .../trigger/schedule/CronScheduleTests.java | 2 +- .../trigger/schedule/DailyScheduleTests.java | 6 +-- .../trigger/schedule/HourlyScheduleTests.java | 4 +- .../schedule/IntervalScheduleTests.java | 2 +- .../schedule/MonthlyScheduleTests.java | 8 +-- .../schedule/ScheduleRegistryTests.java | 2 +- .../trigger/schedule/ScheduleTestCase.java | 51 +++++++++---------- .../schedule/ScheduleTriggerEventTests.java | 2 +- .../trigger/schedule/WeeklyScheduleTests.java | 10 ++-- .../trigger/schedule/YearlyScheduleTests.java | 8 +-- .../engine/BaseTriggerEngineTestCase.java | 33 ++++++------ .../engine/SchedulerScheduleEngineTests.java | 6 +-- .../engine/TickerScheduleEngineTests.java | 6 +-- .../schedule/tool/CronEvalToolTests.java | 2 +- .../trigger/schedule/tool/EvalCron.java | 2 +- .../xpack/watcher/WatcherServiceTests.java | 6 +-- .../actions/ActionErrorIntegrationTests.java | 4 +- .../actions/TimeThrottleIntegrationTests.java | 4 +- .../actions/email/EmailAttachmentTests.java | 6 +-- .../index/IndexActionIntegrationTests.java | 20 ++++---- .../actions/index/IndexActionTests.java | 8 +-- .../actions/throttler/AckThrottlerTests.java | 2 +- .../throttler/ActionThrottleTests.java | 12 ++--- .../actions/webhook/WebhookActionTests.java | 2 +- .../webhook/WebhookHttpsIntegrationTests.java | 4 +- .../webhook/WebhookIntegrationTests.java | 4 +- .../script/ScriptConditionTests.java | 2 +- .../execution/ExecutionServiceTests.java | 2 +- .../execution/ManualExecutionTests.java | 10 ++-- .../TriggeredWatchStoreLifeCycleTests.java | 2 +- .../execution/TriggeredWatchTests.java | 2 +- .../watcher/history/HistoryStoreTests.java | 3 +- .../HistoryTemplateEmailMappingsTests.java | 7 +-- .../HistoryTemplateHttpMappingsTests.java | 4 +- ...storyTemplateIndexActionMappingsTests.java | 4 +- ...storyTemplateSearchInputMappingsTests.java | 4 +- .../HistoryTemplateTimeMappingsTests.java | 4 +- ...HistoryTemplateTransformMappingsTests.java | 4 +- .../watcher/input/chain/ChainInputTests.java | 10 ++-- .../input/chain/ChainIntegrationTests.java | 6 +-- .../input/http/HttpInputIntegrationTests.java | 6 +-- .../watcher/input/http/HttpInputTests.java | 6 +-- .../action/RestExecuteWatchActionTests.java | 2 +- .../watcher/shield/BasicShieldTests.java | 10 ++-- .../DynamicIndexNameIntegrationTests.java | 6 +-- .../xpack/watcher/support/VariablesTests.java | 4 +- .../watcher/support/WatcherUtilsTests.java | 2 +- .../AbstractWatcherIntegrationTestCase.java | 6 +-- .../xpack/watcher/test/TimeWarpedWatcher.java | 6 +-- .../WatchExecutionContextMockBuilder.java | 4 +- .../xpack/watcher/test/WatcherTestUtils.java | 6 +-- .../bench/ScheduleEngineTriggerBenchmark.java | 22 ++++---- .../WatcherExecutorServiceBenchmark.java | 8 +-- .../bench/WatcherScheduleEngineBenchmark.java | 4 +- .../test/integration/BasicWatcherTests.java | 22 ++++---- .../test/integration/BootStrapTests.java | 6 +-- .../ExecutionVarsIntegrationTests.java | 4 +- .../HttpSecretsIntegrationTests.java | 8 +-- .../test/integration/WatchMetadataTests.java | 8 +-- .../transform/TransformIntegrationTests.java | 4 +- .../script/ScriptTransformTests.java | 2 +- .../action/activate/ActivateWatchTests.java | 6 +-- .../action/delete/DeleteWatchTests.java | 4 +- .../action/delete/ForceDeleteWatchTests.java | 4 +- .../action/execute/ExecuteWatchTests.java | 18 +++---- .../ExecuteWatchWithDateMathTests.java | 10 ++-- .../transport/action/get/GetWatchTests.java | 4 +- .../transport/action/put/PutWatchTests.java | 4 +- .../action/stats/SlowWatchStatsTests.java | 4 +- .../action/stats/WatcherStatsTests.java | 4 +- .../xpack/watcher/watch/WatchTests.java | 40 +++++++-------- 173 files changed, 519 insertions(+), 524 deletions(-) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtils.java => src/main/java/org/elasticsearch/xpack/support/DateTimeUtils.java} (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/support/Exceptions.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/support/Strings.java (94%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/AbstractTriggerEngine.java (94%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/Trigger.java (93%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/TriggerBuilders.java (71%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/TriggerEngine.java (89%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/TriggerEvent.java (90%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/TriggerModule.java (87%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/TriggerService.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/manual/ManualTrigger.java (92%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/manual/ManualTriggerEngine.java (84%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/manual/ManualTriggerEvent.java (84%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/Cron.java (99%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/CronSchedule.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/CronnableSchedule.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/DailySchedule.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/HourlySchedule.java (96%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/IntervalSchedule.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/MonthlySchedule.java (96%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/Schedule.java (92%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/ScheduleModule.java (91%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/ScheduleRegistry.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/ScheduleTrigger.java (93%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/ScheduleTriggerEngine.java (76%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/ScheduleTriggerEvent.java (83%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/Schedules.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/WeeklySchedule.java (96%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/YearlySchedule.java (96%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/engine/SchedulerScheduleTriggerEngine.java (87%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/engine/TickerScheduleTriggerEngine.java (92%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/DayOfWeek.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/DayTimes.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/Month.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/MonthTimes.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/Times.java (91%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/WeekTimes.java (98%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/support/YearTimes.java (97%) rename elasticsearch/x-pack/{watcher/src/main/java/org/elasticsearch/xpack/watcher => src/main/java/org/elasticsearch/xpack}/trigger/schedule/tool/CronEvalTool.java (95%) rename elasticsearch/x-pack/{watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtilsTests.java => src/test/java/org/elasticsearch/xpack/support/DateTimeUtilsTests.java} (76%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/ScheduleTriggerEngineMock.java (87%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/CronScheduleTests.java (98%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/DailyScheduleTests.java (97%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/HourlyScheduleTests.java (98%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/IntervalScheduleTests.java (98%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/MonthlyScheduleTests.java (96%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/ScheduleRegistryTests.java (98%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/ScheduleTestCase.java (85%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/ScheduleTriggerEventTests.java (96%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/WeeklyScheduleTests.java (94%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/YearlyScheduleTests.java (96%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/engine/BaseTriggerEngineTestCase.java (88%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/engine/SchedulerScheduleEngineTests.java (80%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/engine/TickerScheduleEngineTests.java (80%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/tool/CronEvalToolTests.java (93%) rename elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/{watcher => }/trigger/schedule/tool/EvalCron.java (89%) diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ExecutionVarsIT.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ExecutionVarsIT.java index dfe469fb446..166b6ea366b 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ExecutionVarsIT.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ExecutionVarsIT.java @@ -25,8 +25,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.scriptCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/GroovyManualExecutionIT.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/GroovyManualExecutionIT.java index cd3f3b864cb..aea978cb2d4 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/GroovyManualExecutionIT.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/GroovyManualExecutionIT.java @@ -20,8 +20,8 @@ import org.elasticsearch.xpack.watcher.transport.actions.delete.DeleteWatchRespo import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -34,8 +34,8 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/HistoryTemplateTransformMappingsIT.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/HistoryTemplateTransformMappingsIT.java index ac70e85f308..8f406cf68ef 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/HistoryTemplateTransformMappingsIT.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/HistoryTemplateTransformMappingsIT.java @@ -21,8 +21,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/IndexActionIT.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/IndexActionIT.java index 6cb442b82ca..db88f0d0055 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/IndexActionIT.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/IndexActionIT.java @@ -14,11 +14,11 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.xpack.watcher.history.HistoryStore; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -33,8 +33,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; @@ -75,10 +75,10 @@ public class IndexActionIT extends AbstractWatcherIntegrationTestCase { assertThat(searchResponse.getHits().totalHits(), is(1L)); SearchHit hit = searchResponse.getHits().getAt(0); if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -111,10 +111,10 @@ public class IndexActionIT extends AbstractWatcherIntegrationTestCase { assertThat(searchResponse.getHits().totalHits(), is(1L)); SearchHit hit = searchResponse.getHits().getAt(0); if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -202,10 +202,10 @@ public class IndexActionIT extends AbstractWatcherIntegrationTestCase { int i = 0; for (SearchHit hit : searchResponse.getHits()) { if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("key", (Object) key.getMillis())); diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java index 500d35e70da..9601c561628 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java @@ -36,7 +36,7 @@ import java.io.IOException; import static java.util.Collections.singletonMap; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.messy.tests.MessyTestUtils.getScriptServiceProxy; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIT.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIT.java index 937b8c9e3e3..9e94ab4b7c5 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIT.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/TransformIT.java @@ -36,8 +36,8 @@ import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.chainTransform; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.searchTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java index bc889ded99d..099fe496e3d 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java @@ -30,8 +30,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.hipchatActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/NoMasterNodeIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/NoMasterNodeIT.java index 2c382165c40..a16f08bdfa6 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/NoMasterNodeIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/NoMasterNodeIT.java @@ -51,9 +51,9 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.always import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java index a60d8c9f81f..64cbea85bbe 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java @@ -32,8 +32,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.pagerDutyAc import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java index b2d46d4a4ac..65a2a93ca75 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java @@ -37,9 +37,9 @@ import org.elasticsearch.xpack.watcher.input.search.SearchInputFactory; import org.elasticsearch.xpack.watcher.input.simple.ExecutableSimpleInput; import org.elasticsearch.xpack.watcher.input.simple.SimpleInput; import org.elasticsearch.xpack.watcher.support.init.proxy.WatcherClientProxy; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformIT.java index d2b9f47bbd3..a303c639707 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformIT.java @@ -43,9 +43,9 @@ import org.elasticsearch.xpack.watcher.transform.TransformBuilders; import org.elasticsearch.xpack.watcher.transform.search.ExecutableSearchTransform; import org.elasticsearch.xpack.watcher.transform.search.SearchTransform; import org.elasticsearch.xpack.watcher.transform.search.SearchTransformFactory; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; @@ -74,7 +74,7 @@ import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.parseDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.parseDate; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.EMPTY_PAYLOAD; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.getRandomSupportedSearchType; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java index 59e2468b866..2fe06fa1295 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java @@ -30,8 +30,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.slackAction import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/WatchAckIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/WatchAckIT.java index 77774111be4..ca81cbf1d5b 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/WatchAckIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/WatchAckIT.java @@ -46,8 +46,8 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compar import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.matchAllRequest; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.searchTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpContentType.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpContentType.java index 5ab4c09c02c..9fb972f3834 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpContentType.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpContentType.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentType; import java.io.IOException; import java.util.Locale; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** */ diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java index 8bc7e446796..afc640217a6 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.support.RestUtils; import org.elasticsearch.xpack.common.http.auth.HttpAuthRegistry; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.WatcherUtils; import org.elasticsearch.xpack.common.http.auth.HttpAuth; @@ -272,14 +272,14 @@ public class HttpRequest implements ToXContent { builder.auth(httpAuthRegistry.parse(parser)); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.CONNECTION_TIMEOUT)) { try { - builder.connectionTimeout(WatcherDateTimeUtils.parseTimeValue(parser, Field.CONNECTION_TIMEOUT.toString())); + builder.connectionTimeout(DateTimeUtils.parseTimeValue(parser, Field.CONNECTION_TIMEOUT.toString())); } catch (ElasticsearchParseException pe) { throw new ElasticsearchParseException("could not parse http request. invalid time value for [{}] field", pe, currentFieldName); } } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.READ_TIMEOUT)) { try { - builder.readTimeout(WatcherDateTimeUtils.parseTimeValue(parser, Field.READ_TIMEOUT.toString())); + builder.readTimeout(DateTimeUtils.parseTimeValue(parser, Field.READ_TIMEOUT.toString())); } catch (ElasticsearchParseException pe) { throw new ElasticsearchParseException("could not parse http request. invalid time value for [{}] field", pe, currentFieldName); diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java index a97aec967c2..01d09fc78a6 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.support.RestUtils; import org.elasticsearch.xpack.common.http.auth.HttpAuth; import org.elasticsearch.xpack.common.http.auth.HttpAuthRegistry; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.common.text.TextTemplate; import org.elasticsearch.xpack.common.text.TextTemplateEngine; import org.jboss.netty.handler.codec.http.HttpHeaders; @@ -283,7 +283,7 @@ public class HttpRequestTemplate implements ToXContent { builder.fromUrl(parser.text()); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, HttpRequest.Field.CONNECTION_TIMEOUT)) { try { - builder.connectionTimeout(WatcherDateTimeUtils.parseTimeValue(parser, + builder.connectionTimeout(DateTimeUtils.parseTimeValue(parser, HttpRequest.Field.CONNECTION_TIMEOUT.toString())); } catch (ElasticsearchParseException pe) { throw new ElasticsearchParseException("could not parse http request template. invalid time value for [{}] field", @@ -291,7 +291,7 @@ public class HttpRequestTemplate implements ToXContent { } } else if (ParseFieldMatcher.STRICT.match(currentFieldName, HttpRequest.Field.READ_TIMEOUT)) { try { - builder.readTimeout(WatcherDateTimeUtils.parseTimeValue(parser, HttpRequest.Field.READ_TIMEOUT.toString())); + builder.readTimeout(DateTimeUtils.parseTimeValue(parser, HttpRequest.Field.READ_TIMEOUT.toString())); } catch (ElasticsearchParseException pe) { throw new ElasticsearchParseException("could not parse http request template. invalid time value for [{}] field", pe, currentFieldName); diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/auth/HttpAuthRegistry.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/auth/HttpAuthRegistry.java index da461ba9aa6..5b12457d117 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/auth/HttpAuthRegistry.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/auth/HttpAuthRegistry.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import java.io.IOException; import java.util.Map; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** * diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/DataAttachment.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/DataAttachment.java index a3c1d1a6619..be3909ea4ad 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/DataAttachment.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/DataAttachment.java @@ -18,7 +18,7 @@ import java.io.IOException; import java.util.Locale; import java.util.Map; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtils.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/DateTimeUtils.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtils.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/DateTimeUtils.java index 6c0d1a12e29..563efb00bbf 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtils.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/DateTimeUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.support; +package org.elasticsearch.xpack.support; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.io.stream.StreamInput; @@ -23,12 +23,12 @@ import java.util.concurrent.Callable; /** * */ -public class WatcherDateTimeUtils { +public class DateTimeUtils { public static final FormatDateTimeFormatter dateTimeFormatter = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER; public static final DateMathParser dateMathParser = new DateMathParser(dateTimeFormatter); - private WatcherDateTimeUtils() { + private DateTimeUtils() { } public static DateTime convertToDate(Object value, Clock clock) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Exceptions.java similarity index 97% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Exceptions.java index 6ec41119413..f130ce49d29 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Exceptions.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.support; +package org.elasticsearch.xpack.support; import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.script.GeneralScriptException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Strings.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Strings.java similarity index 94% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Strings.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Strings.java index b55ae3298a1..b36f6dd03cf 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Strings.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/support/Strings.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.support; +package org.elasticsearch.xpack.support; import java.util.Objects; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/AbstractTriggerEngine.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/AbstractTriggerEngine.java similarity index 94% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/AbstractTriggerEngine.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/AbstractTriggerEngine.java index 27eafe415e2..0e75044c8c7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/AbstractTriggerEngine.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/AbstractTriggerEngine.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Settings; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/Trigger.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/Trigger.java similarity index 93% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/Trigger.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/Trigger.java index eb3124cddc8..ca18f5d773c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/Trigger.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/Trigger.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentParser; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerBuilders.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerBuilders.java similarity index 71% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerBuilders.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerBuilders.java index b8fd5dfb17c..8c2529bb590 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerBuilders.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerBuilders.java @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.Schedule; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEngine.java similarity index 89% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEngine.java index 24d192f90d6..102d65887b6 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEngine.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.xcontent.XContentParser; @@ -43,7 +43,7 @@ public interface TriggerEngine { T parseTrigger(String context, XContentParser parser) throws IOException; - E parseTriggerEvent(TriggerService service, String watchId, String context, XContentParser parser) throws IOException; + E parseTriggerEvent(TriggerService service, String id, String context, XContentParser parser) throws IOException; interface Listener { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEvent.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEvent.java similarity index 90% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEvent.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEvent.java index 85c5ce6473f..28c87ee2e9b 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEvent.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerEvent.java @@ -3,12 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.joda.time.DateTime; import java.io.IOException; @@ -58,7 +58,7 @@ public abstract class TriggerEvent implements ToXContent { public void recordXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(Field.TYPE.getPreferredName(), type()); - WatcherDateTimeUtils.writeDate(Field.TRIGGERED_TIME.getPreferredName(), builder, triggeredTime); + DateTimeUtils.writeDate(Field.TRIGGERED_TIME.getPreferredName(), builder, triggeredTime); recordDataXContent(builder, params); builder.endObject(); } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerModule.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerModule.java similarity index 87% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerModule.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerModule.java index 236ba0a1b37..2c7d3321890 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerModule.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerModule.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.inject.multibindings.Multibinder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleModule; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.ScheduleModule; import java.util.HashSet; import java.util.Set; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerService.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerService.java index 92ca3dce3f2..0fb23502800 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/TriggerService.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.component.AbstractComponent; @@ -20,7 +20,7 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTrigger.java similarity index 92% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTrigger.java index 68efc970975..336b4f5163a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTrigger.java @@ -3,12 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.manual; +package org.elasticsearch.xpack.trigger.manual; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.xpack.watcher.trigger.Trigger; +import org.elasticsearch.xpack.trigger.Trigger; import java.io.IOException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTriggerEngine.java similarity index 84% rename from elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java rename to elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTriggerEngine.java index 5773f3a3ea7..88f5a26f4ba 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/trigger/manual/ManualTriggerEngine.java @@ -3,19 +3,19 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.manual; +package org.elasticsearch.xpack.trigger.manual; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerService; import java.io.IOException; import java.util.Collection; import java.util.Map; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** */ @@ -79,8 +79,8 @@ public class ManualTriggerEngine implements TriggerEngine { @@ -71,9 +71,9 @@ public class ExecutableIndexAction extends ExecutableAction { if (!(data instanceof HashMap)) { data = new HashMap<>(data); // ensuring mutability } - data.put(action.executionTimeField, WatcherDateTimeUtils.formatDate(ctx.executionTime())); + data.put(action.executionTimeField, DateTimeUtils.formatDate(ctx.executionTime())); } else { - indexRequest.timestamp(WatcherDateTimeUtils.formatDate(ctx.executionTime())); + indexRequest.timestamp(DateTimeUtils.formatDate(ctx.executionTime())); } indexRequest.source(jsonBuilder().prettyPrint().map(data)); @@ -104,9 +104,9 @@ public class ExecutableIndexAction extends ExecutableAction { if (!(doc instanceof HashMap)) { doc = new HashMap<>(doc); // ensuring mutability } - doc.put(action.executionTimeField, WatcherDateTimeUtils.formatDate(ctx.executionTime())); + doc.put(action.executionTimeField, DateTimeUtils.formatDate(ctx.executionTime())); } else { - indexRequest.timestamp(WatcherDateTimeUtils.formatDate(ctx.executionTime())); + indexRequest.timestamp(DateTimeUtils.formatDate(ctx.executionTime())); } indexRequest.source(jsonBuilder().prettyPrint().map(doc)); bulkRequest.add(indexRequest); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java index df402b63c6e..58c3fb6195b 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.actions.Action; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.joda.time.DateTimeZone; @@ -129,7 +129,7 @@ public class IndexAction implements Action { } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.EXECUTION_TIME_FIELD)) { executionTimeField = parser.text(); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.TIMEOUT)) { - timeout = WatcherDateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); + timeout = DateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.DYNAMIC_NAME_TIMEZONE)) { if (token == XContentParser.Token.VALUE_STRING) { dynamicNameTimeZone = DateTimeZone.forID(parser.text()); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottler.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottler.java index bb78e8ec111..29df5177f42 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottler.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottler.java @@ -9,7 +9,7 @@ import org.elasticsearch.xpack.watcher.actions.ActionStatus; import org.elasticsearch.xpack.watcher.actions.ActionStatus.AckStatus; import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.formatDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.formatDate; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java index f2e7758383e..283e0e4d512 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java @@ -19,10 +19,10 @@ import org.elasticsearch.xpack.watcher.condition.Condition; import org.elasticsearch.xpack.watcher.condition.always.AlwaysCondition; import org.elasticsearch.xpack.watcher.input.Input; import org.elasticsearch.xpack.watcher.input.none.NoneInput; -import org.elasticsearch.xpack.watcher.support.Exceptions; +import org.elasticsearch.xpack.support.Exceptions; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.transform.Transform; -import org.elasticsearch.xpack.watcher.trigger.Trigger; +import org.elasticsearch.xpack.trigger.Trigger; import org.elasticsearch.xpack.watcher.watch.Watch; import java.io.IOException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/AbstractExecutableCompareCondition.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/AbstractExecutableCompareCondition.java index 6cf82fc55bf..8db4918c4b5 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/AbstractExecutableCompareCondition.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/AbstractExecutableCompareCondition.java @@ -10,7 +10,7 @@ import org.elasticsearch.xpack.watcher.condition.Condition; import org.elasticsearch.xpack.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.watcher.support.Variables; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.support.clock.Clock; import org.elasticsearch.xpack.watcher.support.xcontent.ObjectPath; import org.joda.time.DateTime; @@ -55,8 +55,8 @@ public abstract class AbstractExecutableCompareCondition { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionModule.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionModule.java index 7a9c70113e4..9caccd968cb 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionModule.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionModule.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.watcher.execution; import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerEngine; /** */ diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java index c885773f0d6..2cc2465456c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java @@ -21,7 +21,7 @@ import org.elasticsearch.xpack.watcher.input.Input; import org.elasticsearch.xpack.support.clock.Clock; import org.elasticsearch.xpack.watcher.support.validation.WatcherSettingsValidation; import org.elasticsearch.xpack.watcher.transform.Transform; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchLockService; import org.elasticsearch.xpack.watcher.watch.WatchStore; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionContext.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionContext.java index d424c4e105f..f4c0dc77ce7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionContext.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionContext.java @@ -10,7 +10,7 @@ import org.elasticsearch.xpack.watcher.actions.Action; import org.elasticsearch.xpack.watcher.actions.ActionWrapper; import org.elasticsearch.xpack.watcher.condition.Condition; import org.elasticsearch.xpack.watcher.input.Input; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEvent; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/SyncTriggerListener.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/SyncTriggerListener.java index 36c28fc142e..31aced50c13 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/SyncTriggerListener.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/SyncTriggerListener.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerService; import java.util.stream.StreamSupport; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredExecutionContext.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredExecutionContext.java index b3d7ee82030..3bfc0b2b484 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredExecutionContext.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredExecutionContext.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.watcher.execution; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java index 715735dfa7b..c23427a684c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerService; import java.io.IOException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java index 5a4f6dd15bd..6dcf8d7dda1 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java @@ -38,8 +38,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalState; -import static org.elasticsearch.xpack.watcher.support.Exceptions.ioException; +import static org.elasticsearch.xpack.support.Exceptions.illegalState; +import static org.elasticsearch.xpack.support.Exceptions.ioException; public class TriggeredWatchStore extends AbstractComponent { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionContext.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionContext.java index 350056316c1..1bea6c187d1 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionContext.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionContext.java @@ -13,7 +13,7 @@ import org.elasticsearch.xpack.watcher.condition.Condition; import org.elasticsearch.xpack.watcher.history.WatchRecord; import org.elasticsearch.xpack.watcher.input.Input; import org.elasticsearch.xpack.watcher.transform.Transform; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java index dc1abe0a297..62ffdd8cbe9 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.xpack.watcher.actions.ExecutableActions; import org.elasticsearch.xpack.watcher.condition.Condition; import org.elasticsearch.xpack.watcher.input.Input; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.transform.Transform; import org.joda.time.DateTime; @@ -73,7 +73,7 @@ public class WatchExecutionResult implements ToXContent { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - WatcherDateTimeUtils.writeDate(Field.EXECUTION_TIME.getPreferredName(), builder, executionTime); + DateTimeUtils.writeDate(Field.EXECUTION_TIME.getPreferredName(), builder, executionTime); builder.field(Field.EXECUTION_DURATION.getPreferredName(), executionDurationMs); if (inputResult != null) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/Wid.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/Wid.java index 9ccedf58014..043f37d2ca5 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/Wid.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/Wid.java @@ -9,7 +9,7 @@ import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java index 72ac3d09f88..a27791f5da8 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.engine.VersionConflictEngineException; -import org.elasticsearch.xpack.watcher.WatcherModule; import org.elasticsearch.xpack.watcher.execution.ExecutionState; import org.elasticsearch.xpack.watcher.support.WatcherIndexTemplateRegistry; import org.elasticsearch.xpack.watcher.support.init.proxy.WatcherClientProxy; @@ -26,7 +25,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import static org.elasticsearch.xpack.watcher.support.Exceptions.ioException; +import static org.elasticsearch.xpack.support.Exceptions.ioException; /** */ diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java index bf8bdd57e57..ec66492f253 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java @@ -17,7 +17,7 @@ import org.elasticsearch.xpack.watcher.execution.WatchExecutionResult; import org.elasticsearch.xpack.watcher.execution.Wid; import org.elasticsearch.xpack.watcher.input.ExecutableInput; import org.elasticsearch.xpack.watcher.support.xcontent.WatcherParams; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import java.io.IOException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java index 71e9fff136e..0081ed344eb 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java @@ -18,7 +18,7 @@ import org.elasticsearch.search.aggregations.AggregatorParsers; import org.elasticsearch.search.suggest.Suggesters; import org.elasticsearch.xpack.watcher.input.Input; import org.elasticsearch.xpack.watcher.support.SearchRequestEquivalence; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.WatcherUtils; import org.elasticsearch.xpack.watcher.watch.Payload; import org.joda.time.DateTimeZone; @@ -149,7 +149,7 @@ public class SearchInput implements Input { watchId, currentFieldName); } } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.TIMEOUT)) { - timeout = WatcherDateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); + timeout = DateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.DYNAMIC_NAME_TIMEZONE)) { if (token == XContentParser.Token.VALUE_STRING) { dynamicNameTimeZone = DateTimeZone.forID(parser.text()); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java index 770ab071d9f..b1cd0aee7dd 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java @@ -28,7 +28,7 @@ import org.elasticsearch.xpack.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRequestBuilder; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.TriggerService; import java.io.IOException; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/SearchRequestEquivalence.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/SearchRequestEquivalence.java index 9b7a76a3356..8a029790be5 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/SearchRequestEquivalence.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/SearchRequestEquivalence.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import java.util.Arrays; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalState; +import static org.elasticsearch.xpack.support.Exceptions.illegalState; /** diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherUtils.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherUtils.java index 5d895c0a45c..477f0be2f0b 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherUtils.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherUtils.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.watcher.support; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.formatDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.formatDate; import java.io.IOException; import java.lang.reflect.Array; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/validation/WatcherSettingsValidation.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/validation/WatcherSettingsValidation.java index f87eb233891..0e0397a8468 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/validation/WatcherSettingsValidation.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/validation/WatcherSettingsValidation.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.LoggerMessageFormat; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.xpack.watcher.support.Exceptions; +import org.elasticsearch.xpack.support.Exceptions; import java.util.ArrayList; import java.util.List; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ExecutableScriptTransform.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ExecutableScriptTransform.java index 11a289e0560..e4d2f71ded7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ExecutableScriptTransform.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ExecutableScriptTransform.java @@ -18,7 +18,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.xpack.watcher.support.Exceptions.invalidScript; +import static org.elasticsearch.xpack.support.Exceptions.invalidScript; import static org.elasticsearch.xpack.watcher.support.Variables.createCtxModel; /** diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java index 1acfdf239e9..ee4dc64c3a8 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java @@ -17,7 +17,7 @@ import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.search.aggregations.AggregatorParsers; import org.elasticsearch.search.suggest.Suggesters; import org.elasticsearch.xpack.watcher.support.SearchRequestEquivalence; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.WatcherUtils; import org.elasticsearch.xpack.watcher.transform.Transform; import org.elasticsearch.xpack.watcher.watch.Payload; @@ -115,7 +115,7 @@ public class SearchTransform implements Transform { TYPE, watchId, currentFieldName); } } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.TIMEOUT)) { - timeout = WatcherDateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); + timeout = DateTimeUtils.parseTimeValue(parser, Field.TIMEOUT.toString()); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.DYNAMIC_NAME_TIMEZONE)) { if (token == XContentParser.Token.VALUE_STRING) { dynamicNameTimeZone = DateTimeZone.forID(parser.text()); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequest.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequest.java index 478c0996914..666c48f828a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequest.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequest.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.xpack.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.watcher.execution.ActionExecutionMode; import org.elasticsearch.xpack.watcher.support.validation.Validation; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import java.io.IOException; import java.util.HashMap; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java index 3ccea8ab05a..5d2ab31ebd2 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.xpack.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.watcher.execution.ActionExecutionMode; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; import java.io.IOException; import java.util.Map; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/TransportExecuteWatchAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/TransportExecuteWatchAction.java index 705f07b885c..2e2c51a3566 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/TransportExecuteWatchAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/execute/TransportExecuteWatchAction.java @@ -30,9 +30,9 @@ import org.elasticsearch.xpack.watcher.WatcherLicensee; import org.elasticsearch.xpack.support.clock.Clock; import org.elasticsearch.xpack.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.transport.actions.WatcherTransportAction; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStore; @@ -41,7 +41,7 @@ import org.joda.time.DateTimeZone; import java.util.Map; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; /** * Performs the watch execution operation. diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java index 9b77e34f4a8..7dd219462c2 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java @@ -30,7 +30,7 @@ import org.elasticsearch.xpack.watcher.condition.always.ExecutableAlwaysConditio import org.elasticsearch.xpack.watcher.input.ExecutableInput; import org.elasticsearch.xpack.watcher.input.InputRegistry; import org.elasticsearch.xpack.watcher.input.none.ExecutableNoneInput; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.support.clock.Clock; import org.elasticsearch.xpack.support.clock.HaltedClock; import org.elasticsearch.xpack.common.secret.SecretService; @@ -38,9 +38,9 @@ import org.elasticsearch.xpack.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.support.xcontent.WatcherXContentParser; import org.elasticsearch.xpack.watcher.transform.ExecutableTransform; import org.elasticsearch.xpack.watcher.transform.TransformRegistry; -import org.elasticsearch.xpack.watcher.trigger.Trigger; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.Trigger; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerService; import org.joda.time.DateTime; import org.joda.time.PeriodType; @@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicLong; import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.XContentHelper.createParser; -import static org.elasticsearch.xpack.watcher.support.Exceptions.ioException; +import static org.elasticsearch.xpack.support.Exceptions.ioException; public class Watch implements TriggerEngine.Job, ToXContent { @@ -310,7 +310,7 @@ public class Watch implements TriggerEngine.Job, ToXContent { transform = transformRegistry.parse(id, parser); } else if (ParseFieldMatcher.STRICT.match(currentFieldName, Field.THROTTLE_PERIOD)) { try { - throttlePeriod = WatcherDateTimeUtils.parseTimeValue(parser, Field.THROTTLE_PERIOD.toString()); + throttlePeriod = DateTimeUtils.parseTimeValue(parser, Field.THROTTLE_PERIOD.toString()); } catch (ElasticsearchParseException pe) { throw new ElasticsearchParseException("could not parse watch [{}]. failed to parse time value for field [{}]", pe, id, currentFieldName); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchLockService.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchLockService.java index 2aa1f9edc8b..565d94e911a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchLockService.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchLockService.java @@ -16,7 +16,7 @@ import org.joda.time.PeriodType; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalState; +import static org.elasticsearch.xpack.support.Exceptions.illegalState; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java index 8fb570b4290..506f3369d47 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java @@ -30,11 +30,11 @@ import java.util.Map; import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.parseDate; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.readDate; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.readOptionalDate; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.writeDate; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.writeOptionalDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.parseDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.readDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.readOptionalDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.writeDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.writeOptionalDate; /** * diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStore.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStore.java index 5b91661cf94..7bbe0e38dd5 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStore.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStore.java @@ -40,7 +40,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalState; +import static org.elasticsearch.xpack.support.Exceptions.illegalState; /** */ diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/HistoryIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/HistoryIntegrationTests.java index 8d13982b6d7..ec82cdaaba9 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/HistoryIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/HistoryIntegrationTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.xpack.watcher.client.WatchSourceBuilders; import org.elasticsearch.xpack.watcher.input.InputBuilders; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerBuilders; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedules; +import org.elasticsearch.xpack.trigger.TriggerBuilders; +import org.elasticsearch.xpack.trigger.schedule.Schedules; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/ScheduleTriggerEngineMock.java similarity index 87% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/ScheduleTriggerEngineMock.java index 16a87d205bb..f6f27e29c4f 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/ScheduleTriggerEngineMock.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger; +package org.elasticsearch.xpack.trigger; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.ESLogger; @@ -13,10 +13,10 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.xpack.support.clock.Clock; import org.elasticsearch.xpack.support.clock.ClockMock; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -48,9 +48,9 @@ public class ScheduleTriggerEngineMock extends ScheduleTriggerEngine { } @Override - public ScheduleTriggerEvent parseTriggerEvent(TriggerService service, String watchId, String context, + public ScheduleTriggerEvent parseTriggerEvent(TriggerService service, String id, String context, XContentParser parser) throws IOException { - return ScheduleTriggerEvent.parse(parser, watchId, context, clock); + return ScheduleTriggerEvent.parse(parser, id, context, clock); } @Override diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/CronScheduleTests.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/CronScheduleTests.java index c029f7052b0..707a0b1df79 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/CronScheduleTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/DailyScheduleTests.java similarity index 97% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/DailyScheduleTests.java index 18d6ee385f6..6c4e0ae68ac 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/DailyScheduleTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; +import org.elasticsearch.xpack.trigger.schedule.support.DayTimes; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Strings.join; +import static org.elasticsearch.xpack.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.containsString; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/HourlyScheduleTests.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/HourlyScheduleTests.java index 6602729b3f5..237db7dd57c 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/HourlyScheduleTests.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.watcher.support.Strings; +import org.elasticsearch.xpack.support.Strings; import java.util.Arrays; import java.util.stream.Collectors; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/IntervalScheduleTests.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/IntervalScheduleTests.java index dec68cf1101..4c4096cbc2a 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/IntervalScheduleTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/MonthlyScheduleTests.java similarity index 96% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/MonthlyScheduleTests.java index c361a5a7d28..400f7455cb0 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/MonthlyScheduleTests.java @@ -3,18 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; +import org.elasticsearch.xpack.trigger.schedule.support.DayTimes; +import org.elasticsearch.xpack.trigger.schedule.support.MonthTimes; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Strings.join; +import static org.elasticsearch.xpack.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.hasItemInArray; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleRegistryTests.java similarity index 98% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleRegistryTests.java index 6bdb46868ea..affc55dad96 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleRegistryTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.common.bytes.BytesReference; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTestCase.java similarity index 85% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTestCase.java index d9a8e9bad07..868f1f2a5b8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTestCase.java @@ -3,29 +3,26 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.Month; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.YearTimes; +import org.elasticsearch.xpack.trigger.schedule.support.DayOfWeek; +import org.elasticsearch.xpack.trigger.schedule.support.DayTimes; +import org.elasticsearch.xpack.trigger.schedule.support.Month; +import org.elasticsearch.xpack.trigger.schedule.support.MonthTimes; +import org.elasticsearch.xpack.trigger.schedule.support.WeekTimes; +import org.elasticsearch.xpack.trigger.schedule.support.YearTimes; import java.io.IOException; import java.util.EnumSet; import java.util.HashSet; import java.util.Set; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.daily; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.hourly; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.monthly; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.weekly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.hourly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; /** * @@ -46,44 +43,44 @@ public abstract class ScheduleTestCase extends ESTestCase { protected static MonthlySchedule randomMonthlySchedule() { switch (randomIntBetween(1, 4)) { - case 1: return monthly().build(); - case 2: return monthly().time(MonthTimes.builder().atMidnight()).build(); - case 3: return monthly().time(MonthTimes.builder().on(randomIntBetween(1, 31)).atMidnight()).build(); + case 1: return Schedules.monthly().build(); + case 2: return Schedules.monthly().time(MonthTimes.builder().atMidnight()).build(); + case 3: return Schedules.monthly().time(MonthTimes.builder().on(randomIntBetween(1, 31)).atMidnight()).build(); default: return new MonthlySchedule(validMonthTimes()); } } protected static WeeklySchedule randomWeeklySchedule() { switch (randomIntBetween(1, 4)) { - case 1: return weekly().build(); - case 2: return weekly().time(WeekTimes.builder().atMidnight()).build(); - case 3: return weekly().time(WeekTimes.builder().on(DayOfWeek.THURSDAY).atMidnight()).build(); + case 1: return Schedules.weekly().build(); + case 2: return Schedules.weekly().time(WeekTimes.builder().atMidnight()).build(); + case 3: return Schedules.weekly().time(WeekTimes.builder().on(DayOfWeek.THURSDAY).atMidnight()).build(); default: return new WeeklySchedule(validWeekTimes()); } } protected static DailySchedule randomDailySchedule() { switch (randomIntBetween(1, 4)) { - case 1: return daily().build(); - case 2: return daily().atMidnight().build(); - case 3: return daily().atNoon().build(); + case 1: return Schedules.daily().build(); + case 2: return Schedules.daily().atMidnight().build(); + case 3: return Schedules.daily().atNoon().build(); default: return new DailySchedule(validDayTimes()); } } protected static HourlySchedule randomHourlySchedule() { switch (randomIntBetween(1, 4)) { - case 1: return hourly().build(); - case 2: return hourly().minutes(randomIntBetween(0, 59)).build(); - case 3: return hourly(randomIntBetween(0, 59)); - default: return hourly().minutes(validMinutes()).build(); + case 1: return Schedules.hourly().build(); + case 2: return Schedules.hourly().minutes(randomIntBetween(0, 59)).build(); + case 3: return Schedules.hourly(randomIntBetween(0, 59)); + default: return Schedules.hourly().minutes(validMinutes()).build(); } } protected static IntervalSchedule randomIntervalSchedule() { switch (randomIntBetween(1, 3)) { - case 1: return interval(randomInterval().toString()); - case 2: return interval(randomIntBetween(1, 100), randomIntervalUnit()); + case 1: return Schedules.interval(randomInterval().toString()); + case 2: return Schedules.interval(randomIntBetween(1, 100), randomIntervalUnit()); default: return new IntervalSchedule(randomInterval()); } } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTriggerEventTests.java similarity index 96% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTriggerEventTests.java index cb0247a3d70..9d21fc0dcfe 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/ScheduleTriggerEventTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.common.xcontent.XContentBuilder; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/WeeklyScheduleTests.java similarity index 94% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/WeeklyScheduleTests.java index f0033de7725..4631c03c728 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/WeeklyScheduleTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; @@ -12,12 +12,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; +import org.elasticsearch.xpack.trigger.schedule.support.DayOfWeek; +import org.elasticsearch.xpack.trigger.schedule.support.DayTimes; +import org.elasticsearch.xpack.trigger.schedule.support.WeekTimes; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Strings.join; +import static org.elasticsearch.xpack.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.contains; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/YearlyScheduleTests.java similarity index 96% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/YearlyScheduleTests.java index d230e1122ac..3c8c9593ece 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/YearlyScheduleTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule; +package org.elasticsearch.xpack.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; @@ -12,11 +12,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.YearTimes; +import org.elasticsearch.xpack.trigger.schedule.support.DayTimes; +import org.elasticsearch.xpack.trigger.schedule.support.YearTimes; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Strings.join; +import static org.elasticsearch.xpack.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.hasItemInArray; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/BaseTriggerEngineTestCase.java similarity index 88% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/BaseTriggerEngineTestCase.java index 5d5040a7fda..a4fb4f988c8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/BaseTriggerEngineTestCase.java @@ -3,17 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule.engine; +package org.elasticsearch.xpack.trigger.schedule.engine; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.support.clock.SystemClock; -import org.elasticsearch.xpack.watcher.trigger.Trigger; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; +import org.elasticsearch.xpack.trigger.Trigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.Schedules; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.Schedule; +import org.elasticsearch.xpack.trigger.schedule.support.DayOfWeek; +import org.elasticsearch.xpack.trigger.schedule.support.WeekTimes; import org.joda.time.DateTime; import org.junit.After; import org.junit.Before; @@ -25,10 +26,8 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.daily; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.hourly; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.weekly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.hourly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.joda.time.DateTimeZone.UTC; @@ -52,7 +51,7 @@ public abstract class BaseTriggerEngineTestCase extends ESTestCase { final CountDownLatch latch = new CountDownLatch(count); List jobs = new ArrayList<>(); for (int i = 0; i < count; i++) { - jobs.add(new SimpleJob(String.valueOf(i), interval("1s"))); + jobs.add(new SimpleJob(String.valueOf(i), Schedules.interval("1s"))); } final BitSet bits = new BitSet(count); engine.register(new TriggerEngine.Listener() { @@ -104,7 +103,7 @@ public abstract class BaseTriggerEngineTestCase extends ESTestCase { int minute = minOfHour.value; logger.info("scheduling hourly job [{}]", minute); logger.info("current date [{}]", now); - engine.add(new SimpleJob(name, hourly(minute))); + engine.add(new SimpleJob(name, Schedules.hourly(minute))); long secondsToWait = now.getSecondOfMinute() < 29 ? 62 - now.getSecondOfMinute() : 122 - now.getSecondOfMinute(); logger.info("waiting at least [{}] seconds for response", secondsToWait); if (!latch.await(secondsToWait, TimeUnit.SECONDS)) { @@ -138,7 +137,7 @@ public abstract class BaseTriggerEngineTestCase extends ESTestCase { int hour = hourOfDay.value; logger.info("scheduling hourly job [{}:{}]", hour, minute); logger.info("current date [{}]", now); - engine.add(new SimpleJob(name, daily().at(hour, minute).build())); + engine.add(new SimpleJob(name, Schedules.daily().at(hour, minute).build())); // 30 sec is the default idle time for the scheduler long secondsToWait = now.getSecondOfMinute() < 29 ? 62 - now.getSecondOfMinute() : 122 - now.getSecondOfMinute(); logger.info("waiting at least [{}] seconds for response", secondsToWait); @@ -175,7 +174,7 @@ public abstract class BaseTriggerEngineTestCase extends ESTestCase { DayOfWeek day = dayOfWeek.day(); logger.info("scheduling hourly job [{} {}:{}]", day, hour, minute); logger.info("current date [{}]", now); - engine.add(new SimpleJob(name, weekly().time(WeekTimes.builder().on(day).at(hour, minute).build()).build())); + engine.add(new SimpleJob(name, Schedules.weekly().time(WeekTimes.builder().on(day).at(hour, minute).build()).build())); // 30 sec is the default idle time for the scheduler long secondsToWait = now.getSecondOfMinute() < 29 ? 62 - now.getSecondOfMinute() : 122 - now.getSecondOfMinute(); logger.info("waiting at least [{}] seconds for response", secondsToWait); @@ -196,7 +195,7 @@ public abstract class BaseTriggerEngineTestCase extends ESTestCase { int times = scaledRandomIntBetween(3, 30); for (int i = 0; i < times; i++) { - engine.add(new SimpleJob("_id", interval("10s"))); + engine.add(new SimpleJob("_id", Schedules.interval("10s"))); } } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/SchedulerScheduleEngineTests.java similarity index 80% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/SchedulerScheduleEngineTests.java index cdb7a9d0598..e8759263426 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/SchedulerScheduleEngineTests.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule.engine; +package org.elasticsearch.xpack.trigger.schedule.engine; import org.apache.lucene.util.LuceneTestCase.BadApple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.support.clock.SystemClock; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.ScheduleRegistry; import static org.mockito.Mockito.mock; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/TickerScheduleEngineTests.java similarity index 80% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/TickerScheduleEngineTests.java index 883e41600d6..c28bf098ed0 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/engine/TickerScheduleEngineTests.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule.engine; +package org.elasticsearch.xpack.trigger.schedule.engine; import org.apache.lucene.util.LuceneTestCase.BadApple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.support.clock.SystemClock; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.TriggerEngine; import static org.mockito.Mockito.mock; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/CronEvalToolTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/CronEvalToolTests.java similarity index 93% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/CronEvalToolTests.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/CronEvalToolTests.java index 22388424948..0aa1af20be2 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/CronEvalToolTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/CronEvalToolTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule.tool; +package org.elasticsearch.xpack.trigger.schedule.tool; import org.elasticsearch.cli.Command; import org.elasticsearch.cli.CommandTestCase; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/EvalCron.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/EvalCron.java similarity index 89% rename from elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/EvalCron.java rename to elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/EvalCron.java index 8d945304116..10d96e267a8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/EvalCron.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/trigger/schedule/tool/EvalCron.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.watcher.trigger.schedule.tool; +package org.elasticsearch.xpack.trigger.schedule.tool; import org.elasticsearch.cli.Terminal; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java index 998dffda5a3..f74933fb468 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.xpack.watcher.execution.ExecutionService; import org.elasticsearch.xpack.watcher.support.WatcherIndexTemplateRegistry; import org.elasticsearch.xpack.support.clock.ClockMock; import org.elasticsearch.xpack.support.clock.SystemClock; -import org.elasticsearch.xpack.watcher.trigger.Trigger; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.Trigger; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerService; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchLockService; import org.elasticsearch.xpack.watcher.watch.WatchStatus; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java index d62df74f188..241b51a348a 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java @@ -28,8 +28,8 @@ import java.util.List; import static org.elasticsearch.index.query.QueryBuilders.termsQuery; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; /** diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java index 8bc312df0e9..474c8f6b2e9 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java @@ -27,8 +27,8 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compar import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.matchAllRequest; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.searchTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java index 242675561d5..8deeae53060 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java @@ -26,7 +26,7 @@ import org.elasticsearch.xpack.watcher.condition.compare.CompareCondition; import org.elasticsearch.xpack.common.http.HttpRequestTemplate; import org.elasticsearch.xpack.common.http.Scheme; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; import org.junit.After; import org.junit.Before; @@ -52,8 +52,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.newInputSearchRequest; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionIntegrationTests.java index 4bbae26cc62..1077d8ff531 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionIntegrationTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.xpack.watcher.history.HistoryStore; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -30,8 +30,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; @@ -65,10 +65,10 @@ public class IndexActionIntegrationTests extends AbstractWatcherIntegrationTestC assertThat(searchResponse.getHits().totalHits(), is(1L)); SearchHit hit = searchResponse.getHits().getAt(0); if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -101,10 +101,10 @@ public class IndexActionIntegrationTests extends AbstractWatcherIntegrationTestC assertThat(searchResponse.getHits().totalHits(), is(1L)); SearchHit hit = searchResponse.getHits().getAt(0); if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -192,10 +192,10 @@ public class IndexActionIntegrationTests extends AbstractWatcherIntegrationTestC int i = 0; for (SearchHit hit : searchResponse.getHits()) { if (timeWarped()) { - assertThat(hit.getSource(), hasEntry("@timestamp", (Object) WatcherDateTimeUtils.formatDate(now))); + assertThat(hit.getSource(), hasEntry("@timestamp", (Object) DateTimeUtils.formatDate(now))); } else { assertThat(hit.getSource(), hasKey("@timestamp")); - DateTime timestamp = WatcherDateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); + DateTime timestamp = DateTimeUtils.parseDate((String) hit.getSource().get("@timestamp")); assertThat(timestamp.isEqual(now) || timestamp.isAfter(now), is(true)); } assertThat(hit.getSource(), hasEntry("key", (Object) key.getMillis())); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java index 39dc979a77e..e8379cce4c3 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.watcher.actions.Action; import org.elasticsearch.xpack.watcher.actions.Action.Result.Status; import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.init.proxy.WatcherClientProxy; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; @@ -104,7 +104,7 @@ public class IndexActionTests extends ESIntegTestCase { if (customTimestampField) { assertThat(hit.getSource().size(), is(2)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); - assertThat(hit.getSource(), hasEntry(timestampField, (Object) WatcherDateTimeUtils.formatDate(executionTime))); + assertThat(hit.getSource(), hasEntry(timestampField, (Object) DateTimeUtils.formatDate(executionTime))); } else { assertThat(hit.getSource().size(), is(1)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -168,7 +168,7 @@ public class IndexActionTests extends ESIntegTestCase { if (customTimestampField) { assertThat(hit.getSource().size(), is(2)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); - assertThat(hit.getSource(), hasEntry(timestampField, (Object) WatcherDateTimeUtils.formatDate(executionTime))); + assertThat(hit.getSource(), hasEntry(timestampField, (Object) DateTimeUtils.formatDate(executionTime))); } else { assertThat(hit.getSource().size(), is(1)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar")); @@ -177,7 +177,7 @@ public class IndexActionTests extends ESIntegTestCase { if (customTimestampField) { assertThat(hit.getSource().size(), is(2)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar1")); - assertThat(hit.getSource(), hasEntry(timestampField, (Object) WatcherDateTimeUtils.formatDate(executionTime))); + assertThat(hit.getSource(), hasEntry(timestampField, (Object) DateTimeUtils.formatDate(executionTime))); } else { assertThat(hit.getSource().size(), is(1)); assertThat(hit.getSource(), hasEntry("foo", (Object) "bar1")); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottlerTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottlerTests.java index 462c906e0db..94ec1028cc5 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottlerTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/AckThrottlerTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; import org.joda.time.DateTime; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.formatDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.formatDate; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.EMPTY_PAYLOAD; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.CoreMatchers.nullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java index 84b6d2ac058..1363a44b0fe 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java @@ -27,10 +27,10 @@ import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRes import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.notification.email.EmailTemplate; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -44,8 +44,8 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.webhookAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java index b215214efdb..e5dbee127eb 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java @@ -34,7 +34,7 @@ import org.elasticsearch.xpack.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.MockTextTemplateEngine; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.notification.email.Attachment; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java index 5aed1126be6..879132353de 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java @@ -35,8 +35,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.xContentSource; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java index c599e2c40c6..3cedb5b19a3 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java @@ -32,8 +32,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.xContentSource; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java index c24b79efd5e..cdb4e4742a0 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java @@ -33,7 +33,7 @@ import java.io.IOException; import static java.util.Collections.singletonMap; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.getScriptServiceProxy; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.Matchers.containsString; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java index 8395da0acda..31e1aec95a1 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java @@ -28,7 +28,7 @@ import org.elasticsearch.xpack.support.clock.ClockMock; import org.elasticsearch.xpack.watcher.support.validation.WatcherSettingsValidation; import org.elasticsearch.xpack.watcher.transform.ExecutableTransform; import org.elasticsearch.xpack.watcher.transform.Transform; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchLockService; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionTests.java index 0da9dff123c..816f553c673 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ManualExecutionTests.java @@ -27,9 +27,9 @@ import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchRequest; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; @@ -47,8 +47,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.neverCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreLifeCycleTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreLifeCycleTests.java index c5f992f9d58..b05a335073a 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreLifeCycleTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreLifeCycleTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.xpack.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.watcher.condition.always.ExecutableAlwaysCondition; import org.elasticsearch.xpack.watcher.input.none.ExecutableNoneInput; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchTests.java index 852f80cf7d7..5acbc87160b 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryStoreTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryStoreTests.java index 1f52b12c660..121067314ae 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryStoreTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryStoreTests.java @@ -10,12 +10,11 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.watcher.WatcherModule; import org.elasticsearch.xpack.watcher.execution.ExecutionState; import org.elasticsearch.xpack.watcher.execution.Wid; import org.elasticsearch.xpack.watcher.support.WatcherIndexTemplateRegistry; import org.elasticsearch.xpack.watcher.support.init.proxy.WatcherClientProxy; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import org.junit.Before; import org.mockito.Matchers; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java index fd358684e60..81a9accee17 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.watcher.history; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.ESLoggerFactory; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.search.aggregations.Aggregations; @@ -17,9 +16,7 @@ import org.elasticsearch.xpack.notification.email.support.EmailServer; import org.elasticsearch.xpack.watcher.execution.ExecutionState; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.junit.After; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; @@ -28,8 +25,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.emailAction import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java index 7edbfeff8ea..5c131dffd46 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java @@ -27,8 +27,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.webhookActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java index 1bb90565419..df68bd470d0 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java @@ -16,8 +16,8 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.indexAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java index 066750967a3..4fe263f802e 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java @@ -21,8 +21,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java index f59478281ca..252fc063a8c 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java @@ -21,8 +21,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java index 3a2085c8aa4..1195b28f166 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java @@ -23,8 +23,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java index 99263047e6e..fb97b0843ea 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java @@ -26,9 +26,9 @@ import org.elasticsearch.xpack.watcher.input.simple.SimpleInput; import org.elasticsearch.xpack.watcher.input.simple.SimpleInputFactory; import org.elasticsearch.xpack.common.http.HttpRequestTemplate; import org.elasticsearch.xpack.common.http.auth.basic.BasicAuth; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; @@ -46,8 +46,8 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.script import static org.elasticsearch.xpack.watcher.input.InputBuilders.chainInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.hasSize; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java index 77b2029dc44..0a50a91a58e 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java @@ -24,9 +24,9 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.input.InputBuilders.chainInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule.Interval.Unit.SECONDS; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.IntervalSchedule.Interval.Unit.SECONDS; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; public class ChainIntegrationTests extends AbstractWatcherIntegrationTestCase { diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputIntegrationTests.java index 2ff6a291474..79a739c02a8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputIntegrationTests.java @@ -20,7 +20,7 @@ import org.elasticsearch.xpack.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; import java.net.InetSocketAddress; @@ -33,8 +33,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.xContentSource; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCase { diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java index 33dad76f532..9622848dfcf 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java @@ -35,9 +35,9 @@ import org.elasticsearch.xpack.common.http.auth.basic.BasicAuthFactory; import org.elasticsearch.xpack.common.secret.SecretService; import org.elasticsearch.xpack.common.text.TextTemplate; import org.elasticsearch.xpack.common.text.TextTemplateEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java index 97bf5762fc6..6d2ed33e7d5 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRequestBuilder; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.TriggerService; import static org.hamcrest.core.Is.is; import static org.mockito.Mockito.mock; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/shield/BasicShieldTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/shield/BasicShieldTests.java index e12c7565f2c..95f70891a5a 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/shield/BasicShieldTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/shield/BasicShieldTests.java @@ -15,17 +15,17 @@ import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchRes import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.stats.WatcherStatsResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import java.util.Collections; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.Is.is; import static org.joda.time.DateTimeZone.UTC; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/DynamicIndexNameIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/DynamicIndexNameIntegrationTests.java index abcd33831cc..7c095cf7324 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/DynamicIndexNameIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/DynamicIndexNameIntegrationTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.util.Callback; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; import org.joda.time.format.DateTimeFormat; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; @@ -25,8 +25,8 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.always import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.searchTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.is; /** diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java index 70614be781c..6189deb20bf 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.watcher.execution.Wid; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.joda.time.DateTime; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java index 68eea0e90ae..e0d37ba7828 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.watcher.support; import static java.util.Collections.singletonMap; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.formatDate; +import static org.elasticsearch.xpack.support.DateTimeUtils.formatDate; import static org.elasticsearch.xpack.watcher.support.WatcherUtils.DEFAULT_INDICES_OPTIONS; import static org.elasticsearch.xpack.watcher.support.WatcherUtils.flattenModel; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.getRandomSupportedSearchType; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index ac9d9a2b749..f19521c75db 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -52,9 +52,9 @@ import org.elasticsearch.xpack.support.clock.ClockMock; import org.elasticsearch.xpack.common.http.HttpClient; import org.elasticsearch.xpack.common.ScriptServiceProxy; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; -import org.elasticsearch.xpack.watcher.trigger.ScheduleTriggerEngineMock; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleModule; +import org.elasticsearch.xpack.trigger.ScheduleTriggerEngineMock; +import org.elasticsearch.xpack.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.schedule.ScheduleModule; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.TimeWarpedXPackPlugin; import org.elasticsearch.xpack.XPackClient; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/TimeWarpedWatcher.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/TimeWarpedWatcher.java index 6b2c75a5d6d..e8173a31589 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/TimeWarpedWatcher.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/TimeWarpedWatcher.java @@ -12,9 +12,9 @@ import org.elasticsearch.xpack.watcher.Watcher; import org.elasticsearch.xpack.watcher.execution.ExecutionModule; import org.elasticsearch.xpack.watcher.execution.SyncTriggerListener; import org.elasticsearch.xpack.watcher.execution.WatchExecutor; -import org.elasticsearch.xpack.watcher.trigger.ScheduleTriggerEngineMock; -import org.elasticsearch.xpack.watcher.trigger.TriggerModule; -import org.elasticsearch.xpack.watcher.trigger.manual.ManualTriggerEngine; +import org.elasticsearch.xpack.trigger.ScheduleTriggerEngineMock; +import org.elasticsearch.xpack.trigger.TriggerModule; +import org.elasticsearch.xpack.trigger.manual.ManualTriggerEngine; import java.util.ArrayList; import java.util.Collection; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatchExecutionContextMockBuilder.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatchExecutionContextMockBuilder.java index 16b9144c1c1..9fd65d0008c 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatchExecutionContextMockBuilder.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatchExecutionContextMockBuilder.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.watcher.test; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.watcher.execution.Wid; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.joda.time.DateTime; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java index e576cfd50ab..a86b804bdda 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java @@ -62,9 +62,9 @@ import org.elasticsearch.xpack.watcher.support.xcontent.ObjectPath; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.transform.search.ExecutableSearchTransform; import org.elasticsearch.xpack.watcher.transform.search.SearchTransform; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.CronSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.CronSchedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; import org.elasticsearch.xpack.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStatus; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/ScheduleEngineTriggerBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/ScheduleEngineTriggerBenchmark.java index ac7adf19353..9512c21a409 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/ScheduleEngineTriggerBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/ScheduleEngineTriggerBenchmark.java @@ -10,16 +10,16 @@ import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.support.clock.SystemClock; -import org.elasticsearch.xpack.watcher.trigger.Trigger; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.engine.SchedulerScheduleTriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleTriggerEngine; +import org.elasticsearch.xpack.trigger.Trigger; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.Schedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.engine.SchedulerScheduleTriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.engine.TickerScheduleTriggerEngine; import java.util.ArrayList; import java.util.Arrays; @@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import static java.util.Collections.emptyMap; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; /** * diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java index 250d58d6f0b..a803ab894e9 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java @@ -19,8 +19,8 @@ import org.elasticsearch.xpack.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.common.http.HttpRequestTemplate; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchRequest; -import org.elasticsearch.xpack.watcher.trigger.ScheduleTriggerEngineMock; -import org.elasticsearch.xpack.watcher.trigger.TriggerModule; +import org.elasticsearch.xpack.trigger.ScheduleTriggerEngineMock; +import org.elasticsearch.xpack.trigger.TriggerModule; import org.elasticsearch.xpack.XPackPlugin; import java.util.ArrayList; @@ -32,8 +32,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.indexAction import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.scriptCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; /** * Starts a master only node with watcher and benchmarks the executor service side, so no scheduling. The benchmark diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java index bec1608e710..965a0d71cd8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java @@ -50,8 +50,8 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.percenti import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.scriptCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; /** */ diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java index b552439b30e..05becfd857c 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java @@ -26,10 +26,10 @@ import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.delete.DeleteWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedules; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.Schedules; +import org.elasticsearch.xpack.trigger.schedule.support.MonthTimes; +import org.elasticsearch.xpack.trigger.schedule.support.WeekTimes; import org.elasticsearch.xpack.watcher.watch.WatchStore; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -48,13 +48,13 @@ import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.newInputSearchRequest; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.xContentSource; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.daily; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.hourly; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.monthly; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.weekly; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.daily; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.hourly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.monthly; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.weekly; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java index 210e295db79..79251abc4b8 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.xpack.watcher.history.HistoryStore; import org.elasticsearch.xpack.watcher.history.WatchRecord; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.stats.WatcherStatsResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.watch.WatchStore; import org.hamcrest.Matchers; @@ -42,8 +42,8 @@ import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.always import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.newInputSearchRequest; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.is; import static org.hamcrest.core.IsEqual.equalTo; import static org.joda.time.DateTimeZone.UTC; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java index 66cd8bba4ba..0639a1fecfb 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java @@ -24,8 +24,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.scriptCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java index 948ee132b39..ce82c15c5c9 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java @@ -22,8 +22,8 @@ import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.WatchStore; import org.joda.time.DateTime; import org.junit.After; @@ -39,8 +39,8 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.httpInput; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java index b458cce21aa..d8f0a68de3e 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java @@ -18,8 +18,8 @@ import org.elasticsearch.xpack.watcher.support.xcontent.ObjectPath; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.TriggerEvent; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.TriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.joda.time.DateTime; import java.util.ArrayList; @@ -34,8 +34,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.joda.time.DateTimeZone.UTC; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java index 989c17e4a25..48868ab50ad 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java @@ -34,8 +34,8 @@ import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.chainTransform; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.scriptTransform; import static org.elasticsearch.xpack.watcher.transform.TransformBuilders.searchTransform; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java index 910ee7a8341..5e2bac7538b 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java @@ -32,7 +32,7 @@ import java.util.Map; import static java.util.Collections.singleton; import static java.util.Collections.singletonMap; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.xpack.watcher.support.Exceptions.illegalArgument; +import static org.elasticsearch.xpack.support.Exceptions.illegalArgument; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.EMPTY_PAYLOAD; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.getScriptServiceProxy; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java index 20a096a3662..cd7b831d771 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java @@ -28,9 +28,9 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.indexAction import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java index cf6d61ebbc1..845964d7447 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java @@ -15,8 +15,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/ForceDeleteWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/ForceDeleteWatchTests.java index 51c5883cc6b..d6f389ba755 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/ForceDeleteWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/ForceDeleteWatchTests.java @@ -20,8 +20,8 @@ import java.util.List; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.scriptCondition; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java index 73841fc1ca5..59b0c90b203 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.xpack.watcher.actions.ActionStatus; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.execution.ActionExecutionMode; import org.elasticsearch.xpack.watcher.execution.Wid; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.ack.AckWatchRequestBuilder; @@ -20,7 +20,7 @@ import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchReq import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.get.GetWatchResponse; import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEvent; import org.elasticsearch.xpack.watcher.watch.WatchStatus; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -34,9 +34,9 @@ import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBu import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.neverCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -132,9 +132,9 @@ public class ExecuteWatchTests extends AbstractWatcherIntegrationTestCase { ExecuteWatchRequestBuilder requestBuilder = watcherClient.prepareExecuteWatch("_id"); if (randomBoolean()) { Map data = new HashMap<>(); - data.put("triggered_time", WatcherDateTimeUtils.formatDate(triggeredTime)); + data.put("triggered_time", DateTimeUtils.formatDate(triggeredTime)); if (scheduledTime != triggeredTime) { - data.put("scheduled_time", WatcherDateTimeUtils.formatDate(scheduledTime)); + data.put("scheduled_time", DateTimeUtils.formatDate(scheduledTime)); } requestBuilder.setTriggerData(data); } else { @@ -151,8 +151,8 @@ public class ExecuteWatchTests extends AbstractWatcherIntegrationTestCase { XContentSource record = response.getRecordSource(); assertValue(record, "watch_id", is("_id")); assertValue(record, "trigger_event.type", is("manual")); - assertValue(record, "trigger_event.triggered_time", is(WatcherDateTimeUtils.formatDate(triggeredTime))); - assertValue(record, "trigger_event.manual.schedule.scheduled_time", is(WatcherDateTimeUtils.formatDate(scheduledTime))); + assertValue(record, "trigger_event.triggered_time", is(DateTimeUtils.formatDate(triggeredTime))); + assertValue(record, "trigger_event.manual.schedule.scheduled_time", is(DateTimeUtils.formatDate(scheduledTime))); assertValue(record, "state", is("executed")); assertValue(record, "input.simple.foo", is("bar")); assertValue(record, "condition.always", notNullValue()); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchWithDateMathTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchWithDateMathTests.java index b47f2d1c0cb..d7ad17c79c9 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchWithDateMathTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchWithDateMathTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.watcher.transport.action.execute; import org.apache.lucene.util.LuceneTestCase.BadApple; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.execution.Wid; -import org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils; +import org.elasticsearch.xpack.support.DateTimeUtils; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.transport.actions.execute.ExecuteWatchResponse; @@ -22,8 +22,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; @@ -69,8 +69,8 @@ public class ExecuteWatchWithDateMathTests extends AbstractWatcherIntegrationTes XContentSource record = response.getRecordSource(); assertValue(record, "watch_id", is("_id")); assertValue(record, "trigger_event.type", is("manual")); - assertValue(record, "trigger_event.triggered_time", is(WatcherDateTimeUtils.formatDate(triggeredTime))); - assertValue(record, "trigger_event.manual.schedule.scheduled_time", is(WatcherDateTimeUtils.formatDate(scheduledTime))); + assertValue(record, "trigger_event.triggered_time", is(DateTimeUtils.formatDate(triggeredTime))); + assertValue(record, "trigger_event.manual.schedule.scheduled_time", is(DateTimeUtils.formatDate(scheduledTime))); assertValue(record, "state", is("executed")); assertValue(record, "input.simple.foo", is("bar")); assertValue(record, "condition.always", notNullValue()); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java index 6e78c03c24a..8a245cafcd2 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java @@ -18,8 +18,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchTests.java index 07e72e5f22a..85344ef9b83 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchTests.java @@ -16,8 +16,8 @@ import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingActi import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.alwaysCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.simpleInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/SlowWatchStatsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/SlowWatchStatsTests.java index a4d05811d59..1b2db355cf4 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/SlowWatchStatsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/SlowWatchStatsTests.java @@ -27,8 +27,8 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interval; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/WatcherStatsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/WatcherStatsTests.java index 7c41d915a73..3704267b618 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/WatcherStatsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/stats/WatcherStatsTests.java @@ -27,8 +27,8 @@ import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.condition.ConditionBuilders.compareCondition; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; -import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.cron; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.schedule.Schedules.cron; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import static org.hamcrest.core.IsEqual.equalTo; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java index 8c9429500b1..34c20b96f27 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java @@ -97,25 +97,25 @@ import org.elasticsearch.xpack.watcher.transform.script.ScriptTransformFactory; import org.elasticsearch.xpack.watcher.transform.search.ExecutableSearchTransform; import org.elasticsearch.xpack.watcher.transform.search.SearchTransform; import org.elasticsearch.xpack.watcher.transform.search.SearchTransformFactory; -import org.elasticsearch.xpack.watcher.trigger.Trigger; -import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.TriggerService; -import org.elasticsearch.xpack.watcher.trigger.schedule.CronSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.DailySchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.HourlySchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.MonthlySchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.Schedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTrigger; -import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEngine; -import org.elasticsearch.xpack.watcher.trigger.schedule.WeeklySchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.YearlySchedule; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.Month; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; -import org.elasticsearch.xpack.watcher.trigger.schedule.support.YearTimes; +import org.elasticsearch.xpack.trigger.Trigger; +import org.elasticsearch.xpack.trigger.TriggerEngine; +import org.elasticsearch.xpack.trigger.TriggerService; +import org.elasticsearch.xpack.trigger.schedule.CronSchedule; +import org.elasticsearch.xpack.trigger.schedule.DailySchedule; +import org.elasticsearch.xpack.trigger.schedule.HourlySchedule; +import org.elasticsearch.xpack.trigger.schedule.IntervalSchedule; +import org.elasticsearch.xpack.trigger.schedule.MonthlySchedule; +import org.elasticsearch.xpack.trigger.schedule.Schedule; +import org.elasticsearch.xpack.trigger.schedule.ScheduleRegistry; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTrigger; +import org.elasticsearch.xpack.trigger.schedule.ScheduleTriggerEngine; +import org.elasticsearch.xpack.trigger.schedule.WeeklySchedule; +import org.elasticsearch.xpack.trigger.schedule.YearlySchedule; +import org.elasticsearch.xpack.trigger.schedule.support.DayOfWeek; +import org.elasticsearch.xpack.trigger.schedule.support.Month; +import org.elasticsearch.xpack.trigger.schedule.support.MonthTimes; +import org.elasticsearch.xpack.trigger.schedule.support.WeekTimes; +import org.elasticsearch.xpack.trigger.schedule.support.YearTimes; import org.elasticsearch.xpack.notification.email.EmailService; import org.elasticsearch.xpack.notification.email.EmailTemplate; import org.elasticsearch.xpack.notification.email.HtmlSanitizer; @@ -132,7 +132,7 @@ import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.matchAllRequest; -import static org.elasticsearch.xpack.watcher.trigger.TriggerBuilders.schedule; +import static org.elasticsearch.xpack.trigger.TriggerBuilders.schedule; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is;