• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ActionErrors类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中jetbrains.buildServer.controllers.ActionErrors的典型用法代码示例。如果您正苦于以下问题:Java ActionErrors类的具体用法?Java ActionErrors怎么用?Java ActionErrors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionErrors类属于jetbrains.buildServer.controllers包,在下文中一共展示了ActionErrors类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkInput

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
public void checkInput(final HttpServletRequest request, final ActionErrors errors) throws IllegalArgumentException, EncryptionException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    final HubServerConfigBuilder builder = getHubServerConfigBuilderFromRequest(request);

    final AbstractValidator validator = builder.createValidator();

    final ValidationResults results = validator.assertValid();
    if (results.isSuccess()) {
        final HubServerConfig config = builder.buildObject();
        configPersistenceManager.setHubServerConfig(config);
        configPersistenceManager.setHubWorkspaceCheck(Boolean.valueOf(request.getParameter("hubWorkspaceCheck")));
    } else {
        checkForErrors(HubServerConfigFieldEnum.HUBURL, "errorUrl", results, errors);
        checkForErrors(HubServerConfigFieldEnum.HUBTIMEOUT, "errorTimeout", results, errors);

        checkForErrors(HubCredentialsFieldEnum.USERNAME, "errorUserName", results, errors);
        checkForErrors(HubCredentialsFieldEnum.PASSWORD, "errorPassword", results, errors);

        checkForErrors(HubProxyInfoFieldEnum.PROXYHOST, "errorHubProxyServer", results, errors);
        checkForErrors(HubProxyInfoFieldEnum.PROXYPORT, "errorHubProxyPort", results, errors);
        checkForErrors(HubProxyInfoFieldEnum.NOPROXYHOSTS, "errorHubNoProxyHost", results, errors);
        checkForErrors(HubProxyInfoFieldEnum.PROXYUSERNAME, "errorHubProxyUser", results, errors);
        checkForErrors(HubProxyInfoFieldEnum.PROXYPASSWORD, "errorHubProxyPass", results, errors);
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:25,代码来源:HubGlobalServerConfigController.java


示例2: validate

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
public ActionErrors validate(final GlobalConfigRequest request) {
    GlobalConfigRequestType type = request.getType();
    ActionErrors errors = new ActionErrors();
    
    if(BUSINESS_DATA_TYPES.contains(type)){
        String username = request.getUsername();
        String password = request.getPassword();
        
        if (StringUtils.isBlank(username)) {
            errors.addError("errorUsername", "Username can't be empty.");
        }

        if (StringUtils.isBlank(password)) {
            errors.addError("errorPassword", "Password can't be empty.");
        }
    }
    
    if(IDENTIFYABLE_TYPES.contains(type)) {
        String id = request.getId();
        if (StringUtils.isBlank(id)) {
            errors.addError("errorId", "Identifier can't be empty.");
        }
    }
    
    return errors;
}
 
开发者ID:automate-website,项目名称:teamcity-plugin,代码行数:27,代码来源:GlobalConfigRequestValidator.java


示例3: handleTestConnectionRequest

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
private void handleTestConnectionRequest(final HttpServletRequest request, final Element xmlResponse) {
    ActionErrors errors = new ActionErrors();
    try {
        errors = testConnection(request);
        if (errors.hasErrors()) {
            errors.serialize(xmlResponse);
        }
    } catch (final Exception e) {
        Loggers.SERVER.error("Error testing Server connection", e);
        errors.addError("errorConnection", e.toString());
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:13,代码来源:HubGlobalServerConfigController.java


示例4: hasSSLErrors

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
private boolean hasSSLErrors(final ActionErrors errors) {
    final ActionErrors.Error error = errors.findErrorById("errorUrl");
    if (null != error) {
        return error.getMessage().toLowerCase().contains("ssl");
    }
    return false;
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:8,代码来源:HubGlobalServerConfigController.java


示例5: doPost

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
@Override
protected void doPost(@NotNull final HttpServletRequest request,
                      @NotNull final HttpServletResponse response,
                      @NotNull final Element xmlResponse) {
  final ActionErrors errors = new ActionErrors();
  final Map<String, String> parameters = getProperties(request);

  try {
    xmlResponse.addContent((Content) S3Util.withS3Client(parameters, s3Client -> {
      final Element bucketsElement = new Element("buckets");
      for (Bucket bucket : s3Client.listBuckets()) {
        final Element bucketElement = new Element("bucket");
        final String bucketName = bucket.getName();
        final String location = s3Client.getBucketLocation(bucketName);
        final String regionName = getRegionName(location);
        bucketElement.setAttribute("location", regionName);
        bucketElement.setText(bucketName);
        bucketsElement.addContent(bucketElement);
      }
      return bucketsElement;
    }));
  } catch (Throwable e) {
    final String message = String.format("Failed to get list of buckets: %s", e.getMessage());
    LOG.infoAndDebugDetails(message, e);
    errors.addError("buckets", message);
  }

  if (errors.hasErrors()) {
    errors.serialize(xmlResponse);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-s3-artifact-storage-plugin,代码行数:32,代码来源:S3SettingsController.java


示例6: handleException

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
private void handleException(ActionErrors errors, Exception e) {
    Throwable throwable = e.getCause();
    String errorMessage;
    if (throwable != null) {
        errorMessage = e.getMessage() + " (" + throwable.getClass().getCanonicalName() + ")";
    } else {
        errorMessage = e.getClass().getCanonicalName() + ": " + e.getMessage();
    }
    errors.addError("objectError", errorMessage);
    Loggers.SERVER.error("GlobalConfigRequest processing failed.", e);
}
 
开发者ID:automate-website,项目名称:teamcity-plugin,代码行数:12,代码来源:GlobalServerConfigController.java


示例7: validate

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
@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;
}
 
开发者ID:JetBrains,项目名称:TeamCity.SonarQubePlugin,代码行数:15,代码来源:EditSQRRunType.java


示例8: doPost

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
@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);
    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);
    errors.addError(
      "errorFetchResults",
      VmwareErrorMessages.getInstance().getFriendlyErrorMessage(
        ex, "Please check the connection parameters. See the teamcity-clouds.log for details")
    );
    writeErrors(xmlResponse, errors);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:30,代码来源:VMWareEditProfileController.java


示例9: checkForErrors

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
private void checkForErrors(final FieldEnum key, final String fieldId, final ValidationResults results, final ActionErrors errors) {
    if (!results.isSuccess()) {
        errors.addError(fieldId, results.getResultString(key));
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:6,代码来源:HubGlobalServerConfigController.java


示例10: updateBuildType

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
public void updateBuildType(@NotNull final HttpServletRequest request,
                            @NotNull final BuildTypeForm form,
                            @NotNull final BuildTypeSettings buildTypeSettings,
                            @NotNull final ActionErrors errors) {
    // do nothing
}
 
开发者ID:JetBrains,项目名称:TeamCity.SonarQubePlugin,代码行数:7,代码来源:EditSQRRunType.java


示例11: validate

import jetbrains.buildServer.controllers.ActionErrors; //导入依赖的package包/类
@Override
protected ActionErrors validate(VSONotificatorSettingsBean settingsBean) {
  return new ActionErrors();
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:5,代码来源:VSONotificatorSettingsController.java



注:本文中的jetbrains.buildServer.controllers.ActionErrors类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ExtendedBlockId类代码示例发布时间:2022-05-23
下一篇:
Java BindingApiMessages类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap