use of org.eclipse.che.multiuser.resource.api.ResourceUsageTracker in project che-server by eclipse-che.
the class ResourceManager method getUsedResources.
/**
* Returns list of resources which are used by given account.
*
* @param accountId id of account
* @return list of resources which are used by given account
* @throws NotFoundException when account with specified id was not found
* @throws ServerException when some exception occurred while resources fetching
*/
public List<? extends Resource> getUsedResources(String accountId) throws NotFoundException, ServerException {
List<Resource> usedResources = new ArrayList<>();
for (ResourceUsageTracker usageTracker : usageTrackers) {
Optional<Resource> usedResource = usageTracker.getUsedResource(accountId);
usedResource.ifPresent(usedResources::add);
}
return usedResources;
}
use of org.eclipse.che.multiuser.resource.api.ResourceUsageTracker in project devspaces-images by redhat-developer.
the class ResourceManager method getUsedResources.
/**
* Returns list of resources which are used by given account.
*
* @param accountId id of account
* @return list of resources which are used by given account
* @throws NotFoundException when account with specified id was not found
* @throws ServerException when some exception occurred while resources fetching
*/
public List<? extends Resource> getUsedResources(String accountId) throws NotFoundException, ServerException {
List<Resource> usedResources = new ArrayList<>();
for (ResourceUsageTracker usageTracker : usageTrackers) {
Optional<Resource> usedResource = usageTracker.getUsedResource(accountId);
usedResource.ifPresent(usedResources::add);
}
return usedResources;
}
Aggregations