stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject stratos git commit: Update the application undeployment rest method
Date Thu, 01 Oct 2015 14:11:26 GMT
Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 6ca309168 -> 3917c9d9f


Update the application undeployment rest method


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

Branch: refs/heads/stratos-4.1.x
Commit: 3917c9d9fdc4aff10d7528a6507f30ea156c8a2f
Parents: 6ca3091
Author: gayangunarathne <gayang@wso2.com>
Authored: Thu Oct 1 19:40:34 2015 +0530
Committer: gayangunarathne <gayang@wso2.com>
Committed: Thu Oct 1 19:40:34 2015 +0530

----------------------------------------------------------------------
 .../apache/stratos/rest/endpoint/api/StratosApiV41.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3917c9d9/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 e7cd8d1..b55a2f0 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
@@ -1301,6 +1301,12 @@ public class StratosApiV41 extends AbstractApi {
 
         ApplicationBean applicationDefinition = StratosApiV41Utils.getApplication(applicationId);
         int tenantId= CarbonContext.getThreadLocalCarbonContext().getTenantId();
+        if (applicationDefinition == null) {
+            String message = String.format("Application does not exist [application-id] %s",
applicationId);
+            log.error(message);
+            return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(
+                    ResponseMessageBean.ERROR, message)).build();
+        }
         if (applicationDefinition.isMultiTenant() && (tenantId != -1234)) {
             String message = String.format(
                     "Multi-tenant applications can only be deployed by super tenant: [application-id]
%s",
@@ -1308,12 +1314,6 @@ public class StratosApiV41 extends AbstractApi {
             log.error(message);
             throw new RestAPIException(message);
         }
-        if (applicationDefinition == null) {
-            String message = String.format("Application does not exist [application-id] %s",
applicationId);
-            log.error(message);
-            return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(
-                    ResponseMessageBean.ERROR, message)).build();
-        }
         if (applicationDefinition.getStatus().equalsIgnoreCase(StratosApiV41Utils.APPLICATION_STATUS_CREATED))
{
             String message = String.format("Could not undeploy since application is not in
DEPLOYED status " +
                     "[application-id] %s [current status] %S", applicationId, applicationDefinition.getStatus());


Mime
View raw message