Updated Branches: refs/heads/master 1c2453a4a -> 0f6abf70b
adding a method to retreive LB cartridges Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0f6abf70 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0f6abf70 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0f6abf70 Branch: refs/heads/master Commit: 0f6abf70b36b0cb096bf9709054b0b7fa9bef41e Parents: 1c2453a Author: rekathiru <[email protected]> Authored: Tue Feb 11 14:34:46 2014 +0530 Committer: rekathiru <[email protected]> Committed: Tue Feb 11 14:34:46 2014 +0530 ---------------------------------------------------------------------- .../stratos/rest/endpoint/services/ServiceUtils.java | 11 ++++++----- .../stratos/rest/endpoint/services/StratosAdmin.java | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0f6abf70/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 3edb420..96204ee 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 @@ -409,14 +409,15 @@ public class ServiceUtils { throw new RestAPIException("cannot find the required cartridge Type") ; } - static Cartridge getAvailableLbCartridges(Boolean multiTenant, ConfigurationContext configurationContext) throws ADCException, RestAPIException { + static List<Cartridge> getAvailableLbCartridges(Boolean multiTenant, ConfigurationContext configurationContext) throws ADCException { List<Cartridge> cartridges = getAvailableCartridges(null, multiTenant, configurationContext); + List<Cartridge> lbCartridges = new ArrayList<Cartridge>(); for(Cartridge cartridge : cartridges) { - /*if(cartridge.getCartridgeType().equals()) { - return cartridge; - }*/ + if(cartridge.isLoadBalancer()) { + lbCartridges.add(cartridge); + } } - throw new RestAPIException("cannot find the required cartridge Type") ; + return lbCartridges; } static List<Cartridge> getAvailableCartridges(String cartridgeSearchString, Boolean multiTenant, ConfigurationContext configurationContext) throws ADCException { http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0f6abf70/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 ed3faa8..530bc74 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 @@ -319,8 +319,8 @@ public class StratosAdmin extends AbstractAdmin { @Produces("application/json") @Consumes("application/json") @AuthorizationAction("/permission/protected/manage/monitor/tenants") - public Cartridge getAvailableLbCartridges() - throws ADCException, RestAPIException { + public List<Cartridge> getAvailableLbCartridges() + throws ADCException { return ServiceUtils.getAvailableLbCartridges(false, getConfigContext()); }
