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;
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()) {
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) {
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
@Singleton
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
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 =
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) {
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;
// 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();
}
}
* 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;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
public class Ipv6RouterAdvt {
private static final Logger LOG = LoggerFactory.getLogger(Ipv6RouterAdvt.class);
private final PacketProcessingService packetService;
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;
}
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());
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;
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);
// 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:
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) {
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;
} 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);
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
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 {}",
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;
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;
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;
}
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 {
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,
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;
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
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;
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;