예제 #1
0
  /**
   * Remove failed key.
   *
   * @param key failed key
   */
  private void removeFailedKey(@Nonnull final KeyItem key) {
    service.deleteKey(
        key,
        new AsyncRequestCallback<Void>() {
          @Override
          public void onFailure(Throwable caught) {
            loader.hide(constant.loaderDeleteSshKeyMessage(key.getHost()));
            notificationManager.showError(constant.deleteSshKeyFailed());
            refreshKeys();
          }

          @Override
          public void onSuccess(Void result) {
            loader.hide(constant.loaderDeleteSshKeyMessage(key.getHost()));
            refreshKeys();
          }
        });
  }
예제 #2
0
  private void deleteKey(final KeyItem key) {
    service.deleteKey(
        key,
        new AsyncRequestCallback<Void>() {
          @Override
          public void onSuccess(Void result) {
            loader.hide(constant.loaderDeleteSshKeyMessage(key.getHost()));
            refreshKeys();
          }

          @Override
          public void onFailure(Throwable exception) {
            loader.hide(constant.loaderDeleteSshKeyMessage(key.getHost()));
            notificationManager.showError(
                SafeHtmlUtils.fromString(exception.getMessage()).asString());
            eventBus.fireEvent(new ExceptionThrownEvent(exception));
          }
        });
  }