private List<Vcenter> filterVcentersByTenant(List<Vcenter> vcenters,URI tenantId){
  List<Vcenter> tenantVcenterList=new ArrayList<Vcenter>();
  Iterator<Vcenter> vcenterIt=vcenters.iterator();
  while (vcenterIt.hasNext()) {
    Vcenter vcenter=vcenterIt.next();
    if (vcenter == null) {
      continue;
    }
    Set<URI> tenantUris=_permissionsHelper.getUsageURIsFromAcls(vcenter.getAcls());
    if (CollectionUtils.isEmpty(tenantUris)) {
      continue;
    }
    if (!NullColumnValueGetter.isNullURI(tenantId) && !tenantUris.contains(tenantId)) {
      continue;
    }
    Iterator<URI> tenantUriIt=tenantUris.iterator();
    while (tenantUriIt.hasNext()) {
      if (verifyAuthorizedInTenantOrg(tenantUriIt.next())) {
        tenantVcenterList.add(vcenter);
      }
    }
  }
  return tenantVcenterList;
}

private List < Vcenter > filterVcentersByTenant ( List < Vcenter > vcenters , URI tenantId ) { List < Vcenter > tenantVcenterList = new ArrayList < Vcenter > ( ) ; Iterator < Vcenter > vcenterIt = vcenters . iterator ( ) ; while ( vcenterIt . hasNext ( ) ) { Vcenter vcenter = vcenterIt . next ( ) ; if ( vcenter == null ) { continue ; } Set < URI > tenantUris = _permissionsHelper . getUsageURIsFromAcls ( vcenter . getAcls ( ) ) ; if ( CollectionUtils . isEmpty ( tenantUris ) ) { continue ; } if ( ! NullColumnValueGetter . isNullURI ( tenantId ) && ! tenantUris . contains ( tenantId ) ) { continue ; } Iterator < URI > tenantUriIt = tenantUris . iterator ( ) ; while ( tenantUriIt . hasNext ( ) ) { if ( verifyAuthorizedInTenantOrg ( tenantUriIt . next ( ) ) ) { tenantVcenterList . add ( vcenter ) ; } } } return tenantVcenterList ; }
filters the vcenters by the tenant . if the provided tenant is null or the tenant does not share the vcenter than the vcenters are filtered with the user ' s tenant .
