当前位置: 首页>>代码示例>>Java>>正文


Java PropertiesProcessor类代码示例

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


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

示例1: getPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getPropertiesProcessor() {
    return properties -> {
        List<InvalidProperty> result = new Vector<InvalidProperty>();
        final String releaseName = properties.get(HELM_ROLLBACK_COMMAND_NAME + HelmConstants.RELEASE_NAME);
        if (PropertiesUtil.isEmptyOrNull(releaseName)) {
            result.add(new InvalidProperty(HELM_ROLLBACK_COMMAND_NAME + HelmConstants.RELEASE_NAME, "Release name must be specified"));
        }
        final Integer revision = PropertiesUtil.parseInt(properties.get(HELM_ROLLBACK_COMMAND_NAME + HelmConstants.REVISION));
        if (revision == null || revision <= 0) {
            result.add(new InvalidProperty(HELM_ROLLBACK_COMMAND_NAME + HelmConstants.REVISION, "Revision must be specified as positive integer"));
        }
        return result;
    };
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:17,代码来源:RollbackCommand.java

示例2: getPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getPropertiesProcessor() {
    return properties -> {
        List<InvalidProperty> result = new Vector<InvalidProperty>();
        final String chart = properties.get(HELM_UPGRADE_COMMAND_NAME + HelmConstants.CHART);
        if (PropertiesUtil.isEmptyOrNull(chart)) {
            result.add(new InvalidProperty(HELM_UPGRADE_COMMAND_NAME + HelmConstants.CHART, "Chart must be specified"));
        }
        final String releaseName = properties.get(HELM_UPGRADE_COMMAND_NAME + HelmConstants.RELEASE_NAME);
        if (PropertiesUtil.isEmptyOrNull(releaseName)) {
            result.add(new InvalidProperty(HELM_UPGRADE_COMMAND_NAME + HelmConstants.RELEASE_NAME, "Release name must be specified"));
        }
        return result;
    };
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:17,代码来源:UpgradeCommand.java

示例3: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
    return properties -> {
        List<InvalidProperty> result = new Vector<>();
        final String commandId = properties.get(HelmConstants.COMMAND_ID);
        if (PropertiesUtil.isEmptyOrNull(commandId)) {
            result.add(new InvalidProperty(HelmConstants.COMMAND_ID, "Command to run must be specified"));
        }
        final HelmCommand helmCommand = HelmCommands.find(commandId);
        if(helmCommand != null){
            PropertiesProcessor propertiesProcessor = helmCommand.getPropertiesProcessor();
            if(propertiesProcessor != null) {
                result.addAll(propertiesProcessor.process(properties));
            }
        }
        return result;
    };
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:20,代码来源:HelmRunType.java

示例4: getParametersProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getParametersProcessor() {
    return properties -> {
        ArrayList<InvalidProperty> toReturn = new ArrayList<>();
        if (!properties.containsKey(RunInContainerCloudConstants.ParameterName_CloudProfile))
            toReturn.add(new InvalidProperty(RunInContainerCloudConstants.ParameterName_CloudProfile,
                    "Please choose a cloud profile"));

        if (!properties.containsKey(RunInContainerCloudConstants.ParameterName_Image) ||
                properties.get(RunInContainerCloudConstants.ParameterName_Image).isEmpty())
            toReturn.add(new InvalidProperty(RunInContainerCloudConstants.ParameterName_Image,
                    "Please choose an image"));
        else if (!properties.get(RunInContainerCloudConstants.ParameterName_Image).matches(ContainerCloudConstants.ContainerImageRegex))
            toReturn.add(new InvalidProperty(RunInContainerCloudConstants.ParameterName_Image,
                    "Image must have format owner/image:version or repo-domain/owner/image:version (note that upper-case letters are not allowed)"));

        return toReturn;
    };
}
 
开发者ID:carlpett,项目名称:teamcity-container-cloud,代码行数:21,代码来源:RunInContainerCloudBuildFeature.java

示例5: getPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
public static PropertiesProcessor getPropertiesProcessor() {
    return properties -> {
        if (!properties.containsKey(ContainerCloudConstants.ProfileParameterName_ContainerProvider)) {
            // There's no use trying to validate anything more at this point (shouldn't ever happen anayway...)
            return Stream.of(
                    new InvalidProperty(ContainerCloudConstants.ProfileParameterName_ContainerProvider,
                            "Container provider not selected"))
                    .collect(Collectors.toList());
        }

        PropertiesProcessor specificProcessor;
        String provider = properties.get(ContainerCloudConstants.ProfileParameterName_ContainerProvider);
        switch (provider) {
            case ContainerCloudConstants.ProfileParameterValue_ContainerProvider_DockerSocket:
                specificProcessor = DockerSocketContainerProvider.getPropertiesProcessor();
                break;
            case ContainerCloudConstants.ProfileParameterValue_ContainerProvider_Helios:
                specificProcessor = HeliosContainerProvider.getPropertiesProcessor();
                break;
            default:
                throw new CloudException("Unknown container provider '" + provider + "'");
        }

        return specificProcessor.process(properties);
    };
}
 
开发者ID:carlpett,项目名称:teamcity-container-cloud,代码行数:27,代码来源:ContainerProviderFactory.java

示例6: getParametersProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getParametersProcessor() {
  return new PropertiesProcessor() {
    public Collection<InvalidProperty> process(Map<String, String> properties) {
      List<InvalidProperty> result = new ArrayList<InvalidProperty>();

      final String userName = properties.get(myBean.getRunAsUserKey());
      if (isEmpty(userName))
        result.add(new InvalidProperty(myBean.getRunAsUserKey(), "Please specify an user name"));

      final String password = properties.get(myBean.getRunAsPasswordKey());
      if (isEmpty(password))
        result.add(new InvalidProperty(myBean.getRunAsPasswordKey(), "Please specify a password"));

      return result;
    }
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-runas-plugin,代码行数:20,代码来源:RunAsBuildFeature.java

示例7: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new PropertiesProcessor() {
    @Override
    public Collection<InvalidProperty> process(final Map<String, String> properties) {
      final ArrayList<InvalidProperty> result = new ArrayList<InvalidProperty>();

      final String user = properties.get(RunAsBean.Shared.getRunAsUserKey());
      final String password = properties.get(RunAsBean.Shared.getRunAsPasswordKey());

      if(!(StringUtil.isEmpty(user) && StringUtil.isEmpty(password))) {
        if (StringUtil.isEmptyOrSpaces(user)) {
          result.add(new InvalidProperty(RunAsBean.Shared.getRunAsUserKey(), "The user must be specified."));
        }

        if (StringUtil.isEmpty(password)) {
          result.add(new InvalidProperty(RunAsBean.Shared.getRunAsPasswordKey(), "The password must be specified."));
        }
      }

      return result;
    }
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-runas-plugin,代码行数:26,代码来源:RunAsRunTypeExtension.java

示例8: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new SSHDeployerPropertiesProcessor() {
    @Override
    public Collection<InvalidProperty> process(Map<String, String> properties) {
      final Collection<InvalidProperty> invalidProperties = new HashSet<InvalidProperty>();
      if (jetbrains.buildServer.util.StringUtil.isEmptyOrSpaces(properties.get(DeployerRunnerConstants.PARAM_USERNAME)) &&
          !SSHRunnerConstants.AUTH_METHOD_DEFAULT_KEY.equals(properties.get(SSHRunnerConstants.PARAM_AUTH_METHOD))) {
        invalidProperties.add(new InvalidProperty(DeployerRunnerConstants.PARAM_USERNAME, "Username must be specified."));
      }

      if (jetbrains.buildServer.util.StringUtil.isEmptyOrSpaces(properties.get(DeployerRunnerConstants.PARAM_TARGET_URL))) {
        invalidProperties.add(new InvalidProperty(DeployerRunnerConstants.PARAM_TARGET_URL, "The target must be specified."));
      }

      if (jetbrains.buildServer.util.StringUtil.isEmptyOrSpaces(properties.get(SSHRunnerConstants.PARAM_COMMAND))) {
        invalidProperties.add(new InvalidProperty(SSHRunnerConstants.PARAM_COMMAND, "Remote command must be specified"));
      }
      return invalidProperties;
    }
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:23,代码来源:SSHExecRunType.java

示例9: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
    return new PropertiesProcessor() {
        private void checkNotEmpty(@NotNull final Map<String, String> properties,
                                   @NotNull final String key,
                                   @NotNull final String message,
                                   @NotNull final Collection<InvalidProperty> res) {
            if (jetbrains.buildServer.util.StringUtil.isEmptyOrSpaces(properties.get(key))) {
                res.add(new InvalidProperty(key, message));
            }
        }

        @NotNull
        public Collection<InvalidProperty> process(@Nullable final Map<String, String> p) {
            final Collection<InvalidProperty> result = new ArrayList<InvalidProperty>();
            if (p == null) return result;

            checkNotEmpty(p, DotNetBuildConstants.Instance.getAssemblyKey(), "Assembly must be specified", result);
            checkNotEmpty(p, DotNetBuildConstants.Instance.getTargetKey(), "Target must be specified", result);

            return result;
        }
    };
}
 
开发者ID:stevenlauwers22,项目名称:DotNetBuild.TeamCity,代码行数:26,代码来源:DotNetBuildRunType.java

示例10: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new PropertiesProcessor() {
    @Override
    public Collection<InvalidProperty> process(final Map<String, String> properties) {
      final ArrayList<InvalidProperty> result = new ArrayList<InvalidProperty>();

      final boolean useDotTrace = StringUtil.isTrue(properties.get(DotTraceBean.Shared.getUseDotTraceKey()));
      if(useDotTrace && StringUtil.isEmptyOrSpaces(properties.get(DotTraceBean.Shared.getPathKey()))) {
        result.add(new InvalidProperty(DotTraceBean.Shared.getPathKey(), PATH_NOT_SPECIFIED_ERROR_MESSAGE));
      }

      if(useDotTrace && StringUtil.isEmptyOrSpaces(properties.get(DotTraceBean.Shared.getThresholdsKey()))) {
        result.add(new InvalidProperty(DotTraceBean.Shared.getThresholdsKey(), THRESHOLDS_NOT_SPECIFIED_ERROR_MESSAGE));
      }

      return result;
    }
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:22,代码来源:DotTraceEditExtension.java

示例11: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new PropertiesProcessor() {
    @Override
    public Collection<InvalidProperty> process(final Map<String, String> properties) {
      final ArrayList<InvalidProperty> result = new ArrayList<InvalidProperty>();

      final boolean useDotMemoryUnit = StringUtil.isTrue(properties.get(DotMemoryUnitBean.Shared.getUseDotMemoryUnitKey()));
      if(useDotMemoryUnit && StringUtil.isEmptyOrSpaces(properties.get(DotMemoryUnitBean.Shared.getPathKey()))) {
        result.add(new InvalidProperty(DotMemoryUnitBean.Shared.getPathKey(), DOT_MEMORY_UNIT_PATH_NOT_SPECIFIED_ERROR_MESSAGE));
      }

      if(useDotMemoryUnit && StringUtil.isEmptyOrSpaces(properties.get(DotMemoryUnitBean.Shared.getSnapshotsPathKey()))) {
        result.add(new InvalidProperty(DotMemoryUnitBean.Shared.getSnapshotsPathKey(), SNAPSHOTS_PATH_NOT_SPECIFIED_ERROR_MESSAGE));
      }

      return result;
    }
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-dotmemory,代码行数:22,代码来源:DotMemoryUnitEditExtension.java

示例12: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@NotNull
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new PropertiesProcessor() {
    public Collection<InvalidProperty> process(final Map<String, String> properties) {
        List<InvalidProperty> errors = new ArrayList<InvalidProperty>();
        AnsibleRunConfig config = new AnsibleRunConfig(properties);
        if (AnsibleCommand.EXECUTABLE.equals(config.getCommandType())) {
            if (StringUtil.isEmptyOrSpaces(config.getExecutable())) {
                errors.add(new InvalidProperty(AnsibleRunnerConstants.EXECUTABLE_KEY, "Cannot be empty"));
            }
            if (StringUtil.isEmptyOrSpaces(config.getPlaybook())) {
                errors.add(new InvalidProperty(AnsibleRunnerConstants.PLAYBOOK_FILE_KEY, "Cannot be empty"));
            }
        } else if (AnsibleCommand.CUSTOM_SCRIPT.equals(config.getCommandType())) {
            if (StringUtil.isEmptyOrSpaces(config.getSourceCode())) {
                errors.add(new InvalidProperty(AnsibleRunnerConstants.SOURCE_CODE_KEY, "Cannot be empty"));
            }
        }
      return errors;
    }
  };
}
 
开发者ID:andreizhuk,项目名称:tc-ansible-runner,代码行数:24,代码来源:AnsibleRunType.java

示例13: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
    return new PropertiesProcessor() {
        public Collection<InvalidProperty> process(Map<String, String> properties) {
            List<InvalidProperty> invalidProperties = new LinkedList<InvalidProperty>();

            final String serverId = properties.get(Constants.SONAR_SERVER_ID);
            if (serverId == null) {
                invalidProperties.add(new InvalidProperty(Constants.SQS_CHOOSER, "Choose a SonarQube Server to send information to"));
            }

            return invalidProperties;
        }
    };
}
 
开发者ID:JetBrains,项目名称:TeamCity.SonarQubePlugin,代码行数:17,代码来源:SQRRunType.java

示例14: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Nullable
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return new PropertiesProcessor() {
    @NotNull
    public Collection<InvalidProperty> process(Map<String, String> properties) {
      List<InvalidProperty> result = new ArrayList<InvalidProperty>();
      if (StringUtil.isEmptyOrSpaces(properties.get(VMConstants.PARAMETER_SCRIPT))) {
        result.add(new InvalidProperty(VMConstants.PARAMETER_SCRIPT, "Script should not be empty"));
      }

      final String vm = properties.get(VMConstants.PARAMETER_VM);
      final VM w = VM.find(vm);
      if (w == null) {
        result.add(new InvalidProperty(VMConstants.PARAMETER_VM, "Unknown VM"));
      } else {
        result.addAll(w.validate(properties));
      }
      return result;
    }
  };
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:23,代码来源:VMRunType.java

示例15: getRunnerPropertiesProcessor

import jetbrains.buildServer.serverSide.PropertiesProcessor; //导入依赖的package包/类
@Override
public PropertiesProcessor getRunnerPropertiesProcessor() {
  return properties -> {
    Collection<InvalidProperty> col = new ArrayList<>();
    final PowerShellExecutionMode exe = PowerShellExecutionMode.fromString(properties.get(RUNNER_EXECUTION_MODE));
    if (exe == null) {
      col.add(new InvalidProperty(RUNNER_EXECUTION_MODE, "Execution mode must be specified"));
    }

    final PowerShellScriptMode mod = getScriptMode(properties);
    if (mod == null) {
      col.add(new InvalidProperty(RUNNER_SCRIPT_MODE, "Script mode is not defined"));
    } else {
      switch (mod) {
        case FILE:
          final String script = properties.get(RUNNER_SCRIPT_FILE);
          if (StringUtil.isEmptyOrSpaces(script)) {
            col.add(new InvalidProperty(RUNNER_SCRIPT_FILE, "Script file is not defined"));
          } else if (!ReferencesResolverUtil.containsReference(script) && !script.toLowerCase().endsWith(".ps1")) {
            col.add(new InvalidProperty(RUNNER_SCRIPT_FILE, "PowerShell requires script files to have .ps1 extension"));
          }
          break;
        case CODE:
          if (StringUtil.isEmptyOrSpaces(properties.get(RUNNER_SCRIPT_CODE))) {
            col.add(new InvalidProperty(RUNNER_SCRIPT_CODE, "Code should not be empty"));
          }
          break;
      }
    }
    return col;
  };
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:33,代码来源:PowerShellRunType.java


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