Search in sources :

Example 6 with DomainVlanMapVO

use of com.cloud.dc.DomainVlanMapVO in project cloudstack by apache.

the class ConfigurationManagerImpl method getVlanDomain.

@Override
public Domain getVlanDomain(long vlanId) {
    Vlan vlan = _vlanDao.findById(vlanId);
    Long domainId = null;
    // from the network
    if (vlan.getVlanType() == VlanType.VirtualNetwork) {
        List<DomainVlanMapVO> maps = _domainVlanMapDao.listDomainVlanMapsByVlan(vlanId);
        if (maps != null && !maps.isEmpty()) {
            return _domainDao.findById(maps.get(0).getDomainId());
        }
    }
    return null;
}
Also used : Vlan(com.cloud.dc.Vlan) DomainVlanMapVO(com.cloud.dc.DomainVlanMapVO)

Aggregations

DomainVlanMapVO (com.cloud.dc.DomainVlanMapVO)6 AccountVlanMapVO (com.cloud.dc.AccountVlanMapVO)5 VlanVO (com.cloud.dc.VlanVO)5 IPAddressVO (com.cloud.network.dao.IPAddressVO)5 DB (com.cloud.utils.db.DB)4 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)3 TransactionStatus (com.cloud.utils.db.TransactionStatus)3 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 ArrayList (java.util.ArrayList)3 List (java.util.List)2 DataCenter (com.cloud.dc.DataCenter)1 DataCenterVO (com.cloud.dc.DataCenterVO)1 Pod (com.cloud.dc.Pod)1 PodVlanMapVO (com.cloud.dc.PodVlanMapVO)1 Vlan (com.cloud.dc.Vlan)1 Domain (com.cloud.domain.Domain)1 ActionEvent (com.cloud.event.ActionEvent)1 AccountLimitException (com.cloud.exception.AccountLimitException)1 InsufficientAddressCapacityException (com.cloud.exception.InsufficientAddressCapacityException)1 ResourceAllocationException (com.cloud.exception.ResourceAllocationException)1