Repository: airavata Updated Branches: refs/heads/master bdad5c67a -> 5d6cb2911
adding getting list of all gateway profiles Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5d6cb291 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5d6cb291 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5d6cb291 Branch: refs/heads/master Commit: 5d6cb2911a3dd9a8e1d2604b7cb5538e1103d27a Parents: bdad5c6 Author: Chathuri Wimalasena <[email protected]> Authored: Tue Jul 8 13:35:07 2014 -0400 Committer: Chathuri Wimalasena <[email protected]> Committed: Tue Jul 8 13:35:07 2014 -0400 ---------------------------------------------------------------------- .../appcatalog/cpi/GwyResourceProfile.java | 2 ++ .../data/impl/GwyResourceProfileImpl.java | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/5d6cb291/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/GwyResourceProfile.java ---------------------------------------------------------------------- diff --git a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/GwyResourceProfile.java b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/GwyResourceProfile.java index ceb4921..ba7b0d3 100644 --- a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/GwyResourceProfile.java +++ b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/GwyResourceProfile.java @@ -55,4 +55,6 @@ public interface GwyResourceProfile { * @return */ List<ComputeResourcePreference> getAllComputeResourcePreferences (String gatewayId) throws AppCatalogException; + + List<String> getGatewayProfileIds (String gatewayName) throws AppCatalogException; } http://git-wip-us.apache.org/repos/asf/airavata/blob/5d6cb291/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java ---------------------------------------------------------------------- diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java index 4ce597a..279ff0e 100644 --- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java +++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java @@ -21,6 +21,7 @@ package org.apache.aiaravata.application.catalog.data.impl; +import java.util.ArrayList; import java.util.List; import org.airavata.appcatalog.cpi.AppCatalogException; @@ -185,4 +186,22 @@ public class GwyResourceProfileImpl implements GwyResourceProfile { throw new AppCatalogException(e); } } + + @Override + public List<String> getGatewayProfileIds(String gatewayName) throws AppCatalogException { + try { + GatewayProfileResource profileResource = new GatewayProfileResource(); + List<Resource> resourceList = profileResource.get(AbstractResource.GatewayProfileConstants.GATEWAY_NAME, gatewayName); + List<String> gatewayIds = new ArrayList<String>(); + if (resourceList != null && !resourceList.isEmpty()){ + for (Resource resource : resourceList){ + gatewayIds.add(((GatewayProfileResource)resource).getGatewayID()); + } + } + return gatewayIds; + }catch (Exception e) { + logger.error("Error while retrieving gateway ids...", e); + throw new AppCatalogException(e); + } + } }
