package org.opendaylight.netvirt.elan.internal;
import static java.util.Collections.emptyList;
-import static org.opendaylight.netvirt.elan.utils.ElanUtils.requireNonNullElse;
import com.google.common.base.Optional;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Set;
import java.util.concurrent.Future;
import java.util.function.BiFunction;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.infra.Datastore;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
-import org.opendaylight.genius.mdsalutil.MatchInfoBase;
-import org.opendaylight.genius.mdsalutil.MetaDataUtil;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
-import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister;
import org.opendaylight.genius.utils.ServiceIndex;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.infrautils.inject.AbstractLifecycle;
}
@Override
- @Nonnull
+ @NonNull
public List<String> getElanInterfaces(String elanInstanceName) {
List<String> elanInterfaces = new ArrayList<>();
InstanceIdentifier<ElanInterfaces> elanInterfacesIdentifier = InstanceIdentifier.builder(ElanInterfaces.class)
if (!elanInterfacesOptional.isPresent()) {
return elanInterfaces;
}
- List<ElanInterface> elanInterfaceList =
- requireNonNullElse(elanInterfacesOptional.get().getElanInterface(), emptyList());
+ List<ElanInterface> elanInterfaceList = elanInterfacesOptional.get().nonnullElanInterface();
for (ElanInterface elanInterface : elanInterfaceList) {
if (Objects.equals(elanInterface.getElanInstanceName(), elanInstanceName)) {
elanInterfaces.add(elanInterface.getName());
elanUtils.removeDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), macAddress, dpnsIdsForElanInstance);
}
- @Override
- public List<MatchInfoBase> getEgressMatchesForElanInstance(String elanInstanceName) {
- ElanInstance elanInstance = getElanInstance(elanInstanceName);
- if (elanInstance == null) {
- LOG.debug("No ELAN instance found for {}", elanInstanceName);
- return emptyList();
- }
-
- Long elanTag = elanInstance.getElanTag();
- if (elanTag == null) {
- LOG.debug("No ELAN tag found for {}", elanInstanceName);
- return emptyList();
- }
- return Collections.singletonList(
- new NxMatchRegister(ElanConstants.ELAN_REG_ID, elanTag, MetaDataUtil.getElanMaskForReg()));
- }
-
/**
* Create ietf-interfaces based on the ELAN segment type.<br>
* For segment type flat - create transparent interface pointing to the