cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/master to a8140ff
Date Tue, 27 May 2014 22:09:16 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 20a31b43d -> a8140ff58


CLOUDSTACK-6787: Event Bus - uuids missing in some cases due to various reasons


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

Branch: refs/heads/master
Commit: a8140ff58c73be36e56a17b938e6c602e05f0685
Parents: 20a31b4
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Tue May 27 14:55:22 2014 -0700
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Tue May 27 15:07:38 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/event/EventTypes.java         | 45 ++++++++++++++------
 api/src/com/cloud/network/vpc/NetworkACL.java   |  3 +-
 .../com/cloud/network/vpc/NetworkACLItem.java   |  3 +-
 .../user/vpn/CreateRemoteAccessVpnCmd.java      |  8 +---
 .../src/com/cloud/event/ActionEventUtils.java   |  8 ++--
 .../network/vpc/NetworkACLServiceImpl.java      |  4 ++
 .../network/vpn/RemoteAccessVpnManagerImpl.java |  2 +
 server/src/com/cloud/vm/UserVmManagerImpl.java  |  3 ++
 8 files changed, 52 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/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 d9aa3f4..a856bd9 100755
--- a/api/src/com/cloud/event/EventTypes.java
+++ b/api/src/com/cloud/event/EventTypes.java
@@ -19,6 +19,13 @@ package com.cloud.event;
 import java.util.HashMap;
 import java.util.Map;
 
+import com.cloud.network.IpAddress;
+import com.cloud.network.Site2SiteVpnGateway;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.HealthCheckPolicy;
+import com.cloud.network.rules.StickinessPolicy;
+import com.cloud.network.vpc.NetworkACL;
+import com.cloud.network.vpc.NetworkACLItem;
 import com.cloud.server.ResourceTag;
 import com.cloud.vm.ConsoleProxy;
 import com.cloud.vm.SecondaryStorageVm;
@@ -35,7 +42,6 @@ import com.cloud.network.Network;
 import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PhysicalNetworkTrafficType;
-import com.cloud.network.PublicIpAddress;
 import com.cloud.network.RemoteAccessVpn;
 import com.cloud.network.as.AutoScaleCounter;
 import com.cloud.network.as.AutoScalePolicy;
@@ -539,21 +545,27 @@ public class EventTypes {
         entityEventDetails.put(EVENT_NETWORK_DELETE, Network.class);
         entityEventDetails.put(EVENT_NETWORK_UPDATE, Network.class);
         entityEventDetails.put(EVENT_NETWORK_RESTART, Network.class);
-        entityEventDetails.put(EVENT_NET_IP_ASSIGN, PublicIpAddress.class);
-        entityEventDetails.put(EVENT_NET_IP_RELEASE, PublicIpAddress.class);
-        entityEventDetails.put(EVENT_NET_RULE_ADD, Network.class);
-        entityEventDetails.put(EVENT_NET_RULE_DELETE, Network.class);
-        entityEventDetails.put(EVENT_NET_RULE_MODIFY, Network.class);
-        entityEventDetails.put(EVENT_FIREWALL_OPEN, Network.class);
-        entityEventDetails.put(EVENT_FIREWALL_CLOSE, Network.class);
+        entityEventDetails.put(EVENT_NET_IP_ASSIGN, IpAddress.class);
+        entityEventDetails.put(EVENT_PORTABLE_IP_ASSIGN, IpAddress.class);
+        entityEventDetails.put(EVENT_PORTABLE_IP_RELEASE, IpAddress.class);
+        entityEventDetails.put(EVENT_NET_IP_RELEASE, IpAddress.class);
+        entityEventDetails.put(EVENT_NET_RULE_ADD, FirewallRule.class);
+        entityEventDetails.put(EVENT_NET_RULE_DELETE, FirewallRule.class);
+        entityEventDetails.put(EVENT_NET_RULE_MODIFY, FirewallRule.class);
+        entityEventDetails.put(EVENT_FIREWALL_OPEN, FirewallRule.class);
+        entityEventDetails.put(EVENT_FIREWALL_CLOSE, FirewallRule.class);
 
         // Load Balancers
         entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, LoadBalancer.class);
         entityEventDetails.put(EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, LoadBalancer.class);
         entityEventDetails.put(EVENT_LOAD_BALANCER_CREATE, LoadBalancer.class);
         entityEventDetails.put(EVENT_LOAD_BALANCER_DELETE, LoadBalancer.class);
