diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index 82e8b05b23d..93dccbadb79 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -24,31 +24,12 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
// FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
public enum ResourceObjectType {
- UserVm(true, true),
- Template(true, true),
- ISO(true, false),
- Volume(true, true),
- Snapshot(true, false),
- Network(true, true),
- Nic(false, true),
- LoadBalancer(true, true),
- PortForwardingRule(true, true),
- FirewallRule(true, true),
- SecurityGroup(true, false),
- PublicIpAddress(true, true),
- Project(true, false),
- Vpc(true, true),
- NetworkACL(true, true),
- StaticRoute(true, false),
- VMSnapshot(true, false),
- RemoteAccessVpn(true, true),
- Zone(false, true),
- ServiceOffering(false, true),
- Storage(false, true),
- PrivateGateway(false, true),
- NetworkACLList(false, true),
- VpnGateway(false, true),
- CustomerGateway(false, true);
+ UserVm(true, true), Template(true, true), ISO(true, false), Volume(true, true), Snapshot(true, false), Network(true, true), Nic(false, true), LoadBalancer(true, true), PortForwardingRule(
+ true, true), FirewallRule(true, true),
+
+ SecurityGroup(true, false), PublicIpAddress(true, true), Project(true, false), Vpc(true, true), NetworkACL(true, true), StaticRoute(true, false), VMSnapshot(true, false), RemoteAccessVpn(
+ true, true), Zone(false, true), ServiceOffering(false, true), Storage(false, true), PrivateGateway(false, true), NetworkACLList(false, true), VpnGateway(false,
+ true), CustomerGateway(false, true), VpnConnection(false, true);
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
this.resourceTagsSupport = resourceTagsSupport;
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 ce7c222f164..a3747c06123 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
@@ -329,6 +329,7 @@
+
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 00000000000..9a4b616624b
--- /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;
+ }
+}
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 00000000000..ceb5cf7211f
--- /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, ResourceDetailsDao {
+
+}
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 00000000000..7261df8ea1f
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteVpnConnectionDetailsDaoImpl.java
@@ -0,0 +1,32 @@
+// 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 implements Site2SiteVpnConnectionDetailsDao {
+
+ @Override
+ public void addDetail(long resourceId, String key, String value) {
+ super.addDetail(new Site2SiteVpnConnectionDetailVO(resourceId, key, value));
+ }
+}
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 86f0e27753a..d1d147f2bce 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -31,8 +31,6 @@ import java.util.TimeZone;
import javax.inject.Inject;
-import org.apache.log4j.Logger;
-
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.affinity.AffinityGroup;
@@ -149,6 +147,7 @@ import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.usage.Usage;
import org.apache.cloudstack.usage.UsageService;
import org.apache.cloudstack.usage.UsageTypes;
+import org.apache.log4j.Logger;
import com.cloud.api.query.ViewResponseHelper;
import com.cloud.api.query.vo.AccountJoinVO;
@@ -288,7 +287,6 @@ import com.cloud.uservm.UserVm;
import com.cloud.utils.Pair;
import com.cloud.utils.StringUtils;
import com.cloud.utils.db.EntityManager;
-import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.Ip;
import com.cloud.utils.net.NetUtils;
import com.cloud.vm.ConsoleProxyVO;
@@ -465,9 +463,9 @@ public class ApiResponseHelper implements ResponseGenerator {
}
if (snapshotInfo == null) {
- s_logger.debug("Unable to find info for image store snapshot with uuid "+snapshot.getUuid());
+ s_logger.debug("Unable to find info for image store snapshot with uuid " + snapshot.getUuid());
snapshotResponse.setRevertable(false);
- }else{
+ } else {
snapshotResponse.setRevertable(snapshotInfo.isRevertable());
}
@@ -1704,8 +1702,8 @@ public class ApiResponseHelper implements ResponseGenerator {
short capacityType = capacity.getCapacityType();
// If local storage then ignore
- if ((capacityType == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED || capacityType == Capacity.CAPACITY_TYPE_STORAGE) &&
- poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
+ if ((capacityType == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED || capacityType == Capacity.CAPACITY_TYPE_STORAGE)
+ && poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
continue;
}
@@ -2198,8 +2196,7 @@ public class ApiResponseHelper implements ResponseGenerator {
reservation = (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1));
}
if (startVmIp > startGuestIp + 1 && endVmIp < endGuestIp - 1) {
- reservation =
- (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1) + " , " + NetUtils.long2Ip(endVmIp + 1) + "-" + NetUtils.long2Ip(endGuestIp));
+ reservation = (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1) + " , " + NetUtils.long2Ip(endVmIp + 1) + "-" + NetUtils.long2Ip(endGuestIp));
}
}
response.setReservedIpRange(reservation);
@@ -2210,10 +2207,10 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setBroadcastUri(broadcastUri);
String vlan = "N/A";
switch (BroadcastDomainType.getSchemeValue(network.getBroadcastUri())) {
- case Vlan:
- case Vxlan:
- vlan = BroadcastDomainType.getValue(network.getBroadcastUri());
- break;
+ case Vlan:
+ case Vxlan:
+ vlan = BroadcastDomainType.getValue(network.getBroadcastUri());
+ break;
}
// return vlan information only to Root admin
response.setVlan(vlan);
@@ -2626,8 +2623,8 @@ public class ApiResponseHelper implements ResponseGenerator {
CapabilityResponse capabilityResponse = new CapabilityResponse();
capabilityResponse.setName(cap.getName());
capabilityResponse.setObjectName("capability");
- if (cap.getName().equals(Capability.SupportedLBIsolation.getName()) || cap.getName().equals(Capability.SupportedSourceNatTypes.getName()) ||
- cap.getName().equals(Capability.RedundantRouter.getName())) {
+ if (cap.getName().equals(Capability.SupportedLBIsolation.getName()) || cap.getName().equals(Capability.SupportedSourceNatTypes.getName())
+ || cap.getName().equals(Capability.RedundantRouter.getName())) {
capabilityResponse.setCanChoose(true);
} else {
capabilityResponse.setCanChoose(false);
@@ -2641,8 +2638,8 @@ public class ApiResponseHelper implements ResponseGenerator {
List serviceProvidersResponses = new ArrayList();
for (Network.Provider serviceProvider : serviceProviders) {
// return only Virtual Router/JuniperSRX/CiscoVnmc as a provider for the firewall
- if (service == Service.Firewall &&
- !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc || serviceProvider == Provider.PaloAlto)) {
+ if (service == Service.Firewall
+ && !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc || serviceProvider == Provider.PaloAlto)) {
continue;
}
@@ -2734,8 +2731,7 @@ public class ApiResponseHelper implements ResponseGenerator {
OvsProviderResponse response = new OvsProviderResponse();
response.setId(result.getUuid());
- PhysicalNetworkServiceProvider nsp = ApiDBUtils
- .findPhysicalNetworkServiceProviderById(result.getNspId());
+ PhysicalNetworkServiceProvider nsp = ApiDBUtils.findPhysicalNetworkServiceProviderById(result.getNspId());
if (nsp != null) {
response.setNspId(nsp.getUuid());
}
@@ -3373,8 +3369,8 @@ public class ApiResponseHelper implements ResponseGenerator {
NetworkVO network = _entityMgr.findById(NetworkVO.class, usageRecord.getNetworkId().toString());
usageRecResponse.setNetworkId(network.getUuid());
- } else if (usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_WRITE ||
- usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_WRITE) {
+ } else if (usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_WRITE
+ || usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_WRITE) {
//Device Type
usageRecResponse.setType(usageRecord.getType());
//VM Instance Id
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index d6b96028b10..4cd98402a56 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -30,6 +30,9 @@ 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.Site2SiteVpnConnectionDetailsDao;
+import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.VpcGatewayDetailsDao;
@@ -92,9 +95,14 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
NetworkACLListDetailsDao _networkACLListDetailsDao;
@Inject
NetworkACLItemDetailsDao _networkACLDetailsDao;
+ @Inject
+ Site2SiteVpnGatewayDetailsDao _vpnGatewayDetailsDao;
+ @Inject
+ Site2SiteCustomerGatewayDetailsDao _customerGatewayDetailsDao;
+ @Inject
+ Site2SiteVpnConnectionDetailsDao _vpnConnectionDetailsDao;
- private static Map> s_daoMap =
- new HashMap>();
+ private static Map> s_daoMap = new HashMap>();
@Override
public boolean configure(String name, Map params) throws ConfigurationException {
@@ -115,6 +123,9 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDetailsDao);
s_daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDetailsDao);
s_daoMap.put(ResourceObjectType.NetworkACL, _networkACLDetailsDao);
+ s_daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDetailsDao);
+ s_daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDetailsDao);
+ s_daoMap.put(ResourceObjectType.VpnConnection, _vpnConnectionDetailsDao);
return true;
}
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index 28f94f06f4f..3dd90ff6a82 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -42,6 +42,9 @@ 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.Site2SiteVpnConnectionDao;
+import com.cloud.network.dao.Site2SiteVpnGatewayDao;
import com.cloud.network.rules.dao.PortForwardingRulesDao;
import com.cloud.network.security.dao.SecurityGroupDao;
import com.cloud.network.vpc.NetworkACLItemDao;
@@ -138,6 +141,12 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
VpcGatewayDao _vpcGatewayDao;
@Inject
NetworkACLDao _networkACLListDao;
+ @Inject
+ Site2SiteVpnGatewayDao _vpnGatewayDao;
+ @Inject
+ Site2SiteCustomerGatewayDao _customerGatewayDao;
+ @Inject
+ Site2SiteVpnConnectionDao _vpnConnectionDao;
@Override
public boolean configure(String name, Map params) throws ConfigurationException {
@@ -164,6 +173,9 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
s_daoMap.put(ResourceObjectType.Storage, _storagePoolDao);
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDao);
s_daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDao);
+ s_daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDao);
+ s_daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDao);
+ s_daoMap.put(ResourceObjectType.VpnConnection, _vpnConnectionDao);
return true;
}
@@ -294,8 +306,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
throw new InvalidParameterValueException("Value for the key " + key + " is either null or empty");
}
- ResourceTagVO resourceTag =
- new ResourceTagVO(key, value, accountDomainPair.first(), accountDomainPair.second(), id, resourceType, customer, resourceUuid);
+ ResourceTagVO resourceTag = new ResourceTagVO(key, value, accountDomainPair.first(), accountDomainPair.second(), id, resourceType, customer, resourceUuid);
resourceTag = _resourceTagDao.persist(resourceTag);
resourceTags.add(resourceTag);
}
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index 08611014d86..45baaafee33 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -859,3 +859,13 @@ CREATE TABLE `cloud`.`s2s_customer_gateway_details` (
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;