mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
Resource metadata support for S2SVpnConnection
Conflicts: server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java server/src/com/cloud/tags/TaggedResourceManagerImpl.java setup/db/db/schema-421to430.sql
This commit is contained in:
parent
d5fcc6ef5a
commit
9df10718e4
@ -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
|
// FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
|
||||||
public enum ResourceObjectType {
|
public enum ResourceObjectType {
|
||||||
UserVm(true, 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(
|
||||||
Template(true, true),
|
true, true), FirewallRule(true, true),
|
||||||
ISO(true, false),
|
|
||||||
Volume(true, true),
|
SecurityGroup(true, false), PublicIpAddress(true, true), Project(true, false), Vpc(true, true), NetworkACL(true, true), StaticRoute(true, false), VMSnapshot(true, false), RemoteAccessVpn(
|
||||||
Snapshot(true, false),
|
true, true), Zone(false, true), ServiceOffering(false, true), Storage(false, true), PrivateGateway(false, true), NetworkACLList(false, true), VpnGateway(false,
|
||||||
Network(true, true),
|
true), CustomerGateway(false, true), VpnConnection(false, 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);
|
|
||||||
|
|
||||||
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
|
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
|
||||||
this.resourceTagsSupport = resourceTagsSupport;
|
this.resourceTagsSupport = resourceTagsSupport;
|
||||||
|
|||||||
@ -329,6 +329,7 @@
|
|||||||
<bean id="NetworkACLItemDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDaoImpl" />
|
<bean id="NetworkACLItemDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDaoImpl" />
|
||||||
<bean id="Site2SiteVpnGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDaoImpl" />
|
<bean id="Site2SiteVpnGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDaoImpl" />
|
||||||
<bean id="Site2SiteCustomerGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDaoImpl" />
|
<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" />
|
<bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -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<Site2SiteVpnConnectionDetailVO> implements Site2SiteVpnConnectionDetailsDao {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addDetail(long resourceId, String key, String value) {
|
||||||
|
super.addDetail(new Site2SiteVpnConnectionDetailVO(resourceId, key, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -31,8 +31,6 @@ import java.util.TimeZone;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import org.apache.cloudstack.acl.ControlledEntity;
|
import org.apache.cloudstack.acl.ControlledEntity;
|
||||||
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
|
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
|
||||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
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.Usage;
|
||||||
import org.apache.cloudstack.usage.UsageService;
|
import org.apache.cloudstack.usage.UsageService;
|
||||||
import org.apache.cloudstack.usage.UsageTypes;
|
import org.apache.cloudstack.usage.UsageTypes;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.cloud.api.query.ViewResponseHelper;
|
import com.cloud.api.query.ViewResponseHelper;
|
||||||
import com.cloud.api.query.vo.AccountJoinVO;
|
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.Pair;
|
||||||
import com.cloud.utils.StringUtils;
|
import com.cloud.utils.StringUtils;
|
||||||
import com.cloud.utils.db.EntityManager;
|
import com.cloud.utils.db.EntityManager;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
|
||||||
import com.cloud.utils.net.Ip;
|
import com.cloud.utils.net.Ip;
|
||||||
import com.cloud.utils.net.NetUtils;
|
import com.cloud.utils.net.NetUtils;
|
||||||
import com.cloud.vm.ConsoleProxyVO;
|
import com.cloud.vm.ConsoleProxyVO;
|
||||||
@ -465,9 +463,9 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (snapshotInfo == null) {
|
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);
|
snapshotResponse.setRevertable(false);
|
||||||
}else{
|
} else {
|
||||||
snapshotResponse.setRevertable(snapshotInfo.isRevertable());
|
snapshotResponse.setRevertable(snapshotInfo.isRevertable());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1704,8 +1702,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
short capacityType = capacity.getCapacityType();
|
short capacityType = capacity.getCapacityType();
|
||||||
|
|
||||||
// If local storage then ignore
|
// If local storage then ignore
|
||||||
if ((capacityType == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED || capacityType == Capacity.CAPACITY_TYPE_STORAGE) &&
|
if ((capacityType == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED || capacityType == Capacity.CAPACITY_TYPE_STORAGE)
|
||||||
poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
|
&& poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2198,8 +2196,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
reservation = (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1));
|
reservation = (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1));
|
||||||
}
|
}
|
||||||
if (startVmIp > startGuestIp + 1 && endVmIp < endGuestIp - 1) {
|
if (startVmIp > startGuestIp + 1 && endVmIp < endGuestIp - 1) {
|
||||||
reservation =
|
reservation = (NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1) + " , " + NetUtils.long2Ip(endVmIp + 1) + "-" + NetUtils.long2Ip(endGuestIp));
|
||||||
(NetUtils.long2Ip(startGuestIp) + "-" + NetUtils.long2Ip(startVmIp - 1) + " , " + NetUtils.long2Ip(endVmIp + 1) + "-" + NetUtils.long2Ip(endGuestIp));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response.setReservedIpRange(reservation);
|
response.setReservedIpRange(reservation);
|
||||||
@ -2626,8 +2623,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
CapabilityResponse capabilityResponse = new CapabilityResponse();
|
CapabilityResponse capabilityResponse = new CapabilityResponse();
|
||||||
capabilityResponse.setName(cap.getName());
|
capabilityResponse.setName(cap.getName());
|
||||||
capabilityResponse.setObjectName("capability");
|
capabilityResponse.setObjectName("capability");
|
||||||
if (cap.getName().equals(Capability.SupportedLBIsolation.getName()) || cap.getName().equals(Capability.SupportedSourceNatTypes.getName()) ||
|
if (cap.getName().equals(Capability.SupportedLBIsolation.getName()) || cap.getName().equals(Capability.SupportedSourceNatTypes.getName())
|
||||||
cap.getName().equals(Capability.RedundantRouter.getName())) {
|
|| cap.getName().equals(Capability.RedundantRouter.getName())) {
|
||||||
capabilityResponse.setCanChoose(true);
|
capabilityResponse.setCanChoose(true);
|
||||||
} else {
|
} else {
|
||||||
capabilityResponse.setCanChoose(false);
|
capabilityResponse.setCanChoose(false);
|
||||||
@ -2641,8 +2638,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
List<ProviderResponse> serviceProvidersResponses = new ArrayList<ProviderResponse>();
|
List<ProviderResponse> serviceProvidersResponses = new ArrayList<ProviderResponse>();
|
||||||
for (Network.Provider serviceProvider : serviceProviders) {
|
for (Network.Provider serviceProvider : serviceProviders) {
|
||||||
// return only Virtual Router/JuniperSRX/CiscoVnmc as a provider for the firewall
|
// return only Virtual Router/JuniperSRX/CiscoVnmc as a provider for the firewall
|
||||||
if (service == Service.Firewall &&
|
if (service == Service.Firewall
|
||||||
!(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc || serviceProvider == Provider.PaloAlto)) {
|
&& !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc || serviceProvider == Provider.PaloAlto)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2734,8 +2731,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
|
|
||||||
OvsProviderResponse response = new OvsProviderResponse();
|
OvsProviderResponse response = new OvsProviderResponse();
|
||||||
response.setId(result.getUuid());
|
response.setId(result.getUuid());
|
||||||
PhysicalNetworkServiceProvider nsp = ApiDBUtils
|
PhysicalNetworkServiceProvider nsp = ApiDBUtils.findPhysicalNetworkServiceProviderById(result.getNspId());
|
||||||
.findPhysicalNetworkServiceProviderById(result.getNspId());
|
|
||||||
if (nsp != null) {
|
if (nsp != null) {
|
||||||
response.setNspId(nsp.getUuid());
|
response.setNspId(nsp.getUuid());
|
||||||
}
|
}
|
||||||
@ -3373,8 +3369,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
NetworkVO network = _entityMgr.findById(NetworkVO.class, usageRecord.getNetworkId().toString());
|
NetworkVO network = _entityMgr.findById(NetworkVO.class, usageRecord.getNetworkId().toString());
|
||||||
usageRecResponse.setNetworkId(network.getUuid());
|
usageRecResponse.setNetworkId(network.getUuid());
|
||||||
|
|
||||||
} else if (usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_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) {
|
|| usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_READ || usageRecord.getUsageType() == UsageTypes.VM_DISK_BYTES_WRITE) {
|
||||||
//Device Type
|
//Device Type
|
||||||
usageRecResponse.setType(usageRecord.getType());
|
usageRecResponse.setType(usageRecord.getType());
|
||||||
//VM Instance Id
|
//VM Instance Id
|
||||||
|
|||||||
@ -30,6 +30,9 @@ import org.apache.cloudstack.resourcedetail.dao.FirewallRuleDetailsDao;
|
|||||||
import org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDao;
|
import org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDao;
|
||||||
import org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDao;
|
import org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDao;
|
||||||
import org.apache.cloudstack.resourcedetail.dao.RemoteAccessVpnDetailsDao;
|
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.UserIpAddressDetailsDao;
|
||||||
import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
|
import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
|
||||||
import org.apache.cloudstack.resourcedetail.dao.VpcGatewayDetailsDao;
|
import org.apache.cloudstack.resourcedetail.dao.VpcGatewayDetailsDao;
|
||||||
@ -92,9 +95,14 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
|
|||||||
NetworkACLListDetailsDao _networkACLListDetailsDao;
|
NetworkACLListDetailsDao _networkACLListDetailsDao;
|
||||||
@Inject
|
@Inject
|
||||||
NetworkACLItemDetailsDao _networkACLDetailsDao;
|
NetworkACLItemDetailsDao _networkACLDetailsDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteVpnGatewayDetailsDao _vpnGatewayDetailsDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteCustomerGatewayDetailsDao _customerGatewayDetailsDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteVpnConnectionDetailsDao _vpnConnectionDetailsDao;
|
||||||
|
|
||||||
private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>> s_daoMap =
|
private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>> s_daoMap = new HashMap<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>>();
|
||||||
new HashMap<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>>();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
@ -115,6 +123,9 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
|
|||||||
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDetailsDao);
|
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDetailsDao);
|
||||||
s_daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDetailsDao);
|
s_daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDetailsDao);
|
||||||
s_daoMap.put(ResourceObjectType.NetworkACL, _networkACLDetailsDao);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,9 @@ import com.cloud.network.dao.IPAddressDao;
|
|||||||
import com.cloud.network.dao.LoadBalancerDao;
|
import com.cloud.network.dao.LoadBalancerDao;
|
||||||
import com.cloud.network.dao.NetworkDao;
|
import com.cloud.network.dao.NetworkDao;
|
||||||
import com.cloud.network.dao.RemoteAccessVpnDao;
|
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.rules.dao.PortForwardingRulesDao;
|
||||||
import com.cloud.network.security.dao.SecurityGroupDao;
|
import com.cloud.network.security.dao.SecurityGroupDao;
|
||||||
import com.cloud.network.vpc.NetworkACLItemDao;
|
import com.cloud.network.vpc.NetworkACLItemDao;
|
||||||
@ -138,6 +141,12 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
|
|||||||
VpcGatewayDao _vpcGatewayDao;
|
VpcGatewayDao _vpcGatewayDao;
|
||||||
@Inject
|
@Inject
|
||||||
NetworkACLDao _networkACLListDao;
|
NetworkACLDao _networkACLListDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteVpnGatewayDao _vpnGatewayDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteCustomerGatewayDao _customerGatewayDao;
|
||||||
|
@Inject
|
||||||
|
Site2SiteVpnConnectionDao _vpnConnectionDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
@ -164,6 +173,9 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso
|
|||||||
s_daoMap.put(ResourceObjectType.Storage, _storagePoolDao);
|
s_daoMap.put(ResourceObjectType.Storage, _storagePoolDao);
|
||||||
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDao);
|
s_daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDao);
|
||||||
s_daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDao);
|
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;
|
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");
|
throw new InvalidParameterValueException("Value for the key " + key + " is either null or empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceTagVO resourceTag =
|
ResourceTagVO resourceTag = new ResourceTagVO(key, value, accountDomainPair.first(), accountDomainPair.second(), id, resourceType, customer, resourceUuid);
|
||||||
new ResourceTagVO(key, value, accountDomainPair.first(), accountDomainPair.second(), id, resourceType, customer, resourceUuid);
|
|
||||||
resourceTag = _resourceTagDao.persist(resourceTag);
|
resourceTag = _resourceTagDao.persist(resourceTag);
|
||||||
resourceTags.add(resourceTag);
|
resourceTags.add(resourceTag);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
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;
|
) 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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user