IPAddressVO.isOneToOneNat
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.cloud.network.dao.IPAddressVO.isOneToOneNat(Showing top 15 results out of 315)

origin: apache/cloudstack

@Override
public boolean isOneToOneNat() {
  return _addr.isOneToOneNat();
}
origin: apache/cloudstack

@Override
public List<FirewallRuleVO> listStaticNatByVmId(long vmId) {
  if (VmSearch == null) {
    SearchBuilder<IPAddressVO> IpSearch = _ipDao.createSearchBuilder();
    IpSearch.and("associatedWithVmId", IpSearch.entity().getAssociatedWithVmId(), SearchCriteria.Op.EQ);
    IpSearch.and("oneToOneNat", IpSearch.entity().isOneToOneNat(), SearchCriteria.Op.NNULL);
    VmSearch = createSearchBuilder();
    VmSearch.and("purpose", VmSearch.entity().getPurpose(), Op.EQ);
    VmSearch.join("ipSearch", IpSearch, VmSearch.entity().getSourceIpAddressId(), IpSearch.entity().getId(), JoinBuilder.JoinType.INNER);
    VmSearch.done();
  }
  SearchCriteria<FirewallRuleVO> sc = VmSearch.create();
  sc.setParameters("purpose", Purpose.StaticNat);
  sc.setJoinParameters("ipSearch", "associatedWithVmId", vmId);
  return listBy(sc);
}
origin: apache/cloudstack

@Override
public List<IPAddressVO> findManagedPublicIps() {
  List<NetworkVO> dbNets = findManagedNetworks(null);
  if (dbNets == null || dbNets.isEmpty()) {
    s_logger.debug("Juniper managed networks is empty");
    return null;
  }
  SearchBuilder<IPAddressVO> searchBuilder = _ipAddressDao.createSearchBuilder();
  searchBuilder.and("sourceNat", searchBuilder.entity().isSourceNat(), Op.EQ);
  searchBuilder.and("network", searchBuilder.entity().getAssociatedWithNetworkId(), Op.IN);
  searchBuilder.and("oneToOneNat", searchBuilder.entity().isOneToOneNat(), Op.EQ);
  searchBuilder.and("associatedWithVmId", searchBuilder.entity().getAssociatedWithVmId(), Op.NNULL);
  List<Long> netIds = new ArrayList<Long>();
  for (NetworkVO net : dbNets) {
    netIds.add(net.getId());
  }
  SearchCriteria<IPAddressVO> sc = searchBuilder.create();
  sc.setParameters("oneToOneNat", true);
  sc.setParameters("sourceNat", false);
  sc.setParameters("network", netIds.toArray());
  List<IPAddressVO> publicIps = _ipAddressDao.search(sc, null);
  if (publicIps == null) {
    s_logger.debug("no public ips");
    return null;
  }
  return publicIps;
}
origin: apache/cloudstack

if (!ipAddress.isOneToOneNat()) { // Dont allow to enable static nat if PF/LB rules exist for the IP
  List<FirewallRuleVO> portForwardingRules = _firewallDao.listByIpAndPurposeAndNotRevoked(ipAddress.getId(), Purpose.PortForwarding);
  if (portForwardingRules != null && !portForwardingRules.isEmpty()) {
origin: apache/cloudstack

long networkId = ipAddress.getAssociatedWithNetworkId();
if (!ipAddress.isOneToOneNat()) {
  InvalidParameterValueException ex = new InvalidParameterValueException("One to one nat is not enabled for the specified ip id");
  ex.addProxyObject(ipAddress.getUuid(), "ipId");
origin: apache/cloudstack

AllFieldsSearch.and("network", AllFieldsSearch.entity().getAssociatedWithNetworkId(), Op.EQ);
AllFieldsSearch.and("associatedWithVmId", AllFieldsSearch.entity().getAssociatedWithVmId(), Op.EQ);
AllFieldsSearch.and("oneToOneNat", AllFieldsSearch.entity().isOneToOneNat(), Op.EQ);
AllFieldsSearch.and("sourcenetwork", AllFieldsSearch.entity().getSourceNetworkId(), Op.EQ);
AllFieldsSearch.and("physicalNetworkId", AllFieldsSearch.entity().getPhysicalNetworkId(), Op.EQ);
origin: apache/cloudstack

} else if (ipAddress.isSourceNat() || !ipAddress.isOneToOneNat() || ipAddress.getAssociatedWithVmId() == null) {
  throw new NetworkRuleConflictException("Can't do static nat on ip address: " + ipAddress.getAddress());
origin: apache/cloudstack

if (vpcIsStaticNatProvider || !ip.isOneToOneNat()) {
  final PublicIp publicIp = PublicIp.createFromAddrAndVlan(ip, _vlanDao.findById(ip.getVlanId()));
  if ((ip.getState() == IpAddress.State.Allocated  || ip.getState() == IpAddress.State.Allocating)
origin: apache/cloudstack

if (!ip.isOneToOneNat() && !ip.isSourceNat() && !(_firewallDao.countRulesByIpId(ip.getId()) > 0)) {
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("Releasing Public IP addresses" + ip + " of vlan " + vlanDbId + " as part of Public IP" + " range release to the system pool");
origin: apache/cloudstack

} else if (ipVO.isOneToOneNat()) {
  throw new NetworkRuleConflictException("Can't do load balance on ip address: " + ipVO.getAddress());
origin: apache/cloudstack

if (ip.isOneToOneNat() && ip.getRuleState() == null) {
  ipsStaticNat++;
origin: apache/cloudstack

if (ip.isOneToOneNat()) {
  throw new InvalidParameterValueException("Can't delete account specific vlan " + vlanDbId + " as ip " + ip
      + " belonging to the range is used for static nat purposes. Cleanup the rules first");
origin: apache/cloudstack

sb.and("associatedNetworkIdEq", sb.entity().getAssociatedWithNetworkId(), SearchCriteria.Op.EQ);
sb.and("isSourceNat", sb.entity().isSourceNat(), SearchCriteria.Op.EQ);
sb.and("isStaticNat", sb.entity().isOneToOneNat(), SearchCriteria.Op.EQ);
sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ);
sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
origin: apache/cloudstack

} else if (ipAddr.isOneToOneNat()) {
  InvalidParameterValueException ex = new InvalidParameterValueException("Unable to create load balancer rule; specified sourceip id has static nat enabled");
  ex.addProxyObject(ipAddr.getUuid(), "sourceIpId");
origin: apache/cloudstack

} else if (ipAddress.isOneToOneNat()) {
  throw new InvalidParameterValueException("Unable to create port forwarding rule; ip id=" + ipAddrId + " has static nat enabled");
com.cloud.network.daoIPAddressVOisOneToOneNat

Popular methods of IPAddressVO

  • getId
  • getAddress
  • getVlanId
  • isSourceNat
  • getAllocatedTime
  • getAssociatedWithNetworkId
  • getAssociatedWithVmId
  • getDataCenterId
  • getState
  • getUuid
  • getVpcId
  • setAssociatedWithNetworkId
  • getVpcId,
  • setAssociatedWithNetworkId,
  • setState,
  • getAllocatedToAccountId,
  • getSystem,
  • getVmIp,
  • isPortable,
  • setAssociatedWithVmId,
  • setOneToOneNat

Popular classes and methods

  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Runner (org.openjdk.jmh.runner)
    Runner executes JMH benchmarks.This is the entry point for JMH Java API. Runner is not usually reu

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)