@Test public void assertUpdate() { when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(true); when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.put("http: verify(getRegCenter()).update("/config/job/test_job", YAML); HttpTestUtil.delete("http: }
@Mapping(method = Http.PUT, path = "/update") public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { producerManager.update(cloudJobConfig); return true; }
CloudJobController implements RestfulController { @Mapping(method = Http.PUT, path = "/update") public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { producerManager.update(cloudJobConfig); return true; } }
CloudJobController implements RestfulController { @Mapping(method = Http.PUT, path = "/update") public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { producerManager.update(cloudJobConfig); return true; } CloudJobController(); }
CloudJobController implements RestfulController { @Mapping(method = Http.PUT, path = "/update") public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { producerManager.update(cloudJobConfig); return true; } CloudJobController(); static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Mapping(method = Http.POST, path = "/register") boolean register(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig); @Mapping(method = Http.PUT, path = "/update") boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig); @Mapping(method = Http.DELETE, path = "/{jobName}/deregister") boolean deregister(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.GET, path = "/{jobName}/disable") boolean isDisabled(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/{jobName}/enable") boolean enable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/{jobName}/disable") boolean disable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/trigger") boolean trigger(@RequestBody final String jobName); @Mapping(method = Http.GET, path = "/jobs/{jobName}") CloudJobConfigurationPOJO detail(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.GET, path = "/jobs") Collection<CloudJobConfigurationPOJO> findAllJobs(); @Mapping(method = Http.GET, path = "/tasks/running") Collection<TaskContext> findAllRunningTasks(); @Mapping(method = Http.GET, path = "/tasks/ready") Collection<Map<String, String>> findAllReadyTasks(); @Mapping(method = Http.GET, path = "/tasks/failover") Collection<FailoverTaskInfo> findAllFailoverTasks(); @Mapping(method = Http.GET, path = "/events/executions") JobEventRdbSearch.Result<JobExecutionEvent> findJobExecutionEvents(final QueryParameterMap requestParams); @Mapping(method = Http.GET, path = "/events/statusTraces") JobEventRdbSearch.Result<JobStatusTraceEvent> findJobStatusTraceEvents(final QueryParameterMap requestParams); @Mapping(method = Http.GET, path = "/statistics/tasks/results") List<TaskResultStatistics> findTaskResultStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/tasks/results/{period}") TaskResultStatistics getTaskResultStatistics(@Param(name = "period", source = ParamSource.PATH, required = false) final String period); @Mapping(method = Http.GET, path = "/statistics/tasks/running") List<TaskRunningStatistics> findTaskRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/jobs/executionType") JobExecutionTypeStatistics getJobExecutionTypeStatistics(); @Mapping(method = Http.GET, path = "/statistics/jobs/running") List<JobRunningStatistics> findJobRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/jobs/register") List<JobRegisterStatistics> findJobRegisterStatistics(); }
CloudJobController implements RestfulController { @Mapping(method = Http.PUT, path = "/update") public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { producerManager.update(cloudJobConfig); return true; } CloudJobController(); static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Mapping(method = Http.POST, path = "/register") boolean register(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig); @Mapping(method = Http.PUT, path = "/update") boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig); @Mapping(method = Http.DELETE, path = "/{jobName}/deregister") boolean deregister(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.GET, path = "/{jobName}/disable") boolean isDisabled(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/{jobName}/enable") boolean enable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/{jobName}/disable") boolean disable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.POST, path = "/trigger") boolean trigger(@RequestBody final String jobName); @Mapping(method = Http.GET, path = "/jobs/{jobName}") CloudJobConfigurationPOJO detail(@Param(name = "jobName", source = ParamSource.PATH) final String jobName); @Mapping(method = Http.GET, path = "/jobs") Collection<CloudJobConfigurationPOJO> findAllJobs(); @Mapping(method = Http.GET, path = "/tasks/running") Collection<TaskContext> findAllRunningTasks(); @Mapping(method = Http.GET, path = "/tasks/ready") Collection<Map<String, String>> findAllReadyTasks(); @Mapping(method = Http.GET, path = "/tasks/failover") Collection<FailoverTaskInfo> findAllFailoverTasks(); @Mapping(method = Http.GET, path = "/events/executions") JobEventRdbSearch.Result<JobExecutionEvent> findJobExecutionEvents(final QueryParameterMap requestParams); @Mapping(method = Http.GET, path = "/events/statusTraces") JobEventRdbSearch.Result<JobStatusTraceEvent> findJobStatusTraceEvents(final QueryParameterMap requestParams); @Mapping(method = Http.GET, path = "/statistics/tasks/results") List<TaskResultStatistics> findTaskResultStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/tasks/results/{period}") TaskResultStatistics getTaskResultStatistics(@Param(name = "period", source = ParamSource.PATH, required = false) final String period); @Mapping(method = Http.GET, path = "/statistics/tasks/running") List<TaskRunningStatistics> findTaskRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/jobs/executionType") JobExecutionTypeStatistics getJobExecutionTypeStatistics(); @Mapping(method = Http.GET, path = "/statistics/jobs/running") List<JobRunningStatistics> findJobRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since); @Mapping(method = Http.GET, path = "/statistics/jobs/register") List<JobRegisterStatistics> findJobRegisterStatistics();  }