incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [50/50] [abbrv] git commit: refs/heads/cisco-vnmc-api-integration - Changes related to instantiating the dao components
Date Wed, 13 Mar 2013 06:25:04 GMT
Updated Branches:
  refs/heads/cisco-vnmc-api-integration 9c94b6d23 -> 43e299742


Changes related to instantiating the dao components


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

Branch: refs/heads/cisco-vnmc-api-integration
Commit: 43e29974215a73788b249f246d7e62825cf8b4e6
Parents: 99e88ec
Author: Koushik Das <koushik.das@citrix.com>
Authored: Wed Mar 13 11:51:59 2013 +0530
Committer: Koushik Das <koushik.das@citrix.com>
Committed: Wed Mar 13 11:51:59 2013 +0530

----------------------------------------------------------------------
 client/tomcatconf/nonossComponentContext.xml.in    |    6 +++-
 .../api/response/CiscoVnmcResourceResponse.java    |    5 ++-
 .../cloud/network/dao/CiscoAsa1000vDaoImpl.java    |    3 ++
 .../com/cloud/network/dao/CiscoVnmcDaoImpl.java    |    3 ++
 .../network/dao/NetworkAsa1000vMapDaoImpl.java     |    3 ++
 .../cloud/network/resource/CiscoVnmcResource.java  |   20 +++++++++------
 6 files changed, 28 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index 89bd49b..e638b2c 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -39,7 +39,7 @@
   
   <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
   <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl"
/>
-   
+  
   <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
   <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl"
/>
   <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl"
/>
@@ -103,7 +103,9 @@
   <bean id="CiscoNexus1000vVSM" class="com.cloud.network.element.CiscoNexusVSMElement">
     <property name="name" value="CiscoNexus1000vVSM"/>
   </bean>
-             
+  <bean id="CiscoVNMC" class="com.cloud.network.element.CiscoVnmcElement">
+    <property name="name" value="CiscoVNMC"/>
+  </bean>
   <!--
      Adapters
   -->

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
index 4bbde68..f5c9b72 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
@@ -29,12 +29,13 @@ import com.google.gson.annotations.SerializedName;
 public class CiscoVnmcResourceResponse extends BaseResponse {
     public static final String RESOURCE_NAME = "resourcename";
 
-    @SerializedName(ApiConstants.RESOURCE_ID) @Parameter(description="resource id of the
Cisco  VNMC controller")
+    @SerializedName(ApiConstants.RESOURCE_ID)
+    @Parameter(description="resource id of the Cisco VNMC controller")
     private String id;
 
     @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
     @Parameter(description="the physical network to which this VNMC belongs to", entityType
= PhysicalNetworkResponse.class)
-    private Long physicalNetworkId ;
+    private Long physicalNetworkId;
 
     public Long getPhysicalNetworkId() {
         return physicalNetworkId;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
index 3046045..a5820de 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
@@ -20,12 +20,15 @@ import java.util.List;
 
 import javax.ejb.Local;
 
+import org.springframework.stereotype.Component;
+
 import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
 
+@Component
 @Local(value=CiscoAsa1000vDao.class)
 public class CiscoAsa1000vDaoImpl extends GenericDaoBase<CiscoAsa1000vDeviceVO, Long>
         implements CiscoAsa1000vDao {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
index 69c56c1..8951810 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
@@ -20,12 +20,15 @@ import java.util.List;
 
 import javax.ejb.Local;
 
+import org.springframework.stereotype.Component;
+
 import com.cloud.network.cisco.CiscoVnmcControllerVO;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
 
+@Component
 @Local(value=CiscoVnmcDao.class)
 public class CiscoVnmcDaoImpl extends GenericDaoBase<CiscoVnmcControllerVO, Long>
         implements CiscoVnmcDao {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
index 7326a90..692b3d6 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
@@ -18,12 +18,15 @@ package com.cloud.network.dao;
 
 import javax.ejb.Local;
 
+import org.springframework.stereotype.Component;
+
 import com.cloud.network.cisco.NetworkAsa1000vMapVO;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
 
+@Component
 @Local(value=NetworkAsa1000vMapDao.class)
 public class NetworkAsa1000vMapDaoImpl extends GenericDaoBase<NetworkAsa1000vMapVO, Long>
         implements NetworkAsa1000vMapDao {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43e29974/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
index a489b1d..02428ff 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
@@ -52,6 +52,7 @@ import com.cloud.agent.api.to.PortForwardingRuleTO;
 import com.cloud.agent.api.to.StaticNatRuleTO;
 import com.cloud.host.Host;
 import com.cloud.network.cisco.CiscoVnmcConnectionImpl;
+import com.cloud.network.rules.FirewallRule.TrafficType;
 import com.cloud.resource.ServerResource;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
@@ -352,15 +353,18 @@ public class CiscoVnmcResource implements ServerResource {
                             throw new Exception("Failed to delete ACL ingress rule in VNMC
for guest network with vlan " + vlanId);
                         }
                     } else {
-                        String[] externalIpRange = getIpRangeFromCidr(rule.getSourceCidrList().get(0));
-                        if (!_connection.createTenantVDCIngressAclRule(tenant,
-                                Long.toString(rule.getId()), policyIdentifier,
-                                rule.getProtocol().toUpperCase(), externalIpRange[0], externalIpRange[1],
-                                Integer.toString(rule.getSrcPortRange()[0]), Integer.toString(rule.getSrcPortRange()[1]),
publicIp)) {
-                            throw new Exception("Failed to create ACL ingress rule in VNMC
for guest network with vlan " + vlanId);
-                        }
+                    	if (rule.getTrafficType() == TrafficType.Ingress) {
+                            String[] externalIpRange = getIpRangeFromCidr(rule.getSourceCidrList().get(0));
+                            if (!_connection.createTenantVDCIngressAclRule(tenant,
+                                    Long.toString(rule.getId()), policyIdentifier,
+                                    rule.getProtocol().toUpperCase(), externalIpRange[0],
externalIpRange[1],
+                                    Integer.toString(rule.getSrcPortRange()[0]), Integer.toString(rule.getSrcPortRange()[1]),
publicIp)) {
+                                throw new Exception("Failed to create ACL ingress rule in
VNMC for guest network with vlan " + vlanId);
+                            }
+                    	} else {
+                            // TODO for egress
+                    	}
                     }
-                    // TODO for egress
                 }
             }
 


Mime
View raw message