mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-4193: don't let privateGateway to be created with NULL networkId
This commit is contained in:
parent
35d20d163d
commit
4976a67bfc
@ -56,7 +56,7 @@ public interface VpcGateway extends Identity, ControlledEntity, InternalIdentity
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
Long getNetworkId();
|
||||
long getNetworkId();
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
||||
@ -63,7 +63,7 @@ public class VpcGatewayVO implements VpcGateway {
|
||||
long zoneId;
|
||||
|
||||
@Column(name="network_id")
|
||||
Long networkId;
|
||||
long networkId;
|
||||
|
||||
@Column(name=GenericDao.CREATED_COLUMN)
|
||||
Date created;
|
||||
@ -110,7 +110,7 @@ public class VpcGatewayVO implements VpcGateway {
|
||||
* @param account_id
|
||||
* @param sourceNat
|
||||
*/
|
||||
public VpcGatewayVO(String ip4Address, Type type, Long vpcId, long zoneId, Long networkId, String vlanTag,
|
||||
public VpcGatewayVO(String ip4Address, Type type, long vpcId, long zoneId, long networkId, String vlanTag,
|
||||
String gateway, String netmask, long accountId, long domainId, boolean sourceNat, long networkACLId) {
|
||||
this.ip4Address = ip4Address;
|
||||
this.type = type;
|
||||
@ -160,7 +160,7 @@ public class VpcGatewayVO implements VpcGateway {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getNetworkId() {
|
||||
public long getNetworkId() {
|
||||
return networkId;
|
||||
}
|
||||
|
||||
|
||||
@ -16,16 +16,15 @@
|
||||
// under the License.
|
||||
package com.cloud.network.vpc.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.vpc.VpcGateway;
|
||||
import com.cloud.network.vpc.VpcGatewayVO;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface VpcGatewayDao extends GenericDao<VpcGatewayVO, Long>{
|
||||
VpcGatewayVO getPrivateGatewayForVpc(long vpcId);
|
||||
VpcGatewayVO getVpnGatewayForVpc(long vpcId);
|
||||
|
||||
Long getNetworkAclIdForPrivateIp(long vpcId, long networkId, String ipaddr);
|
||||
|
||||
|
||||
@ -55,14 +55,6 @@ public class VpcGatewayDaoImpl extends GenericDaoBase<VpcGatewayVO, Long> implem
|
||||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VpcGatewayVO getVpnGatewayForVpc(long vpcId) {
|
||||
SearchCriteria<VpcGatewayVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("vpcId", vpcId);
|
||||
sc.setParameters("type", VpcGateway.Type.Vpn);
|
||||
|
||||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getNetworkAclIdForPrivateIp (long vpcId, long networkId, String ipaddr) {
|
||||
|
||||
@ -448,7 +448,6 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
|
||||
|
||||
@Override
|
||||
public boolean applyACLItemsToPrivateGw(PrivateGateway gateway,List<? extends NetworkACLItem> rules) throws ResourceUnavailableException {
|
||||
VpcGatewayVO vpcGatewayVo = _vpcGatewayDao.findById(gateway.getId());
|
||||
Network config = _networkDao.findById(gateway.getNetworkId());
|
||||
boolean isPrivateGateway = true;
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ public class PrivateGatewayProfile implements PrivateGateway {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getNetworkId() {
|
||||
public long getNetworkId() {
|
||||
return vpcGateway.getNetworkId();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user