@Test public void alterBrokerConfigs_nonExistingCluster_throwsNotFound() { expect( brokerConfigManager.alterBrokerConfigs( CLUSTER_ID, BROKER_ID, Arrays.asList( AlterConfigCommand.set(CONFIG_1.getName(), "newValue"), AlterConfigCommand.delete(CONFIG_2.getName())))) .andReturn(failedFuture(new NotFoundException())); replay(brokerConfigManager); FakeAsyncResponse response = new FakeAsyncResponse(); alterBrokerConfigBatchAction.alterBrokerConfigBatch( response, CLUSTER_ID, BROKER_ID, AlterBrokerConfigBatchRequest.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.brokers.configs.alter") public void alterBrokerConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("brokerId") int brokerId, @Valid AlterBrokerConfigBatchRequest request ) { CompletableFuture<Void> response = brokerConfigManager.get() .alterBrokerConfigs(clusterId, brokerId, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); }
AlterBrokerConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") public void alterBrokerConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("brokerId") int brokerId, @Valid AlterBrokerConfigBatchRequest request ) { CompletableFuture<Void> response = brokerConfigManager.get() .alterBrokerConfigs(clusterId, brokerId, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } }
AlterBrokerConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") public void alterBrokerConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("brokerId") int brokerId, @Valid AlterBrokerConfigBatchRequest request ) { CompletableFuture<Void> response = brokerConfigManager.get() .alterBrokerConfigs(clusterId, brokerId, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterBrokerConfigBatchAction(Provider<BrokerConfigManager> brokerConfigManager); }
AlterBrokerConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") public void alterBrokerConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("brokerId") int brokerId, @Valid AlterBrokerConfigBatchRequest request ) { CompletableFuture<Void> response = brokerConfigManager.get() .alterBrokerConfigs(clusterId, brokerId, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterBrokerConfigBatchAction(Provider<BrokerConfigManager> brokerConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") void alterBrokerConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("brokerId") int brokerId,
      @Valid AlterBrokerConfigBatchRequest request
  ); }
AlterBrokerConfigBatchAction { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") public void alterBrokerConfigBatch( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("brokerId") int brokerId, @Valid AlterBrokerConfigBatchRequest request ) { CompletableFuture<Void> response = brokerConfigManager.get() .alterBrokerConfigs(clusterId, brokerId, request.getValue().toAlterConfigCommands()); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  AlterBrokerConfigBatchAction(Provider<BrokerConfigManager> brokerConfigManager); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.brokers.configs.alter") void alterBrokerConfigBatch(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("brokerId") int brokerId,
      @Valid AlterBrokerConfigBatchRequest request
  );  }