当前位置: 首页>>代码示例>>Java>>正文


Java IPAddressVO.getId方法代码示例

本文整理汇总了Java中com.cloud.network.dao.IPAddressVO.getId方法的典型用法代码示例。如果您正苦于以下问题:Java IPAddressVO.getId方法的具体用法?Java IPAddressVO.getId怎么用?Java IPAddressVO.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cloud.network.dao.IPAddressVO的用法示例。


在下文中一共展示了IPAddressVO.getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: replacePublicIpACL

import com.cloud.network.dao.IPAddressVO; //导入方法依赖的package包/类
@Override
public boolean replacePublicIpACL(final NetworkACL acl, final IPAddressVO publicIp) throws ResourceUnavailableException {

    if (publicIp.getIpACLId() != null) {
        // Revoke ACL Items of the existing ACL if the new ACL is empty
        // Existing rules won't be removed otherwise
        final List<NetworkACLItemVO> aclItems = _networkACLItemDao.listByACL(acl.getId());
        if (aclItems == null || aclItems.isEmpty()) {
            s_logger.debug("New network ACL is empty. Revoke existing rules before applying ACL");
            if (!revokeACLItemsForPublicIp(publicIp.getId())) {
                throw new CloudRuntimeException("Failed to replace network ACL. Error while removing existing ACL items for public ip: " + publicIp.getId());
            }
        }
    }

    publicIp.setIpACLId(acl.getId());
    //Update Public IP ACL
    if (_ipAddressDao.update(publicIp.getId(), publicIp)) {
        s_logger.debug("Updated public ip address: " + publicIp.getId() + " with ACL Id: " + acl.getId() + ", Applying ACL items");
        //Apply ACL to public ip
        return applyACLToPublicIp(publicIp.getId());
    }
    return false;
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:25,代码来源:NetworkACLManagerImpl.java

示例2: applyStaticNatsForNetwork

import com.cloud.network.dao.IPAddressVO; //导入方法依赖的package包/类
@Override
public boolean applyStaticNatsForNetwork(final long networkId, final boolean continueOnError, final Account caller) {
    final List<IPAddressVO> ips = _ipAddressDao.listStaticNatPublicIps(networkId);
    if (ips.isEmpty()) {
        s_logger.debug("There are no static nat to apply for network id=" + networkId);
        return true;
    }

    if (caller != null) {
        _accountMgr.checkAccess(caller, null, true, ips.toArray(new IPAddressVO[ips.size()]));
    }

    final List<StaticNat> staticNats = new ArrayList<>();
    for (final IPAddressVO ip : ips) {
        // Get nic IP4 address
        //String dstIp = _networkModel.getIpInNetwork(ip.getAssociatedWithVmId(), networkId);
        final StaticNatImpl staticNat = new StaticNatImpl(ip.getAllocatedToAccountId(), ip.getAllocatedInDomainId(), networkId, ip.getId(), ip.getVmIp(), false);
        staticNats.add(staticNat);
    }

    try {
        if (!_ipAddrMgr.applyStaticNats(staticNats, continueOnError, false)) {
            return false;
        }
    } catch (final ResourceUnavailableException ex) {
        s_logger.warn("Failed to create static nat for network due to ", ex);
        return false;
    }

    return true;
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:32,代码来源:RulesManagerImpl.java

示例3: applyStaticNatRuleForInlineLBRule

import com.cloud.network.dao.IPAddressVO; //导入方法依赖的package包/类
private void applyStaticNatRuleForInlineLBRule(DataCenterVO zone, Network network, boolean revoked, String publicIp, String privateIp)
    throws ResourceUnavailableException {
    List<StaticNat> staticNats = new ArrayList<StaticNat>();
    IPAddressVO ipVO = _ipAddressDao.listByDcIdIpAddress(zone.getId(), publicIp).get(0);
    StaticNatImpl staticNat = new StaticNatImpl(ipVO.getAllocatedToAccountId(), ipVO.getAllocatedInDomainId(), network.getId(), ipVO.getId(), privateIp, revoked);
    staticNats.add(staticNat);
    StaticNatServiceProvider element = _networkMgr.getStaticNatProviderForNetwork(network);
    element.applyStaticNats(network, staticNats);
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:10,代码来源:ExternalLoadBalancerDeviceManagerImpl.java

示例4: applyStaticNatsForNetwork

import com.cloud.network.dao.IPAddressVO; //导入方法依赖的package包/类
@Override
public boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller) {
    List<IPAddressVO> ips = _ipAddressDao.listStaticNatPublicIps(networkId);
    if (ips.isEmpty()) {
        s_logger.debug("There are no static nat to apply for network id=" + networkId);
        return true;
    }

    if (caller != null) {
        _accountMgr.checkAccess(caller, null, true, ips.toArray(new IPAddressVO[ips.size()]));
    }

    List<StaticNat> staticNats = new ArrayList<StaticNat>();
    for (IPAddressVO ip : ips) {
        // Get nic IP4 address
        //String dstIp = _networkModel.getIpInNetwork(ip.getAssociatedWithVmId(), networkId);
        StaticNatImpl staticNat = new StaticNatImpl(ip.getAllocatedToAccountId(), ip.getAllocatedInDomainId(), networkId, ip.getId(), ip.getVmIp(), false);
        staticNats.add(staticNat);
    }

    try {
        if (!_ipAddrMgr.applyStaticNats(staticNats, continueOnError, false)) {
            return false;
        }
    } catch (ResourceUnavailableException ex) {
        s_logger.warn("Failed to create static nat for network due to ", ex);
        return false;
    }

    return true;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:32,代码来源:RulesManagerImpl.java


注:本文中的com.cloud.network.dao.IPAddressVO.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。