class DefaultOrganizationResourcesProvider implements DefaultResourcesProvider {

  @Override
  public List<ResourceImpl> getResources(String accountId)
      throws ServerException, NotFoundException {
    final Organization organization = organizationManager.getById(accountId);
    // only root organizations should have own resources
    if (organization.getParent() == null) {
      return asList(
          new ResourceImpl(TimeoutResourceType.ID, timeout, TimeoutResourceType.UNIT),
          new ResourceImpl(RamResourceType.ID, ramPerOrganization, RamResourceType.UNIT),
          new ResourceImpl(
              WorkspaceResourceType.ID, workspacesPerOrganization, WorkspaceResourceType.UNIT),
          new ResourceImpl(
              RuntimeResourceType.ID, runtimesPerOrganization, RuntimeResourceType.UNIT));
    }

    return Collections.emptyList();
  }

  @Inject public  DefaultOrganizationResourcesProvider(
      OrganizationManager organizationManager,
      @Named("che.limits.organization.workspaces.ram") String ramPerOrganization,
      @Named("che.limits.organization.workspaces.count") int workspacesPerOrganization,
      @Named("che.limits.organization.workspaces.run.count") int runtimesPerOrganization,
      @Named("che.limits.workspace.idle.timeout") long timeout);

}