import java.util.function.Predicate;
import javax.inject.Inject;
import javax.inject.Singleton;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
import org.opendaylight.genius.utils.ServiceIndex;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
import org.opendaylight.netvirt.elan.cache.ElanInstanceCache;
import org.opendaylight.netvirt.elan.l2gw.utils.SettableFutureCallback;
});
}
+ @Nullable
public String getEndpointIpAddressForDPN(BigInteger dpnId) {
Future<RpcResult<GetDpnEndpointIpsOutput>> result = itmRpcService.getDpnEndpointIps(
: interfaceManager.getInterfaceInfoFromOperationalDataStore(ifName).getMacAddress());
}
+ @Nullable
public String getL3vpnNameFromElan(ElanInstance elanInfo) {
if (elanInfo == null) {
LOG.debug("getL3vpnNameFromElan :elanInfo is NULL");
return evpnAugmentation != null ? evpnAugmentation.getL3vpnName() : null;
}
+ @Nullable
public static String getEvpnNameFromElan(ElanInstance elanInfo) {
if (elanInfo == null) {
LOG.debug("getEvpnNameFromElan :elanInfo is NULL");
return evpnAugmentation != null ? evpnAugmentation.getEvpnName() : null;
}
+ @Nullable
public String getEvpnRd(ElanInstance elanInfo) {
String evpnName = getEvpnNameFromElan(elanInfo);
if (evpnName == null) {
return;
}
int vpnLabel = 0;
- long l2vni = elanUtils.getVxlanSegmentationId(elanInfo);
+ long l2vni = ElanUtils.getVxlanSegmentationId(elanInfo);
long l3vni = 0;
String gatewayMacAddr = null;
String l3VpName = getL3vpnNameFromElan(elanInfo);
LOG.info("No DC gateways configured while programming the l2vni table.");
return tunnelInterfaceNameList;
}
- List<DcGatewayIp> dcGatewayIps = dcGatewayIpListOptional.get().getDcGatewayIp();
+ List<DcGatewayIp> dcGatewayIps = dcGatewayIpListOptional.get().nonnullDcGatewayIp();
Optional<ExternalTunnelList> externalTunnelListOptional = getExternalTunnelList();
if (!externalTunnelListOptional.isPresent()) {
LOG.info("No External Tunnel Configured while programming the l2vni table.");
return tunnelInterfaceNameList;
}
- List<ExternalTunnel> externalTunnels = externalTunnelListOptional.get().getExternalTunnel();
+ List<ExternalTunnel> externalTunnels = externalTunnelListOptional.get().nonnullExternalTunnel();
- dcGatewayIps
- .forEach(dcIp -> externalTunnels
+ dcGatewayIps.forEach(dcIp -> externalTunnels
.stream()
.filter(externalTunnel -> externalTunnel.getDestinationDevice()
.contains(dcIp.getIpAddress().getIpv4Address().toString()))
}
public void bindElanServiceToExternalTunnel(String elanName, String interfaceName) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
int instructionKey = 0;
LOG.trace("Binding external interface {} elan {}", interfaceName, elanName);
List<Instruction> instructions = new ArrayList<>();
}
public void unbindElanServiceFromExternalTunnel(String elanName, String interfaceName) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
LOG.trace("UnBinding external interface {} elan {}", interfaceManager, elanName);
short elanServiceIndex =
ServiceIndex.getIndex(NwConstants.ELAN_SERVICE_NAME, NwConstants.ELAN_SERVICE_INDEX);
private void programEvpnL2vniFlow(ElanInstance elanInfo, BiConsumer<BigInteger, FlowEntity> flowHandler) {
long elanTag = elanInfo.getElanTag();
List<MatchInfo> mkMatches = new ArrayList<>();
- mkMatches.add(new MatchTunnelId(BigInteger.valueOf(elanUtils.getVxlanSegmentationId(elanInfo))));
+ mkMatches.add(new MatchTunnelId(BigInteger.valueOf(ElanUtils.getVxlanSegmentationId(elanInfo))));
NWUtil.getOperativeDPNs(broker).forEach(dpnId -> {
LOG.debug("Updating tunnel flow to dpnid {}", dpnId);
List<InstructionInfo> instructions = getInstructionsForExtTunnelTable(elanTag);