question: 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 ; }
target:  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.