You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/10/11 15:27:55 UTC

[2/3] Refactoring CLI commands with a proper naming convention

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployKubernetesHostCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployKubernetesHostCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployKubernetesHostCommand.java
index 2886e52..2650da1 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployKubernetesHostCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployKubernetesHostCommand.java
@@ -25,7 +25,7 @@ import org.apache.stratos.cli.RestCommandLineService;
 import org.apache.stratos.cli.StratosCommandContext;
 import org.apache.stratos.cli.exception.CommandException;
 import org.apache.stratos.cli.utils.CliConstants;
-import org.apache.stratos.cli.utils.CommandLineUtils;
+import org.apache.stratos.cli.utils.CliUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,7 +75,7 @@ public class DeployKubernetesHostCommand implements Command<StratosCommandContex
 
         if ((args == null) || (args.length <= 0)) {
             context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         }
 
         try {
@@ -85,24 +85,24 @@ public class DeployKubernetesHostCommand implements Command<StratosCommandContex
                 String resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
                 if (resourcePath == null) {
                     System.out.println("usage: " + getName() + " [-" + CliConstants.RESOURCE_PATH + " " + CliConstants.RESOURCE_PATH_LONG_OPTION + "]");
-                    return CliConstants.BAD_ARGS_CODE;
+                    return CliConstants.COMMAND_FAILED;
                 }
-                String resourceFileContent = CommandLineUtils.readResource(resourcePath);
+                String resourceFileContent = CliUtils.readResource(resourcePath);
                 RestCommandLineService.getInstance().deployKubernetesHost(resourceFileContent);
-                return CliConstants.SUCCESSFUL_CODE;
+                return CliConstants.COMMAND_SUCCESSFULL;
             } else {
                 System.out.println("usage: " + getName() + " [-" + CliConstants.RESOURCE_PATH + " " + CliConstants.RESOURCE_PATH_LONG_OPTION + "]");
-                return CliConstants.BAD_ARGS_CODE;
+                return CliConstants.COMMAND_FAILED;
             }
         } catch (ParseException e) {
             if (logger.isErrorEnabled()) {
                 logger.error("Error parsing arguments", e);
             }
             System.out.println(e.getMessage());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         } catch (IOException e) {
             System.out.println("Invalid resource path");
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployPartitionCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployPartitionCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployPartitionCommand.java
new file mode 100644
index 0000000..c00ce7b
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployPartitionCommand.java
@@ -0,0 +1,138 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.*;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class DeployPartitionCommand implements Command<StratosCommandContext> {
+
+    private static final Logger logger = LoggerFactory.getLogger(DeployPartitionCommand.class);
+
+    private final Options options;
+
+    public DeployPartitionCommand(){
+        options = constructOptions();
+    }
+
+    private Options constructOptions() {
+        final Options options = new Options();
+
+        Option resourcePath = new Option(CliConstants.RESOURCE_PATH, CliConstants.RESOURCE_PATH_LONG_OPTION, true,
+                "Partition deployment resource path");
+        resourcePath.setArgName("resource path");
+        options.addOption(resourcePath);
+
+        return options;
+    }
+
+    public String getName() {
+        return CliConstants.PARTITION_DEPLOYMENT;
+    }
+
+    public String getDescription() {
+        return "Add new partition deployment";
+    }
+
+    public String getArgumentSyntax() {
+        return null;
+    }
+
+    public int execute(StratosCommandContext context, String[] args) throws CommandException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Executing {} command...", getName());
+        }
+
+        if (args != null && args.length > 0) {
+            String resourcePath = null;
+            String partionDeployment = null;
+
+            final CommandLineParser parser = new GnuParser();
+            CommandLine commandLine;
+
+            try {
+                commandLine = parser.parse(options, args);
+
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Partition deployment");
+                }
+
+                if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Resource path option is passed");
+                    }
+                    resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
+                    partionDeployment = readResource(resourcePath);
+                }
+
+                if (resourcePath == null) {
+                    System.out.println("usage: " + getName() + " [-p <resource path>]");
+                    return CliConstants.COMMAND_FAILED;
+                }
+
+                RestCommandLineService.getInstance().deployPartition(partionDeployment);
+                return CliConstants.COMMAND_SUCCESSFULL;
+
+            } catch (ParseException e) {
+                if (logger.isErrorEnabled()) {
+                    logger.error("Error parsing arguments", e);
+                }
+                System.out.println(e.getMessage());
+                return CliConstants.COMMAND_FAILED;
+            } catch (IOException e) {
+                //e.printStackTrace();
+                System.out.println("Invalid resource path");
+                return CliConstants.COMMAND_FAILED;
+            }
+        } else {
+            context.getStratosApplication().printUsage(getName());
+            return CliConstants.COMMAND_FAILED;
+        }
+    }
+
+    private String readResource(String fileName) throws IOException {
+        BufferedReader br = new BufferedReader(new FileReader(fileName));
+        try {
+            StringBuilder sb = new StringBuilder();
+            String line = br.readLine();
+
+            while (line != null) {
+                sb.append(line);
+                sb.append("\n");
+                line = br.readLine();
+            }
+            return sb.toString();
+        } finally {
+            br.close();
+        }
+    }
+
+    public Options getOptions() {
+        return options;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceCommand.java
new file mode 100644
index 0000000..4961bfa
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceCommand.java
@@ -0,0 +1,139 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.*;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class DeployServiceCommand implements Command<StratosCommandContext> {
+
+    private static final Logger logger = LoggerFactory.getLogger(DeployServiceCommand.class);
+
+    private final Options options;
+
+    public DeployServiceCommand(){
+        options = constructOptions();
+    }
+
+    private Options constructOptions() {
+        final Options options = new Options();
+
+        Option resourcePath = new Option(CliConstants.RESOURCE_PATH, CliConstants.RESOURCE_PATH_LONG_OPTION, true,
+                "Deploy Service resource path");
+        resourcePath.setArgName("resource path");
+        options.addOption(resourcePath);
+
+        return options;
+    }
+
+    public String getName() {
+        return CliConstants.DEPLOY_SERVICE_DEPLOYMENT;
+    }
+
+    public String getDescription() {
+        return "Add new deploy service";
+    }
+
+    public String getArgumentSyntax() {
+        return null;
+    }
+
+    public int execute(StratosCommandContext context, String[] args) throws CommandException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Executing {} command...", getName());
+        }
+
+        if (args != null && args.length > 0) {
+            String resourcePath = null;
+            String deployServiceDeployment = null;
+
+            final CommandLineParser parser = new GnuParser();
+            CommandLine commandLine;
+
+            try {
+                commandLine = parser.parse(options, args);
+
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Deploy Service Deployment");
+                }
+
+                if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Resource path option is passed");
+                    }
+                    resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
+                    deployServiceDeployment = readResource(resourcePath);
+                }
+
+                if (resourcePath == null) {
+                    System.out.println("usage: " + getName() + " [-p <resource path>]");
+                    return CliConstants.COMMAND_FAILED;
+                }
+
+                RestCommandLineService.getInstance().deployService(deployServiceDeployment);
+                return CliConstants.COMMAND_SUCCESSFULL;
+
+            } catch (ParseException e) {
+                if (logger.isErrorEnabled()) {
+                    logger.error("Error parsing arguments", e);
+                }
+                System.out.println(e.getMessage());
+                return CliConstants.COMMAND_FAILED;
+            } catch (IOException e) {
+                //e.printStackTrace();
+                System.out.println("Invalid resource path");
+                return CliConstants.COMMAND_FAILED;
+            }
+        } else {
+            context.getStratosApplication().printUsage(getName());
+            return CliConstants.COMMAND_FAILED;
+        }
+    }
+
+    private String readResource(String fileName) throws IOException {
+        BufferedReader br = new BufferedReader(new FileReader(fileName));
+        try {
+            StringBuilder sb = new StringBuilder();
+            String line = br.readLine();
+
+            while (line != null) {
+                sb.append(line);
+                sb.append("\n");
+                line = br.readLine();
+            }
+            return sb.toString();
+        } finally {
+            br.close();
+        }
+    }
+
+    public Options getOptions() {
+        return options;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceDeploymentCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceDeploymentCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceDeploymentCommand.java
deleted file mode 100644
index 95d9647..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployServiceDeploymentCommand.java
+++ /dev/null
@@ -1,139 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.*;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class DeployServiceDeploymentCommand implements Command<StratosCommandContext> {
-
-    private static final Logger logger = LoggerFactory.getLogger(DeployServiceDeploymentCommand.class);
-
-    private final Options options;
-
-    public DeployServiceDeploymentCommand(){
-        options = constructOptions();
-    }
-
-    private Options constructOptions() {
-        final Options options = new Options();
-
-        Option resourcePath = new Option(CliConstants.RESOURCE_PATH, CliConstants.RESOURCE_PATH_LONG_OPTION, true,
-                "Deploy Service resource path");
-        resourcePath.setArgName("resource path");
-        options.addOption(resourcePath);
-
-        return options;
-    }
-
-    public String getName() {
-        return CliConstants.DEPLOY_SERVICE_DEPLOYMENT;
-    }
-
-    public String getDescription() {
-        return "Add new deploy service";
-    }
-
-    public String getArgumentSyntax() {
-        return null;
-    }
-
-    public int execute(StratosCommandContext context, String[] args) throws CommandException {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Executing {} command...", getName());
-        }
-
-        if (args != null && args.length > 0) {
-            String resourcePath = null;
-            String deployServiceDeployment = null;
-
-            final CommandLineParser parser = new GnuParser();
-            CommandLine commandLine;
-
-            try {
-                commandLine = parser.parse(options, args);
-
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Deploy Service Deployment");
-                }
-
-                if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
-                    if (logger.isTraceEnabled()) {
-                        logger.trace("Resource path option is passed");
-                    }
-                    resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
-                    deployServiceDeployment = readResource(resourcePath);
-                }
-
-                if (resourcePath == null) {
-                    System.out.println("usage: " + getName() + " [-p <resource path>]");
-                    return CliConstants.BAD_ARGS_CODE;
-                }
-
-                RestCommandLineService.getInstance().deployService(deployServiceDeployment);
-                return CliConstants.SUCCESSFUL_CODE;
-
-            } catch (ParseException e) {
-                if (logger.isErrorEnabled()) {
-                    logger.error("Error parsing arguments", e);
-                }
-                System.out.println(e.getMessage());
-                return CliConstants.BAD_ARGS_CODE;
-            } catch (IOException e) {
-                //e.printStackTrace();
-                System.out.println("Invalid resource path");
-                return CliConstants.BAD_ARGS_CODE;
-            }
-        } else {
-            context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
-        }
-    }
-
-    private String readResource(String fileName) throws IOException {
-        BufferedReader br = new BufferedReader(new FileReader(fileName));
-        try {
-            StringBuilder sb = new StringBuilder();
-            String line = br.readLine();
-
-            while (line != null) {
-                sb.append(line);
-                sb.append("\n");
-                line = br.readLine();
-            }
-            return sb.toString();
-        } finally {
-            br.close();
-        }
-    }
-
-    public Options getOptions() {
-        return options;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyCommand.java
deleted file mode 100644
index 1072029..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyCommand.java
+++ /dev/null
@@ -1,66 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.Options;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DeploymentPolicyCommand implements Command<StratosCommandContext> {
-
-    private static final Logger logger = LoggerFactory.getLogger(AutoscalePolicyCommand.class);
-
-    public DeploymentPolicyCommand() {
-    }
-
-    public String getName() {
-        return CliConstants.LIST_DEPLOYMENT_POLICIES;
-    }
-
-    public String getDescription() {
-        return "List available deployment policies";
-    }
-
-    public String getArgumentSyntax() {
-        return null;
-    }
-
-    public int execute(StratosCommandContext context, String[] args) throws CommandException {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Executing {} command...", getName());
-        }
-        if (args == null || args.length == 0) {
-            //CommandLineService.getInstance().listAvailableCartridges();
-            RestCommandLineService.getInstance().listDeploymentPolicies();
-            return CliConstants.SUCCESSFUL_CODE;
-        } else {
-            context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
-        }
-    }
-
-    public Options getOptions() {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyDeploymentCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyDeploymentCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyDeploymentCommand.java
deleted file mode 100644
index 75fe52a..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeploymentPolicyDeploymentCommand.java
+++ /dev/null
@@ -1,138 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.*;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class DeploymentPolicyDeploymentCommand implements Command<StratosCommandContext> {
-
-    private static final Logger logger = LoggerFactory.getLogger(DeploymentPolicyDeploymentCommand.class);
-
-    private final Options options;
-
-    public DeploymentPolicyDeploymentCommand(){
-        options = constructOptions();
-    }
-
-    private Options constructOptions() {
-        final Options options = new Options();
-
-        Option resourcePath = new Option(CliConstants.RESOURCE_PATH, CliConstants.RESOURCE_PATH_LONG_OPTION, true,
-                "Deployment policy deployment resource path");
-        resourcePath.setArgName("resource path");
-        options.addOption(resourcePath);
-
-        return options;
-    }
-
-    public String getName() {
-        return CliConstants.DEPLOYMENT_POLICY_DEPLOYMENT;
-    }
-
-    public String getDescription() {
-        return "Add new deployment policy";
-    }
-
-    public String getArgumentSyntax() {
-        return null;
-    }
-
-    public int execute(StratosCommandContext context, String[] args) throws CommandException {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Executing {} command...", getName());
-        }
-
-        if (args != null && args.length > 0) {
-            String resourcePath = null;
-            String deploymentPolicyDeployment = null;
-
-            final CommandLineParser parser = new GnuParser();
-            CommandLine commandLine;
-
-            try {
-                commandLine = parser.parse(options, args);
-
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Deployment policy deployment");
-                }
-
-                if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
-                    if (logger.isTraceEnabled()) {
-                        logger.trace("Resource path option is passed");
-                    }
-                    resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
-                    deploymentPolicyDeployment = readResource(resourcePath);
-                }
-
-                if (resourcePath == null) {
-                    System.out.println("usage: " + getName() + " [-p <resource path>]");
-                    return CliConstants.BAD_ARGS_CODE;
-                }
-
-                RestCommandLineService.getInstance().deployDeploymentPolicy(deploymentPolicyDeployment);
-                return CliConstants.SUCCESSFUL_CODE;
-
-            } catch (ParseException e) {
-                if (logger.isErrorEnabled()) {
-                    logger.error("Error parsing arguments", e);
-                }
-                System.out.println(e.getMessage());
-                return CliConstants.BAD_ARGS_CODE;
-            } catch (IOException e) {
-                //e.printStackTrace();
-                System.out.println("Invalid resource path");
-                return CliConstants.BAD_ARGS_CODE;
-            }
-        } else {
-            context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
-        }
-    }
-
-    private String readResource(String fileName) throws IOException {
-        BufferedReader br = new BufferedReader(new FileReader(fileName));
-        try {
-            StringBuilder sb = new StringBuilder();
-            String line = br.readLine();
-
-            while (line != null) {
-                sb.append(line);
-                sb.append("\n");
-                line = br.readLine();
-            }
-            return sb.toString();
-        } finally {
-            br.close();
-        }
-    }
-
-    public Options getOptions() {
-        return options;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeAutoScalingPolicyCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeAutoScalingPolicyCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeAutoScalingPolicyCommand.java
index 195b417..a7e6945 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeAutoScalingPolicyCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeAutoScalingPolicyCommand.java
@@ -61,10 +61,10 @@ public class DescribeAutoScalingPolicyCommand implements Command<StratosCommandC
 				logger.debug("Getting Autoscale policy info {}", id);
 			}
 			RestCommandLineService.getInstance().describeAutoScalingPolicy(id);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeCartridgeCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeCartridgeCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeCartridgeCommand.java
