本文整理汇总了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);
}
示例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();
}
}
示例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;
}
示例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());
}
}