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


Java IpAddress.equals方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress.equals方法的典型用法代码示例。如果您正苦于以下问题:Java IpAddress.equals方法的具体用法?Java IpAddress.equals怎么用?Java IpAddress.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress的用法示例。


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

示例1: onArpRequestReceived

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入方法依赖的package包/类
@Override
public void onArpRequestReceived(ArpRequestReceived notification) {
    String srcInterface = notification.getInterface();
    IpAddress srcIP = notification.getSrcIpaddress();
    PhysAddress srcMac = notification.getSrcMac();
    IpAddress targetIP = notification.getDstIpaddress();
    BigInteger metadata = notification.getMetadata();
    boolean isGarp = srcIP.equals(targetIP);
    if (!isGarp) {
        LOG.info("ArpNotification Non-Gratuitous Request Received from "
                  + "interface {} and IP {} having MAC {} target destination {}, ignoring..",
                srcInterface, srcIP.getIpv4Address().getValue(),srcMac.getValue(),
                targetIP.getIpv4Address().getValue());
        return;
    }
    LOG.info("ArpNotification Gratuitous Request Received from "
              + "interface {} and IP {} having MAC {} target destination {}, learning MAC",
              srcInterface, srcIP.getIpv4Address().getValue(),srcMac.getValue(),
              targetIP.getIpv4Address().getValue());
    processArpLearning(srcInterface, srcIP, srcMac, metadata, targetIP);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:ArpNotificationHandler.java

示例2: handleTunnelStateDown

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入方法依赖的package包/类
public List<ListenableFuture<Void>> handleTunnelStateDown(IpAddress tunnelIp, BigInteger interfaceDpn) {
    LOG.trace("In handleTunnelStateDown tunnelIp {}, interfaceDpn {}", tunnelIp, interfaceDpn);
    if (interfaceDpn == null) {
        return Collections.emptyList();
    }
    try {
        synchronized (getTunnelIpDpnKey(tunnelIp, interfaceDpn)) {
            Set<Pair<IpAddress, String>> tunnelElanPairSet =
                    designatedDpnsToTunnelIpElanNameCache.get(interfaceDpn);
            if (tunnelElanPairSet == null || tunnelElanPairSet.isEmpty()) {
                return Collections.emptyList();
            }
            WriteTransaction tx = broker.newWriteOnlyTransaction();
            for (Pair<IpAddress, String> tunnelElanPair : tunnelElanPairSet) {
                IpAddress tunnelIpInDpn = tunnelElanPair.getLeft();
                if (tunnelIpInDpn.equals(tunnelIp)) {
                    if (!checkL2GatewayConnection(tunnelElanPair)) {
                        LOG.trace("Couldn't find device for given tunnelIpElanPair {} in L2GwConnCache",
                                tunnelElanPair);
                        tx.cancel();
                        return Collections.emptyList();
                    }
                    List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(broker);
                    dpns.remove(interfaceDpn);
                    changeExistingFlowToDrop(tunnelElanPair, interfaceDpn, tx);
                    updateCacheAndInstallNewFlows(interfaceDpn, dpns, tunnelElanPair, tx);
                }
            }
            return Collections.singletonList(tx.submit());
        }
    } catch (ExecutionException e) {
        LOG.error("Error in handleTunnelStateDown {}", e.getMessage());
        LOG.trace("Exception details {}", e);
        return Collections.emptyList();
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:37,代码来源:DhcpExternalTunnelManager.java

示例3: getDeviceFromTunnelIp

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入方法依赖的package包/类
private L2GatewayDevice getDeviceFromTunnelIp(String elanInstanceName, IpAddress tunnelIp) {
    Collection<L2GatewayDevice> devices = l2GatewayCache.getAll();
    LOG.trace("In getDeviceFromTunnelIp devices {}", devices);
    for (L2GatewayDevice device : devices) {
        if (tunnelIp.equals(device.getTunnelIp())) {
            return device;
        }
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:11,代码来源:DhcpExternalTunnelManager.java

示例4: handleTunnelStateUp

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入方法依赖的package包/类
public List<ListenableFuture<Void>> handleTunnelStateUp(IpAddress tunnelIp, BigInteger interfaceDpn) {
    LOG.trace("In handleTunnelStateUp tunnelIp {}, interfaceDpn {}", tunnelIp, interfaceDpn);
    synchronized (getTunnelIpDpnKey(tunnelIp, interfaceDpn)) {
        Set<Pair<IpAddress, String>> tunnelIpElanPair =
                designatedDpnsToTunnelIpElanNameCache.get(DhcpMConstants.INVALID_DPID);
        List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(broker);
        if (tunnelIpElanPair == null || tunnelIpElanPair.isEmpty()) {
            LOG.trace("There are no undesignated DPNs");
            return Collections.emptyList();
        }
        WriteTransaction tx = broker.newWriteOnlyTransaction();
        for (Pair<IpAddress, String> pair : tunnelIpElanPair) {
            if (tunnelIp.equals(pair.getLeft())) {
                BigInteger newDesignatedDpn = designateDpnId(tunnelIp, pair.getRight(), dpns);
                if (newDesignatedDpn != null && !newDesignatedDpn.equals(DhcpMConstants.INVALID_DPID)) {
                    Set<String> vmMacAddress = tunnelIpElanNameToVmMacCache.get(pair);
                    if (vmMacAddress != null && !vmMacAddress.isEmpty()) {
                        LOG.trace("Updating DHCP flow for macAddress {} with newDpn {}",
                                vmMacAddress, newDesignatedDpn);
                        installDhcpFlowsForVms(newDesignatedDpn, vmMacAddress, tx);
                    }
                }
            }
        }
        return Collections.singletonList(tx.submit());
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:28,代码来源:DhcpExternalTunnelManager.java


注:本文中的org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。