cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.3 to 326313e
Date Thu, 12 Dec 2013 23:23:55 GMT
Updated Branches:
  refs/heads/4.3 94f6c9f34 -> 326313e02


Resource metadata support for S2SVpnConnection


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

Branch: refs/heads/4.3
Commit: 326313e02e7d9665b31b76240ba935cd96cc24d7
Parents: 94f6c9f
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Dec 12 14:57:44 2013 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Dec 12 14:57:44 2013 -0800

----------------------------------------------------------------------
 api/src/com/cloud/server/ResourceTag.java       |  3 +-
 .../spring-engine-schema-core-daos-context.xml  |  1 +
 .../Site2SiteVpnConnectionDetailVO.java         | 81 ++++++++++++++++++++
 .../dao/Site2SiteVpnConnectionDetailsDao.java   | 26 +++++++
 .../Site2SiteVpnConnectionDetailsDaoImpl.java   | 33 ++++++++
 .../metadata/ResourceMetaDataManagerImpl.java   |  4 +
 .../cloud/tags/TaggedResourceManagerImpl.java   |  4 +
 setup/db/db/schema-421to430.sql                 | 10 +++
 8 files changed, 161 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/api/src/com/cloud/server/ResourceTag.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index bd20691..6c6b34c 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -49,7 +49,8 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
         PrivateGateway(false, true),
         NetworkACLList(false, true),
         VpnGateway(false, true),
-        CustomerGateway(false, true);
+        CustomerGateway(false, true),
+        VpnConnection(false, true);
 
         ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport)
{
             this.resourceTagsSupport = resourceTagsSupport;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
index 0447b71..ea0bad9 100644
--- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -330,6 +330,7 @@
   <bean id="NetworkACLItemDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDaoImpl"
/>
   <bean id="Site2SiteVpnGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDaoImpl"
/>
   <bean id="Site2SiteCustomerGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDaoImpl"
/>
+  <bean id="Site2SiteVpnConnectionDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnConnectionDetailsDaoImpl"
/>
   <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"
/>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteVpnConnectionDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteVpnConnectionDetailVO.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteVpnConnectionDetailVO.java
new file mode 100644
index 0000000..9a4b616
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteVpnConnectionDetailVO.java
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+@Entity
+@Table(name = "s2s_vpn_connection_details")
+public class Site2SiteVpnConnectionDetailVO implements ResourceDetail {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name = "s2s_vpn_connection_id")
+    private long resourceId;
+
+    @Column(name = "name")
+    private String name;
+
+    @Column(name = "value", length = 1024)
+    private String value;
+
+    @Column(name = "display")
+    private boolean display;
+
+    public Site2SiteVpnConnectionDetailVO() {
+    }
+
+    public Site2SiteVpnConnectionDetailVO(long id, String name, String value) {
+        this.resourceId = id;
+        this.name = name;
+        this.value = value;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public long getResourceId() {
+        return resourceId;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDao.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDao.java
new file mode 100644
index 0000000..ceb5cf7
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDao.java
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail.dao;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDao;
+import org.apache.cloudstack.resourcedetail.Site2SiteVpnConnectionDetailVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface Site2SiteVpnConnectionDetailsDao extends GenericDao<Site2SiteVpnConnectionDetailVO,
Long>, ResourceDetailsDao<Site2SiteVpnConnectionDetailVO> {
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDaoImpl.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDaoImpl.java
new file mode 100644
index 0000000..a737850
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDaoImpl.java
@@ -0,0 +1,33 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail.dao;
+
+import javax.ejb.Local;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase;
+import org.apache.cloudstack.resourcedetail.Site2SiteVpnConnectionDetailVO;
+import org.springframework.stereotype.Component;
+
+@Component
+@Local(value = {Site2SiteVpnConnectionDetailsDao.class})
+public class Site2SiteVpnConnectionDetailsDaoImpl extends ResourceDetailsDaoBase<Site2SiteVpnConnectionDetailVO>
implements Site2SiteVpnConnectionDetailsDao {
+
+    @Override
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new Site2SiteVpnConnectionDetailVO(resourceId, key, value));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index 36da81a..dc087a3 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -31,6 +31,7 @@ import org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.RemoteAccessVpnDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDao;
+import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnConnectionDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
@@ -99,6 +100,8 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
     Site2SiteVpnGatewayDetailsDao _vpnGatewayDetailsDao;
     @Inject
     Site2SiteCustomerGatewayDetailsDao _customerGatewayDetailsDao;
+    @Inject
+    Site2SiteVpnConnectionDetailsDao _vpnConnectionDetailsDao;
     
 
     private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>>
_daoMap =
@@ -125,6 +128,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
         _daoMap.put(ResourceObjectType.NetworkACL, _networkACLDetailsDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDetailsDao);
         _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDetailsDao);
+        _daoMap.put(ResourceObjectType.VpnConnection, _vpnConnectionDetailsDao);
 
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index c811b1d..554cb5b 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -43,6 +43,7 @@ import com.cloud.network.dao.LoadBalancerDao;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.RemoteAccessVpnDao;
 import com.cloud.network.dao.Site2SiteCustomerGatewayDao;
+import com.cloud.network.dao.Site2SiteVpnConnectionDao;
 import com.cloud.network.dao.Site2SiteVpnGatewayDao;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.security.dao.SecurityGroupDao;
@@ -144,6 +145,8 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     Site2SiteVpnGatewayDao _vpnGatewayDao;
     @Inject
     Site2SiteCustomerGatewayDao _customerGatewayDao;
+    @Inject
+    Site2SiteVpnConnectionDao _vpnConnectionDao;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
@@ -172,6 +175,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
         _daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDao);
         _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDao);
+        _daoMap.put(ResourceObjectType.VpnConnection, _vpnConnectionDao);
 
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/326313e0/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index bcbf078..d49c20c 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -858,4 +858,14 @@ CREATE TABLE `cloud`.`s2s_customer_gateway_details` (
   `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed
to the end user',
   PRIMARY KEY (`id`),
   CONSTRAINT `fk_s2s_customer_gateway_details__s2s_customer_gateway_id` FOREIGN KEY `fk_s2s_customer_gateway_details__s2s_customer_gateway_id`(`s2s_customer_gateway_id`)
REFERENCES `s2s_customer_gateway`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`s2s_vpn_connection_details` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `s2s_vpn_connection_id` bigint unsigned NOT NULL COMMENT 'VPC gateway id',
+  `name` varchar(255) NOT NULL,
+  `value` varchar(1024) NOT NULL,
+  `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed
to the end user',
+  PRIMARY KEY (`id`),
+  CONSTRAINT `fk_s2s_vpn_connection_details__s2s_vpn_connection_id` FOREIGN KEY `fk_s2s_vpn_connection_details__s2s_vpn_connection_id`(`s2s_vpn_connection_id`)
REFERENCES `s2s_vpn_connection`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file


Mime
View raw message