bug 12107: don't show public ip addresses associated with CPVM/SSVM

status 12107: resolved fixed
This commit is contained in:
Alena Prokharchyk 2011-12-02 15:38:51 -08:00
parent 22f6ad7566
commit c2146ea8e8
2 changed files with 14 additions and 19 deletions

View File

@ -170,23 +170,11 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
return allocatedOnly;
}
public void setAllocatedOnly(Boolean allocatedOnly) {
this.allocatedOnly = allocatedOnly;
}
public Boolean getForVirtualNetwork() {
return forVirtualNetwork;
}
public void setForVirtualNetwork(Boolean forVirtualNetwork) {
this.forVirtualNetwork = forVirtualNetwork;
}
public Boolean getForLoadBalancing() {
return forLoadBalancing;
}
public void setForLoadBalancing(Boolean forLoadBalancing) {
this.forLoadBalancing = forLoadBalancing;
}
}

View File

@ -1908,8 +1908,22 @@ public class ManagementServerImpl implements ManagementServer {
vlanSearch.and("vlanType", vlanSearch.entity().getVlanType(), SearchCriteria.Op.EQ);
sb.join("vlanSearch", vlanSearch, sb.entity().getVlanId(), vlanSearch.entity().getId(), JoinBuilder.JoinType.INNER);
boolean allocatedOnly = false;
if ((isAllocated != null) && (isAllocated == true)) {
sb.and("allocated", sb.entity().getAllocatedTime(), SearchCriteria.Op.NNULL);
allocatedOnly = true;
}
VlanType vlanType = null;
if (forVirtualNetwork != null) {
vlanType = (Boolean) forVirtualNetwork ? VlanType.VirtualNetwork : VlanType.DirectAttached;
} else {
vlanType = VlanType.VirtualNetwork;
}
//don't show SSVM/CPVM ips
if (vlanType == VlanType.VirtualNetwork && (allocatedOnly)) {
sb.and("associatedNetworkId", sb.entity().getAssociatedWithNetworkId(), SearchCriteria.Op.NNULL);
}
SearchCriteria<IPAddressVO> sc = sb.create();
@ -1920,13 +1934,6 @@ public class ManagementServerImpl implements ManagementServer {
sc.setJoinParameters("domainSearch", "path", domain.getPath() + "%");
}
VlanType vlanType = null;
if (forVirtualNetwork != null) {
vlanType = (Boolean) forVirtualNetwork ? VlanType.VirtualNetwork : VlanType.DirectAttached;
} else {
vlanType = VlanType.VirtualNetwork;
}
sc.setJoinParameters("vlanSearch", "vlanType", vlanType);
if (zone != null) {