You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/12/12 19:23:53 UTC

[3/3] git commit: updated refs/heads/master to 9a21afb

Resource metadata support for customer gateway

Conflicts:
	server/src/com/cloud/tags/TaggedResourceManagerImpl.java


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

Branch: refs/heads/master
Commit: 9a21afb50bb8c0b139f74d78ecdcbe6fbb85c00d
Parents: cf84733
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Dec 12 09:49:18 2013 -0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Dec 12 10:16:30 2013 -0800

----------------------------------------------------------------------
 api/src/com/cloud/server/ResourceTag.java       |  3 +-
 .../spring-engine-schema-core-daos-context.xml  |  2 +-
 .../Site2SiteCustomerGatewayDetailVO.java       | 81 ++++++++++++++++++++
 .../dao/Site2SiteCustomerGatewayDetailsDao.java | 26 +++++++
 .../Site2SiteCustomerGatewayDetailsDaoImpl.java | 33 ++++++++
 .../metadata/ResourceMetaDataManagerImpl.java   |  4 +
 .../cloud/tags/TaggedResourceManagerImpl.java   |  4 +
 7 files changed, 151 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/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 7ed6db5..82e8b05 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -47,7 +47,8 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
         Storage(false, true),
         PrivateGateway(false, true),
         NetworkACLList(false, true),
-        VpnGateway(false, true);
+        VpnGateway(false, true),
+        CustomerGateway(false, true);
 
         ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
             this.resourceTagsSupport = resourceTagsSupport;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/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 d9da3bd..ce7c222 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
@@ -328,7 +328,7 @@
   <bean id="NetworkACLListDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDaoImpl" />
   <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="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
new file mode 100644
index 0000000..1a2743c
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.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_customer_gateway_details")
+public class Site2SiteCustomerGatewayDetailVO implements ResourceDetail {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name = "s2s_customer_gateway_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 Site2SiteCustomerGatewayDetailVO() {
+    }
+
+    public Site2SiteCustomerGatewayDetailVO(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/9a21afb5/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
new file mode 100644
index 0000000..0689b1c
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.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.Site2SiteCustomerGatewayDetailVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface Site2SiteCustomerGatewayDetailsDao extends GenericDao<Site2SiteCustomerGatewayDetailVO, Long>, ResourceDetailsDao<Site2SiteCustomerGatewayDetailVO> {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
new file mode 100644
index 0000000..b07adcb
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.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.Site2SiteCustomerGatewayDetailVO;
+import org.springframework.stereotype.Component;
+
+@Component
+@Local(value = {Site2SiteCustomerGatewayDetailsDao.class})
+public class Site2SiteCustomerGatewayDetailsDaoImpl extends ResourceDetailsDaoBase<Site2SiteCustomerGatewayDetailVO> implements Site2SiteCustomerGatewayDetailsDao {
+
+    @Override
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new Site2SiteCustomerGatewayDetailVO(resourceId, key, value));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/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 c17f6d0..104de3a 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -30,6 +30,7 @@ import org.apache.cloudstack.resourcedetail.dao.FirewallRuleDetailsDao;
 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.Site2SiteVpnGatewayDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
@@ -95,6 +96,8 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     NetworkACLItemDetailsDao _networkACLDetailsDao;
     @Inject
     Site2SiteVpnGatewayDetailsDao _vpnGatewayDetailsDao;
+    @Inject
+    Site2SiteCustomerGatewayDetailsDao _customerGatewayDetailsDao;
     
 
     private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>> _daoMap =
@@ -120,6 +123,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
         _daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDetailsDao);
         _daoMap.put(ResourceObjectType.NetworkACL, _networkACLDetailsDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDetailsDao);
+        _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDetailsDao);
 
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a21afb5/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 f178fc3..84b7a67 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -42,6 +42,7 @@ import com.cloud.network.dao.IPAddressDao;
 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.Site2SiteVpnGatewayDao;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.security.dao.SecurityGroupDao;
@@ -141,6 +142,8 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
     NetworkACLDao _networkACLListDao;
     @Inject
     Site2SiteVpnGatewayDao _vpnGatewayDao;
+    @Inject
+    Site2SiteCustomerGatewayDao _customerGatewayDao;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
@@ -168,6 +171,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
         _daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDao);
         _daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDao);
+        _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDao);
 
         return true;
     }