cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [33/50] [abbrv] git commit: updated refs/heads/object_store to f7c1b71
Date Fri, 17 May 2013 07:20:37 GMT
CLOUDSTACK-2460: fix the event descriptions for
create/delete/update/assign global load balancer rule apis


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

Branch: refs/heads/object_store
Commit: 565d829c006609251c18883b1007175b6a1d2f79
Parents: 3c51c4e
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Thu May 16 14:25:14 2013 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Thu May 16 15:19:41 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/event/EventTypes.java            |    1 +
 .../ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java |    2 +-
 .../ha/gslb/CreateGlobalLoadBalancerRuleCmd.java   |    2 +-
 .../ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java   |    4 +-
 .../ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java   |   28 ++++++++++++---
 5 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/565d829c/api/src/com/cloud/event/EventTypes.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java
index d272c99..e317a8f 100755
--- a/api/src/com/cloud/event/EventTypes.java
+++ b/api/src/com/cloud/event/EventTypes.java
@@ -134,6 +134,7 @@ public class EventTypes {
     public static final String EVENT_REMOVE_FROM_GLOBAL_LOAD_BALANCER_RULE = "GLOBAL.LB.REMOVE";
     public static final String EVENT_GLOBAL_LOAD_BALANCER_CREATE = "GLOBAL.LB.CREATE";
     public static final String EVENT_GLOBAL_LOAD_BALANCER_DELETE = "GLOBAL.LB.DELETE";
+    public static final String EVENT_GLOBAL_LOAD_BALANCER_UPDATE = "GLOBAL.LB.UPDATE";
 
     // Account events
     public static final String EVENT_ACCOUNT_ENABLE = "ACCOUNT.ENABLE";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/565d829c/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
index 1c07a0a..1575cd3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
@@ -95,7 +95,7 @@ public class AssignToGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
 
     @Override
     public String getEventDescription() {
-        return "applying load balancer rules " + StringUtils.join(getLoadBalancerRulesIds(),
",") +
+        return "assign load balancer rules " + StringUtils.join(getLoadBalancerRulesIds(),
",") +
                 " to global load balancer rule " + getGlobalLoadBalancerRuleId();
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/565d829c/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
index 07d3274..ac33495 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
@@ -162,7 +162,7 @@ public class CreateGlobalLoadBalancerRuleCmd extends BaseAsyncCreateCmd
{
 
     @Override
     public String getEventDescription() {
-        return "creating a global load balancer: " + getName() + " for account: " + getAccountName();
+        return "creating a global load balancer rule Id: " + getEntityId();
 
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/565d829c/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
index 424b107..fe5decd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
@@ -77,12 +77,12 @@ public class DeleteGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
 
     @Override
     public String getEventType() {
-        return EventTypes.EVENT_LOAD_BALANCER_DELETE;
+        return EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE;
     }
 
     @Override
     public String getEventDescription() {
-        return  "deleting global load balancer: " + getGlobalLoadBalancerId();
+        return  "deleting global load balancer rule: " + getGlobalLoadBalancerId();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/565d829c/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
index 10694e1..4e2c0fd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
@@ -17,11 +17,11 @@
 
 package org.apache.cloudstack.api.command.user.region.ha.gslb;
 
+import com.cloud.event.EventTypes;
+import com.cloud.region.ha.GlobalLoadBalancerRule;
 import com.cloud.region.ha.GlobalLoadBalancingRulesService;
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
-import org.apache.cloudstack.api.Parameter;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.*;
 import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
 import org.apache.cloudstack.api.response.LoadBalancerResponse;
 import org.apache.log4j.Logger;
@@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
 import javax.inject.Inject;
 
 @APICommand(name = "updateGlobalLoadBalancerRule", description = "update global load balancer
rules.", responseObject = LoadBalancerResponse.class)
-public class UpdateGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd {
+public class UpdateGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(GlobalLoadBalancerResponse.class.getName());
 
     private static final String s_name = "updategloballoadbalancerruleresponse";
@@ -89,8 +89,26 @@ public class UpdateGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd
     }
 
     @Override
+    public long getEntityOwnerId() {
+        GlobalLoadBalancerRule lb = _entityMgr.findById(GlobalLoadBalancerRule.class, getId());
+        if (lb != null) {
+            return lb.getAccountId();
+        }
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
     public void execute() {
         _gslbService.updateGlobalLoadBalancerRule(this);
     }
 
+    @Override
+    public String getEventType() {
+        return EventTypes.EVENT_GLOBAL_LOAD_BALANCER_UPDATE;
+    }
+
+    @Override
+    public String getEventDescription() {
+        return null;
+    }
 }


Mime
View raw message