Example usage for com.google.common.util.concurrent ListenableFuture equals

List of usage examples for com.google.common.util.concurrent ListenableFuture equals

Introduction

In this page you can find the example usage for com.google.common.util.concurrent ListenableFuture equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.opendaylight.genius.arputil.internal.ArpUtilImpl.java

private void fireArpReqRecvdNotification(String interfaceName, InetAddress srcInetAddr, byte[] srcMac,
        InetAddress dstInetAddr, int tableId, BigInteger metadata) throws InterruptedException {
    ArpUtilCounters.arp_req_rcv.inc();//  w  w  w . ja  va2s .c  o  m
    String macAddress = NWUtil.toStringMacAddress(srcMac);
    ArpRequestReceivedBuilder builder = new ArpRequestReceivedBuilder();
    builder.setInterface(interfaceName);
    builder.setOfTableId((long) tableId);
    builder.setSrcIpaddress(new IpAddress(srcInetAddr.getHostAddress().toCharArray()));
    builder.setDstIpaddress(new IpAddress(dstInetAddr.getHostAddress().toCharArray()));
    builder.setSrcMac(new PhysAddress(macAddress));
    builder.setMetadata(metadata);
    ListenableFuture<?> offerNotification = notificationPublishService.offerNotification(builder.build());
    if (offerNotification != null && offerNotification.equals(NotificationPublishService.REJECTED)) {
        ArpUtilCounters.arp_req_rcv_notification_rejected.inc();
    } else {
        ArpUtilCounters.arp_req_rcv_notification.inc();
    }
}

From source file:org.opendaylight.genius.arputil.internal.ArpUtilImpl.java

private void fireArpRespRecvdNotification(String interfaceName, InetAddress srcInetAddr,
        byte[] srcMacAddressBytes, int tableId, BigInteger metadata, InetAddress dstInetAddr,
        byte[] dstMacAddressBytes) throws InterruptedException {
    ArpUtilCounters.arp_res_rcv.inc();/*from w w w.  j a  v  a 2 s  . c  om*/

    IpAddress srcIp = new IpAddress(srcInetAddr.getHostAddress().toCharArray());
    IpAddress dstIp = new IpAddress(dstInetAddr.getHostAddress().toCharArray());
    String srcMacAddress = NWUtil.toStringMacAddress(srcMacAddressBytes);
    PhysAddress srcMac = new PhysAddress(srcMacAddress);
    String dstMacAddress = NWUtil.toStringMacAddress(dstMacAddressBytes);
    PhysAddress dstMac = new PhysAddress(dstMacAddress);
    ArpResponseReceivedBuilder builder = new ArpResponseReceivedBuilder();
    builder.setInterface(interfaceName);
    builder.setSrcIpaddress(srcIp);
    builder.setOfTableId((long) tableId);
    builder.setSrcMac(srcMac);
    builder.setMetadata(metadata);
    builder.setDstIpaddress(dstIp);
    builder.setDstMac(dstMac);
    ListenableFuture<?> offerNotification = notificationPublishService.offerNotification(builder.build());
    if (offerNotification != null && offerNotification.equals(NotificationPublishService.REJECTED)) {
        ArpUtilCounters.arp_res_rcv_notification_rejected.inc();
    } else {
        ArpUtilCounters.arp_res_rcv_notification.inc();
    }
}