You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by pr...@apache.org on 2014/01/17 14:52:29 UTC

git commit: adding subscribe method

Updated Branches:
  refs/heads/master 218035f5f -> 543153c5c


adding subscribe method


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

Branch: refs/heads/master
Commit: 543153c5ccbbe2f3aeb6012b848d07b4cb20f2c2
Parents: 218035f
Author: Pradeep Fernando <pr...@gmail.com>
Authored: Fri Jan 17 19:22:13 2014 +0530
Committer: Pradeep Fernando <pr...@gmail.com>
Committed: Fri Jan 17 19:22:13 2014 +0530

----------------------------------------------------------------------
 .../console/util/utility.jag                          | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/543153c5/components/org.apache.stratos.manager.console/console/util/utility.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/util/utility.jag b/components/org.apache.stratos.manager.console/console/util/utility.jag
index f313717..49479b7 100644
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ b/components/org.apache.stratos.manager.console/console/util/utility.jag
@@ -75,7 +75,7 @@ function getServerUrl(){
 }
 
 consoleAppUtil = new function(){
-    var log = new Log();
+    var log = new Log('utility.consoleAppUtil');
 
     this.getAvailableSingleTenantCartridges = function(){
         return this.sendReceive("GET","/cartridge/list",{}).data;
@@ -105,6 +105,10 @@ consoleAppUtil = new function(){
         return this.send("POST","/policy/deployment",policyDefinition).data;
     };
 
+    this.subscribeToCartridge = function(cartridgeBeanInfo){
+        log.info(cartridgeBeanInfo);
+        return this.sendReceive("POST","/cartridge/subscribe", cartridgeBeanInfo).data;
+    }
 
 
     // refactor sendRecive and send method. duplicate code...
@@ -113,6 +117,8 @@ consoleAppUtil = new function(){
         var backendServerURL = config.backendServerConfiguration.url;
         // getting the access token from the session.
         var endpoint = backendServerURL + urlPostFix;
+        //var endpoint = "http://localhost:9000/stratos/admin" + urlPostFix;
+
         var accessToken = this.getAccessTokenFromSession();
         // the header values are constant
         var headers = {
@@ -126,13 +132,13 @@ consoleAppUtil = new function(){
                 response = get(endpoint,{},headers,type);
                 break;
             case   "POST":
-                response = post(endpoint,data,headers,type);
+                response = post(endpoint,stringify(data),headers,type);
                 break;
             case    "PUT":
-                response = put(endpoint,data,headers,type);
+                response = put(endpoint,stringify(data),headers,type);
                 break;
             case    "DELETE":
-                response = del(endpoint,data,headers,type);
+                response = del(endpoint,stringify(data),headers,type);
                 break;
             default :
                 log.error("Error in the programme flow.");