jetbrains.buildServer.controllers.ActionErrors Java Examples

The following examples show how to use jetbrains.buildServer.controllers.ActionErrors. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EditSQRRunType.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
@NotNull
public ActionErrors validate(@NotNull final HttpServletRequest request, @NotNull final BuildTypeForm form) {
    final ActionErrors errors = new ActionErrors();
    final String sonarServer = getSonarServer(form);
    if (Util.isEmpty(sonarServer)) {
        errors.addError("sonarServer", "SonarQube server should be set");
    } else {
        final SQSInfo server = mySqsManager.getServer(form.getProject(), sonarServer);
        if (server == null) {
            errors.addError("sonarServer", "This SonarQube server doesn't exist");
        }
    }
    return errors;
}
 
Example #2
Source File: VMWareEditProfileController.java    From teamcity-vmware-plugin with Apache License 2.0 5 votes vote down vote up
@Override
protected void doPost(@NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response, @NotNull final Element xmlResponse) {
  final ActionErrors errors = new ActionErrors();

  final BasePropertiesBean propsBean = new BasePropertiesBean(null);
  PluginPropertiesUtil.bindPropertiesFromRequest(request, propsBean, true);

  final Map<String, String> props = propsBean.getProperties();
  final String serverUrl = props.get(VMWareWebConstants.SERVER_URL);
  final String username = props.get(VMWareWebConstants.USERNAME);
  final String password = props.get(VMWareWebConstants.SECURE_PASSWORD);

  try {
    final VMWareApiConnector myApiConnector = VmwareApiConnectorsPool.getOrCreateConnector(
      new URL(serverUrl), username, password, null, null, null, mySslTrustStoreProvider);
    myApiConnector.test();
    xmlResponse.addContent(getVirtualMachinesAsElement(myApiConnector.getVirtualMachines(true)));
    xmlResponse.addContent(getFoldersAsElement(myApiConnector.getFolders()));
    xmlResponse.addContent(getResourcePoolsAsElement(myApiConnector.getResourcePools()));
    xmlResponse.addContent(getCustomizationSpecsAsElement(myApiConnector.getCustomizationSpecs()));
  } catch (Exception ex) {
    LOG.warnAndDebugDetails("Unable to get vCenter details: " + ex.toString(), ex);
    if (ex.getCause() != null && ex.getCause() instanceof SSLException){
      errors.addError(
        "errorFetchResultsSSL",
        VmwareErrorMessages.getInstance().getFriendlyErrorMessage(
          ex, "Please check the connection parameters. See the teamcity-clouds.log for details"
        )
      );
    } else {
      errors.addError(
        "errorFetchResults",
        VmwareErrorMessages.getInstance().getFriendlyErrorMessage(
          ex, "Please check the connection parameters. See the teamcity-clouds.log for details")
      );
    }
    writeErrors(xmlResponse, errors);
  }
}
 
Example #3
Source File: EditSQRRunType.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
public void updateBuildType(@NotNull final HttpServletRequest request,
                            @NotNull final BuildTypeForm form,
                            @NotNull final BuildTypeSettings buildTypeSettings,
                            @NotNull final ActionErrors errors) {
    // do nothing
}