class ResourceManager {

  public ResourcesDetails getResourceDetails(String accountId)
      throws NotFoundException, ServerException {
    final List<ProvidedResources> resources = new ArrayList<>();
    for (ResourcesProvider resourcesProvider : resourcesProviders) {
      resources.addAll(resourcesProvider.getResources(accountId));
    }

    final List<Resource> allResources =
        resources
            .stream()
            .flatMap(providedResources -> providedResources.getResources().stream())
            .collect(Collectors.toList());

    return new ResourcesDetailsImpl(
        accountId,
        resources,
        new ArrayList<>(resourceAggregator.aggregateByType(allResources).values()));
  }

  @Inject public  ResourceManager(
      ResourceAggregator resourceAggregator,
      Set<ResourcesProvider> resourcesProviders,
      Set<ResourceUsageTracker> usageTrackers,
      AccountManager accountManager,
      Map<String, AvailableResourcesProvider> accountTypeToAvailableResourcesProvider,
      DefaultAvailableResourcesProvider defaultAvailableResourcesProvider);

}