Updated Branches: refs/heads/master c4255c6c5 -> 6474a7916
fixing the validation issue when listing members Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/1a7b03be Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/1a7b03be Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/1a7b03be Branch: refs/heads/master Commit: 1a7b03be1adc5f363b289b6df4454714a179442e Parents: e5d7e1f Author: rekathiru <[email protected]> Authored: Thu Feb 6 12:10:02 2014 +0530 Committer: rekathiru <[email protected]> Committed: Thu Feb 6 12:10:02 2014 +0530 ---------------------------------------------------------------------- .../apache/stratos/rest/endpoint/services/ServiceUtils.java | 8 ++++++-- .../apache/stratos/rest/endpoint/services/StratosAdmin.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1a7b03be/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java index f1522f2..7849e2d 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java @@ -950,11 +950,15 @@ public class ServiceUtils { } - public static org.apache.stratos.rest.endpoint.bean.topology.Cluster getCluster (String cartridgeType, String subscriptionAlias, ConfigurationContext configurationContext) { + public static org.apache.stratos.rest.endpoint.bean.topology.Cluster getCluster (String cartridgeType, String subscriptionAlias, ConfigurationContext configurationContext) throws RestAPIException { Cluster cluster = TopologyClusterInformationModel.getInstance().getCluster(ApplicationManagementUtil.getTenantId(configurationContext) ,cartridgeType , subscriptionAlias); - return PojoConverter.populateClusterPojos(cluster); + if(cluster == null) { + throw new RestAPIException(); + } else{ + return PojoConverter.populateClusterPojos(cluster); + } } public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForTenant (ConfigurationContext configurationContext) { http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1a7b03be/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java index 8e6f14b..207ca11 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java @@ -356,7 +356,7 @@ public class StratosAdmin extends AbstractAdmin { @Consumes("application/json") @AuthorizationAction("/permission/protected/manage/monitor/tenants") public Cluster getCluster(@PathParam("cartridgeType") String cartridgeType, - @PathParam("subscriptionAlias") String subscriptionAlias) throws ADCException { + @PathParam("subscriptionAlias") String subscriptionAlias) throws ADCException, RestAPIException { return ServiceUtils.getCluster(cartridgeType, subscriptionAlias, getConfigContext()); }
