class RepositoryConfigValidationService {

    public RepoConfigValidationV4Response validate(RepoConfigValidationV4Request request) {
        RepoConfigValidationV4Response result = new RepoConfigValidationV4Response();
        if (request != null) {
            String ambariBaseUrl = request.getAmbariBaseUrl();
            if (isNotEmpty(ambariBaseUrl)) {
                result.setAmbariBaseUrl(repoUrlAvailable(ambariBaseUrl, "Ambari"));
            }

            String ambariGpgKeyUrl = request.getAmbariGpgKeyUrl();
            if (isNotEmpty(ambariGpgKeyUrl)) {
                result.setAmbariGpgKeyUrl(isAccessible(ambariGpgKeyUrl, null));
            }

            String stackBaseURL = request.getStackBaseURL();
            if (isNotEmpty(stackBaseURL)) {
                result.setStackBaseURL(repoUrlAvailable(stackBaseURL, "HDP"));
            }

            String utilsBaseURL = request.getUtilsBaseURL();
            if (isNotEmpty(utilsBaseURL)) {
                result.setUtilsBaseURL(repoUrlAvailable(utilsBaseURL, "HDP-UTILS"));
            }

            String versionDefinitionFileUrl = request.getVersionDefinitionFileUrl();
            if (isNotEmpty(versionDefinitionFileUrl)) {
                result.setVersionDefinitionFileUrl(isAccessible(versionDefinitionFileUrl, null));
            }

            String mpackUrl = request.getMpackUrl();
            if (isNotEmpty(mpackUrl)) {
                result.setMpackUrl(isAccessible(mpackUrl, null));
            }
        }
        return result;
    }

}