/*
- * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
public List<ElanInstance> getElanInstances() {
InstanceIdentifier<ElanInstances> elanInstancesIdentifier = InstanceIdentifier.builder(ElanInstances.class)
.build();
- return elanUtils.read(broker, LogicalDatastoreType.CONFIGURATION, elanInstancesIdentifier).transform(
- ElanInstances::getElanInstance).or(Collections.emptyList());
+ return elanUtils.read(broker, LogicalDatastoreType.CONFIGURATION, elanInstancesIdentifier).toJavaUtil().map(
+ ElanInstances::getElanInstance).orElse(Collections.emptyList());
}
@Override
private boolean shouldDeleteTrunk(String trunkInterfaceName, String elanInterfaceName) {
List<Interface> childInterfaces = interfaceManager.getChildInterfaces(trunkInterfaceName);
if (childInterfaces == null || childInterfaces.isEmpty()
- || (childInterfaces.size() == 1 && elanInterfaceName.equals(childInterfaces.get(0).getName()))) {
+ || childInterfaces.size() == 1 && elanInterfaceName.equals(childInterfaces.get(0).getName())) {
LOG.debug("No more VLAN member interfaces left for trunk {}", trunkInterfaceName);
return true;
}
if (update && !elanInstance.isExternal()) {
DpnInterfaces dpnInterfaces = elanUtils.getElanInterfaceInfoByElanDpn(elanInstanceName,
bridgeMgr.getDatapathId(node));
- if (dpnInterfaces == null || dpnInterfaces.getInterfaces().size() == 0) {
+ if (dpnInterfaces == null || dpnInterfaces.getInterfaces().isEmpty()) {
continue;
}
}
@Override
public void addArpResponderFlow(ArpResponderInput arpResponderInput) {
-
elanUtils.addArpResponderFlow(arpResponderInput.getDpId(), arpResponderInput.getInterfaceName(),
arpResponderInput.getSpa(), arpResponderInput.getSha(), arpResponderInput.getLportTag(),
arpResponderInput.getInstructions());
-
-
}
@Override
elanUtils.removeArpResponderFlow(arpResponderInput.getDpId(), arpResponderInput.getInterfaceName(),
arpResponderInput.getSpa(), arpResponderInput.getLportTag());
}
+
+ /**
+ * Uses the IdManager to retrieve a brand new ElanTag.
+ *
+ * @param idKey
+ * the id key
+ * @return the integer
+ */
+ @Override
+ public Long retrieveNewElanTag(String idKey) {
+ return elanUtils.retrieveNewElanTag(idManager, idKey);
+ }
+
}