-        entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, LoadBalancer.class);
-        entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, LoadBalancer.class);
+        entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, StickinessPolicy.class);
+        entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_UPDATE, StickinessPolicy.class);
+        entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, StickinessPolicy.class);
+        entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_CREATE, HealthCheckPolicy.class);
+        entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_UPDATE, HealthCheckPolicy.class);
+        entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_DELETE, HealthCheckPolicy.class);
         entityEventDetails.put(EVENT_LOAD_BALANCER_UPDATE, LoadBalancer.class);
         entityEventDetails.put(EVENT_LB_CERT_UPLOAD, LoadBalancer.class);
         entityEventDetails.put(EVENT_LB_CERT_DELETE, LoadBalancer.class);
@@ -693,8 +705,8 @@ public class EventTypes {
         entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_DESTROY, RemoteAccessVpn.class);
         entityEventDetails.put(EVENT_VPN_USER_ADD, RemoteAccessVpn.class);
         entityEventDetails.put(EVENT_VPN_USER_REMOVE, RemoteAccessVpn.class);
-        entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, RemoteAccessVpn.class);
-        entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, RemoteAccessVpn.class);
+        entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, Site2SiteVpnGateway.class);
+        entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, Site2SiteVpnGateway.class);
         entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_CREATE, RemoteAccessVpn.class);
         entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_DELETE, RemoteAccessVpn.class);
         entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_UPDATE, RemoteAccessVpn.class);
@@ -757,6 +769,15 @@ public class EventTypes {
         entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE, PhysicalNetwork.class);
         entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE, PhysicalNetwork.class);
 
