@Test public void alterClusterConfigs_existingConfig_alterConfigs() { expect( clusterConfigManager.alterClusterConfigs( CLUSTER_ID, ClusterConfig.Type.BROKER, Arrays.asList( AlterConfigCommand.set(CONFIG_1.getName(), "newValue"), AlterConfigCommand.delete(CONFIG_2.getName())))) .andReturn(completedFuture(null)); replay(clusterConfigManager); FakeAsyncResponse response = new FakeAsyncResponse(); alterClusterConfigBatchAction.alterClusterConfigBatch( response, CLUSTER_ID, ClusterConfig.Type.BROKER, AlterClusterConfigBatchRequest.create( AlterConfigBatchRequestData.create( Arrays.asList( AlterEntry.builder() .setName(CONFIG_1.getName()) .setValue("newValue") .build(), AlterEntry.builder() .setName(CONFIG_2.getName()) .setOperation(AlterOperation.DELETE) .build())))); assertNull(response.getValue()); assertNull(response.getException()); assertTrue(response.isDone()); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") public void alterClusterConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("config_type") ClusterConfig.Type configType, @Valid AlterClusterConfigBatchRequest request ) { CompletableFuture<Void> response = clusterConfigManager.get() .alterClusterConfigs(clusterId, configType, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); }
AlterClusterConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") public void alterClusterConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("config_type") ClusterConfig.Type configType, @Valid AlterClusterConfigBatchRequest request ) { CompletableFuture<Void> response = clusterConfigManager.get() .alterClusterConfigs(clusterId, configType, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } }
AlterClusterConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") public void alterClusterConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("config_type") ClusterConfig.Type configType, @Valid AlterClusterConfigBatchRequest request ) { CompletableFuture<Void> response = clusterConfigManager.get() .alterClusterConfigs(clusterId, configType, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterClusterConfigBatchAction(Provider<ClusterConfigManager> clusterConfigManager); }
AlterClusterConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") public void alterClusterConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("config_type") ClusterConfig.Type configType, @Valid AlterClusterConfigBatchRequest request ) { CompletableFuture<Void> response = clusterConfigManager.get() .alterClusterConfigs(clusterId, configType, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterClusterConfigBatchAction(Provider<ClusterConfigManager> clusterConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") void alterClusterConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("config_type") ClusterConfig.Type configType,
      @Valid AlterClusterConfigBatchRequest request
  ); }
AlterClusterConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") public void alterClusterConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("config_type") ClusterConfig.Type configType, @Valid AlterClusterConfigBatchRequest request ) { CompletableFuture<Void> response = clusterConfigManager.get() .alterClusterConfigs(clusterId, configType, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterClusterConfigBatchAction(Provider<ClusterConfigManager> clusterConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.clusters.configs.alter") void alterClusterConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("config_type") ClusterConfig.Type configType,
      @Valid AlterClusterConfigBatchRequest request
  );  }