index 3ae2b42..cb4608e 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeCartridgeCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeCartridgeCommand.java
@@ -61,10 +61,10 @@ public class DescribeCartridgeCommand implements Command<StratosCommandContext>
 				logger.debug("Getting cartridge info {}", id);
 			}
 			 RestCommandLineService.getInstance().describeAvailableCartridges(id);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeDeploymentPolicyCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeDeploymentPolicyCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeDeploymentPolicyCommand.java
index ce31127..fe44e26 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeDeploymentPolicyCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribeDeploymentPolicyCommand.java
@@ -61,10 +61,10 @@ public class DescribeDeploymentPolicyCommand implements Command<StratosCommandCo
 				logger.debug("Getting Deployment policy info {}", id);
 			}
 			 RestCommandLineService.getInstance().describeDeploymentPolicies(id);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
index 950a957..3709f4d 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
@@ -61,10 +61,10 @@ public class DescribePartitionCommand implements Command<StratosCommandContext>
 				logger.debug("Getting Partition info {}", id);
 			}
 			 RestCommandLineService.getInstance().describePartition(id);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ExitCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ExitCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ExitCommand.java
index 1dbd7d4..4605113 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ExitCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ExitCommand.java
@@ -26,11 +26,6 @@ import org.apache.stratos.cli.StratosCommandContext;
 import org.apache.stratos.cli.exception.CommandException;
 import org.apache.stratos.cli.utils.CliConstants;
 
