Package com.cloud.dc

Examples of com.cloud.dc.StorageNetworkIpAddressVO


    public StorageNetworkIpAddressVO takeIpAddress(long rangeId) {
    SearchCriteria<StorageNetworkIpAddressVO> sc = untakenIp.create();
    sc.setParameters("rangeId", rangeId);
        Transaction txn = Transaction.currentTxn();
        txn.start();
        StorageNetworkIpAddressVO ip = lockOneRandomRow(sc, true);
        if (ip == null) {
          txn.rollback();
          return null;
        }
        ip.setTakenAt(new Date());
        update(ip.getId(), ip);
        txn.commit();
        return ip;
  }
View Full Code Here


  @Override
    public void releaseIpAddress(String ip) {
    SearchCriteria<StorageNetworkIpAddressVO> sc = ipSearch.create();
      sc.setParameters("ipAddress", ip);
      StorageNetworkIpAddressVO vo = createForUpdate();
      vo.setTakenAt(null);
      update(vo, sc);
    }
View Full Code Here

    public StorageNetworkIpAddressVO takeIpAddress(long rangeId) {
    SearchCriteria<StorageNetworkIpAddressVO> sc = untakenIp.create();
    sc.setParameters("rangeId", rangeId);
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        StorageNetworkIpAddressVO ip = lockOneRandomRow(sc, true);
        if (ip == null) {
          txn.rollback();
          return null;
        }
        ip.setTakenAt(new Date());
        update(ip.getId(), ip);
        txn.commit();
        return ip;
  }
View Full Code Here

  @Override
    public void releaseIpAddress(String ip) {
    SearchCriteria<StorageNetworkIpAddressVO> sc = ipSearch.create();
      sc.setParameters("ipAddress", ip);
      StorageNetworkIpAddressVO vo = createForUpdate();
      vo.setTakenAt(null);
      update(vo, sc);
    }
View Full Code Here

                    String msg = "Unable to acquire lock on storage network ip range id=" + rangeId + ", delete failed";
                    s_logger.warn(msg);
                    throw new CloudRuntimeException(msg);
                }

                StorageNetworkIpAddressVO ip = _sNwIpDao.takeIpAddress(r.getId());
                if (ip != null) {
                    return ip;
                }
            } finally {
                if (r != null) {
View Full Code Here

    }
   
    Pod pod = dest.getPod();
    Integer vlan = null;
   
    StorageNetworkIpAddressVO ip = _sNwMgr.acquireIpAddress(pod.getId());
    if (ip == null) {
      throw new InsufficientAddressCapacityException("Unable to get a storage network ip address", Pod.class, pod.getId());
    }
 
    vlan = ip.getVlan()
    nic.setIp4Address(ip.getIpAddress());
    nic.setMacAddress(NetUtils.long2Mac(NetUtils.createSequenceBasedMacAddress(ip.getMac())));
    nic.setFormat(AddressFormat.Ip4);
    nic.setNetmask(ip.getNetmask());
    nic.setBroadcastType(BroadcastDomainType.Storage);
    nic.setGateway(ip.getGateway());
    if (vlan != null) {
      nic.setBroadcastUri(BroadcastDomainType.Storage.toUri(vlan));
    } else {
      nic.setBroadcastUri(null);
    }
View Full Code Here

                    String msg = "Unable to acquire lock on storage network ip range id=" + r.getId() + ", delete failed";
                    s_logger.warn(msg);
                    throw new CloudRuntimeException(msg);
                }

                StorageNetworkIpAddressVO ip = _sNwIpDao.takeIpAddress(r.getId());
                if (ip != null) {
                    return ip;
                }
            } finally {
                if (r != null) {
View Full Code Here

TOP

Related Classes of com.cloud.dc.StorageNetworkIpAddressVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.