Migrate JdkFutures users 24/91624/5
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Jul 2020 11:17:59 +0000 (13:17 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Aug 2020 09:35:26 +0000 (11:35 +0200)
JdkFutures.addErrorLogging() has been deprecated and has a new
name. Use the new location in LoggingFutures.

Change-Id: Ib895f46599b8d36f2f477e5ccd58b95cbd5759e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpAllocationPoolManager.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpPktHandler.java
ipv6service/impl/src/main/java/org/opendaylight/netvirt/ipv6service/Ipv6PktHandler.java
ipv6service/impl/src/main/java/org/opendaylight/netvirt/ipv6service/Ipv6RouterAdvt.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptEventHandler.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/VpnFloatingIpHandler.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/SubnetRoutePacketInHandler.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/InterVpnLinkListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AlivenessMonitorUtils.java

index 3026297910ee5fcd1c9da6706fca238e984bdd76..fcb844708249cac6d493ab5288f80c7c4b654aa0 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
 import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
@@ -120,8 +120,7 @@ public class DhcpAllocationPoolManager implements AutoCloseable, EventListener {
             return null;
         }
         Network networkConfData = optionalNetworkConfData.get();
-        List<AllocationPool> allocationPoolList = new ArrayList<AllocationPool>(networkConfData
-                .nonnullAllocationPool().values());
+        List<AllocationPool> allocationPoolList = new ArrayList<>(networkConfData.nonnullAllocationPool().values());
         // if network has allocation pool list - get the first element
         // as we have no info about a specific subnet
         if (allocationPoolList != null && !allocationPoolList.isEmpty()) {
@@ -189,7 +188,7 @@ public class DhcpAllocationPoolManager implements AutoCloseable, EventListener {
 
     private void releaseIdAllocation(String groupIdKey, String idKey) {
         ReleaseIdInput getIdInput = new ReleaseIdInputBuilder().setPoolName(groupIdKey).setIdKey(idKey).build();
-        JdkFutures.addErrorLogging(idManager.releaseId(getIdInput), LOG, "Release Id");
+        LoggingFutures.addErrorLogging(idManager.releaseId(getIdInput), LOG, "Release Id");
     }
 
     protected void createIdAllocationPool(String networkId, AllocationPool pool) {
index c960f2b7a72d4acc0293b01c4c8b09d58e14db0a..0fb6e4e6210883c34274663ece6963e6c9ba797e 100644 (file)
@@ -38,7 +38,7 @@ import org.opendaylight.infrautils.metrics.Counter;
 import org.opendaylight.infrautils.metrics.Labeled;
 import org.opendaylight.infrautils.metrics.MetricDescriptor;
 import org.opendaylight.infrautils.metrics.MetricProvider;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.netvirt.dhcpservice.api.DHCP;
 import org.opendaylight.netvirt.dhcpservice.api.DHCPConstants;
@@ -76,7 +76,6 @@ import org.opendaylight.yangtools.yang.common.Uint64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 @Singleton
 public class DhcpPktHandler implements PacketProcessingListener {
 
@@ -254,7 +253,7 @@ public class DhcpPktHandler implements PacketProcessingListener {
         }
         TransmitPacketInput output = MDSALUtil.getPacketOut(action, pktOut, dpnId);
         LOG.trace("Transmitting packet: {}", output);
-        JdkFutures.addErrorLogging(pktService.transmitPacket(output), LOG, "Transmit packet");
+        LoggingFutures.addErrorLogging(pktService.transmitPacket(output), LOG, "Transmit packet");
     }
 
     @Nullable
@@ -818,7 +817,7 @@ public class DhcpPktHandler implements PacketProcessingListener {
                     LOG.warn("RPC Call to Get egress actions for interface {} returned with Errors {}",
                             interfaceName, rpcResult.getErrors());
                 } else {
-                    return new ArrayList<Action>(rpcResult.getResult().nonnullAction().values());
+                    return new ArrayList<>(rpcResult.getResult().nonnullAction().values());
                 }
             } else {
                 GetEgressActionsForInterfaceInputBuilder egressAction =
@@ -833,7 +832,7 @@ public class DhcpPktHandler implements PacketProcessingListener {
                     LOG.warn("RPC Call to Get egress actions for interface {} returned with Errors {}",
                             interfaceName, rpcResult.getErrors());
                 } else {
-                    return new ArrayList<Action>(rpcResult.getResult().nonnullAction().values());
+                    return new ArrayList<>(rpcResult.getResult().nonnullAction().values());
                 }
             }
         } catch (InterruptedException | ExecutionException e) {
index f3ce2ae605a8a17fdb0b355096ff4506b169c17e..8fde98fac95dc748b96a1bd46a1a36c363918a00 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.genius.ipv6util.api.decoders.Ipv6NaDecoder;
 import org.opendaylight.genius.mdsalutil.MetaDataUtil;
 import org.opendaylight.genius.mdsalutil.NwConstants;
 import org.opendaylight.genius.mdsalutil.packet.IPProtocols;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.netvirt.ipv6service.api.IIpv6PacketListener;
 import org.opendaylight.netvirt.ipv6service.utils.IpV6NAConfigHelper;
 import org.opendaylight.netvirt.ipv6service.utils.Ipv6ServiceUtils;
@@ -204,7 +204,7 @@ public class Ipv6PktHandler implements AutoCloseable, PacketProcessingListener {
             // Tx the packet out of the controller.
             if (pktService != null) {
                 LOG.debug("Transmitting the Neighbor Advt packet out on {}", packet.getIngress());
-                JdkFutures.addErrorLogging(pktService.transmitPacket(input), LOG, "transmitPacket");
+                LoggingFutures.addErrorLogging(pktService.transmitPacket(input), LOG, "transmitPacket");
                 pktProccessedCounter.incrementAndGet();
             }
         }
index bdd3cdde460753a36a1c1eeba44745130f178189..29c53ba01318fc19825b4e3bf280a540205f6710 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netvirt.ipv6service;
 
 import static java.util.Objects.requireNonNull;
@@ -24,7 +23,7 @@ import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.NwConstants;
 import org.opendaylight.genius.mdsalutil.actions.ActionGroup;
 import org.opendaylight.genius.mdsalutil.packet.IPProtocols;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.netvirt.ipv6service.utils.Ipv6ServiceConstants;
 import org.opendaylight.netvirt.ipv6service.utils.Ipv6ServiceUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil;
@@ -44,7 +43,6 @@ import org.opendaylight.yangtools.yang.common.Uint64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 public class Ipv6RouterAdvt {
     private static final Logger LOG = LoggerFactory.getLogger(Ipv6RouterAdvt.class);
     private final PacketProcessingService packetService;
@@ -83,7 +81,7 @@ public class Ipv6RouterAdvt {
             input = MDSALUtil.getPacketOutDefault(lstActionInfo, txPayload, dpnId);
             LOG.debug("Transmitting the Router Advt packet out to ELAN Group ID {}", elanGroupId);
         }
-        JdkFutures.addErrorLogging(packetService.transmitPacket(input), LOG, "transmitPacket");
+        LoggingFutures.addErrorLogging(packetService.transmitPacket(input), LOG, "transmitPacket");
         return true;
     }
 
@@ -243,7 +241,7 @@ public class Ipv6RouterAdvt {
             buf.putInt((int)pdu.getMtu().longValue());
         }
 
-        for (PrefixList prefix : new ArrayList<PrefixList>(pdu.nonnullPrefixList().values())) {
+        for (PrefixList prefix : new ArrayList<>(pdu.nonnullPrefixList().values())) {
             buf.put((byte)prefix.getOptionType().shortValue());
             buf.put((byte)prefix.getOptionLength().shortValue());
             buf.put((byte)prefix.getPrefixLength().shortValue());
index 127ffd79bf6802185f33f96837f721714904e4fd..47539a3218e33fedf9d43ce7c2df5c20a265146d 100644 (file)
@@ -64,7 +64,7 @@ import org.opendaylight.genius.mdsalutil.packet.Ethernet;
 import org.opendaylight.genius.mdsalutil.packet.IPv4;
 import org.opendaylight.genius.mdsalutil.packet.TCP;
 import org.opendaylight.genius.mdsalutil.packet.UDP;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.netvirt.elanmanager.api.IElanService;
 import org.opendaylight.openflowplugin.libraries.liblldp.PacketException;
@@ -176,7 +176,7 @@ public class NaptEventHandler {
             LOG.trace("handleEvent : Time Elapsed before procesing snat ({}:{}) packet is {} ms,routerId: {},"
                     + "isPktProcessed:{}",
                               internalIpAddress, internalPort,
-                              (System.currentTimeMillis() - naptEntryEvent.getObjectCreationTime()), routerId,
+                              System.currentTimeMillis() - naptEntryEvent.getObjectCreationTime(), routerId,
                               naptEntryEvent.isPktProcessed());
             //Get the DPN ID
             Uint64 dpnId = NatUtil.getPrimaryNaptfromRouterId(dataBroker, routerId);
@@ -602,7 +602,7 @@ public class NaptEventHandler {
                 // reset the split-horizon bit to allow traffic from tunnel to be sent back to the provider port
                 instructionInfo.add(new InstructionWriteMetadata(MetaDataUtil.getVpnIdMetadata(vpnId.longValue()),
                     Uint64.fromLongBits(MetaDataUtil.METADATA_MASK_VRFID.longValue()
-                            | (MetaDataUtil.METADATA_MASK_SH_FLAG.longValue()))));
+                            | MetaDataUtil.METADATA_MASK_SH_FLAG.longValue())));
                 break;
 
             case NwConstants.INBOUND_NAPT_TABLE:
@@ -688,7 +688,7 @@ public class NaptEventHandler {
         TransmitPacketInput output = MDSALUtil.getPacketOut(actionInfos, pktOut, dpnID.longValue(), inPort);
         LOG.debug("sendNaptPacketOut : Transmitting packet: {}, inPort {}", output, inPort);
 
-        JdkFutures.addErrorLogging(pktService.transmitPacket(output), LOG, "Transmit packet");
+        LoggingFutures.addErrorLogging(pktService.transmitPacket(output), LOG, "Transmit packet");
     }
 
     private String getInterfaceNameFromTag(long portTag) {
index 95457a1e652c6417693d2f440d46b20a2ecf7ffd..5f1f55c082dc0a3b14ce98ef283f4fbc4b00a4f0 100644 (file)
@@ -46,8 +46,8 @@ import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType;
 import org.opendaylight.genius.mdsalutil.matches.MatchMplsLabel;
 import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
 import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
@@ -444,7 +444,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
         } else {
             mkMatches.add(new MatchTunnelId(Uint64.valueOf(serviceId)));
         }
-        Map<InstructionKey, Instruction> customInstructionsMap = new HashMap<InstructionKey, Instruction>();
+        Map<InstructionKey, Instruction> customInstructionsMap = new HashMap<>();
         int instructionKey = 0;
         for (Instruction instructionObj : customInstructions) {
             customInstructionsMap.put(new InstructionKey(++instructionKey), instructionObj);
@@ -464,7 +464,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
         matches.add(MatchEthernetType.MPLS_UNICAST);
         matches.add(new MatchMplsLabel(serviceId.longValue()));
 
-        Map<InstructionKey, Instruction> instructionMap = new HashMap<InstructionKey, Instruction>();
+        Map<InstructionKey, Instruction> instructionMap = new HashMap<>();
         int instructionKey = 0;
         List<ActionInfo> actionsInfos = new ArrayList<>();
         //NAT is required for IPv4 only. Hence always etherType will be IPv4
@@ -529,7 +529,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
             SendArpRequestInput sendArpRequestInput = new SendArpRequestInputBuilder().setIpaddress(floatingIpAddress)
                 .setInterfaceAddress(interfaceAddresses).build();
 
-            JdkFutures.addErrorLogging(arpUtilService.sendArpRequest(sendArpRequestInput), LOG, "sendArpRequest");
+            LoggingFutures.addErrorLogging(arpUtilService.sendArpRequest(sendArpRequestInput), LOG, "sendArpRequest");
             natServiceCounters.garpSent();
         } catch (Exception e) {
             LOG.error("sendGarpOnInterface : Failed to send GARP request for floating ip {} from interface {}",
index 9ff0c42441ab312b9dc7f8f17f0dc5a5cc1633d1..7c0cf5288de6f0ddba335300902965ac15e62861 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.infrautils.metrics.Counter;
 import org.opendaylight.infrautils.metrics.Labeled;
 import org.opendaylight.infrautils.metrics.MetricDescriptor;
 import org.opendaylight.infrautils.metrics.MetricProvider;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.netvirt.vpnmanager.api.ICentralizedSwitchProvider;
@@ -57,7 +57,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev16011
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.routers.ExternalIps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.routers.ExternalIpsKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.interfaces.VpnInterface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.interfaces.vpn._interface.VpnInstanceNames;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.networkmaps.NetworkMap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.neutron.vpn.portip.port.data.VpnPortipToPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap;
@@ -105,7 +104,7 @@ public class SubnetRoutePacketInHandler implements PacketProcessingListener {
 
         short tableId = notification.getTableId().getValue().toJava();
         LOG.trace("{} onPacketReceived: Packet punted from table {}", LOGGING_PREFIX, tableId);
-        if (!vpnUtil.isArpLearningEnabled()) {
+        if (!VpnUtil.isArpLearningEnabled()) {
             LOG.trace("Not handling packet as ARP Based Learning is disabled");
             return;
         }
@@ -283,14 +282,14 @@ public class SubnetRoutePacketInHandler implements PacketProcessingListener {
             return;
         }
         if (VpnHelper.doesVpnInterfaceBelongToVpnInstance(vpnIdVpnInstanceName,
-               new ArrayList<VpnInstanceNames>(vmVpnInterface.nonnullVpnInstanceNames().values()))
+               new ArrayList<>(vmVpnInterface.nonnullVpnInstanceNames().values()))
                && !vpnUtil.isBgpVpnInternet(vpnIdVpnInstanceName)) {
             LOG.trace("Unknown IP is in internal network");
             handlePacketToInternalNetwork(dstIp, dstIpStr, elanTag, srcIpStr);
         } else {
             LOG.trace("Unknown IP is in external network");
             String vpnName = vpnUtil.getInternetVpnFromVpnInstanceList(
-                    new ArrayList<VpnInstanceNames>(vmVpnInterface.nonnullVpnInstanceNames().values()));
+                    new ArrayList<>(vmVpnInterface.nonnullVpnInstanceNames().values()));
             if (vpnName != null) {
                 handlePacketToExternalNetwork(new Uuid(vpnIdVpnInstanceName), vpnName, dstIp, dstIpStr, elanTag);
             } else {
@@ -315,7 +314,7 @@ public class SubnetRoutePacketInHandler implements PacketProcessingListener {
             TransmitPacketInput packetInput =
                     ArpUtils.createArpRequestInput(dpnId, groupid, HexEncode.bytesFromHexString(sourceMac),
                             InetAddress.getByName(sourceIpAddress).getAddress(), dstIpBytes);
-            JdkFutures.addErrorLogging(packetService.transmitPacket(packetInput), LOG, "Transmit packet");
+            LoggingFutures.addErrorLogging(packetService.transmitPacket(packetInput), LOG, "Transmit packet");
         } else {
             // IPv6 case
             LOG.debug("Sending NS: srcIp={}, srcMac={}, dstIp={}, dpId={}, elan-tag={}, groupid={}", sourceIpAddress,
index 6ddd3114b5168db89ae7c459b19f8bb678e2f5df..938a6230e53e6e1fc5bffbd399583c1121144e7b 100755 (executable)
@@ -29,8 +29,8 @@ import org.opendaylight.genius.mdsalutil.NwConstants;
 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
 import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
 import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
 import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -413,7 +413,7 @@ public class InterVpnLinkListener extends AbstractAsyncDataTreeChangeListener<In
         ReleaseIdInput releaseIdInput =
             new ReleaseIdInputBuilder().setPoolName(VpnConstants.PSEUDO_LPORT_TAG_ID_POOL_NAME).setIdKey(idKey).build();
 
-        JdkFutures.addErrorLogging(idManager.releaseId(releaseIdInput), LOG, "Release Id");
+        LoggingFutures.addErrorLogging(idManager.releaseId(releaseIdInput), LOG, "Release Id");
     }
 
     @Override
index e4b2985a2cc55395c1b4c406a023b6dc9c8b42dc..03e0bfcf9bd0631792a0fd1e0faeb40051a12011 100644 (file)
@@ -17,7 +17,7 @@ import javax.inject.Singleton;
 import org.opendaylight.genius.arputil.api.ArpConstants;
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
 import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager;
@@ -137,7 +137,7 @@ public final class AlivenessMonitorUtils {
     void stopIpMonitoring(Uint32 monitorId) {
         MonitorStopInput input = new MonitorStopInputBuilder().setMonitorId(monitorId).build();
 
-        JdkFutures.addErrorLogging(alivenessManager.monitorStop(input), LOG, "Stop monitoring");
+        LoggingFutures.addErrorLogging(alivenessManager.monitorStop(input), LOG, "Stop monitoring");
 
         alivenessCache.remove(monitorId.toJava());
         return;