private void onResetAllParameters() {
    ConfirmationModel model = (ConfirmationModel) getWindow();

    if (model.getProgress() != null) {
      return;
    }

    if (getEntity() == null) {
      return;
    }
    GlusterVolumeEntity volume = getEntity();

    ResetGlusterVolumeOptionsParameters parameters =
        new ResetGlusterVolumeOptionsParameters(volume.getId(), null, false);

    model.startProgress();

    Frontend.getInstance()
        .runAction(
            VdcActionType.ResetGlusterVolumeOptions,
            parameters,
            new IFrontendActionAsyncCallback() {

              @Override
              public void executed(FrontendActionAsyncResult result) {
                ConfirmationModel localModel = (ConfirmationModel) result.getState();
                localModel.stopProgress();
                cancel();
              }
            },
            model);
  }
  private void onRemove() {
    if (getSelectedItems() != null && getSelectedItems().size() > 0) {
      ConfirmationModel model = (ConfirmationModel) getWindow();

      if (model.getProgress() != null) {
        return;
      }

      ArrayList<VdcActionParametersBase> list = new ArrayList<VdcActionParametersBase>();
      for (Object perm : getSelectedItems()) {
        PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
        tempVar.setPermission((Permission) perm);
        list.add(tempVar);
      }

      model.startProgress(null);

      Frontend.getInstance()
          .runMultipleAction(
              VdcActionType.RemoveSystemPermission,
              list,
              new IFrontendMultipleActionAsyncCallback() {
                @Override
                public void executed(FrontendMultipleActionAsyncResult result) {

                  ConfirmationModel localModel = (ConfirmationModel) result.getState();
                  localModel.stopProgress();
                  cancel();
                }
              },
              model);
    }
  }
  private void onDisableHook() {
    if (getConfirmWindow() == null) {
      return;
    }

    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();

    if (model.getProgress() != null) {
      return;
    }

    ArrayList<VdcActionParametersBase> list = new ArrayList<VdcActionParametersBase>();

    for (Object item : getSelectedItems()) {
      GlusterHookEntity hook = (GlusterHookEntity) item;
      list.add(new GlusterHookParameters(hook.getId()));
    }

    model.startProgress();

    Frontend.getInstance()
        .runMultipleAction(
            VdcActionType.DisableGlusterHook,
            list,
            new IFrontendMultipleActionAsyncCallback() {
              @Override
              public void executed(FrontendMultipleActionAsyncResult result) {

                ConfirmationModel localModel = (ConfirmationModel) result.getState();
                localModel.stopProgress();
                cancelConfirmation();
              }
            },
            model);
  }
Exemplo n.º 4
0
  private void unplug() {
    final ConfirmationModel model = (ConfirmationModel) getWindow();
    model.startProgress();

    Frontend.getInstance()
        .runMultipleAction(
            VdcActionType.HotUnPlugDiskFromVm,
            createHotPlugDiskToVmParameters(false),
            new IFrontendMultipleActionAsyncCallback() {
              @Override
              public void executed(FrontendMultipleActionAsyncResult result) {
                model.stopProgress();
                setWindow(null);
              }
            },
            this);
  }