Added a method to look up public IPs that are used for static NAT rules.

This commit is contained in:
keshav 2011-05-10 15:47:46 -07:00
parent b4605fbf2f
commit 17abb3e5d4
2 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,8 @@ public interface IPAddressDao extends GenericDao<IPAddressVO, Long> {
List<IPAddressVO> listByDcIdIpAddress(long dcId, String ipAddress);
List<IPAddressVO> listByAssociatedNetwork(long networkId, Boolean isSourceNat);
List<IPAddressVO> listStaticNatPublicIps(long networkId);
int countIPs(long dcId, long vlanDbId, boolean onlyCountAllocated);

View File

@ -206,6 +206,14 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
return listBy(sc);
}
@Override
public List<IPAddressVO> listStaticNatPublicIps(long networkId) {
SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create();
sc.setParameters("network", networkId);
sc.setParameters("oneToOneNat", true);
return listBy(sc);
}
@Override
public IPAddressVO findByAssociatedVmId(long vmId) {
SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create();