예제 #1
0
 private void putESCfg(ServiceCfgDto dto) {
   ResourceRequestBuilderFactory.newBuilder()
       .forResource("/service/search/cfg") //
       .withResourceBody(ServiceCfgDto.stringify(dto)) //
       .withCallback(
           Response.SC_OK,
           new ResponseCodeCallback() {
             @Override
             public void onResponseCode(Request request, Response response) {
               getView().hideDialog();
               getEventBus().fireEvent(new TableIndicesRefreshEvent());
             }
           }) //
       .withCallback(
           Response.SC_INTERNAL_SERVER_ERROR,
           new ResponseCodeCallback() {
             @Override
             public void onResponseCode(Request request, Response response) {
               getView().hideDialog();
               getEventBus().fireEvent(new TableIndicesRefreshEvent());
               getEventBus()
                   .fireEvent(NotificationEvent.newBuilder().error(response.getText()).build());
             }
           }) //
       .put()
       .send();
 }
 private void putESCfg(ServiceCfgDto dto) {
   ResponseCodeCallback callbackHandler = new CreateOrUpdateMethodCallBack(dto);
   ResourceRequestBuilderFactory.newBuilder()
       .forResource("/service/search/cfg")
       .put() //
       .withResourceBody(ServiceCfgDto.stringify(dto)) //
       .withCallback(callbackHandler, Response.SC_OK, Response.SC_INTERNAL_SERVER_ERROR)
       .send();
 }