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 2015/05/21 16:13:28 UTC

[01/23] stratos git commit: Modified service group into cartridge group

Repository: stratos
Updated Branches:
  refs/heads/master 6b130b3fa -> c4235bfee


Modified service group into cartridge group


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

Branch: refs/heads/master
Commit: e414299516c95094fe6e9e25a35ea2d54f39b28e
Parents: 21f7931
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 13:35:33 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 13:35:33 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/autoscaler/util/AutoscalerUtil.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e4142995/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
index ce71418..71661a7 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
@@ -870,7 +870,8 @@ public class AutoscalerUtil {
             for (String splittedStartupOrder : splittedStartupOrders) {
                 if (!splittedStartupOrder.trim().startsWith("cartridge.") && !splittedStartupOrder.trim().startsWith("group.")) {
                     // invalid startup order; should prefixed by either 'cartridge.' or 'group.'
-                    throw new InvalidServiceGroupException("Invalid Service Group: startup order [" + startupOrder + "] for group " + groupName +
+                    throw new InvalidServiceGroupException("Invalid cartridge group: startup order [" + startupOrder +
+                            "] for group " + groupName +
                             ", should prefixed by either 'cartridge.' or 'group.'");
                 }
             }
@@ -892,7 +893,8 @@ public class AutoscalerUtil {
             for (String splittedDependent : splittedDependents) {
                 if (!splittedDependent.trim().startsWith("cartridge.") && !splittedDependent.trim().startsWith("group.")) {
                     // invalid startup order; should prefixed by either 'cartridge.' or 'group.'
-                    throw new InvalidServiceGroupException("Invalid Service Group: Scaling Dependency [" + scalingDependent + "] for group " + groupName +
+                    throw new InvalidServiceGroupException("Invalid cartridge group: Scaling Dependency [" +
+                            scalingDependent + "] for group " + groupName +
                             ", should prefixed by either 'cartridge.' or 'group.'");
                 }
             }


[10/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: f8e622d98ed12e201c77aabb7e36ab4bf694de5f
Parents: 9f6a5af 7f58cdb
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 22:21:13 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 22:21:13 2015 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[16/23] stratos git commit: Fixed issues found when removing a non existing cartridge

Posted by re...@apache.org.
Fixed issues found when removing a non existing cartridge


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

Branch: refs/heads/master
Commit: 04bf4cbb7ed750c5f252b1bc75ef93c23d158ede
Parents: 2ca933c
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 19:24:53 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 19:24:53 2015 +0530

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


http://git-wip-us.apache.org/repos/asf/stratos/blob/04bf4cbb/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 7b50e40..bb6585f 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
@@ -426,10 +426,14 @@ public class StratosApiV41 extends AbstractApi {
     @AuthorizationAction("/permission/protected/manage/removeCartridge")
     public Response removeCartridge(
             @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
-        StratosApiV41Utils.removeCartridge(cartridgeType);
-        return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
-                String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
-
+        try {
+            StratosApiV41Utils.removeCartridge(cartridgeType);
+            return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
+                    String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
+        } catch (Exception e) {
+            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
+                    ResponseMessageBean.ERROR, e.getMessage())).build();
+        }
     }
 
     // API methods for cartridge groups

http://git-wip-us.apache.org/repos/asf/stratos/blob/04bf4cbb/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 9fd3413..8ca2ff0 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
@@ -25,7 +25,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.autoscaler.stub.*;
 import org.apache.stratos.autoscaler.stub.deployment.policy.ApplicationPolicy;
-import org.apache.stratos.autoscaler.stub.exception.UnremovablePolicyException;
 import org.apache.stratos.autoscaler.stub.pojo.ApplicationContext;
 import org.apache.stratos.autoscaler.stub.pojo.ServiceGroup;
 import org.apache.stratos.cloud.controller.stub.*;
@@ -252,10 +251,12 @@ public class StratosApiV41Utils {
             if (log.isInfoEnabled()) {
                 log.info(String.format("Successfully removed cartridge: [cartridge-type] %s ", cartridgeType));
             }
-        } catch (Exception e) {
-            String msg = "Could not remove cartridge " + e.getLocalizedMessage();
-            log.error(msg, e);
-            throw new RestAPIException(e.getMessage(), e);
+        } catch (RemoteException e) {
+            throw new RestAPIException(e.getMessage());
+        } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
+            throw new RestAPIException(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage());
+        } catch (CloudControllerServiceCartridgeNotFoundExceptionException e) {
+            throw new RestAPIException(e.getFaultMessage().getCartridgeNotFoundException().getMessage());
         }
     }
 


[03/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 8c395a8dc2cc2e3ebe719cadd509d6dd5c645c63
Parents: fd23b6c 75d55a0
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 15:30:37 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 15:30:37 2015 +0530

----------------------------------------------------------------------
 .../stratos/cli/RestCommandLineService.java     |  11 +-
 .../console/controllers/rest/rest_calls.jag     | 179 ++++++++++---------
 2 files changed, 102 insertions(+), 88 deletions(-)
----------------------------------------------------------------------



[02/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: fd23b6c37c52d08f78037fa365d7eec526908d6e
Parents: e414299 a7c7dd8
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 13:35:51 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 13:35:51 2015 +0530

----------------------------------------------------------------------
 products/stratos/dbscripts/billing-h2.sql       | 128 -----
 products/stratos/dbscripts/billing-mysql.sql    | 139 -----
 products/stratos/dbscripts/metering_h2.sql      | 133 -----
 products/stratos/dbscripts/metering_mysql.sql   | 168 ------
 products/stratos/dbscripts/migration.sql        |  26 -
 products/stratos/dbscripts/s2_h2.sql            | 115 ----
 products/stratos/dbscripts/stratos_mysql.sql    | 159 ------
 products/stratos/dbscripts/wso2_rss.sql         |  99 ----
 products/stratos/modules/distribution/pom.xml   |  84 +--
 .../modules/distribution/src/assembly/bin.xml   | 545 +++++++++----------
 10 files changed, 277 insertions(+), 1319 deletions(-)
----------------------------------------------------------------------



[18/23] stratos git commit: handling specific exceptions in API class

Posted by re...@apache.org.
handling specific exceptions in API class


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

Branch: refs/heads/master
Commit: 4c6da2e9e9af6b2aaec8ff05cf17abb39e7a4965
Parents: 2ac1499
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 22:32:37 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 22:32:37 2015 +0530

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


http://git-wip-us.apache.org/repos/asf/stratos/blob/4c6da2e9/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 b4dbb45..1a0ca88 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
@@ -59,6 +59,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 import java.net.URI;
+import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -430,9 +431,16 @@ public class StratosApiV41 extends AbstractApi {
             StratosApiV41Utils.removeCartridge(cartridgeType);
             return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
                     String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
-        } catch (Exception e) {
+        } catch (RemoteException e) {
             return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
                     ResponseMessageBean.ERROR, e.getMessage())).build();
+        } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
+            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
+                    ResponseMessageBean.ERROR, e.getFaultMessage().getInvalidCartridgeTypeException().getMessage()))
+                    .build();
+        } catch (CloudControllerServiceCartridgeNotFoundExceptionException e) {
+            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
+                    ResponseMessageBean.ERROR, e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/4c6da2e9/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 8ca2ff0..2be2180 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
@@ -225,9 +225,10 @@ public class StratosApiV41Utils {
      * @param cartridgeType Cartridge Type
      * @throws RestAPIException
      */
-    public static void removeCartridge(String cartridgeType) throws RestAPIException {
+    public static void removeCartridge(String cartridgeType) throws RestAPIException, RemoteException,
+            CloudControllerServiceCartridgeNotFoundExceptionException,
+            CloudControllerServiceInvalidCartridgeTypeExceptionException {
 
-        try {
             if (log.isDebugEnabled()) {
                 log.debug(String.format("Removing cartridge: [cartridge-type] %s ", cartridgeType));
             }
@@ -251,13 +252,6 @@ public class StratosApiV41Utils {
             if (log.isInfoEnabled()) {
                 log.info(String.format("Successfully removed cartridge: [cartridge-type] %s ", cartridgeType));
             }
-        } catch (RemoteException e) {
-            throw new RestAPIException(e.getMessage());
-        } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
-            throw new RestAPIException(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage());
-        } catch (CloudControllerServiceCartridgeNotFoundExceptionException e) {
-            throw new RestAPIException(e.getFaultMessage().getCartridgeNotFoundException().getMessage());
-        }
     }
 
     /**


[05/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 858961317b15f6b89273acf871b2d3fd1ae6cc92
Parents: a9c641a efe5aac
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 18:05:48 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 18:05:48 2015 +0530

----------------------------------------------------------------------
 .../applications/topic/ApplicationBuilder.java  |   8 +-
 ...ApplicationLevelNetworkPartitionContext.java | 178 ++++++++
 .../GroupLevelNetworkPartitionContext.java      | 177 +++++++-
 .../network/NetworkPartitionContext.java        | 173 +-------
 .../stratos/autoscaler/monitor/Monitor.java     |   2 +-
 .../monitor/cluster/ClusterMonitor.java         |  23 +-
 .../monitor/component/ApplicationMonitor.java   | 123 +++---
 .../monitor/component/GroupMonitor.java         |  61 +--
 .../autoscaler/pojo/policy/PolicyManager.java   |  10 +-
 .../stratos/autoscaler/util/AutoscalerUtil.java |  34 +-
 .../services/CloudControllerService.java        |   9 +
 .../impl/CloudControllerServiceImpl.java        |  34 ++
 .../common/beans/cartridge/CartridgeBean.java   |  10 +
 .../beans/kubernetes/KubernetesMasterBean.java  |   8 -
 .../client/CloudControllerServiceClient.java    |   6 +
 .../configure/configure_requests.jag            |   6 +
 .../forms/default/configure/cartridges.json     |   1 +
 .../forms/schema/configure/cartridges.json      |  17 +-
 .../console/controllers/menu/menu.json          |  31 +-
 .../console/controllers/rest/rest_calls.jag     |   8 +
 .../themes/theme0/partials/configure_form.hbs   |   6 +
 .../rest/endpoint/api/StratosApiV41.java        |  40 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   |  26 ++
 .../util/converter/ObjectConverter.java         |  11 +-
 .../main/resources/CloudControllerService.wsdl  | 424 +++++++++++--------
 25 files changed, 908 insertions(+), 518 deletions(-)
----------------------------------------------------------------------



[15/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 2ca933c68954783e0844e51dacd29ad664a68257
Parents: f132227 06f7c93
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 19:23:25 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 19:23:25 2015 +0530

----------------------------------------------------------------------
 .../console/configure_form.jag                  |   6 +
 .../default/configure/kubernetes-clusters.json  |  22 +-
 .../schema/configure/kubernetes-clusters.json   | 347 +++++--------------
 3 files changed, 93 insertions(+), 282 deletions(-)
----------------------------------------------------------------------



[09/23] stratos git commit: Display correct response message when removing a non existing user

Posted by re...@apache.org.
Display correct response message when removing a non existing user


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

Branch: refs/heads/master
Commit: 9f6a5afacc6516b2cace0532b00f7aa16dad3432
Parents: fd4a798
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 20:49:08 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 20:49:08 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java | 13 ++-----------
 .../stratos/rest/endpoint/api/StratosApiV41.java       | 13 +++++++++----
 .../stratos/rest/endpoint/api/StratosApiV41Utils.java  |  2 +-
 3 files changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9f6a5afa/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index efc06d3..01bc45d 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -793,19 +793,10 @@ public class RestCommandLineService {
             HttpResponse response = restClient.doDelete(httpClient, restClient.getBaseURL()
                     + ENDPOINT_ADD_USER + "/" + userName);
 
-            String responseCode = "" + response.getStatusLine().getStatusCode();
-
+            String resultString = CliUtils.getHttpResponseString(response);
             GsonBuilder gsonBuilder = new GsonBuilder();
             Gson gson = gsonBuilder.create();
-
-            if (responseCode.equals(CliConstants.RESPONSE_NO_CONTENT) || responseCode.equals(CliConstants.RESPONSE_OK)) {
-                System.out.println("You have successfully deleted user:" + userName);
-            } else {
-                String resultString = CliUtils.getHttpResponseString(response);
-                ExceptionMapper exception = gson.fromJson(resultString, ExceptionMapper.class);
-                System.out.println(exception);
-            }
-
+            System.out.println(gson.fromJson(resultString, ResponseMessageBean.class).getMessage());
         } catch (Exception e) {
             String message = "Could not delete user: " + userName;
             printError(message, e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/9f6a5afa/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 6188995..ed46f17 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
@@ -1736,11 +1736,16 @@ public class StratosApiV41 extends AbstractApi {
     @AuthorizationAction("/permission/admin/manage/removeUser")
     public Response removeUser(
             @PathParam("userName") String userName) throws RestAPIException {
+        try {
+            StratosApiV41Utils.removeUser(userName);
+            log.info("Successfully removed user: [username] " + userName);
+            return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
+                    String.format("User deleted successfully: [user] %s", userName))).build();
+        } catch (RestAPIException e) {
+            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
+                    ResponseMessageBean.ERROR, e.getMessage())).build();
+        }
 
-        StratosApiV41Utils.removeUser(userName);
-        log.info("Successfully removed user: [username] " + userName);
-        return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
-                String.format("User deleted successfully: [user] %s", userName))).build();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/stratos/blob/9f6a5afa/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 8304f98..d89ea35 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
@@ -3295,7 +3295,7 @@ public class StratosApiV41Utils {
         } catch (UserManagerException e) {
             String msg = "Error in removing user :" + userName;
             log.error(msg, e);
-            throw new RestAPIException(msg, e);
+            throw new RestAPIException(e.getMessage());
         }
     }
 


[23/23] stratos git commit: Merge branch 'master' of https://github.com/dinithis/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/dinithis/stratos


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

Branch: refs/heads/master
Commit: c4235bfeee4bc00a4d13f1797f1115dc3bb77b8f
Parents: 6b130b3 6a72e52
Author: reka <rt...@gmail.com>
Authored: Thu May 21 19:43:10 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Thu May 21 19:43:10 2015 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.common.stub/pom.xml      | 116 ----------------
 .../src/main/resources/PackageInfoServce.wsdl   | 133 -------------------
 service-stubs/pom.xml                           |   1 -
 3 files changed, 250 deletions(-)
----------------------------------------------------------------------



[22/23] stratos git commit: Removing commons stub

Posted by re...@apache.org.
Removing commons stub


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

Branch: refs/heads/master
Commit: 6a72e526797e22cae872d538eb0d2a0db5d054e9
Parents: dbeb34d
Author: Dinithi <di...@wso2.com>
Authored: Thu May 21 15:35:46 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Thu May 21 15:35:46 2015 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.common.stub/pom.xml      | 116 ----------------
 .../src/main/resources/PackageInfoServce.wsdl   | 133 -------------------
 service-stubs/pom.xml                           |   1 -
 3 files changed, 250 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6a72e526/service-stubs/org.apache.stratos.common.stub/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.common.stub/pom.xml b/service-stubs/org.apache.stratos.common.stub/pom.xml
deleted file mode 100644
index 4b2e5c8..0000000
--- a/service-stubs/org.apache.stratos.common.stub/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-service-stubs-parent</artifactId>
-        <version>4.1.0-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.apache.stratos.common.stub</artifactId>
-    <packaging>bundle</packaging>
-    <name>Apache Stratos - Common Stubs</name>
-    <url>http://apache.org</url>
-
-    <build>
-        <plugins>
-            
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>source-code-generation</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks>
-                                <path id="wsdl2java.classpath">
-			 <pathelement location="${settings.localRepository}/org/apache/ws/commons/axiom/wso2/axiom/${axis2.wso2.version}/axiom-${axis2.wso2.version}.jar" />
-                                    <pathelement location="${settings.localRepository}/org/apache/axis2/wso2/axis2-client/${axis2.wso2.client.version}/axis2-client-${axis2.wso2.client.version}.jar" />
-                                    <pathelement location="${settings.localRepository}/org/apache/axis2/wso2/axis2/${axis2.wso2.version}/axis2-${axis2.wso2.version}.jar" />
-                                    <pathelement location="${settings.localRepository}/org/apache/ws/commons/axiom/wso2/axiom/${axiom.wso2.version}/axiom-${axiom.wso2.version}.jar" />
-                                </path>
-                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-                                    <arg line="-uri src/main/resources/PackageInfoServce.wsdl -u -uw -p org.apache.stratos.common.packages.stub -o target/generated-code -ns2p http://packages.common.stratos.apache.org/xsd=org.apache.stratos.common.packages.stub,http://services.common.stratos.apache.org=org.apache.stratos.common.packages.stub" />
-                                    <classpath refid="wsdl2java.classpath" />
-                                </java>
-                            </tasks>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>
-                                    target/generated-code/src
-                                </source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-	     <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            org.apache.stratos.common.packages.stub.*;version="${project.version}",
-                        </Export-Package>
-                        <Import-Package>
-                            !org.apache.stratos.common.packages.stub.*,
-                            *;resolution:=optional
-                        </Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2-client</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/stratos/blob/6a72e526/service-stubs/org.apache.stratos.common.stub/src/main/resources/PackageInfoServce.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.common.stub/src/main/resources/PackageInfoServce.wsdl b/service-stubs/org.apache.stratos.common.stub/src/main/resources/PackageInfoServce.wsdl
deleted file mode 100644
index 018009a..0000000
--- a/service-stubs/org.apache.stratos.common.stub/src/main/resources/PackageInfoServce.wsdl
+++ /dev/null
@@ -1,133 +0,0 @@
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax2375="http://packages.common.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.common.stratos.apache.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.common.stratos.apache.org">
-    <wsdl:documentation>PackageInfoService</wsdl:documentation>
-    <wsdl:types>
-        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://packages.common.stratos.apache.org/xsd">
-            <xs:complexType name="PackageInfo">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="bandwidthLimit" type="xs:int" />
-                    <xs:element minOccurs="0" name="bandwidthOveruseCharge" type="xs:int" />
-                    <xs:element minOccurs="0" name="chargePerUser" type="xs:int" />
-                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="resourceVolumeLimit" type="xs:int" />
-                    <xs:element minOccurs="0" name="subscriptionCharge" type="xs:int" />
-                    <xs:element minOccurs="0" name="usersLimit" type="xs:int" />
-                </xs:sequence>
-            </xs:complexType>
-        </xs:schema>
-        <xs:schema xmlns:ax2376="http://packages.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.common.stratos.apache.org">
-            <xs:import namespace="http://packages.common.stratos.apache.org/xsd" />
-            <xs:element name="PackageInfoServiceException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="PackageInfoServiceException" nillable="true" type="ns:Exception" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:complexType name="Exception">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:element name="getPackageInfos">
-                <xs:complexType>
-                    <xs:sequence />
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getPackageInfosResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax2375:PackageInfo" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-        </xs:schema>
-    </wsdl:types>
-    <wsdl:message name="getPackageInfosRequest">
-        <wsdl:part name="parameters" element="ns:getPackageInfos" />
-    </wsdl:message>
-    <wsdl:message name="getPackageInfosResponse">
-        <wsdl:part name="parameters" element="ns:getPackageInfosResponse" />
-    </wsdl:message>
-    <wsdl:message name="PackageInfoServiceException">
-        <wsdl:part name="parameters" element="ns:PackageInfoServiceException" />
-    </wsdl:message>
-    <wsdl:portType name="PackageInfoServicePortType">
-        <wsdl:operation name="getPackageInfos">
-            <wsdl:input message="ns:getPackageInfosRequest" wsaw:Action="urn:getPackageInfos" />
-            <wsdl:output message="ns:getPackageInfosResponse" wsaw:Action="urn:getPackageInfosResponse" />
-            <wsdl:fault message="ns:PackageInfoServiceException" name="PackageInfoServiceException" wsaw:Action="urn:getPackageInfosPackageInfoServiceException" />
-        </wsdl:operation>
-    </wsdl:portType>
-    <wsdl:binding name="PackageInfoServiceSoap11Binding" type="ns:PackageInfoServicePortType">
-        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="getPackageInfos">
-            <soap:operation soapAction="urn:getPackageInfos" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="PackageInfoServiceException">
-                <soap:fault use="literal" name="PackageInfoServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="PackageInfoServiceSoap12Binding" type="ns:PackageInfoServicePortType">
-        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="getPackageInfos">
-            <soap12:operation soapAction="urn:getPackageInfos" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="PackageInfoServiceException">
-                <soap12:fault use="literal" name="PackageInfoServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="PackageInfoServiceHttpBinding" type="ns:PackageInfoServicePortType">
-        <http:binding verb="POST" />
-        <wsdl:operation name="getPackageInfos">
-            <http:operation location="getPackageInfos" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:service name="PackageInfoService">
-        <wsdl:port name="PackageInfoServiceHttpsSoap11Endpoint" binding="ns:PackageInfoServiceSoap11Binding">
-            <soap:address location="https://10.100.2.91:9443/services/PackageInfoService.PackageInfoServiceHttpsSoap11Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="PackageInfoServiceHttpsSoap12Endpoint" binding="ns:PackageInfoServiceSoap12Binding">
-            <soap12:address location="https://10.100.2.91:9443/services/PackageInfoService.PackageInfoServiceHttpsSoap12Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="PackageInfoServiceHttpsEndpoint" binding="ns:PackageInfoServiceHttpBinding">
-            <http:address location="https://10.100.2.91:9443/services/PackageInfoService.PackageInfoServiceHttpsEndpoint/" />
-        </wsdl:port>
-    </wsdl:service>
-</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/stratos/blob/6a72e526/service-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/pom.xml b/service-stubs/pom.xml
index ee04ef4..ac5cc93 100644
--- a/service-stubs/pom.xml
+++ b/service-stubs/pom.xml
@@ -36,7 +36,6 @@
     <modules>                            
         <module>org.apache.stratos.cloud.controller.service.stub</module>
         <module>org.apache.stratos.manager.service.stub</module>
-        <module>org.apache.stratos.common.stub</module>
         <module>org.apache.stratos.autoscaler.service.stub</module>
     </modules>
 


[17/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 2ac1499e79716a8f814ef5ebabb94df3733b2dfa
Parents: 04bf4cb 7ee7ecf
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 22:29:37 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 22:29:37 2015 +0530

----------------------------------------------------------------------
 .../src/main/resources/META-INF/component.xml   |  51 +--
 .../stratos/cli/RestCommandLineService.java     |  14 +-
 .../src/main/resources/META-INF/component.xml   |  73 ++--
 .../forms/schema/configure/cartridges.json      | 340 ++++---------------
 .../console/controllers/menu/menu.json          | 156 ++++++++-
 .../theme0/partials/applications_form.hbs       |   2 +-
 .../themes/theme0/partials/configure_form.hbs   |  10 +-
 .../manager/utils/PermissionConstants.java      |  82 ++---
 .../stratos/manager/utils/UserRoleCreator.java  |   2 +-
 .../src/main/resources/META-INF/component.xml   | 111 ++----
 .../rest/endpoint/api/AuthenticationApi.java    |   2 -
 .../rest/endpoint/api/StratosApiV41.java        | 306 ++++++++---------
 .../src/main/webapp/api/WEB-INF/cxf-servlet.xml |   3 +-
 .../distribution/src/main/conf/autoscaler.xml   |   5 +
 tools/stratos-installer/conf/setup.conf         |   3 +
 tools/stratos-installer/mock_iaas.sh            |  62 ++++
 tools/stratos-installer/setup.sh                |   2 +
 .../templates/cloud-controller.xml              |   7 +
 18 files changed, 578 insertions(+), 653 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2ac1499e/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index bb6585f,647d8d2..b4dbb45
--- 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
@@@ -423,17 -423,13 +423,17 @@@ public class StratosApiV41 extends Abst
      @Path("/cartridges/{cartridgeType}")
      @Produces("application/json")
      @Consumes("application/json")
-     @AuthorizationAction("/permission/protected/manage/removeCartridge")
+     @AuthorizationAction("/permission/stratos/cartridges/manage")
      public Response removeCartridge(
              @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
 -        StratosApiV41Utils.removeCartridge(cartridgeType);
 -        return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
 -                String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
 -
 +        try {
 +            StratosApiV41Utils.removeCartridge(cartridgeType);
 +            return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
 +                    String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
 +        } catch (Exception e) {
 +            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
 +                    ResponseMessageBean.ERROR, e.getMessage())).build();
 +        }
      }
  
      // API methods for cartridge groups


[21/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: dbeb34d44e19726a83bf7331d68684bcc587f61d
Parents: 6e8d614 a03ff6d
Author: Dinithi <di...@wso2.com>
Authored: Thu May 21 15:01:31 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Thu May 21 15:01:31 2015 +0530

----------------------------------------------------------------------
 .../parser/DefaultApplicationParser.java        |   2 +-
 components/org.apache.stratos.cli/pom.xml       |   2 +-
 .../apache/stratos/cli/CommandLineService.java  | 524 -------------------
 .../java/org/apache/stratos/cli/RestClient.java |   4 +-
 .../stratos/cli/commands/ListTenants.java       |   4 +-
 .../iaases/kubernetes/KubernetesIaas.java       |  26 +-
 .../client/CloudControllerServiceClient.java    |   4 +-
 .../client/live/AbstractLiveTest.java           |   5 +-
 .../org.apache.stratos.logging.view.ui/pom.xml  |   2 +-
 .../logging/view/ui/LogViewerClient.java        |  29 +-
 .../src/main/resources/web/log-view/index.jsp   |   2 +-
 .../configure/configure_requests.jag            |   4 +-
 .../default/configure/application-policies.json |   6 +-
 .../schema/configure/application-policies.json  |  56 +-
 .../schema/configure/kubernetes-clusters.json   |  63 +--
 .../themes/theme0/partials/configure_form.hbs   |   4 +-
 .../manager/utils/PermissionConstants.java      |   2 +-
 .../stratos/manager/utils/UserRoleCreator.java  |   2 +-
 .../rest/endpoint/api/StratosApiV41.java        |   6 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   |  40 +-
 .../pom.xml                                     |   2 +-
 .../pom.xml                                     |   4 +-
 .../distribution/src/main/license/LICENSE       |   1 -
 .../distribution/src/main/license/LICENSE       |   2 +-
 .../artifacts/application.json                  |   2 +-
 .../kubernetes-cluster-1.json                   |   8 +
 26 files changed, 117 insertions(+), 689 deletions(-)
----------------------------------------------------------------------



[20/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 6e8d6140cd2d5ddb73959258afc3a66e5cde6b30
Parents: ca916d4 a28acec
Author: Dinithi <di...@wso2.com>
Authored: Thu May 21 09:26:17 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Thu May 21 09:26:17 2015 +0530

----------------------------------------------------------------------
 .../services/impl/AutoscalerServiceImpl.java    |  25 +-
 .../stratos/autoscaler/util/AutoscalerUtil.java |  31 +-
 .../stratos/cli/RestCommandLineService.java     |  13 +
 .../apache/stratos/cli/StratosApplication.java  |   3 +
 .../cli/commands/UpdateApplicationCommand.java  | 125 ++++
 .../controller/domain/InstanceMetadata.java     |   9 +
 .../iaases/kubernetes/KubernetesIaas.java       |  31 +-
 .../kubernetes/client/KubernetesApiClient.java  |  13 +-
 .../KubernetesAPIClientInterface.java           |  12 +-
 .../kubernetes/client/model/Container.java      |  33 +-
 .../client/live/AbstractLiveTest.java           |   4 +-
 .../live/KubernetesApiClientLiveTest.java       |   8 +-
 products/stratos/modules/integration/pom.xml    |  12 -
 .../application-policy-1.json                   |   6 +-
 .../application-policy-2.json                   |   6 +-
 .../application-policy-3.json                   |   6 +-
 .../application-policy-4.json                   |   6 +-
 .../application-policy-5.json                   |   6 +-
 .../artifacts/application.json                  |  11 +-
 .../wordpress-app/artifacts/application.json    |  10 +-
 .../artifacts/application.json                  |  60 +-
 .../artifacts/application.json                  | 166 ++---
 .../artifacts/application.json                  | 354 +++++------
 .../artifacts/application.json                  |  36 +-
 .../artifacts/application.json                  |  58 +-
 .../artifacts/deployment-policy.json            |  26 +-
 .../artifacts/application-signup.json           |  32 +-
 .../artifacts/application.json                  |  42 +-
 .../artifacts/domain-mappings.json              |   6 +-
 .../artifacts/application.json                  |  26 +-
 .../sample-groups/artifacts/application.json    |  40 +-
 .../artifacts/application.json                  |  46 +-
 .../group-scaling-v1/artifacts/application.json |  22 +-
 .../artifacts/application.json                  |  12 +-
 .../artifacts/application-signup.json           |  32 +-
 .../artifacts/domain-mappings.json              |   6 +-
 .../scripts/kubernetes/deploy.sh                |   2 +-
 .../scripts/kubernetes/undeploy.sh              |   2 +-
 .../autoscaling-policy-1.json                   |  22 +-
 samples/cartridge-groups/db-group.json          |  20 +-
 samples/cartridge-groups/esb-php-group.json     |   2 +-
 ...sted-with-esb-php-nested-with-mysql-php.json |  18 +-
 samples/cartridge-groups/group1.json            |   4 +-
 samples/cartridge-groups/group1b.json           |   2 +-
 samples/cartridge-groups/group6c3.json          |   2 +-
 samples/cartridge-groups/group6c6.json          |   2 +-
 samples/cartridge-groups/group6c7.json          |   8 +-
 samples/cartridge-groups/n-level-nesting.json   |  68 +-
 samples/cartridge-groups/tomcat-group.json      |   2 +-
 samples/cartridges/ec2/c1.json                  |   1 -
 samples/cartridges/ec2/c2.json                  |   1 -
 samples/cartridges/ec2/c3.json                  |   1 -
 samples/cartridges/ec2/c4.json                  |   1 -
 samples/cartridges/ec2/esb.json                 |   1 -
 samples/cartridges/ec2/php.json                 |   1 -
 samples/cartridges/ec2/tomcat.json              |   1 -
 samples/cartridges/ec2/tomcat1.json             |   1 -
 samples/cartridges/ec2/tomcat2.json             |   1 -
 samples/cartridges/kubernetes/c1.json           |   1 -
 samples/cartridges/kubernetes/c2.json           |   1 -
 samples/cartridges/kubernetes/c3.json           |   1 -
 samples/cartridges/kubernetes/c4.json           |   1 -
 samples/cartridges/kubernetes/esb.json          |  20 +-
 samples/cartridges/kubernetes/php.json          |  34 +-
 samples/cartridges/kubernetes/tomcat.json       |  16 +-
 samples/cartridges/kubernetes/tomcat1.json      |  20 +-
 samples/cartridges/kubernetes/tomcat2.json      |  20 +-
 samples/cartridges/kubernetes/tomcat3.json      |  14 +-
 samples/cartridges/kubernetes/wso2-is.json      |  10 +-
 samples/cartridges/mock/c1.json                 |   1 -
 samples/cartridges/mock/c2.json                 |   1 -
 samples/cartridges/mock/c3.json                 |   1 -
 samples/cartridges/mock/c4.json                 |   1 -
 samples/cartridges/mock/esb.json                |   7 +-
 samples/cartridges/mock/mysql.json              |   7 +-
 samples/cartridges/mock/postgres.json           |   7 +-
 samples/cartridges/mock/stratos-lb.json         |   6 +-
 samples/cartridges/mock/tomcat.json             |   5 +-
 samples/cartridges/mock/tomcat2.json            |   5 +-
 samples/cartridges/mock/tomcat3.json            |  14 +-
 samples/cartridges/mock/wso2-is.json            |  10 +-
 samples/cartridges/openstack/tomcat.json        |  39 +-
 samples/cartridges/openstack/tomcat1.json       |  35 +-
 samples/cartridges/openstack/tomcat2.json       |  35 +-
 .../deployment-policy-1.json                    |  26 +-
 .../deployment-policy-2.json                    |  54 +-
 .../deployment-policy-3.json                    |  26 +-
 .../deployment-policy-4.json                    |  94 +--
 .../kubernetes/network-partition-2.json         |   2 +-
 .../src/main/resources/AutoscalerService.wsdl   | 634 +++++++++----------
 90 files changed, 1430 insertions(+), 1215 deletions(-)
----------------------------------------------------------------------



[14/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: f132227d5938489074769f4454cc0c65b9457d6d
Parents: ad2afd0 0e2bbd6
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 18:43:43 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 18:43:43 2015 +0530

----------------------------------------------------------------------
 .../applications/parser/ApplicationParser.java  |   4 +-
 .../parser/DefaultApplicationParser.java        |  38 +-
 .../CartridgeGroupNotFoundException.java        |  17 +-
 .../exception/CartridgeNotFoundException.java   |  37 ++
 .../autoscaler/services/AutoscalerService.java  |   8 +-
 .../services/impl/AutoscalerServiceImpl.java    |   7 +-
 .../common/client/AutoscalerServiceClient.java  |   8 +-
 .../console/configure_form.jag                  |  34 +-
 .../configure/configure_requests.jag            |  32 +-
 .../default/configure/application-policies.json |  17 +
 .../default/configure/applicationpolicies.json  |  17 -
 .../default/configure/autoscaling-policies.json |  15 +
 .../default/configure/autoscalingpolicies.json  |  15 -
 .../default/configure/cartridge-groups.json     |   9 +
 .../default/configure/cartridgegroups.json      |   9 -
 .../default/configure/deployment-policies.json  |  15 +
 .../default/configure/deploymentpolicies.json   |  15 -
 .../forms/default/configure/docker.json         |  68 ---
 .../default/configure/kubernetes-clusters.json  |  68 +++
 .../default/configure/network-partitions.json   |  17 +
 .../default/configure/networkpartitions.json    |  17 -
 .../schema/configure/application-policies.json  |  86 +++
 .../schema/configure/applicationpolicies.json   |  86 ---
 .../schema/configure/autoscaling-policies.json  | 118 +++++
 .../schema/configure/autoscalingpolicies.json   | 118 -----
 .../schema/configure/cartridge-groups.json      |  46 ++
 .../forms/schema/configure/cartridgegroups.json |  46 --
 .../schema/configure/deployment-policies.json   |  71 +++
 .../schema/configure/deploymentpolicies.json    |  71 ---
 .../forms/schema/configure/docker.json          | 411 ---------------
 .../schema/configure/kubernetes-clusters.json   | 411 +++++++++++++++
 .../schema/configure/network-partitions.json    |  94 ++++
 .../schema/configure/networkpartitions.json     |  94 ----
 .../console/controllers/menu/menu.json          |  14 +-
 .../controllers/wizard/wizard_requests.jag      |   4 +-
 .../theme0/js/custom/applications-editor.js     |   2 +-
 .../js/custom/applications_group_editor.js      |   2 +-
 .../themes/theme0/partials/configure_form.hbs   |  76 +--
 .../console/themes/theme0/partials/wizard.hbs   |   2 +-
 .../console/wizard.jag                          |   8 +-
 .../rest/endpoint/api/StratosApiV41.java        |  39 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   |   4 +-
 .../artifacts/application.json                  |   2 +-
 .../kubernetes-cluster-2.json                   |  60 +++
 .../kubernetes/network-partition-1.json         |   2 +-
 .../src/main/resources/AutoscalerService.wsdl   | 527 +++++++++++--------
 46 files changed, 1541 insertions(+), 1320 deletions(-)
----------------------------------------------------------------------



[13/23] stratos git commit: Fixed issues found when deploying a non existing application

Posted by re...@apache.org.
Fixed issues found when deploying a non existing application


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

Branch: refs/heads/master
Commit: ad2afd0943288ecf65481f1380ce3af142ab77f4
Parents: 3e12693
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 11:05:50 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 11:05:50 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java   | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ad2afd09/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index edca089..d430572 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -1525,18 +1525,11 @@ public class RestCommandLineService {
             HttpResponse response = restClient.doPost(httpClient, restClient.getBaseURL()
                     + url, "");
 
-            String responseCode = "" + response.getStatusLine().getStatusCode();
+            String result = getHttpResponseString(response);
 
             GsonBuilder gsonBuilder = new GsonBuilder();
             Gson gson = gsonBuilder.create();
-
-            if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
-                System.out.println("You have successfully deployed application: " + applicationId);
-            } else {
-                String resultString = CliUtils.getHttpResponseString(response);
-                ExceptionMapper exception = gson.fromJson(resultString, ExceptionMapper.class);
-                System.out.println(exception);
-            }
+            System.out.println(gson.fromJson(result, ResponseMessageBean.class).getMessage());
 
         } catch (Exception e) {
             String message = "Could not deploy application: " + applicationId;


[07/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 5757f1e1eb338f760fee2f5337090cea1db75fa9
Parents: de1f661 1465912
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 19:34:03 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 19:34:03 2015 +0530

----------------------------------------------------------------------
 .../applications/topic/ApplicationBuilder.java  |  13 +-
 ...ApplicationLevelNetworkPartitionContext.java | 263 -------------
 .../GroupLevelNetworkPartitionContext.java      | 390 -------------------
 .../ParentLevelNetworkPartitionContext.java     | 390 +++++++++++++++++++
 .../monitor/component/ApplicationMonitor.java   |  16 +-
 .../monitor/component/GroupMonitor.java         | 144 +++----
 .../component/ParentComponentMonitor.java       |   6 +-
 .../services/impl/AutoscalerServiceImpl.java    |  32 +-
 .../stratos/autoscaler/util/AutoscalerUtil.java |   6 +-
 .../stratos/cli/RestCommandLineService.java     |   8 +-
 .../common/client/AutoscalerServiceClient.java  |   3 +-
 .../console/configure_form.jag                  |   6 +-
 .../configure/configure_requests.jag            |   6 +-
 .../default/configure/cartridgegroups.json      |   9 +
 .../forms/default/configure/groups.json         |   9 -
 .../forms/schema/configure/cartridgegroups.json |  46 +++
 .../forms/schema/configure/groups.json          |  46 ---
 .../console/controllers/menu/menu.json          |   2 +-
 .../js/custom/applications_group_editor.js      |   2 +-
 .../themes/theme0/partials/configure_form.hbs   |  10 +-
 .../rest/endpoint/api/StratosApiV41.java        |  21 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   |  11 +-
 .../util/converter/ObjectConverter.java         |   7 +-
 23 files changed, 615 insertions(+), 831 deletions(-)
----------------------------------------------------------------------



[08/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: fd4a79869c5358ebd3b148b89368ba8e755be0c6
Parents: 5757f1e bb54544
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 20:45:51 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 20:45:51 2015 +0530

----------------------------------------------------------------------
 .../applications/ApplicationUtils.java          |  4 +--
 .../context/cluster/ClusterContext.java         | 12 +++------
 .../context/cluster/ClusterContextFactory.java  |  4 +--
 ...ApplicationPolicyAlreadyExistsException.java |  3 +--
 .../monitor/component/ApplicationMonitor.java   |  2 +-
 .../monitor/component/GroupMonitor.java         | 14 +++++------
 .../autoscaler/services/AutoscalerService.java  |  2 +-
 .../services/impl/AutoscalerServiceImpl.java    | 25 +++++++++++++++----
 .../cloud/controller/domain/Partition.java      |  2 +-
 .../openstack/networking/NovaNetworkingApi.java |  2 +-
 .../impl/CloudControllerServiceImpl.java        |  3 +--
 .../NetworkPartitionReferenceBean.java          |  2 --
 .../common/client/AutoscalerServiceClient.java  |  4 +--
 .../publisher/wso2/cep/ThriftClientConfig.java  |  2 +-
 .../balancer/conf/structure/NodeBuilder.java    | 26 ++++++++++----------
 .../console/controllers/menu/menu.json          |  2 +-
 .../console/themes/theme0/css/custom.css        |  4 +++
 .../themes/theme0/partials/login_body.hbs       |  2 +-
 .../rest/endpoint/api/StratosApiV41.java        |  5 ++++
 .../rest/endpoint/api/StratosApiV41Utils.java   |  3 ++-
 .../util/converter/ObjectConverter.java         | 14 +++++------
 21 files changed, 77 insertions(+), 60 deletions(-)
----------------------------------------------------------------------



[11/23] stratos git commit: Merge branch 'master' of https://github.com/apache/stratos

Posted by re...@apache.org.
Merge branch 'master' of https://github.com/apache/stratos


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

Branch: refs/heads/master
Commit: 924a8f62577d6e44789da88f5b6713c19beba6b7
Parents: f8e622d 1e7e300
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 09:28:55 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 09:28:55 2015 +0530

----------------------------------------------------------------------
 README.md                                       | 49 ++++++-------
 .../src/main/resources/META-INF/component.xml   |  2 +-
 .../src/main/resources/META-INF/component.xml   | 36 ++++------
 .../console/controllers/menu/menu.json          | 26 +++----
 .../manager/utils/PermissionConstants.java      | 73 +++++++++++++++-----
 .../stratos/manager/utils/UserRoleCreator.java  | 32 +++------
 .../src/main/resources/META-INF/component.xml   | 50 +++++++-------
 .../rest/endpoint/api/StratosApiV41.java        | 67 +++++++++---------
 .../rest/endpoint/api/StratosApiV41Utils.java   | 12 ++++
 .../src/main/webapp/api/WEB-INF/cxf-servlet.xml |  2 +
 10 files changed, 190 insertions(+), 159 deletions(-)
----------------------------------------------------------------------



[04/23] stratos git commit: adding a proper response message when trying to deploy a non existing application

Posted by re...@apache.org.
adding a proper response message when trying to deploy a non existing application


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

Branch: refs/heads/master
Commit: a9c641a0ee35f1b3317511b7940068890aa3ef94
Parents: 8c395a8
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 15:32:46 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 15:32:46 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/rest/endpoint/api/StratosApiV41.java   | 7 ++++++-
 .../apache/stratos/rest/endpoint/api/StratosApiV41Utils.java  | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a9c641a0/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 670e38b..450653d 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
@@ -800,7 +800,12 @@ public class StratosApiV41 extends AbstractApi {
             return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(
                     ResponseMessageBean.ERROR, "Application policy already deployed")).build();
         } catch (RestAPIException e) {
-            throw e;
+            if (e.getMessage().contains("Application not found")) {
+                return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
+                        ResponseMessageBean.ERROR, e.getMessage())).build();
+            } else {
+                throw e;
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/a9c641a0/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 4e90a0b..794907b 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
@@ -1622,7 +1622,7 @@ public class StratosApiV41Utils {
             ApplicationContext application = autoscalerServiceClient.getApplication(applicationId);
 
             if (application == null) {
-                String message = String.format("Application is not found: [application-id] %s", applicationId);
+                String message = String.format("Application not found: [application-id] %s", applicationId);
                 log.error(message);
                 throw new RestAPIException(message);
             }


[12/23] stratos git commit: Fixed issues found when undeploying a non existing application

Posted by re...@apache.org.
Fixed issues found when undeploying a non existing application


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

Branch: refs/heads/master
Commit: 3e12693a76e1671a04ba85057e2a6b199f552b0d
Parents: 924a8f6
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 10:11:49 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 10:11:49 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3e12693a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index 01bc45d..edca089 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -1559,20 +1559,11 @@ public class RestCommandLineService {
         try {
             HttpResponse response = restClient.doPost(httpClient, restClient.getBaseURL()
                     + ENDPOINT_UNDEPLOY_APPLICATION.replace("{id}", applicationId), "");
-
-            String responseCode = "" + response.getStatusLine().getStatusCode();
+            String result = getHttpResponseString(response);
 
             GsonBuilder gsonBuilder = new GsonBuilder();
             Gson gson = gsonBuilder.create();
-
-            if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
-                System.out.println("You have successfully undeployed application: " + applicationId);
-            } else {
-                String resultString = CliUtils.getHttpResponseString(response);
-                ExceptionMapper exception = gson.fromJson(resultString, ExceptionMapper.class);
-                System.out.println(exception);
-            }
-
+            System.out.println(gson.fromJson(result, ResponseMessageBean.class).getMessage());
         } catch (Exception e) {
             String message = "Could not undeploy application: " + applicationId;
             printError(message, e);


[19/23] stratos git commit: handling RemoteException

Posted by re...@apache.org.
handling RemoteException


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

Branch: refs/heads/master
Commit: ca916d42719498d7af52085b500bfd1bba5909aa
Parents: 4c6da2e
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 23:03:37 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed May 20 23:03:37 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ca916d42/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 1a0ca88..0a10a59 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
@@ -432,8 +432,7 @@ public class StratosApiV41 extends AbstractApi {
             return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
                     String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build();
         } catch (RemoteException e) {
-            return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
-                    ResponseMessageBean.ERROR, e.getMessage())).build();
+            throw new RestAPIException(e.getMessage());
         } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
             return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
                     ResponseMessageBean.ERROR, e.getFaultMessage().getInvalidCartridgeTypeException().getMessage()))


[06/23] stratos git commit: Fixed issues found when adding a user with a non existing user role

Posted by re...@apache.org.
Fixed issues found when adding a user with a non existing user role


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

Branch: refs/heads/master
Commit: de1f661911a11508e03e06a5ecc617fdba65896b
Parents: 8589613
Author: Dinithi <di...@wso2.com>
Authored: Tue May 19 18:07:14 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue May 19 18:07:14 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java   | 11 +++++------
 .../manager/user/management/StratosUserManagerUtils.java |  2 +-
 .../stratos/rest/endpoint/api/StratosApiV41Utils.java    |  3 +--
 3 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/de1f6619/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index f878e5f..30b332e 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -63,6 +63,8 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
+import static org.apache.stratos.cli.utils.CliUtils.getHttpResponseString;
+
 public class RestCommandLineService {
 
     private static final Logger log = LoggerFactory.getLogger(RestCommandLineService.class);
@@ -685,12 +687,9 @@ public class RestCommandLineService {
             HttpResponse response = restClient.doPost(httpClient, restClient.getBaseURL()
                     + ENDPOINT_ADD_USER, jsonString);
 
-            int responseCode = response.getStatusLine().getStatusCode();
-            if (responseCode < 200 || responseCode >= 300) {
-                CliUtils.printError(response);
-            } else {
-                System.out.println("User added successfully: " + userName);
-            }
+            String result = getHttpResponseString(response);
+            System.out.println(gson.fromJson(result, ResponseMessageBean.class).getMessage());
+
         } catch (Exception e) {
             String message = "Could not add user: " + userName;
             printError(message, e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/de1f6619/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/management/StratosUserManagerUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/management/StratosUserManagerUtils.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/management/StratosUserManagerUtils.java
index 5ca089d..0f9deeb 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/management/StratosUserManagerUtils.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/management/StratosUserManagerUtils.java
@@ -71,7 +71,7 @@ public class StratosUserManagerUtils {
         } catch (UserStoreException e) {
             String msg = "Error in adding user " + userInfoBean.getUserName() + " to User Store";
             log.error(msg, e);
-            throw new UserManagerException(msg, e);
+            throw new UserManagerException(e.getMessage());
         }
 
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/de1f6619/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 35d2668..70f18ef 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
@@ -3243,9 +3243,8 @@ public class StratosApiV41Utils {
         } catch (UserManagerException e) {
             String msg = "Error in adding User";
             log.error(msg, e);
-            throw new RestAPIException(msg, e);
+            throw new RestAPIException(e.getMessage());
         }
-
     }