private Set < CacheKey > getCacheKeys ( ) { Set < CacheKey > cacheKeys = new HashSet < CacheKey > ( ) ; Applications apps = registry . getApplicationsFromLocalRegionOnly ( ) ; for ( Application app : apps . getRegisteredApplications ( ) ) { for ( InstanceInfo instanceInfo : app . getInstances ( ) ) { String localAccountId = getAccountId ( instanceInfo , accountId ) ; String asgName = instanceInfo . getASGName ( ) ; if ( asgName != null ) { CacheKey key = new CacheKey ( localAccountId , asgName ) ; cacheKeys . add ( key ) ; } } } return cacheKeys ; }
Get the cacheKeys of all the ASG to which query AWS for .