@Override
  public UpgradeCheckResult perform(UpgradeCheckRequest request) throws AmbariException {
    UpgradeCheckResult result = new UpgradeCheckResult(this);
    RepositoryVersion repositoryVersion = request.getTargetRepositoryVersion();
    StackId stackId = new StackId(repositoryVersion.getStackId());

    Cluster cluster = clustersProvider.get().getCluster(request.getClusterName());
    String stackName = stackId.getStackName();
    String stackVersion = stackId.getStackVersion();
    Collection<String> allUnsupported = serviceComponentSupport.allUnsupported(cluster, stackName, stackVersion);

    report(result, request, allUnsupported);

    return result;
  }
The {@link ComponentsExistInRepoCheck} is used to determine if any of the
components scheduled for upgrade do not exist in the target repository or
stack.
ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java