private boolean checkViewVersion(ViewEntity view, String version, String serverVersion, String label,
                                   int errValue, String errMsg) {

    if (version != null && !version.isEmpty()) {

      // make sure that the given version is a valid version string
      if (!version.matches(VIEW_AMBARI_VERSION_REGEXP)) {
        String msg = "The configured " + label + " Ambari version " + version + " for view " +
            view.getName() + " is not valid.";

        setViewStatus(view, ViewEntity.ViewStatus.ERROR, msg);
        LOG.error(msg);
        return false;
      }

      int index = version.indexOf('*');

      int compVal = index == -1 ? VersionUtils.compareVersions(serverVersion, version) :
          index > 0 ? VersionUtils.compareVersions(serverVersion, version.substring(0, index), index) : 0;

      if (compVal == errValue) {
        String msg = "The Ambari server version " + serverVersion + " is " + errMsg + " the configured " + label +
            " Ambari version " + version + " for view " + view.getName();

        setViewStatus(view, ViewEntity.ViewStatus.ERROR, msg);
        LOG.error(msg);
        return false;
      }
    }
    return true;
  }
Check the configured view max and min Ambari versions for the given view entity
against the given Ambari server version.

@param view          the view
@param serverVersion the server version
@return true if the given server version >= min version && <= max version for the given view
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java