@Test public void alterTopicConfigs_nonExistingCluster_throwsNotFound() { expect( topicConfigManager.alterTopicConfigs( CLUSTER_ID, TOPIC_NAME, Arrays.asList( AlterConfigCommand.set(CONFIG_1.getName(), "newValue"), AlterConfigCommand.delete(CONFIG_2.getName())))) .andReturn(failedFuture(new NotFoundException())); replay(topicConfigManager); FakeAsyncResponse response = new FakeAsyncResponse(); alterTopicConfigBatchAction.alterTopicConfigBatch( response, CLUSTER_ID, TOPIC_NAME, AlterTopicConfigBatchRequest.create( AlterConfigBatchRequestData.create( Arrays.asList( AlterEntry.builder() .setName(CONFIG_1.getName()) .setValue("newValue") .build(), AlterEntry.builder() .setName(CONFIG_2.getName()) .setOperation(AlterOperation.DELETE) .build())))); assertEquals(NotFoundException.class, response.getException().getClass()); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") public void alterTopicConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @Valid AlterTopicConfigBatchRequest request ) { CompletableFuture<Void> response = topicConfigManager.get() .alterTopicConfigs(clusterId, topicName, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); }
AlterTopicConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") public void alterTopicConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @Valid AlterTopicConfigBatchRequest request ) { CompletableFuture<Void> response = topicConfigManager.get() .alterTopicConfigs(clusterId, topicName, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } }
AlterTopicConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") public void alterTopicConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @Valid AlterTopicConfigBatchRequest request ) { CompletableFuture<Void> response = topicConfigManager.get() .alterTopicConfigs(clusterId, topicName, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterTopicConfigBatchAction(Provider<TopicConfigManager> topicConfigManager); }
AlterTopicConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") public void alterTopicConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @Valid AlterTopicConfigBatchRequest request ) { CompletableFuture<Void> response = topicConfigManager.get() .alterTopicConfigs(clusterId, topicName, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterTopicConfigBatchAction(Provider<TopicConfigManager> topicConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") void alterTopicConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @Valid AlterTopicConfigBatchRequest request
  ); }
AlterTopicConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") public void alterTopicConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @Valid AlterTopicConfigBatchRequest request ) { CompletableFuture<Void> response = topicConfigManager.get() .alterTopicConfigs(clusterId, topicName, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterTopicConfigBatchAction(Provider<TopicConfigManager> topicConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.alter") void alterTopicConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @Valid AlterTopicConfigBatchRequest request
  );  }