You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2014/12/10 10:38:39 UTC

[2/5] stratos git commit: Renamed category to filter in cartridge filter methods

Renamed category to filter in cartridge filter methods


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3d66f88d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3d66f88d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3d66f88d

Branch: refs/heads/4.1.0-test
Commit: 3d66f88dbae55403d2b85e8d5f9f371ace5e54e2
Parents: 31d4991
Author: Shiro <sh...@wso2.com>
Authored: Wed Dec 10 13:30:39 2014 +0530
Committer: Shiro <sh...@wso2.com>
Committed: Wed Dec 10 13:30:39 2014 +0530

----------------------------------------------------------------------
 .../stratos/rest/endpoint/api/StratosApiV41.java      | 12 ++++++------
 .../stratos/rest/endpoint/api/StratosApiV41Utils.java | 14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3d66f88d/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 9f055f2..3f839aa 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -177,12 +177,12 @@ public class StratosApiV41 extends AbstractApi {
      * @throws RestAPIException the rest api exception
      */
     @GET
-    @Path("/cartridges/{category}")
+    @Path("/cartridges/{filter}")
     @Produces("application/json")
     @Consumes("application/json")
     @AuthorizationAction("/permission/admin/manage/view/cartridge")
-    public Response getCartridgesByCategory(@DefaultValue("") @PathParam("category") String category, @QueryParam("criteria") String criteria) throws RestAPIException {
-        List<Cartridge> cartridges = StratosApiV41Utils.getCartridgesByCategory(category, criteria, getConfigContext());
+    public Response getCartridgesByFilter(@DefaultValue("") @PathParam("filter") String filter, @QueryParam("criteria") String criteria) throws RestAPIException {
+        List<Cartridge> cartridges = StratosApiV41Utils.getCartridgesByFilter(filter, criteria, getConfigContext());
         ResponseBuilder rb = Response.ok();
         rb.entity(cartridges.isEmpty() ? new Cartridge[0] : cartridges.toArray(new Cartridge[cartridges.size()]));
         return rb.build();
@@ -197,12 +197,12 @@ public class StratosApiV41 extends AbstractApi {
      * @throws RestAPIException the rest api exception
      */
     @GET
-    @Path("/cartridges/{category}/{cartridgeType}")
+    @Path("/cartridges/{filter}/{cartridgeType}")
     @Produces("application/json")
     @Consumes("application/json")
     @AuthorizationAction("/permission/admin/manage/view/cartridge")
-    public Response getCartridgeByCategory(@DefaultValue("") @PathParam("category") String category, @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
-        Cartridge cartridge = StratosApiV41Utils.getCartridgeByCategory(category, cartridgeType, getConfigContext());
+    public Response getCartridgeByFilter(@DefaultValue("") @PathParam("filter") String filter, @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
+        Cartridge cartridge = StratosApiV41Utils.getCartridgeByFilter(filter, cartridgeType, getConfigContext());
         ResponseBuilder rb = Response.ok();
         rb.entity(cartridge);
         return rb.build();

http://git-wip-us.apache.org/repos/asf/stratos/blob/3d66f88d/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 2698621..08ebd2b 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -194,26 +194,26 @@ public class StratosApiV41Utils {
         }
     }
     
-    public static List<Cartridge> getCartridgesByCategory(String category, String criteria, ConfigurationContext configurationContext) 
+    public static List<Cartridge> getCartridgesByFilter(String filter, String criteria, ConfigurationContext configurationContext) 
 			throws RestAPIException {
 		List<Cartridge> cartridges = null;
 		
-		if (category.equals("singleTenant")) {
+		if (filter.equals("singleTenant")) {
 			cartridges = getAvailableCartridges(null, false, configurationContext);
-		} else if (category.equals("multiTenant")) {
+		} else if (filter.equals("multiTenant")) {
 			cartridges = getAvailableCartridges(null, true, configurationContext);
-		} else if (category.equals("loadBalancer")) {
+		} else if (filter.equals("loadBalancer")) {
 			cartridges = getAvailableLbCartridges(false, configurationContext);
-		} else if (category.equals("provider")) {
+		} else if (filter.equals("provider")) {
 			cartridges = getAvailableCartridgesByProvider(criteria, configurationContext);
 		}
 		
 		return cartridges;
 	}
 	
-	public static Cartridge getCartridgeByCategory(String category, String cartridgeType, ConfigurationContext configurationContext) 
+	public static Cartridge getCartridgeByFilter(String filter, String cartridgeType, ConfigurationContext configurationContext) 
 	throws RestAPIException {
-		List<Cartridge> cartridges = getCartridgesByCategory(category, null, configurationContext);
+		List<Cartridge> cartridges = getCartridgesByFilter(filter, null, configurationContext);
 		
 		for (Cartridge cartridge : cartridges) {
 			if (cartridge.getCartridgeType().equals(cartridgeType)) {