+        // Network ACL
+        entityEventDetails.put(EVENT_NETWORK_ACL_CREATE, NetworkACL.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_DELETE, NetworkACL.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_REPLACE, NetworkACL.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_UPDATE, NetworkACL.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_CREATE, NetworkACLItem.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_UPDATE, NetworkACLItem.class);
+        entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_DELETE, NetworkACLItem.class);
+
         // VPC
         entityEventDetails.put(EVENT_VPC_CREATE, Vpc.class);
         entityEventDetails.put(EVENT_VPC_UPDATE, Vpc.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/api/src/com/cloud/network/vpc/NetworkACL.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/NetworkACL.java b/api/src/com/cloud/network/vpc/NetworkACL.java
index 193a48c..b0c87cc 100644
--- a/api/src/com/cloud/network/vpc/NetworkACL.java
+++ b/api/src/com/cloud/network/vpc/NetworkACL.java
@@ -18,9 +18,10 @@
 package com.cloud.network.vpc;
 
 import org.apache.cloudstack.api.Displayable;
+import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
-public interface NetworkACL extends InternalIdentity, Displayable {
+public interface NetworkACL extends InternalIdentity, Identity, Displayable {
     public static final long DEFAULT_DENY = 1;
     public static final long DEFAULT_ALLOW = 2;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/api/src/com/cloud/network/vpc/NetworkACLItem.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/NetworkACLItem.java b/api/src/com/cloud/network/vpc/NetworkACLItem.java
index 8e288a2..75153fd 100644
--- a/api/src/com/cloud/network/vpc/NetworkACLItem.java
+++ b/api/src/com/cloud/network/vpc/NetworkACLItem.java
@@ -19,9 +19,10 @@ package com.cloud.network.vpc;
 import java.util.List;
 
 import org.apache.cloudstack.api.Displayable;
+import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
-public interface NetworkACLItem extends InternalIdentity, Displayable {
+public interface NetworkACLItem extends InternalIdentity, Identity, Displayable {
 
     String getUuid();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
index 14b781d..2bef64e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
@@ -147,12 +147,8 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
         try {
             RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange,
getOpenFirewall(), isDisplay());
             if (vpn != null) {
-                setEntityId(vpn.getServerAddressId());
-                // find uuid for server ip address
-                IpAddress ipAddr = _entityMgr.findById(IpAddress.class, vpn.getServerAddressId());
-                if (ipAddr != null) {
-                    setEntityUuid(ipAddr.getUuid());
-                }
+                setEntityId(vpn.getId());
+                setEntityUuid(vpn.getUuid());
             } else {
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create
remote access vpn");
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/server/src/com/cloud/event/ActionEventUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java
index a30ec48..fa9d40d 100755
--- a/server/src/com/cloud/event/ActionEventUtils.java
+++ b/server/src/com/cloud/event/ActionEventUtils.java
@@ -288,8 +288,8 @@ public class ActionEventUtils {
         CallContext context = CallContext.current();
         Map<Object, Object> contextMap = context.getContextParameters();
 
-        try{
-            for(Map.Entry<Object, Object> entry : contextMap.entrySet()){
+        for(Map.Entry<Object, Object> entry : contextMap.entrySet()){
+            try{
                 Object key = entry.getKey();
                 Class clz = Class.forName((String)key);
                 if(clz instanceof Class && Identity.class.isAssignableFrom(clz)){
@@ -297,9 +297,9 @@ public class ActionEventUtils {
                     String uuid = ((Identity) objVO).getUuid();
                     eventDescription.put(ReflectUtil.getEntityName(clz), uuid);
                 }
+            } catch (Exception e){
+                s_logger.trace("Caught exception while populating first class entities for
event bus, moving on");
             }
-        }catch (Exception e){
-            s_logger.debug("Caught exception while populating first class entities for event
bus, moving on", e);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 19a26c1..f871b8e 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -108,6 +108,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_CREATE, eventDescription = "creating
network acl list", async = true)
     public NetworkACL getNetworkACL(long id) {
         return _networkAclMgr.getNetworkACL(id);
     }
@@ -471,6 +472,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_CREATE, eventDescription =
"Applying Network ACL Item", async = true)
     public boolean applyNetworkACL(long aclId) throws ResourceUnavailableException {
         return _networkAclMgr.applyNetworkACL(aclId);
     }
@@ -601,6 +603,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_DELETE, eventDescription =
"Deleting Network ACL Item", async = true)
     public boolean revokeNetworkACLItem(long ruleId) {
         NetworkACLItemVO aclItem = _networkACLItemDao.findById(ruleId);
         if(aclItem != null){
@@ -620,6 +623,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_UPDATE, eventDescription =
"Updating Network ACL Item", async = true)
     public NetworkACLItem updateNetworkACLItem(Long id, String protocol, List<String>
sourceCidrList, NetworkACLItem.TrafficType trafficType, String action,
         Integer number, Integer sourcePortStart, Integer sourcePortEnd, Integer icmpCode,
Integer icmpType, String newUUID, Boolean forDisplay) throws ResourceUnavailableException
{
         NetworkACLItemVO aclItem = _networkACLItemDao.findById(id);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
index 757f618..f4d8947 100755
--- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
@@ -285,6 +285,7 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
 
     @Override
     @DB
+    @ActionEvent(eventType = EventTypes.EVENT_REMOTE_ACCESS_VPN_DESTROY, eventDescription
= "removing remote access vpn", async = true)
     public boolean destroyRemoteAccessVpnForIp(long ipId, Account caller) throws ResourceUnavailableException
{
         final RemoteAccessVpnVO vpn = _remoteAccessVpnDao.findByPublicIpAddress(ipId);
         if (vpn == null) {
@@ -449,6 +450,7 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
 
     @Override
     @DB
+    @ActionEvent(eventType = EventTypes.EVENT_REMOTE_ACCESS_VPN_CREATE, eventDescription
= "creating remote access vpn", async = true)
     public RemoteAccessVpnVO startRemoteAccessVpn(long ipAddressId, boolean openFirewall)
throws ResourceUnavailableException {
         Account caller = CallContext.current().getCallingAccount();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8140ff5/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index f699ee1..f97ce74 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -957,6 +957,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NIC_CREATE, eventDescription = "Creating Nic",
async = true)
     public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterValueException,
PermissionDeniedException, CloudRuntimeException {
         Long vmId = cmd.getVmId();
         Long networkId = cmd.getNetworkId();
@@ -1041,6 +1042,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NIC_DELETE, eventDescription = "Removing Nic",
async = true)
     public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws InvalidParameterValueException,
PermissionDeniedException, CloudRuntimeException {
         Long vmId = cmd.getVmId();
         Long nicId = cmd.getNicId();
@@ -1097,6 +1099,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_NIC_UPDATE, eventDescription = "Creating Nic",
async = true)
     public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) throws
InvalidParameterValueException, CloudRuntimeException {
         Long vmId = cmd.getVmId();
         Long nicId = cmd.getNicId();


Mime
View raw message