-import java.io.File;
-
-import static org.apache.stratos.cli.utils.CliConstants.STRATOS_DIR;
-import static org.apache.stratos.cli.utils.CliConstants.STRATOS_HISTORY_DIR;
-
 public class ExitCommand implements Command<StratosCommandContext> {
 
 	private static final Logger logger = LoggerFactory.getLogger(ExitCommand.class);
@@ -60,10 +55,10 @@ public class ExitCommand implements Command<StratosCommandContext> {
 			logger.debug("Executing {} command...", getName());
 		}
 		if (args == null || args.length == 0) {
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/HelpCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/HelpCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/HelpCommand.java
index 0593b4e..2257f11 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/HelpCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/HelpCommand.java
@@ -55,13 +55,13 @@ public class HelpCommand implements Command<StratosCommandContext> {
 		}
 		if (args == null || args.length == 0) {
 			context.getStratosApplication().printHelp();
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else if (args != null && args.length == 1) {
 			context.getStratosApplication().printHelp(args[0]);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/InfoCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/InfoCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/InfoCommand.java
index d3c071a..a15e215 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/InfoCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/InfoCommand.java
@@ -60,10 +60,10 @@ public class InfoCommand implements Command<StratosCommandContext> {
 				logger.debug("Getting info {}", alias);
 			}
 			CommandLineService.getInstance().info(alias);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllTenants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllTenants.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllTenants.java
index f9f7e09..1540c7c 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllTenants.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllTenants.java
@@ -52,10 +52,10 @@ public class ListAllTenants implements Command<StratosCommandContext> {
         }
         if (args == null || args.length == 0) {
             RestCommandLineService.getInstance().listAllTenants();
-            return CliConstants.SUCCESSFUL_CODE;
+            return CliConstants.COMMAND_SUCCESSFULL;
         } else {
             context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllUsers.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllUsers.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllUsers.java
index bea160e..6638cc7 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllUsers.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAllUsers.java
@@ -52,10 +52,10 @@ public class ListAllUsers implements Command<StratosCommandContext> {
         }
         if (args == null || args.length == 0) {
             RestCommandLineService.getInstance().listAllUsers();
-            return CliConstants.SUCCESSFUL_CODE;
+            return CliConstants.COMMAND_SUCCESSFULL;
         } else {
             context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAutoscalePolicyCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAutoscalePolicyCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAutoscalePolicyCommand.java
new file mode 100644
index 0000000..779b8bd
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListAutoscalePolicyCommand.java
@@ -0,0 +1,66 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.Options;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ListAutoscalePolicyCommand implements Command<StratosCommandContext> {
+
+    private static final Logger logger = LoggerFactory.getLogger(ListAutoscalePolicyCommand.class);
+
+    public ListAutoscalePolicyCommand() {
+    }
+
+    public String getName() {
+        return CliConstants.LIST_AUTOSCALE_POLICY;
+    }
+
+    public String getDescription() {
+        return "List available autoscaling policies";
+    }
+
+    public String getArgumentSyntax() {
+        return null;
+    }
+
+    public int execute(StratosCommandContext context, String[] args) throws CommandException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Executing {} command...", getName());
+        }
+        if (args == null || args.length == 0) {
+            //CommandLineService.getInstance().listAvailableCartridges();
+            RestCommandLineService.getInstance().listAutoscalePolicies();
+            return CliConstants.COMMAND_SUCCESSFULL;
+        } else {
+            context.getStratosApplication().printUsage(getName());
+            return CliConstants.COMMAND_FAILED;
+        }
+    }
+
+    public Options getOptions() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
new file mode 100644
index 0000000..372a23a
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
@@ -0,0 +1,95 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.Options;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ListCartridgeSubscriptionsCommand implements Command<StratosCommandContext>{
+	
+	private static final Logger logger = LoggerFactory.getLogger(ListCartridgeSubscriptionsCommand.class);
+	
+	private final Options options;
+	
+	public ListCartridgeSubscriptionsCommand() {
+		options = constructOptions();
+	}
+	
+	/**
+	 * Construct Options.
+	 * 
+	 * @return Options expected from command-line.
+	 */
+	private Options constructOptions() {
+
+		final Options options = new Options();
+		return options;
+	}
+	
+	@Override
+	public String getName() {
+		return "list-cartridge-subscriptions";
+	}
+
+	@Override
+	public String getDescription() {
+		return "List cartridge subscriptions";
+	}
+
+	@Override
+	public String getArgumentSyntax() {
+		return null;
+	}
+
+	@Override
+	public Options getOptions() {
+		return options;
+	}
+
+	@Override
+	public int execute(StratosCommandContext context, String[] args) throws CommandException {
+		if (logger.isDebugEnabled()) {
+			logger.debug("Executing {} command...", getName());
+		}
+		
+		if (args != null && args.length > 0) {
+			String alias = args[0];
+
+            if(StringUtils.isBlank(alias)){
+                System.out.println("Please specify a non blank alias");
+                return CliConstants.COMMAND_FAILED;
+            }
+            else{
+                RestCommandLineService.getInstance().listSubscribedCartridgeInfo(alias);
+                return CliConstants.COMMAND_SUCCESSFULL;
+            }
+		}else {
+			context.getStratosApplication().printUsage(getName());
+			return CliConstants.COMMAND_FAILED;
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgesCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgesCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgesCommand.java
index 3874d41..d1e9a8f 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgesCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgesCommand.java
@@ -53,10 +53,10 @@ public class ListCartridgesCommand implements Command<StratosCommandContext> {
 		if (args == null || args.length == 0) {
 			//CommandLineService.getInstance().listAvailableCartridges();
             RestCommandLineService.getInstance().listAvailableCartridges();
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeployServiceCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeployServiceCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeployServiceCommand.java
index 7580c56..127e0a5 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeployServiceCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeployServiceCommand.java
@@ -52,10 +52,10 @@ public class ListDeployServiceCommand implements Command<StratosCommandContext>
         }
         if (args == null || args.length == 0) {
             RestCommandLineService.getInstance().listDeployServices();
-            return CliConstants.SUCCESSFUL_CODE;
+            return CliConstants.COMMAND_SUCCESSFULL;
         } else {
             context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeploymentPolicyCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeploymentPolicyCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeploymentPolicyCommand.java
new file mode 100644
index 0000000..16f09ae
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListDeploymentPolicyCommand.java
@@ -0,0 +1,66 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.Options;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ListDeploymentPolicyCommand implements Command<StratosCommandContext> {
+
+    private static final Logger logger = LoggerFactory.getLogger(ListAutoscalePolicyCommand.class);
+
+    public ListDeploymentPolicyCommand() {
+    }
+
+    public String getName() {
+        return CliConstants.LIST_DEPLOYMENT_POLICIES;
+    }
+
+    public String getDescription() {
+        return "List available deployment policies";
+    }
+
+    public String getArgumentSyntax() {
+        return null;
+    }
+
+    public int execute(StratosCommandContext context, String[] args) throws CommandException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Executing {} command...", getName());
+        }
+        if (args == null || args.length == 0) {
+            //CommandLineService.getInstance().listAvailableCartridges();
+            RestCommandLineService.getInstance().listDeploymentPolicies();
+            return CliConstants.COMMAND_SUCCESSFULL;
+        } else {
+            context.getStratosApplication().printUsage(getName());
+            return CliConstants.COMMAND_FAILED;
+        }
+    }
+
+    public Options getOptions() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesGroupsCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesGroupsCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesGroupsCommand.java
index 146df48..22a8e05 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesGroupsCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesGroupsCommand.java
@@ -53,10 +53,10 @@ public class ListKubernetesGroupsCommand implements Command<StratosCommandContex
 		}
 		if ((args == null) || (args.length == 0)) {
             RestCommandLineService.getInstance().listKubernetesGroups();
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesHostsCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesHostsCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesHostsCommand.java
index 43062e7..1b6831e 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesHostsCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListKubernetesHostsCommand.java
@@ -53,11 +53,11 @@ public class ListKubernetesHostsCommand implements Command<StratosCommandContext
 		}
 		if ((args == null) || (args.length == 0)) {
             context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
+            return CliConstants.COMMAND_FAILED;
 		} else {
             String groupId = args[0];
             RestCommandLineService.getInstance().listKubernetesHosts(groupId);
-            return CliConstants.SUCCESSFUL_CODE;
+            return CliConstants.COMMAND_SUCCESSFULL;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListMemberCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListMemberCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListMemberCommand.java
index 4ce5ac7..cbdf039 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListMemberCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListMemberCommand.java
@@ -110,27 +110,27 @@ public class ListMemberCommand implements Command<StratosCommandContext> {
                 if (type == null) {
                     System.out.println("Cartridge type is required.");
                     context.getStratosApplication().printUsage(getName());
-                    return CliConstants.BAD_ARGS_CODE;
+                    return CliConstants.COMMAND_FAILED;
                 }
 
                 if (alias == null) {
                     System.out.println("alis is required...");
                     context.getStratosApplication().printUsage(getName());
-                    return CliConstants.BAD_ARGS_CODE;
+                    return CliConstants.COMMAND_FAILED;
                 }
                 RestCommandLineService.getInstance().listMembersOfCluster(type, alias);
 
-				return CliConstants.SUCCESSFUL_CODE;
+				return CliConstants.COMMAND_SUCCESSFULL;
 			} catch (ParseException e) {
 				if (logger.isErrorEnabled()) {
 					logger.error("Error parsing arguments", e);
 				}
 				System.out.println(e.getMessage());
-				return CliConstants.BAD_ARGS_CODE;
+				return CliConstants.COMMAND_FAILED;
 			}
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListPartitionCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListPartitionCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListPartitionCommand.java
new file mode 100644
index 0000000..ce75bfd
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListPartitionCommand.java
@@ -0,0 +1,65 @@
+/**
+ *  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.
+ */
+package org.apache.stratos.cli.commands;
+
+import org.apache.commons.cli.*;
+import org.apache.stratos.cli.Command;
+import org.apache.stratos.cli.RestCommandLineService;
+import org.apache.stratos.cli.StratosCommandContext;
+import org.apache.stratos.cli.exception.CommandException;
+import org.apache.stratos.cli.utils.CliConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ListPartitionCommand implements Command<StratosCommandContext> {
+
+    private static final Logger logger = LoggerFactory.getLogger(ListPartitionCommand.class);
+
+    public ListPartitionCommand(){
+    }
+
+    public String getName() {
+        return CliConstants.LIST_PARTITION;
+    }
+
+    public String getDescription() {
+        return "List available partitions";
+    }
+
+    public String getArgumentSyntax() {
+        return null;
+    }
+
+    public int execute(StratosCommandContext context, String[] args) throws CommandException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Executing {} command...", getName());
+        }
+        if (args == null || args.length == 0) {
+            RestCommandLineService.getInstance().listPartitions();
+            return CliConstants.COMMAND_SUCCESSFULL;
+        } else {
+            context.getStratosApplication().printUsage(getName());
+            return CliConstants.COMMAND_FAILED;
+        }
+    }
+
+    public Options getOptions() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListSubscribedCartridgesCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListSubscribedCartridgesCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListSubscribedCartridgesCommand.java
index 080a72c..0911c7d 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListSubscribedCartridgesCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListSubscribedCartridgesCommand.java
@@ -74,7 +74,7 @@ public class ListSubscribedCartridgesCommand implements Command<StratosCommandCo
 		if (args == null || args.length == 0) {
             RestCommandLineService.getInstance().listSubscribedCartridges(false);
 			//CommandLineService.getInstance().listSubscribedCartridges(false);
-			return CliConstants.SUCCESSFUL_CODE;
+			return CliConstants.COMMAND_SUCCESSFULL;
 		} else if (args != null && args.length > 0) {
 			String[] remainingArgs = null;
 			boolean full = false;
@@ -85,7 +85,7 @@ public class ListSubscribedCartridgesCommand implements Command<StratosCommandCo
 				remainingArgs = commandLine.getArgs();
 				if (!(remainingArgs == null || remainingArgs.length == 0)) {
 					context.getStratosApplication().printUsage(getName());
-					return CliConstants.BAD_ARGS_CODE;
+					return CliConstants.COMMAND_FAILED;
 				}
 
 				if (commandLine.hasOption(CliConstants.FULL_OPTION)) {
@@ -99,17 +99,17 @@ public class ListSubscribedCartridgesCommand implements Command<StratosCommandCo
 				}
                 RestCommandLineService.getInstance().listSubscribedCartridges(full);
 				//CommandLineService.getInstance().listSubscribedCartridges(full);
-				return CliConstants.SUCCESSFUL_CODE;
+				return CliConstants.COMMAND_SUCCESSFULL;
 			} catch (ParseException e) {
 				if (logger.isErrorEnabled()) {
 					logger.error("Error parsing arguments", e);
 				}
 				System.out.println(e.getMessage());
-				return CliConstants.BAD_ARGS_CODE;
+				return CliConstants.COMMAND_FAILED;
 			}
 		} else {
 			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
+			return CliConstants.COMMAND_FAILED;
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionCommand.java
deleted file mode 100644
index 4e5f4a8..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionCommand.java
+++ /dev/null
@@ -1,65 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.*;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PartitionCommand implements Command<StratosCommandContext> {
-
-    private static final Logger logger = LoggerFactory.getLogger(PartitionCommand.class);
-
-    public PartitionCommand(){
-    }
-
-    public String getName() {
-        return CliConstants.LIST_PARTITION;
-    }
-
-    public String getDescription() {
-        return "List available partitions";
-    }
-
-    public String getArgumentSyntax() {
-        return null;
-    }
-
-    public int execute(StratosCommandContext context, String[] args) throws CommandException {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Executing {} command...", getName());
-        }
-        if (args == null || args.length == 0) {
-            RestCommandLineService.getInstance().listPartitions();
-            return CliConstants.SUCCESSFUL_CODE;
-        } else {
-            context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
-        }
-    }
-
-    public Options getOptions() {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionDeploymentCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionDeploymentCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionDeploymentCommand.java
deleted file mode 100644
index b1e5989..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PartitionDeploymentCommand.java
+++ /dev/null
@@ -1,138 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.*;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class PartitionDeploymentCommand implements Command<StratosCommandContext> {
-
-    private static final Logger logger = LoggerFactory.getLogger(PartitionDeploymentCommand.class);
-
-    private final Options options;
-
-    public PartitionDeploymentCommand(){
-        options = constructOptions();
-    }
-
-    private Options constructOptions() {
-        final Options options = new Options();
-
-        Option resourcePath = new Option(CliConstants.RESOURCE_PATH, CliConstants.RESOURCE_PATH_LONG_OPTION, true,
-                "Partition deployment resource path");
-        resourcePath.setArgName("resource path");
-        options.addOption(resourcePath);
-
-        return options;
-    }
-
-    public String getName() {
-        return CliConstants.PARTITION_DEPLOYMENT;
-    }
-
-    public String getDescription() {
-        return "Add new partition deployment";
-    }
-
-    public String getArgumentSyntax() {
-        return null;
-    }
-
-    public int execute(StratosCommandContext context, String[] args) throws CommandException {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Executing {} command...", getName());
-        }
-
-        if (args != null && args.length > 0) {
-            String resourcePath = null;
-            String partionDeployment = null;
-
-            final CommandLineParser parser = new GnuParser();
-            CommandLine commandLine;
-
-            try {
-                commandLine = parser.parse(options, args);
-
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Partition deployment");
-                }
-
-                if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
-                    if (logger.isTraceEnabled()) {
-                        logger.trace("Resource path option is passed");
-                    }
-                    resourcePath = commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
-                    partionDeployment = readResource(resourcePath);
-                }
-
-                if (resourcePath == null) {
-                    System.out.println("usage: " + getName() + " [-p <resource path>]");
-                    return CliConstants.BAD_ARGS_CODE;
-                }
-
-                RestCommandLineService.getInstance().deployPartition(partionDeployment);
-                return CliConstants.SUCCESSFUL_CODE;
-
-            } catch (ParseException e) {
-                if (logger.isErrorEnabled()) {
-                    logger.error("Error parsing arguments", e);
-                }
-                System.out.println(e.getMessage());
-                return CliConstants.BAD_ARGS_CODE;
-            } catch (IOException e) {
-                //e.printStackTrace();
-                System.out.println("Invalid resource path");
-                return CliConstants.BAD_ARGS_CODE;
-            }
-        } else {
-            context.getStratosApplication().printUsage(getName());
-            return CliConstants.BAD_ARGS_CODE;
-        }
-    }
-
-    private String readResource(String fileName) throws IOException {
-        BufferedReader br = new BufferedReader(new FileReader(fileName));
-        try {
-            StringBuilder sb = new StringBuilder();
-            String line = br.readLine();
-
-            while (line != null) {
-                sb.append(line);
-                sb.append("\n");
-                line = br.readLine();
-            }
-            return sb.toString();
-        } finally {
-            br.close();
-        }
-    }
-
-    public Options getOptions() {
-        return options;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PoliciesCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PoliciesCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PoliciesCommand.java
deleted file mode 100644
index b63f400..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/PoliciesCommand.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.CommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-
-public class PoliciesCommand implements Command<StratosCommandContext> {
-
-	private static final Logger logger = LoggerFactory.getLogger(PoliciesCommand.class);
-
-	public PoliciesCommand() {
-	}
-
-	@Override
-	public String getName() {
-		return CliConstants.POLICIES_ACTION;
-	}
-
-	@Override
-	public String getDescription() {
-		return "List available policies";
-	}
-
-	@Override
-	public String getArgumentSyntax() {
-		return null;
-	}
-
-	@Override
-	public int execute(StratosCommandContext context, String[] args) throws CommandException {
-		if (logger.isDebugEnabled()) {
-			logger.debug("Executing {} command...", getName());
-		}
-		if (args == null || args.length == 0) {
-			CommandLineService.getInstance().listAvailablePolicies();
-			return CliConstants.SUCCESSFUL_CODE;
-		} else {
-			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
-		}
-	}
-
-	@Override
-	public Options getOptions() {
-		return null;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c9df250a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/RemoveDomainMappingCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/RemoveDomainMappingCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/RemoveDomainMappingCommand.java
deleted file mode 100644
index 06e6b11..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/RemoveDomainMappingCommand.java
+++ /dev/null
@@ -1,75 +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.
- */
-package org.apache.stratos.cli.commands;
-
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.CommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RemoveDomainMappingCommand implements Command<StratosCommandContext> {
-
-	private static final Logger logger = LoggerFactory.getLogger(RemoveDomainMappingCommand.class);
-
-	public RemoveDomainMappingCommand() {
-	}
-
-	@Override
-	public String getName() {
-		return CliConstants.REMOVE_DOMAIN_MAPPING_ACTION;
-	}
-
-	@Override
-	public String getDescription() {
-		return "Remove domain mapping for the subscribed cartridge";
-	}
-
-	@Override
-	public String getArgumentSyntax() {
-		return "[Cartridge alias]";
-	}
-
-	@Override
-	public int execute(StratosCommandContext context, String[] args) throws CommandException {
-		if (logger.isDebugEnabled()) {
-			logger.debug("Executing {} command...", getName());
-		}
-		if (args != null && args.length == 1) {
-			String alias = args[0];
-			if (logger.isDebugEnabled()) {
-				logger.debug("Removing domain mapping for {}", alias);
-			}
-			CommandLineService.getInstance().removeDomainMapping(alias);
-			return CliConstants.SUCCESSFUL_CODE;
-		} else {
-			context.getStratosApplication().printUsage(getName());
-			return CliConstants.BAD_ARGS_CODE;
-		}
-	}
-
-	@Override
-	public Options getOptions() {
-		return null;
-	}
-
-}