public PropertiesProcessor getVcsPropertiesProcessor()

in vault-server/src/jetbrains/buildServer/buildTriggers/vcs/vault/VaultVcsSupport.java [167:190]


  public PropertiesProcessor getVcsPropertiesProcessor() {
    return new AbstractVcsPropertiesProcessor() {
      public Collection<InvalidProperty> process(final Map<String, String> properties) {
        final List<InvalidProperty> invalids = new ArrayList<InvalidProperty>();
        String prop;
        prop = properties.get(VaultUtil.SERVER);
        if (isEmpty(prop)) {
          invalids.add(new InvalidProperty(VaultUtil.SERVER, "Vault server URL must be specified"));
        } else if (!ReferencesResolverUtil.mayContainReference(prop) && (!prop.startsWith(HTTP_PEFIX) && !prop.startsWith(HTTPS_PEFIX) || !prop.endsWith(VAULT_SERVICE_SUFFIX))) {
          invalids.add(new InvalidProperty(VaultUtil.SERVER,
            "Vault server URL must have http://hostname[:port]/VaultService or https://hostname[:port]/VaultService structure"));
        }
        prop = properties.get(VaultUtil.REPO);
        if (isEmpty(prop)) {
          invalids.add(new InvalidProperty(VaultUtil.REPO, "The repository name must be specified"));
        }
        prop = properties.get(VaultUtil.USER);
        if (isEmpty(prop)) {
          invalids.add(new InvalidProperty(VaultUtil.USER, "The user name must be specified"));
        }
        return invalids;
      }
    };
  }