@Override
  protected void editEntity(NotificationDto entity, final AsyncCallback<NotificationDto> callback) {
    String endpointKeyHash = detailsView.getEndpointKeyHash().getValue();
    if (endpointKeyHash == null || endpointKeyHash.equals("")) {
      KaaAdmin.getDataSource()
          .sendNotification(
              entity,
              detailsView.getNotificationData().getValue(),
              new AsyncCallback<Void>() {
                @Override
                public void onSuccess(Void result) {
                  callback.onSuccess(null);
                }

                @Override
                public void onFailure(Throwable caught) {
                  callback.onFailure(caught);
                }
              });
    } else {
      KaaAdmin.getDataSource()
          .sendUnicastNotification(
              entity,
              endpointKeyHash,
              detailsView.getNotificationData().getValue(),
              new AsyncCallback<EndpointNotificationDto>() {
                @Override
                public void onSuccess(EndpointNotificationDto result) {
                  callback.onSuccess(null);
                }

                @Override
                public void onFailure(Throwable caught) {
                  callback.onFailure(caught);
                }
              });
    }
  }
Esempio n. 2
0
  @Override
  protected void loadData(final LoadCallback callback, final HasData<EventClassFamilyDto> display) {
    KaaAdmin.getDataSource()
        .loadEcfs(
            new AsyncCallback<List<EventClassFamilyDto>>() {
              @Override
              public void onFailure(Throwable caught) {
                callback.onFailure(caught);
              }

              @Override
              public void onSuccess(List<EventClassFamilyDto> result) {
                callback.onSuccess(result, display);
              }
            });
  }
Esempio n. 3
0
  @Override
  protected void loadData(final LoadCallback callback) {
    KaaAdmin.getDataSource()
        .loadApplicationEventFamilyMaps(
            applicationId,
            new AsyncCallback<List<ApplicationEventFamilyMapDto>>() {
              @Override
              public void onFailure(Throwable caught) {
                callback.onFailure(caught);
              }

              @Override
              public void onSuccess(List<ApplicationEventFamilyMapDto> result) {
                callback.onSuccess(result);
              }
            });
  }
  @Override
  protected void onEntityRetrieved() {
    detailsView.getEndpointKeyHash().setValue("");
    KaaAdmin.getDataSource()
        .getUserNotificationSchemaInfosByApplicationId(
            applicationId,
            new BusyAsyncCallback<List<SchemaInfoDto>>() {
              @Override
              public void onSuccessImpl(List<SchemaInfoDto> result) {
                Collections.sort(result);
                SchemaInfoDto schemaInfo = result.get(result.size() - 1);
                detailsView.getNotificationSchemaInfo().setValue(schemaInfo, true);
                detailsView.getNotificationSchemaInfo().setAcceptableValues(result);
              }

              @Override
              public void onFailureImpl(Throwable caught) {
                Utils.handleException(caught, detailsView);
              }
            });
  }
Esempio n. 5
0
 @Override
 protected void editEntity(PropertiesDto entity, AsyncCallback<PropertiesDto> callback) {
   KaaAdmin.getDataSource().editMailProperties(entity, callback);
 }
Esempio n. 6
0
 @Override
 protected void getEntity(String id, AsyncCallback<PropertiesDto> callback) {
   KaaAdmin.getDataSource().getMailProperties(callback);
 }
Esempio n. 7
0
 @Override
 protected void deleteEntity(String id, AsyncCallback<Void> callback) {
   KaaAdmin.getDataSource().deleteTenant(id, callback);
 }