Пример #1
0
  private void uninstallAgent() {
    disableButtons(true);

    createWaitingWindow(MSG.view_remoteAgentInstall_uninstallingPleaseWait(), true);

    remoteInstallService.uninstallAgent(
        getRemoteAccessInfo(),
        getAgentInstallPath(),
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {
            displayError(MSG.view_remoteAgentInstall_error_7(), caught);
            setAgentStatusText(MSG.view_remoteAgentInstall_error_7());
            doneProcessing();
          }

          public void onSuccess(String result) {
            if (result != null) {
              setAgentStatusText(MSG.view_remoteAgentInstall_uninstallSuccess());
              displayMessage(MSG.view_remoteAgentInstall_uninstallAgentResults(result));
              agentStatusCheck(); // we are relying on this to call doneProcessing(), we shouldn't
                                  // do it here

              // tell the success handler
              invokeSuccessHandler(Type.UNINSTALL);
            } else {
              setAgentStatusText(MSG.view_remoteAgentInstall_error_7());
              doneProcessing();
            }
          }
        });
  }
Пример #2
0
  private void findAgentInstallPath() {
    disableButtons(true);

    final String parentPath = getAgentInstallPath();

    createWaitingWindow(MSG.view_remoteAgentInstall_findAgentWait(), true);

    remoteInstallService.findAgentInstallPath(
        getRemoteAccessInfo(),
        parentPath,
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {
            displayError(MSG.view_remoteAgentInstall_error_1(), caught);
            doneProcessing();
          }

          public void onSuccess(String result) {
            if (result != null) {
              agentInstallPath.setValue(result);
              agentStatusCheck(); // we are relying on this to call doneProcessing(), we shouldn't
                                  // do it here
            } else {
              String err;
              if (parentPath == null || parentPath.length() == 0) {
                err = MSG.view_remoteAgentInstall_error_2();
              } else {
                err = MSG.view_remoteAgentInstall_error_3(parentPath);
              }
              displayError(err, null);
              setAgentStatusText(MSG.view_remoteAgentInstall_agentStatusDefault());
              doneProcessing();
            }
          }
        });
  }
Пример #3
0
  private void agentStatusCheck() {
    disableButtons(true);
    remoteInstallService.agentStatus(
        getRemoteAccessInfo(),
        getAgentInstallPath(),
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {
            setAgentStatusText(caught.getMessage());
            doneProcessing();
          }

          public void onSuccess(String result) {
            setAgentStatusText(result);
            doneProcessing();
          }
        });
  }
Пример #4
0
  private void stopAgent() {
    disableButtons(true);
    createWaitingWindow(MSG.view_remoteAgentInstall_stopAgentPleaseWait(), true);
    remoteInstallService.stopAgent(
        getRemoteAccessInfo(),
        getAgentInstallPath(),
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {
            displayError(MSG.view_remoteAgentInstall_error_6(), caught);
            doneProcessing();
          }

          public void onSuccess(String result) {
            displayMessage(MSG.view_remoteAgentInstall_stopAgentResults(result));
            agentStatusCheck(); // we are relying on this to call doneProcessing(), we shouldn't do
                                // it here

            // tell the success handler
            invokeSuccessHandler(Type.STOP);
          }
        });
  }