@Experimental(feature = ExperimentalFeature.CUSTOM_SERVICE_REPOS,
    comment = "Remove logic for handling custom service repos after enabling multi-mpack cluster deployment")
  protected void toRepositoryVersionEntity(XmlHolder holder) throws AmbariException {

    // !!! TODO validate parsed object graph

    RepositoryVersionEntity entity = new RepositoryVersionEntity();

    StackId stackId = new StackId(holder.xml.release.stackId);

    StackEntity stackEntity = s_stackDAO.find(stackId.getStackName(), stackId.getStackVersion());

    entity.setStack(stackEntity);

    String credentials = null;
    if (holder.url != null) {
      try {
        URI uri = new URI(holder.url);
        credentials = uri.getUserInfo();
      } catch (URISyntaxException e) {
        throw new AmbariException(String.format("Could not parse url %s", holder.url), e);
      }
    }

    List<RepositoryInfo> repos = holder.xml.repositoryInfo.getRepositories(credentials);

    StackInfo stack = s_metaInfo.get().getStack(stackId);

    // Add service repositories (these are not contained by the VDF but are there in the stack model)
    ListMultimap<String, RepositoryInfo> stackReposByOs = stack.getRepositoriesByOs();
    repos.addAll(RepoUtil.getServiceRepos(repos, stackReposByOs));

    entity.addRepoOsEntities(s_repoVersionHelper.get().createRepoOsEntities(repos));

    entity.setVersion(holder.xml.release.getFullVersion(stack.getReleaseVersion()));

    if (StringUtils.isNotEmpty(holder.xml.release.display)) {
      entity.setDisplayName(holder.xml.release.display);
    } else {
      entity.setDisplayName(stackId.getStackName() + "-" + entity.getVersion());
    }

    entity.setType(holder.xml.release.repositoryType);
    entity.setVersionUrl(holder.url);
    entity.setVersionXml(holder.xmlString);
    entity.setVersionXsd(holder.xml.xsdLocation);

    holder.entity = entity;
  }
Transforms a XML version defintion to an entity

@throws AmbariException if some properties are missing or json has incorrect structure
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java