use of org.apache.airavata.registry.core.app.catalog.resources.AppCatalogResource in project airavata by apache.
the class StorageResourceImpl method getAllStorageResourceIdList.
/**
* This method will retrieve all the storage resource id with it's name
*
* @return map of storage resource ids + name
* @throws AppCatalogException
*/
@Override
public Map<String, String> getAllStorageResourceIdList() throws AppCatalogException {
try {
Map<String, String> storageResourceMap = new HashMap<String, String>();
StorageResourceResource resource = new StorageResourceResource();
List<AppCatalogResource> allStorageResources = resource.getAll();
if (allStorageResources != null && !allStorageResources.isEmpty()) {
for (AppCatalogResource sr : allStorageResources) {
StorageResourceResource srr = (StorageResourceResource) sr;
storageResourceMap.put(srr.getStorageResourceId(), srr.getHostName());
}
}
return storageResourceMap;
} catch (Exception e) {
logger.error("Error while retrieving storage resource list...", e);
throw new AppCatalogException(e);
}
}
use of org.apache.airavata.registry.core.app.catalog.resources.AppCatalogResource in project airavata by apache.
the class StorageResourceImpl method getAllStorageResourceList.
/**
* This method will retrieve all the storage resources
*
* @return list of storage resources
* @throws AppCatalogException
*/
@Override
public List<StorageResourceDescription> getAllStorageResourceList() throws AppCatalogException {
List<StorageResourceDescription> storageResourceDescriptions = new ArrayList<StorageResourceDescription>();
try {
StorageResourceResource resource = new StorageResourceResource();
List<AppCatalogResource> resources = resource.getAll();
if (resources != null && !resources.isEmpty()) {
storageResourceDescriptions = AppCatalogThriftConversion.getStorageDescriptionList(resources);
}
} catch (Exception e) {
logger.error("Error while retrieving storage resource list...", e);
throw new AppCatalogException(e);
}
return storageResourceDescriptions;
}
use of org.apache.airavata.registry.core.app.catalog.resources.AppCatalogResource in project airavata by apache.
the class StorageResourceImpl method getAvailableStorageResourceIdList.
/**
* This method will retrieve all the enabled storage resource id with it's name
*
* @return
* @throws AppCatalogException
*/
@Override
public Map<String, String> getAvailableStorageResourceIdList() throws AppCatalogException {
try {
Map<String, String> storageResourceMap = new HashMap<String, String>();
StorageResourceResource resource = new StorageResourceResource();
List<AppCatalogResource> allStorageResources = resource.getAll();
if (allStorageResources != null && !allStorageResources.isEmpty()) {
for (AppCatalogResource sr : allStorageResources) {
StorageResourceResource srr = (StorageResourceResource) sr;
if (srr.isEnabled()) {
storageResourceMap.put(srr.getStorageResourceId(), srr.getHostName());
}
}
}
return storageResourceMap;
} catch (Exception e) {
logger.error("Error while retrieving storage resource list...", e);
throw new AppCatalogException(e);
}
}
Aggregations