use of org.eclipse.che.multiuser.resource.api.AvailableResourcesProvider in project che-server by eclipse-che.
the class ResourceManager method getAvailableResources.
/**
* Returns list of resources which are available for usage by given account.
*
* @param accountId id of account
* @return list of resources which are available for usage 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> getAvailableResources(String accountId) throws NotFoundException, ServerException {
final Account account = accountManager.getById(accountId);
final AvailableResourcesProvider availableResourcesProvider = accountTypeToAvailableResourcesProvider.get(account.getType());
if (availableResourcesProvider == null) {
return defaultAvailableResourcesProvider.getAvailableResources(accountId);
}
return availableResourcesProvider.getAvailableResources(accountId);
}
use of org.eclipse.che.multiuser.resource.api.AvailableResourcesProvider in project devspaces-images by redhat-developer.
the class ResourceManager method getAvailableResources.
/**
* Returns list of resources which are available for usage by given account.
*
* @param accountId id of account
* @return list of resources which are available for usage 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> getAvailableResources(String accountId) throws NotFoundException, ServerException {
final Account account = accountManager.getById(accountId);
final AvailableResourcesProvider availableResourcesProvider = accountTypeToAvailableResourcesProvider.get(account.getType());
if (availableResourcesProvider == null) {
return defaultAvailableResourcesProvider.getAvailableResources(accountId);
}
return availableResourcesProvider.getAvailableResources(accountId);
}
Aggregations