cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [2/2] git commit: updated refs/heads/master to a5dcb27
Date Fri, 19 Jul 2013 13:24:53 GMT
CLOUDSTACK-3640: [Usage][GSLB] usage events are not generated for GSLB

geneating usage events for create/delete of GSLB rule


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

Branch: refs/heads/master
Commit: a5dcb2754707f928318e5aaba52f8aee34a56c4a
Parents: 28aaa75
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Fri Jul 19 18:28:09 2013 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Fri Jul 19 18:45:36 2013 +0530

----------------------------------------------------------------------
 .../gslb/GlobalLoadBalancingRulesServiceImpl.java      | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a5dcb275/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
index 38ba37c..0ba09c1 100644
--- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
+++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
@@ -24,6 +24,7 @@ import com.cloud.configuration.Config;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
+import com.cloud.event.UsageEventUtils;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.Network;
@@ -140,6 +141,11 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
                 stickyMethod, serviceType, regionId, gslbOwner.getId(), gslbOwner.getDomainId(),
                 GlobalLoadBalancerRule.State.Staged);
         _gslbRuleDao.persist(newGslbRule);
+
+        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_CREATE, newGslbRule.getAccountId(),
+                0, newGslbRule.getId(), name, GlobalLoadBalancerRule.class.getName(),
+                newGslbRule.getUuid());
+
         txn.commit();
 
         s_logger.debug("successfully created new global load balancer rule for the account
" + gslbOwner.getId());
@@ -438,6 +444,9 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
                 s_logger.debug("Rule Id: " + gslbRuleId + " is still in Staged state so just
removing it.");
             }
             _gslbRuleDao.remove(gslbRuleId);
+            UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE,
gslbRule.getAccountId(),
+                    0, gslbRule.getId(), gslbRule.getName(), GlobalLoadBalancerRule.class.getName(),
+                    gslbRule.getUuid());
             return;
         } else  if (gslbRule.getState() == GlobalLoadBalancerRule.State.Add || gslbRule.getState()
== GlobalLoadBalancerRule.State.Active) {
             //mark the GSlb rule to be in revoke state
@@ -480,6 +489,10 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
         //remove the GSLB rule itself
         _gslbRuleDao.remove(gslbRuleId);
 
+        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_GLOBAL_LOAD_BALANCER_DELETE, gslbRule.getAccountId(),
+                0, gslbRule.getId(), gslbRule.getName(), GlobalLoadBalancerRule.class.getName(),
+                gslbRule.getUuid());
+
         txn.commit();
     }
 


Mime
View raw message