List<MatchInfoBase> matches = entry.getValue();
matches.add(lportTagMatch);
String flowId = flowName + this.directionString + "_" + port.getDpId() + "_" + port.getLPortTag() + "_"
- + ace.getKey().getRuleName();
+ + ace.key().getRuleName();
int operation = addOrRemove == NwConstants.MOD_FLOW ? NwConstants.DEL_FLOW : addOrRemove;
syncFlow(port.getDpId(), getAclFilterCumDispatcherTable(), flowId, flowPriority, "ACL", 0, 0,
List<MatchInfoBase> matches = entry.getValue();
matches.addAll(lportAndAclMatches);
String flowId = flowName + this.directionString + "_" + port.getDpId() + "_" + port.getLPortTag() + "_"
- + ace.getKey().getRuleName();
+ + ace.key().getRuleName();
int operation = addOrRemove == NwConstants.MOD_FLOW ? NwConstants.DEL_FLOW : addOrRemove;
syncFlow(port.getDpId(), getAclRuleBasedFilterTable(), flowId, flowPriority, "ACL", 0, 0,
return;
}
for (Ace ace : aceList) {
- SecurityRuleAttr aceAttributes = ace.getAugmentation(SecurityRuleAttr.class);
+ SecurityRuleAttr aceAttributes = ace.augmentation(SecurityRuleAttr.class);
if (AclServiceUtils.doesAceHaveRemoteGroupId(aceAttributes)) {
if (action == AclServiceManager.Action.ADD) {
aclDataUtil.addRemoteAclId(aceAttributes.getRemoteGroupId(), new Uuid(aclName),
@Override
public void update(InstanceIdentifier<Interface> key, Interface portBefore, Interface portAfter) {
- if (portBefore.getAugmentation(ParentRefs.class) == null
- && portAfter.getAugmentation(ParentRefs.class) != null) {
+ if (portBefore.augmentation(ParentRefs.class) == null
+ && portAfter.augmentation(ParentRefs.class) != null) {
LOG.trace("Ignoring event for update in ParentRefs for {} ", portAfter.getName());
return;
}
LOG.trace("Received AclInterface update event, portBefore={}, portAfter={}", portBefore, portAfter);
- InterfaceAcl aclInPortAfter = portAfter.getAugmentation(InterfaceAcl.class);
- InterfaceAcl aclInPortBefore = portBefore.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPortAfter = portAfter.augmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPortBefore = portBefore.augmentation(InterfaceAcl.class);
String interfaceId = portAfter.getName();
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state
@Override
public void add(InstanceIdentifier<Interface> key, Interface port) {
LOG.trace("Received AclInterface add event, port={}", port);
- InterfaceAcl aclInPort = port.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPort = port.augmentation(InterfaceAcl.class);
if (aclInPort != null && aclInPort.isPortSecurityEnabled()) {
String interfaceId = port.getName();
AclInterface aclInterface = addOrUpdateAclInterfaceCache(interfaceId, aclInPort);
+ "for ACL failed", added.getName());
return;
}
- InterfaceAcl aclInPort = iface.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPort = iface.augmentation(InterfaceAcl.class);
if (aclInPort == null) {
LOG.trace("Interface {} is not an ACL Interface, ignoring ADD interfaceState event",
added.getName());
if (interfaceOptional.isPresent()) {
Interface interfaceBefore = interfaceOptional.get();
LOG.debug("Starting Recovery of acl Instance {} for interface {}", entityId, interfaceBefore.getName());
- InterfaceAcl interfaceAclBefore = interfaceBefore.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl interfaceAclBefore = interfaceBefore.augmentation(InterfaceAcl.class);
List<Uuid> sgList = new ArrayList<>(interfaceAclBefore.getSecurityGroups());
sgList.remove(aclId);
InterfaceAcl interfaceAclAfter = new InterfaceAclBuilder(interfaceAclBefore).setSecurityGroups(sgList)
LOG.error("Port is Null");
return null;
}
- InterfaceAcl aclInPort = port.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPort = port.augmentation(InterfaceAcl.class);
if (aclInPort == null) {
LOG.error("getSecurityGroupInPortList: no security group associated with port {}",
port.getName());
LOG.error("Ace is Null");
return null;
}
- SecurityRuleAttr aceAttributes = ace.getAugmentation(SecurityRuleAttr.class);
+ SecurityRuleAttr aceAttributes = ace.augmentation(SecurityRuleAttr.class);
if (aceAttributes == null) {
LOG.error("Ace is null");
return null;
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority)
.setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
.setServicePriority(servicePriority).setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
}
for (Iterator<AllowedAddressPairs> iterator = newAllowedAddressPairs.iterator(); iterator.hasNext();) {
AllowedAddressPairs updatedAllowedAddressPair = iterator.next();
for (AllowedAddressPairs currentAllowedAddressPair : origAllowedAddressPairs) {
- if (updatedAllowedAddressPair.getKey().equals(currentAllowedAddressPair.getKey())) {
+ if (updatedAllowedAddressPair.key().equals(currentAllowedAddressPair.key())) {
iterator.remove();
break;
}
LOG.error("Port is Null");
return null;
}
- InterfaceAcl aclInPort = port.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl aclInPort = port.augmentation(InterfaceAcl.class);
if (aclInPort == null) {
LOG.error("getSecurityGroupInPortList: no security group associated to Interface port: {}", port.getName());
return null;
if (acl.getAccessListEntries() != null) {
List<Ace> aceList = acl.getAccessListEntries().getAce();
if (aceList != null && !aceList.isEmpty()) {
- return aceList.get(0).getAugmentation(SecurityRuleAttr.class) != null;
+ return aceList.get(0).augmentation(SecurityRuleAttr.class) != null;
}
}
return false;
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
for (AllowedAddressPairs aap : allowedAddresses) {
PortIds portIdObj =
- new PortIdsBuilder().setKey(new PortIdsKey(portId)).setPortId(portId).build();
+ new PortIdsBuilder().withKey(new PortIdsKey(portId)).setPortId(portId).build();
InstanceIdentifier<PortIds> path =
AclServiceUtils.getPortIdsPathInAclPortsLookup(aclName, aap.getIpAddress(), portId);
tx.put(LogicalDatastoreType.OPERATIONAL, path, portIdObj,
protected static SubnetInfo buildSubnetInfo(Uuid subnetId, String ipPrefix,
Class<? extends IpVersionBase> ipVersion, String gwIp) {
- return new SubnetInfoBuilder().setKey(new SubnetInfoKey(subnetId)).setIpVersion(ipVersion)
+ return new SubnetInfoBuilder().withKey(new SubnetInfoKey(subnetId)).setIpVersion(ipVersion)
.setIpPrefix(new IpPrefixOrAddress(ipPrefix.toCharArray()))
.setGatewayIp(new IpAddress(gwIp.toCharArray())).build();
}
@Override
public Ace dataObject() {
return new AceBuilder()
- .setKey(new AceKey(ruleName))
+ .withKey(new AceKey(ruleName))
.setRuleName(ruleName)
.setMatches(matches)
.setActions(new ActionsBuilder()
@Override
public PortSubnet dataObject() {
return new PortSubnetBuilder()
- .setKey(new PortSubnetKey(newInterfaceName))
+ .withKey(new PortSubnetKey(newInterfaceName))
.setPortId(newInterfaceName)
.setSubnetInfo(subnetInfoList)
.build();
InstanceIdentifier<ExternalTeps> externalTepsId = getExternalTepsIdentifier(elanName, tepIp);
ExternalTepsBuilder externalTepsBuilder = new ExternalTepsBuilder();
ExternalTepsKey externalTepsKey = externalTepsId.firstKeyOf(ExternalTeps.class);
- externalTepsBuilder.setKey(externalTepsKey);
+ externalTepsBuilder.withKey(externalTepsKey);
externalTepsBuilder.setTepIp(externalTepsKey.getTepIp());
update(externalTepsId, externalTepsBuilder.build());
}
super.vpnRd, vpnPseudoLportTag, scfTag, scfTableIdToGo);
VpnToPseudoPortData newValue =
- new VpnToPseudoPortDataBuilder().setKey(new VpnToPseudoPortDataKey(super.vpnRd)).setVrfId(super.vpnRd)
+ new VpnToPseudoPortDataBuilder().withKey(new VpnToPseudoPortDataKey(super.vpnRd)).setVrfId(super.vpnRd)
.setScfTableId(scfTableIdToGo).setScfTag(scfTag)
.setVpnLportTag(vpnPseudoLportTag).build();
LOG.trace("Adding lportTag={} to VpnToLportTag map for VPN with rd={}", vpnPseudoLportTag, vpnRd);
}
break;
}
- vpnScHandler.unbindScfOnVpnInterface(vpnIfaceRemoved.getKey().getName());
+ vpnScHandler.unbindScfOnVpnInterface(vpnIfaceRemoved.key().getName());
}
@Override
LOG.trace("Vpn {} is not related to ServiceChaining. No further action", vpnName);
return;
}
- vpnScHandler.bindScfOnVpnInterface(vpnIfaceAdded.getKey().getName(),
+ vpnScHandler.bindScfOnVpnInterface(vpnIfaceAdded.key().getName(),
optScfInfoForVpn.get().getScfTag());
} catch (ReadFailedException e) {
LOG.error("Error reading the SFC information for VPN {}", vpnName, e);
if (addOrRemove == NwConstants.ADD_FLOW) {
ElanToPseudoPortData newValue =
- new ElanToPseudoPortDataBuilder().setKey(key).setElanLportTag(portTag)
+ new ElanToPseudoPortDataBuilder().withKey(key).setElanLportTag(portTag)
.setScfTag(scfTag).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, path, newValue);
} else {
}
private void stubGetRouteDistinguisher(String vpnName, String rd) throws Exception {
- VpnInstance instance = new VpnInstanceBuilder().setKey(new VpnInstanceKey(vpnName)).setVrfId(rd)
+ VpnInstance instance = new VpnInstanceBuilder().withKey(new VpnInstanceKey(vpnName)).setVrfId(rd)
.setVpnInstanceName(vpnName).build();
InstanceIdentifier<VpnInstance> id = VpnServiceChainUtils.getVpnInstanceToVpnIdIdentifier(vpnName);
private void stubGetVpnInstance(String rd, String ipAddress, String ifaceName) throws Exception {
IpAddresses ipAddr =
- new IpAddressesBuilder().setIpAddress(ipAddress).setKey(new IpAddressesKey(ipAddress)).build();
+ new IpAddressesBuilder().setIpAddress(ipAddress).withKey(new IpAddressesKey(ipAddress)).build();
List<VpnInterfaces> ifacesList =
Collections.singletonList(new VpnInterfacesBuilder().setInterfaceName(ifaceName).build());
VpnToDpnListBuilder vtdlb =
- new VpnToDpnListBuilder().setKey(new VpnToDpnListKey(DPN_ID))
+ new VpnToDpnListBuilder().withKey(new VpnToDpnListKey(DPN_ID))
.setDpnId(DPN_ID)
.setIpAddresses(Collections.singletonList(ipAddr))
.setVpnInterfaces(ifacesList);
VpnInstanceOpDataEntry vpnInstanceOpDataEntry =
- new VpnInstanceOpDataEntryBuilder().setKey(new VpnInstanceOpDataEntryKey(rd))
+ new VpnInstanceOpDataEntryBuilder().withKey(new VpnInstanceOpDataEntryKey(rd))
.setVpnId(VPN_ID)
.setVpnToDpnList(Collections.singletonList(vtdlb.build()))
.setVrfId("1").build();
private void stubGetVrfEntries(String rd, List<VrfEntry> vrfEntryList)
throws Exception {
- VrfTables tables = new VrfTablesBuilder().setKey(new VrfTablesKey(rd)).setRouteDistinguisher(rd)
+ VrfTables tables = new VrfTablesBuilder().withKey(new VrfTablesKey(rd)).setRouteDistinguisher(rd)
.setVrfEntry(vrfEntryList).build();
CheckedFuture chkdFuture = mock(CheckedFuture.class);
when(chkdFuture.checkedGet()).thenReturn(Optional.of(tables));
List<VpnInterfaces> vpnIfacesList =
vpnIfacesOnDpn.stream()
- .map((ifaceName) -> new VpnInterfacesBuilder().setKey(new VpnInterfacesKey(ifaceName))
+ .map((ifaceName) -> new VpnInterfacesBuilder().withKey(new VpnInterfacesKey(ifaceName))
.setInterfaceName(ifaceName).build())
.collect(Collectors.toList());
}
elanInstanceBuilder.setExternal(isExternal);
- elanInstanceBuilder.setKey(new ElanInstanceKey(elanInstanceName));
+ elanInstanceBuilder.withKey(new ElanInstanceKey(elanInstanceName));
return elanInstanceBuilder.build();
}
InstanceIdentifier<ElanInterface> id = InstanceIdentifier.builder(ElanInterfaces.class).child(ElanInterface
.class, new ElanInterfaceKey(elanInterfaceName)).build();
ElanInterface elanInterface = new ElanInterfaceBuilder().setElanInstanceName(elanInstanceName)
- .setName(elanInterfaceName).setKey(new ElanInterfaceKey(elanInterfaceName)).build();
+ .setName(elanInterfaceName).withKey(new ElanInterfaceKey(elanInterfaceName)).build();
wrtConfigTxn.put(LogicalDatastoreType.CONFIGURATION, id, elanInterface);
LOG.debug("Creating new ELAN Interface {}", elanInterface);
}
.class, new ElanInterfaceKey(elanInterfaceName)).build();
PhysAddress physAddress = PhysAddress.getDefaultInstance(macAddress);
List<StaticMacEntries> staticMacEntriesList = new ArrayList<>();
- StaticMacEntries staticMacEntries = new StaticMacEntriesBuilder().setKey(new StaticMacEntriesKey(
+ StaticMacEntries staticMacEntries = new StaticMacEntriesBuilder().withKey(new StaticMacEntriesKey(
physAddress)).setMacAddress(physAddress).setIpPrefix(ipAddress).build();
staticMacEntriesList.add(staticMacEntries);
ElanInterface elanInterface = new ElanInterfaceBuilder().setName(elanInterfaceName)
- .setKey(new ElanInterfaceKey(elanInterfaceName)).setStaticMacEntries(staticMacEntriesList).build();
+ .withKey(new ElanInterfaceKey(elanInterfaceName)).setStaticMacEntries(staticMacEntriesList).build();
wrtConfigTxn.merge(LogicalDatastoreType.CONFIGURATION, id, elanInterface);
LOG.debug("Updating ELAN Interface with static mac {}", elanInterface);
}
WriteTransaction writeTransaction) {
InstanceIdentifier<PodIdentifier> id = InstanceIdentifier.builder(PodidentifierInfo.class)
.child(PodIdentifier.class, new PodIdentifierKey(podName)).build();
- PodIdentifier podIdentifier = new PodIdentifierBuilder().setKey(new PodIdentifierKey(podName))
+ PodIdentifier podIdentifier = new PodIdentifierBuilder().withKey(new PodIdentifierKey(podName))
.setPodName(podName).setPodUuid(pod).build();
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, id, podIdentifier);
LOG.debug("Creating podnametouuid map {} to {}", podName, pod);
List<VpnTarget> vpnTargetList = new ArrayList<>();
LOG.debug("Creating/Updating a new vpn-instance node: {} ", vpnName);
- VpnInstanceBuilder builder = new VpnInstanceBuilder().setKey(new VpnInstanceKey(vpnName))
+ VpnInstanceBuilder builder = new VpnInstanceBuilder().withKey(new VpnInstanceKey(vpnName))
.setVpnInstanceName(vpnName)
.setType(type).setL3vni(l3vni);
if (irt != null && !irt.isEmpty()) {
irt.remove(common);
ert.remove(common);
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(common)).setVrfRTValue(common)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(common)).setVrfRTValue(common)
.setVrfRTType(VpnTarget.VrfRTType.Both).build();
vpnTargetList.add(vpnTarget);
}
}
for (String importRT : irt) {
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(importRT)).setVrfRTValue(importRT)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(importRT)).setVrfRTValue(importRT)
.setVrfRTType(VpnTarget.VrfRTType.ImportExtcommunity).build();
vpnTargetList.add(vpnTarget);
}
if (ert != null && !ert.isEmpty()) {
for (String exportRT : ert) {
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(exportRT)).setVrfRTValue(exportRT)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(exportRT)).setVrfRTValue(exportRT)
.setVrfRTType(VpnTarget.VrfRTType.ExportExtcommunity).build();
vpnTargetList.add(vpnTarget);
}
boolean isRouterInterface, WriteTransaction wrtConfigTxn) {
LOG.trace("createVpnInterface for Port: {}, isRouterInterface: {}", interfaceName, isRouterInterface);
List<VpnInstanceNames> listVpn = new ArrayList<>();
- listVpn.add(new VpnInstanceNamesBuilder().setKey(new VpnInstanceNamesKey(vpnName))
+ listVpn.add(new VpnInstanceNamesBuilder().withKey(new VpnInstanceNamesKey(vpnName))
.setVpnName(vpnName).setAssociatedSubnetType(VpnInstanceNames.AssociatedSubnetType
.V4Subnet).build());
- VpnInterfaceBuilder vpnb = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(interfaceName))
+ VpnInterfaceBuilder vpnb = new VpnInterfaceBuilder().withKey(new VpnInterfaceKey(interfaceName))
.setName(interfaceName)
.setVpnInstanceNames(listVpn)
.setRouterInterface(isRouterInterface);
String hostIp = new String(pod.getHostIpAddress().getValue());
UUID subnetId = UUID.nameUUIDFromBytes(hostIp.getBytes(StandardCharsets.UTF_8));
String gatewayIP = ipValue.replaceFirst("\\d+$", "1");
- Adjacency vmAdj = new AdjacencyBuilder().setKey(new AdjacencyKey(ipPrefix)).setIpAddress(ipPrefix)
+ Adjacency vmAdj = new AdjacencyBuilder().withKey(new AdjacencyKey(ipPrefix)).setIpAddress(ipPrefix)
.setMacAddress(macAddress).setAdjacencyType(Adjacency.AdjacencyType.PrimaryAdjacency)
.setSubnetId(new Uuid(subnetId.toString())).setSubnetGatewayIp(gatewayIP).build();
if (!adjList.contains(vmAdj)) {
DesignatedSwitchForTunnel designatedSwitchForTunnel =
new DesignatedSwitchForTunnelBuilder().setDpId(dpnId.longValue())
.setElanInstanceName(elanInstanceName).setTunnelRemoteIpAddress(tunnelIp)
- .setKey(designatedSwitchForTunnelKey).build();
+ .withKey(designatedSwitchForTunnelKey).build();
LOG.trace("Writing into CONFIG DS tunnelIp {}, elanInstanceName {}, dpnId {}", tunnelIp, elanInstanceName,
dpnId);
MDSALUtil.syncUpdate(broker, LogicalDatastoreType.CONFIGURATION, instanceIdentifier, designatedSwitchForTunnel);
.setMacEntryKey(new MacAddress(UNKNOWN_DMAC))
.setLogicalSwitchRef(lsRef).build();
InstanceIdentifier<RemoteMcastMacs> iid = HwvtepSouthboundUtils.createRemoteMcastMacsInstanceIdentifier(
- dstDevice.getNodeId(), remoteMcastMacs.getKey());
+ dstDevice.getNodeId(), remoteMcastMacs.key());
ReadOnlyTransaction transaction = broker.newReadOnlyTransaction();
try {
//TODO do async mdsal read
}
return Collections.singletonList(txRunner.callWithNewReadWriteTransactionAndSubmit(
tx -> putRemoteMcastMac(tx, elanInstanceName, device,
- tunnelInterface.getAugmentation(IfTunnel.class).getTunnelSource())));
+ tunnelInterface.augmentation(IfTunnel.class).getTunnelSource())));
}
return Collections.emptyList();
});
@Override
protected void remove(InstanceIdentifier<Interface> identifier, Interface del) {
jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(del.getName()), () -> {
- IfTunnel tunnelInterface = del.getAugmentation(IfTunnel.class);
- IfL2vlan vlanInterface = del.getAugmentation(IfL2vlan.class);
+ IfTunnel tunnelInterface = del.augmentation(IfTunnel.class);
+ IfL2vlan vlanInterface = del.augmentation(IfL2vlan.class);
String interfaceName = del.getName();
if (tunnelInterface != null && !tunnelInterface.isInternal()) {
IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
- ParentRefs interfce = del.getAugmentation(ParentRefs.class);
+ ParentRefs interfce = del.augmentation(ParentRefs.class);
if (interfce != null) {
if (LOG.isTraceEnabled()) {
LOG.trace("Calling handleTunnelStateDown for tunnelIp {} and interface {}",
protected void add(InstanceIdentifier<Interface> identifier, Interface add) {
jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(add.getName()), () -> {
String interfaceName = add.getName();
- IfL2vlan vlanInterface = add.getAugmentation(IfL2vlan.class);
+ IfL2vlan vlanInterface = add.augmentation(IfL2vlan.class);
if (vlanInterface == null) {
return Collections.emptyList();
}
private static final Predicate<Optional<Node>> CONTAINS_GLOBAL_AUGMENTATION =
(optionalNode) -> optionalNode.isPresent()
- && optionalNode.get().getAugmentation(HwvtepGlobalAugmentation.class) != null;
+ && optionalNode.get().augmentation(HwvtepGlobalAugmentation.class) != null;
private static final Predicate<Optional<Node>> CONTAINS_SWITCH_AUGMENTATION =
(optionalNode) -> optionalNode.isPresent()
- && optionalNode.get().getAugmentation(PhysicalSwitchAugmentation.class) != null;
+ && optionalNode.get().augmentation(PhysicalSwitchAugmentation.class) != null;
private final DataBroker dataBroker;
private final L2GatewayCache l2GatewayCache;
if (!CONTAINS_GLOBAL_AUGMENTATION.test(nodeOptional)) {
return null;
}
- List<Switches> switchIids = nodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class).getSwitches();
+ List<Switches> switchIids = nodeOptional.get().augmentation(HwvtepGlobalAugmentation.class).getSwitches();
if (EMPTY_LIST.test(switchIids)) {
return null;
}
if (!CONTAINS_SWITCH_AUGMENTATION.test(nodeOptional)) {
return null;
}
- List<TunnelIps> tunnelIps = nodeOptional.get().getAugmentation(PhysicalSwitchAugmentation.class).getTunnelIps();
+ List<TunnelIps> tunnelIps = nodeOptional.get().augmentation(PhysicalSwitchAugmentation.class).getTunnelIps();
if (EMPTY_LIST.test(tunnelIps)) {
return null;
}
- return tunnelIps.get(0).getKey().getTunnelIpsKey();
+ return tunnelIps.get(0).key().getTunnelIpsKey();
}
}
}
private boolean isVnicTypeDirectOrMacVtap(Port port) {
- PortBindingExtension portBinding = port.getAugmentation(PortBindingExtension.class);
+ PortBindingExtension portBinding = port.augmentation(PortBindingExtension.class);
if (portBinding == null || portBinding.getVnicType() == null) {
// By default, VNIC_TYPE is NORMAL
return false;
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie)
.setFlowPriority(flowPriority).setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority))
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority))
.setServiceName(serviceName).setServicePriority(servicePriority)
.setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
static SubnetToDhcpPort getSubnetToDhcpPort(Port port, String subnetId, String ipAddress) {
return new SubnetToDhcpPortBuilder()
- .setKey(new SubnetToDhcpPortKey(subnetId))
+ .withKey(new SubnetToDhcpPortKey(subnetId))
.setSubnetId(subnetId).setPortName(port.getUuid().getValue())
.setPortMacaddress(port.getMacAddress().getValue()).setPortFixedip(ipAddress).build();
}
LOG.trace("Updating InterfaceNameVmMacAddress map with {}, {}", interfaceName,vmMacAddress);
InterfaceNameMacAddress interfaceNameMacAddress =
new InterfaceNameMacAddressBuilder()
- .setKey(new InterfaceNameMacAddressKey(interfaceName))
+ .withKey(new InterfaceNameMacAddressKey(interfaceName))
.setInterfaceName(interfaceName).setMacAddress(vmMacAddress).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, instanceIdentifier, interfaceNameMacAddress,
WriteTransaction.CREATE_MISSING_PARENTS);
if (sn.isPresent()) {
builder = new SubnetmapBuilder(sn.get());
} else {
- builder = new SubnetmapBuilder().setKey(new SubnetmapKey(subnetId)).setId(subnetId);
+ builder = new SubnetmapBuilder().withKey(new SubnetmapKey(subnetId)).setId(subnetId);
}
return builder;
}
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface =
interfaceManager.getInterfaceInfoFromConfigDataStore(interfaceName);
if (iface != null) {
- IfTunnel tunnelInterface = iface.getAugmentation(IfTunnel.class);
+ IfTunnel tunnelInterface = iface.augmentation(IfTunnel.class);
if (tunnelInterface != null && !tunnelInterface.isInternal()) {
IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(dataBroker);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface =
interfaceManager.getInterfaceInfoFromConfigDataStore(interfaceName);
if (iface != null) {
- IfTunnel tunnelInterface = iface.getAugmentation(IfTunnel.class);
+ IfTunnel tunnelInterface = iface.augmentation(IfTunnel.class);
if (tunnelInterface != null && !tunnelInterface.isInternal()) {
IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(dataBroker);
return Collections.emptyList();
}
if (Tunnel.class.equals(iface.getType())) {
- IfTunnel tunnelInterface = iface.getAugmentation(IfTunnel.class);
+ IfTunnel tunnelInterface = iface.augmentation(IfTunnel.class);
if (tunnelInterface != null && !tunnelInterface.isInternal()) {
IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(dataBroker);
public Optional<EtreeInterface> getEtreeInterface(@Nonnull String interfaceName) {
Optional<ElanInterface> elanInterface = get(interfaceName);
return elanInterface.isPresent() ? Optional.fromNullable(
- elanInterface.get().getAugmentation(EtreeInterface.class)) : Optional.absent();
+ elanInterface.get().augmentation(EtreeInterface.class)) : Optional.absent();
}
@Nonnull
LOG.debug("Executing Get EtreeInstance command for {}", etreeName);
if (etreeName != null) {
ElanInstance elanInstance = elanProvider.getElanInstance(etreeName);
- if (elanInstance == null || elanInstance.getAugmentation(EtreeInstance.class) == null) {
+ if (elanInstance == null || elanInstance.augmentation(EtreeInstance.class) == null) {
session.getConsole().println("No Etree Instance present with name:" + etreeName);
} else {
session.getConsole().println(getEtreeHeaderOutput());
if (elanInstanceList != null && !elanInstanceList.isEmpty()) {
session.getConsole().println(getEtreeHeaderOutput());
for (ElanInstance elanInstance : elanInstanceList) {
- if (elanInstance.getAugmentation(EtreeInstance.class) != null) {
+ if (elanInstance.augmentation(EtreeInstance.class) != null) {
session.getConsole().println(String.format(ElanCLIUtils.ETREE_INTERFACE_CLI_FORMAT,
elanInstance.getElanInstanceName(), elanInstance.getMacTimeout(),
elanInstance.getElanTag(),
- elanInstance.getAugmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue(),
+ elanInstance.augmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue(),
elanInstance.getDescription()));
}
}
session.getConsole().println("Etree instance " + elanName + " does not exist.");
return null;
} else {
- if (elanInstance.getAugmentation(EtreeInstance.class) == null) {
+ if (elanInstance.augmentation(EtreeInstance.class) == null) {
session.getConsole().println("Etree instance " + elanName + " exists but isn't configured as Etree.");
return null;
}
LOG.debug("Deleting EtreeInterface command etreeName:{}, interfaceName:{}", etreeName, interfaceName);
ElanInterface existingInterface =
elanProvider.getElanInterfaceByElanInterfaceName(interfaceName);
- if (existingInterface == null || existingInterface.getAugmentation(EtreeInterface.class) == null) {
+ if (existingInterface == null || existingInterface.augmentation(EtreeInterface.class) == null) {
session.getConsole()
.println("Etree interface doesn't exist or isn't configured as etree: " + interfaceName);
}
LOG.debug("Executing Get EtreeInterface command for the corresponding Etree Instance {}", etreeName);
if (etreeName != null) {
ElanInstance elanInstance = elanProvider.getElanInstance(etreeName);
- if (elanInstance == null || elanInstance.getAugmentation(EtreeInstance.class) == null) {
+ if (elanInstance == null || elanInstance.augmentation(EtreeInstance.class) == null) {
session.getConsole().println("Etree instance doesn't exist or isn't configured as etree: " + etreeName);
return null;
}
if (operationalTopoOptional.isPresent()) {
for (Node node : operationalTopoOptional.get().getNode()) {
- InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
+ InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.key());
operationalNodes.put(nodeIid, node);
}
}
if (configTopoOptional.isPresent()) {
for (Node node : configTopoOptional.get().getNode()) {
- InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
+ InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.key());
configNodes.put(nodeIid, node);
}
}
Node node = entry.getValue();
Map<InstanceIdentifier, DataObject> map = new HashMap<>();
dataMap.put(nodeId, map);
- if (node.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
+ if (node.augmentation(HwvtepGlobalAugmentation.class) != null) {
for (MergeCommand command : globalCommands) {
- List<DataObject> data = command.getData(node.getAugmentation(HwvtepGlobalAugmentation.class));
+ List<DataObject> data = command.getData(node.augmentation(HwvtepGlobalAugmentation.class));
if (data != null) {
for (DataObject dataObject : data) {
map.put(command.generateId(nodeId, dataObject), dataObject);
*/
private void verifyConfigVsOperationalDiff() {
for (Node cfgNode : configNodes.values()) {
- InstanceIdentifier<Node> nodeId = topoIid.child(Node.class, cfgNode.getKey());
+ InstanceIdentifier<Node> nodeId = topoIid.child(Node.class, cfgNode.key());
compareNodes(cfgNode, operationalNodes.get(nodeId), false, LogicalDatastoreType.CONFIGURATION);
}
}
}
private boolean containsLogicalSwitch(Node node) {
- if (node == null || node.getAugmentation(HwvtepGlobalAugmentation.class) == null
+ if (node == null || node.augmentation(HwvtepGlobalAugmentation.class) == null
|| HwvtepHAUtil.isEmptyList(
- node.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches())) {
+ node.augmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches())) {
return false;
}
return true;
NodeId nodeId1 = nodeIid1.firstKeyOf(Node.class).getNodeId();
NodeId nodeId2 = nodeIid2.firstKeyOf(Node.class).getNodeId();
- PhysicalSwitchAugmentation psAug1 = node1.getAugmentation(PhysicalSwitchAugmentation.class);
- PhysicalSwitchAugmentation psAug2 = node2.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation psAug1 = node1.augmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation psAug2 = node2.augmentation(PhysicalSwitchAugmentation.class);
- HwvtepGlobalAugmentation aug1 = node1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation aug2 = node2.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation aug1 = node1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation aug2 = node2.augmentation(HwvtepGlobalAugmentation.class);
boolean globalNodes = psAug1 == null && psAug2 == null ? true : false;
MergeCommand[] commands = globalNodes ? globalCommands : physicalSwitchCommands;
RemoteMcastMacs remoteMcastMac = new RemoteMcastMacsBuilder()
.setMacEntryKey(new MacAddress(ElanConstants.UNKNOWN_DMAC)).setLogicalSwitchRef(lsRef).build();
InstanceIdentifier<RemoteMcastMacs> mcastMacIid = HwvtepSouthboundUtils
- .createRemoteMcastMacsInstanceIdentifier(new NodeId(new Uri(nodeId)), remoteMcastMac.getKey());
+ .createRemoteMcastMacsInstanceIdentifier(new NodeId(new Uri(nodeId)), remoteMcastMac.key());
if (!isPresent(configNodesData, nodeIid, mcastMacIid)) {
expectedVlans.add(HwvtepSouthboundUtils.createVlanBinding(nodeId, defaultVlanId, logicalSwitchName));
}
- HwvtepPhysicalPortAugmentation portAugmentation = configTerminationPoint.getAugmentation(
+ HwvtepPhysicalPortAugmentation portAugmentation = configTerminationPoint.augmentation(
HwvtepPhysicalPortAugmentation.class);
if (portAugmentation == null || HwvtepHAUtil.isEmptyList(portAugmentation.getVlanBindings())) {
pw.println("Failed to find the config vlan bindings for port " + deviceInterface.getInterfaceName()
valid = false;
continue;
}
- portAugmentation = operationalTerminationPoint.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ portAugmentation = operationalTerminationPoint.augmentation(HwvtepPhysicalPortAugmentation.class);
if (portAugmentation == null || HwvtepHAUtil.isEmptyList(portAugmentation.getVlanBindings())) {
pw.println("Failed to find the operational vlan bindings for port " + deviceInterface.getInterfaceName()
+ " for node " + hwVtepDevice.getDeviceName() + " for logical switch " + logicalSwitchName
}
VlanBindings expectedBindings = !expectedVlans.isEmpty() ? expectedVlans.get(0) : null;
boolean foundBindings = false;
- List<VlanBindings> vlanBindingses = configTerminationPoint.getAugmentation(
+ List<VlanBindings> vlanBindingses = configTerminationPoint.augmentation(
HwvtepPhysicalPortAugmentation.class).getVlanBindings();
for (VlanBindings actual : vlanBindingses) {
if (actual.equals(expectedBindings)) {
void printRemoteUcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("RemoteUCast macs :");
session.getConsole().println(HEADINGUCAST);
- if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (hwvtepNode == null || hwvtepNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<RemoteUcastMacs> remoteUcastMacs =
- hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getRemoteUcastMacs();
+ hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getRemoteUcastMacs();
if (remoteUcastMacs == null || remoteUcastMacs.isEmpty()) {
return;
}
void printLocalUcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("LocalUCast macs :");
session.getConsole().println(HEADINGUCAST);
- if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (hwvtepNode == null || hwvtepNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<LocalUcastMacs> localUcastMacs =
- hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
+ hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
if (localUcastMacs == null || localUcastMacs.isEmpty()) {
return;
}
void printLocalMcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("LocalMcast macs :");
session.getConsole().println(HEADINGMCAST);
- if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (hwvtepNode == null || hwvtepNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<LocalMcastMacs> localMcastMacs =
- hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getLocalMcastMacs();
+ hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getLocalMcastMacs();
if (localMcastMacs == null || localMcastMacs.isEmpty()) {
return;
}
void printRemoteMcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("RemoteMCast macs :");
session.getConsole().println(HEADINGMCAST);
- if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (hwvtepNode == null || hwvtepNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<RemoteMcastMacs> remoteMcastMacs =
- hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getRemoteMcastMacs();
+ hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getRemoteMcastMacs();
if (remoteMcastMacs == null || remoteMcastMacs.isEmpty()) {
return;
}
}
for (TerminationPoint terminationPoint : terminationPoints) {
HwvtepPhysicalPortAugmentation aug =
- terminationPoint.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ terminationPoint.augmentation(HwvtepPhysicalPortAugmentation.class);
if (aug == null || aug.getVlanBindings() == null) {
continue;
}
}
Node getPSnode(Node hwvtepNode, LogicalDatastoreType datastoreType) {
- if (hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) != null
- && hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches() != null) {
- for (Switches switches : hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches()) {
+ if (hwvtepNode.augmentation(HwvtepGlobalAugmentation.class) != null
+ && hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getSwitches() != null) {
+ for (Switches switches : hwvtepNode.augmentation(HwvtepGlobalAugmentation.class).getSwitches()) {
NodeId psNodeId = switches.getSwitchRef().getValue().firstKeyOf(Node.class).getNodeId();
return HwvtepUtils.getHwVtepNode(dataBroker, datastoreType, psNodeId);
}
ElanInstance update) {
String elanName = update.getElanInstanceName();
if (evpnUtils.isWithdrawEvpnRT2Routes(original, update)) {
- evpnUtils.withdrawEvpnRT2Routes(original.getAugmentation(EvpnAugmentation.class), elanName);
+ evpnUtils.withdrawEvpnRT2Routes(original.augmentation(EvpnAugmentation.class), elanName);
evpnMacVrfUtils.updateEvpnDmacFlows(original, false);
evpnUtils.programEvpnL2vniDemuxTable(elanName,
(elan, interfaceName) -> evpnUtils.bindElanServiceToExternalTunnel(elanName, interfaceName),
mdsalManager::installFlow);
} else if (evpnUtils.isAdvertiseEvpnRT2Routes(original, update)) {
- evpnUtils.advertiseEvpnRT2Routes(update.getAugmentation(EvpnAugmentation.class), elanName);
+ evpnUtils.advertiseEvpnRT2Routes(update.augmentation(EvpnAugmentation.class), elanName);
evpnMacVrfUtils.updateEvpnDmacFlows(update, true);
evpnUtils.programEvpnL2vniDemuxTable(elanName,
(elan, interfaceName) -> evpnUtils.unbindElanServiceFromExternalTunnel(elanName, interfaceName),
public InstanceIdentifier<MacVrfEntry> getMacVrfEntryIid(String rd, MacVrfEntry macVrfEntry) {
return InstanceIdentifier.create(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd))
- .child(MacVrfEntry.class, macVrfEntry.getKey());
+ .child(MacVrfEntry.class, macVrfEntry.key());
}
public void updateEvpnDmacFlows(final ElanInstance elanInstance, final boolean install) {
LOG.debug("getL3vpnNameFromElan :elanInfo is NULL");
return null;
}
- EvpnAugmentation evpnAugmentation = elanInfo.getAugmentation(EvpnAugmentation.class);
+ EvpnAugmentation evpnAugmentation = elanInfo.augmentation(EvpnAugmentation.class);
return evpnAugmentation != null ? evpnAugmentation.getL3vpnName() : null;
}
LOG.debug("getEvpnNameFromElan :elanInfo is NULL");
return null;
}
- EvpnAugmentation evpnAugmentation = elanInfo.getAugmentation(EvpnAugmentation.class);
+ EvpnAugmentation evpnAugmentation = elanInfo.augmentation(EvpnAugmentation.class);
return evpnAugmentation != null ? evpnAugmentation.getEvpnName() : null;
}
List<TerminationPoint> newTerminationPoints = new ArrayList<>();
for (TerminationPoint tp : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ tp.augmentation(OvsdbTerminationPointAugmentation.class);
TerminationPointBuilder tpBuilder = new TerminationPointBuilder(tp);
if (ovsdbTerminationPointAugmentation != null) {
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
LOG.debug("dpninterfaces update fired new size {}", dpnInterfaces.getInterfaces().size());
if (dpnInterfaces.getInterfaces().isEmpty()) {
elanInstanceDpnsCache.remove(getElanName(identifier), dpnInterfaces);
- LOG.debug("dpninterfaces last dpn interface on this elan {} ", dpnInterfaces.getKey());
+ LOG.debug("dpninterfaces last dpn interface on this elan {} ", dpnInterfaces.key());
// this is the last dpn interface on this elan
handleUpdate(identifier, dpnInterfaces);
}
})), ElanConstants.JOB_MAX_RETRIES));
// Release tag
ElanUtils.releaseId(idManager, ElanConstants.ELAN_ID_POOL_NAME, elanName);
- if (deletedElan.getAugmentation(EtreeInstance.class) != null) {
+ if (deletedElan.augmentation(EtreeInstance.class) != null) {
removeEtreeInstance(deletedElan);
}
}
ElanUtils.delete(broker, LogicalDatastoreType.OPERATIONAL,
ElanUtils.getElanInfoEntriesOperationalDataPath(
- deletedElan.getAugmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue()));
+ deletedElan.augmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue()));
}
@Override
// Sometimes elan service is not unbound on the interface when the user does nova delete followed
// by neutron port delete since interface config is deleted a bit later. so adding logic to
// unbind service for interface config removal.
- if (intrf == null || intrf.getAugmentation(IfL2vlan.class) == null) {
+ if (intrf == null || intrf.augmentation(IfL2vlan.class) == null) {
LOG.debug("The interface {} is not a L2 interface. Ignoring it", intrf);
return;
}
private void removeLeavesLocalBroadcastGroup(ElanInstance elanInfo, InterfaceInfo interfaceInfo,
WriteTransaction deleteFlowGroupTx) {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
BigInteger dpnId = interfaceInfo.getDpId();
long groupId = ElanUtils.getEtreeLeafLocalBCGId(etreeInstance.getEtreeLeafTagVal().getValue());
private void removeLeavesEtreeBroadcastGroup(ElanInstance elanInfo, InterfaceInfo interfaceInfo,
WriteTransaction deleteFlowGroupTx) {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
long etreeTag = etreeInstance.getEtreeLeafTagVal().getValue();
int bucketId = 0;
ElanUtils.getElanInfoEntriesOperationalDataPath(elanInfo.getElanTag()));
} else {
Elan updateElanState = new ElanBuilder().setElanInterfaces(elanInterfaces).setName(elanName)
- .setKey(new ElanKey(elanName)).build();
+ .withKey(new ElanKey(elanName)).build();
tx.put(LogicalDatastoreType.OPERATIONAL, ElanUtils.getElanInstanceOperationalDataPath(elanName),
updateElanState);
}
}
MacEntry macEntry = new MacEntryBuilder().setMacAddress(physAddress).setInterface(interfaceName)
- .setKey(new MacEntryKey(physAddress)).build();
+ .withKey(new MacEntryKey(physAddress)).build();
elanForwardingEntriesHandler.deleteElanInterfaceForwardingEntries(
elanInstanceCache.get(elanInstanceName).orNull(), interfaceInfo, macEntry);
}
int elanTag = elanInfo.getElanTag().intValue();
long groupId = ElanUtils.getElanRemoteBCGId(elanTag);
setBCGrouponOtherDpns(elanInfo, dpId, elanTag, groupId);
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
int etreeLeafTag = etreeInstance.getEtreeLeafTagVal().getValue().intValue();
long etreeLeafGroupId = ElanUtils.getEtreeLeafRemoteBCGId(etreeLeafTag);
private void setupLeavesLocalBroadcastGroups(ElanInstance elanInfo, DpnInterfaces newDpnInterface,
InterfaceInfo interfaceInfo) {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
List<Bucket> listBucket = new ArrayList<>();
int bucketId = 0;
private void setupEtreeTerminateServiceTable(ElanInstance elanInfo, BigInteger dpId,
WriteTransaction writeFlowGroupTx) {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
setupTerminateServiceTable(elanInfo, dpId, etreeInstance.getEtreeLeafTagVal().getValue(), writeFlowGroupTx);
}
private void bindEtreeService(ElanInstance elanInfo, ElanInterface elanInterface, int lportTag,
WriteTransaction tx) {
- if (elanInterface.getAugmentation(EtreeInterface.class).getEtreeInterfaceType() == EtreeInterfaceType.Root) {
+ if (elanInterface.augmentation(EtreeInterface.class).getEtreeInterfaceType() == EtreeInterfaceType.Root) {
bindElanService(elanInfo.getElanTag(), elanInfo.getElanInstanceName(), elanInterface.getName(),
lportTag, tx);
} else {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance == null) {
LOG.error("EtreeInterface {} is associated with a non EtreeInstance: {}",
elanInterface.getName(), elanInfo.getElanInstanceName());
}
private boolean isStandardElanService(ElanInterface elanInterface) {
- return elanInterface.getAugmentation(EtreeInterface.class) == null;
+ return elanInterface.augmentation(EtreeInterface.class) == null;
}
protected void unbindService(String interfaceName, ReadWriteTransaction tx) throws ReadFailedException {
private DpnInterfaces updateElanDpnInterfacesList(String elanInstanceName, BigInteger dpId,
List<String> interfaceNames, WriteTransaction tx) {
DpnInterfaces dpnInterface = new DpnInterfacesBuilder().setDpId(dpId).setInterfaces(interfaceNames)
- .setKey(new DpnInterfacesKey(dpId)).build();
+ .withKey(new DpnInterfacesKey(dpId)).build();
tx.put(LogicalDatastoreType.OPERATIONAL,
ElanUtils.getElanDpnInterfaceOperationalDataPath(elanInstanceName, dpId), dpnInterface,
WriteTransaction.CREATE_MISSING_PARENTS);
List<String> interfaceNames = new ArrayList<>();
interfaceNames.add(interfaceName);
DpnInterfaces dpnInterface = new DpnInterfacesBuilder().setDpId(dpId).setInterfaces(interfaceNames)
- .setKey(new DpnInterfacesKey(dpId)).build();
+ .withKey(new DpnInterfacesKey(dpId)).build();
tx.put(LogicalDatastoreType.OPERATIONAL,
ElanUtils.getElanDpnInterfaceOperationalDataPath(elanInstanceName, dpId), dpnInterface,
WriteTransaction.CREATE_MISSING_PARENTS);
// Static-Mac Entries..
if (!interfaceMacTables.isPresent()) {
ElanInterfaceMac elanInterfaceMacTable = new ElanInterfaceMacBuilder().setElanInterface(interfaceName)
- .setKey(new ElanInterfaceMacKey(interfaceName)).build();
+ .withKey(new ElanInterfaceMacKey(interfaceName)).build();
tx.put(LogicalDatastoreType.OPERATIONAL,
ElanUtils.getElanInterfaceMacEntriesOperationalDataPath(interfaceName), elanInterfaceMacTable,
WriteTransaction.CREATE_MISSING_PARENTS);
}
interfaceLists.add(interfaceName);
Elan elanState = new ElanBuilder().setName(elanInstanceName).setElanInterfaces(interfaceLists)
- .setKey(new ElanKey(elanInstanceName)).build();
+ .withKey(new ElanKey(elanInstanceName)).build();
tx.put(LogicalDatastoreType.OPERATIONAL, ElanUtils.getElanInstanceOperationalDataPath(elanInstanceName),
elanState, WriteTransaction.CREATE_MISSING_PARENTS);
}
BigInteger timeStamp = new BigInteger(String.valueOf(System.currentTimeMillis()));
PhysAddress physAddress = new PhysAddress(macAddress);
MacEntry macEntry = new MacEntryBuilder().setInterface(interfaceName).setMacAddress(physAddress)
- .setKey(new MacEntryKey(physAddress)).setControllerLearnedForwardingEntryTimestamp(timeStamp)
+ .withKey(new MacEntryKey(physAddress)).setControllerLearnedForwardingEntryTimestamp(timeStamp)
.setIsStaticAddress(false).build();
InstanceIdentifier<MacEntry> macEntryId = ElanUtils
.getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName, physAddress);
BigInteger timeStamp = new BigInteger(String.valueOf(System.currentTimeMillis()));
if (!srcIpAddress.isPresent()) {
newMacEntry = new MacEntryBuilder().setInterface(interfaceName).setMacAddress(physAddress)
- .setKey(new MacEntryKey(physAddress))
+ .withKey(new MacEntryKey(physAddress))
.setControllerLearnedForwardingEntryTimestamp(timeStamp)
.setIsStaticAddress(false).build();
} else {
newMacEntry = new MacEntryBuilder().setInterface(interfaceName).setMacAddress(physAddress)
- .setIpPrefix(srcIpAddress.get()).setKey(new MacEntryKey(physAddress))
+ .setIpPrefix(srcIpAddress.get()).withKey(new MacEntryKey(physAddress))
.setControllerLearnedForwardingEntryTimestamp(timeStamp)
.setIsStaticAddress(false).build();
}
} else {
ElanInstance updateElanInstance = new ElanInstanceBuilder().setElanInstanceName(elanInstanceName)
.setDescription(description).setMacTimeout(macTimeout)
- .setKey(new ElanInstanceKey(elanInstanceName)).build();
+ .withKey(new ElanInstanceKey(elanInstanceName)).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanHelper.getElanInstanceConfigurationDataPath(elanInstanceName), updateElanInstance);
LOG.debug("Updating the Elan Instance {} with MAC TIME-OUT {} and Description {}",
}
} else {
ElanInstance elanInstance = new ElanInstanceBuilder().setElanInstanceName(elanInstanceName)
- .setMacTimeout(macTimeout).setDescription(description).setKey(new ElanInstanceKey(elanInstanceName))
- .build();
+ .setMacTimeout(macTimeout).setDescription(description)
+ .withKey(new ElanInstanceKey(elanInstanceName)).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanHelper.getElanInstanceConfigurationDataPath(elanInstanceName), elanInstance);
LOG.debug("Creating the new Elan Instance {}", elanInstance);
EtreeInstance etreeInstance = new EtreeInstanceBuilder().build();
ElanInstance updateElanInstance = new ElanInstanceBuilder().setElanInstanceName(elanInstanceName)
.setDescription(description).setMacTimeout(macTimeout)
- .setKey(new ElanInstanceKey(elanInstanceName))
+ .withKey(new ElanInstanceKey(elanInstanceName))
.addAugmentation(EtreeInstance.class, etreeInstance).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanHelper.getElanInstanceConfigurationDataPath(elanInstanceName), updateElanInstance);
} else {
EtreeInstance etreeInstance = new EtreeInstanceBuilder().build();
ElanInstance elanInstance = new ElanInstanceBuilder().setElanInstanceName(elanInstanceName)
- .setMacTimeout(macTimeout).setDescription(description).setKey(new ElanInstanceKey(elanInstanceName))
+ .setMacTimeout(macTimeout).setDescription(description)
+ .withKey(new ElanInstanceKey(elanInstanceName))
.addAugmentation(EtreeInstance.class, etreeInstance).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanHelper.getElanInstanceConfigurationDataPath(elanInstanceName), elanInstance);
List<String> staticMacAddresses, String description) {
Optional<ElanInstance> existingElanInstance = elanInstanceCache.get(etreeInstanceName);
if (existingElanInstance.isPresent()
- && existingElanInstance.get().getAugmentation(EtreeInstance.class) != null) {
+ && existingElanInstance.get().augmentation(EtreeInstance.class) != null) {
EtreeInterface etreeInterface = new EtreeInterfaceBuilder().setEtreeInterfaceType(interfaceType).build();
ElanInterface elanInterface;
if (staticMacAddresses == null) {
elanInterface = new ElanInterfaceBuilder().setElanInstanceName(etreeInstanceName)
- .setDescription(description).setName(interfaceName).setKey(new ElanInterfaceKey(interfaceName))
+ .setDescription(description).setName(interfaceName).withKey(new ElanInterfaceKey(interfaceName))
.addAugmentation(EtreeInterface.class, etreeInterface).build();
} else {
List<StaticMacEntries> staticMacEntries = ElanUtils.getStaticMacEntries(staticMacAddresses);
elanInterface = new ElanInterfaceBuilder().setElanInstanceName(etreeInstanceName)
.setDescription(description).setName(interfaceName)
.setStaticMacEntries(staticMacEntries)
- .setKey(new ElanInterfaceKey(interfaceName))
+ .withKey(new ElanInterfaceKey(interfaceName))
.addAugmentation(EtreeInterface.class, etreeInterface).build();
}
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanInterfaceBuilder elanInterfaceBuilder = new ElanInterfaceBuilder()
.setElanInstanceName(elanInstanceName)
.setDescription(description).setName(interfaceName)
- .setKey(new ElanInterfaceKey(interfaceName));
+ .withKey(new ElanInterfaceKey(interfaceName));
if (staticMacAddresses != null) {
List<StaticMacEntries> staticMacEntries = ElanUtils.getStaticMacEntries(staticMacAddresses);
elanInterfaceBuilder.setStaticMacEntries(staticMacEntries);
LOG.debug("updating the ElanInterface with new Mac Entries {}", updatedStaticMacAddresses);
ElanInterface elanInterface = new ElanInterfaceBuilder().setElanInstanceName(elanInstanceName)
.setName(interfaceName).setDescription(newDescription).setStaticMacEntries(updatedStaticMacEntries)
- .setKey(new ElanInterfaceKey(interfaceName)).build();
+ .withKey(new ElanInterfaceKey(interfaceName)).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION,
ElanUtils.getElanInterfaceConfigurationDataPathId(interfaceName), elanInterface);
}
public static ManagerOtherConfigsBuilder getOtherConfigBuilder(String key, String val) {
ManagerOtherConfigsBuilder otherConfigsBuilder = new ManagerOtherConfigsBuilder();
ManagerOtherConfigsKey otherConfigsKey = new ManagerOtherConfigsKey(key);
- otherConfigsBuilder.setKey(otherConfigsKey);
+ otherConfigsBuilder.withKey(otherConfigsKey);
otherConfigsBuilder.setOtherConfigKey(key);
otherConfigsBuilder.setOtherConfigValue(val);
return otherConfigsBuilder;
}
public static String getHAIdFromManagerOtherConfig(Node node) {
- if (node.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (node.augmentation(HwvtepGlobalAugmentation.class) == null) {
return null;
}
- HwvtepGlobalAugmentation globalAugmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation globalAugmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (globalAugmentation != null) {
List<Managers> managers = globalAugmentation.getManagers();
if (managers != null && managers.size() > 0 && managers.get(0).getManagerOtherConfigs() != null) {
return childNodeIds;
}
HwvtepGlobalAugmentation augmentation =
- haGlobalConfigNodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class);
+ haGlobalConfigNodeOptional.get().augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getManagers() != null
&& augmentation.getManagers().size() > 0) {
Managers managers = augmentation.getManagers().get(0);
public static HwvtepGlobalAugmentation getGlobalAugmentationOfNode(Node node) {
HwvtepGlobalAugmentation result = null;
if (node != null) {
- result = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ result = node.augmentation(HwvtepGlobalAugmentation.class);
}
if (result == null) {
result = new HwvtepGlobalAugmentationBuilder().build();
public static PhysicalSwitchAugmentation getPhysicalSwitchAugmentationOfNode(Node psNode) {
PhysicalSwitchAugmentation result = null;
if (psNode != null) {
- result = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
+ result = psNode.augmentation(PhysicalSwitchAugmentation.class);
}
if (result == null) {
result = new PhysicalSwitchAugmentationBuilder().build();
ManagersBuilder builder1 = new ManagersBuilder();
- builder1.setKey(new ManagersKey(new Uri(MANAGER_KEY)));
+ builder1.withKey(new ManagersKey(new Uri(MANAGER_KEY)));
List<ManagerOtherConfigs> otherConfigses = new ArrayList<>();
String children = nodeIds.stream().map(NodeId::getValue).collect(Collectors.joining(","));
otherConfigses.add(getOtherConfigBuilder(HA_CHILDREN, children).build());
boolean switchesAlreadyPresent = false;
if (haNode.isPresent()) {
Node node = haNode.get();
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null) {
if (augmentation.getSwitches() != null) {
if (augmentation.getSwitches().size() > 0) {
}
}
if (!switchesAlreadyPresent) {
- HwvtepGlobalAugmentation augmentation = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = childNode.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getSwitches() != null) {
List<Switches> src = augmentation.getSwitches();
if (src != null && src.size() > 0) {
ReadWriteTransaction tx)
throws ReadFailedException {
//read from switches attribute and clean up them
- HwvtepGlobalAugmentation globalAugmentation = haNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation globalAugmentation = haNode.augmentation(HwvtepGlobalAugmentation.class);
if (globalAugmentation == null) {
return;
}
Topology topology = topologyOptional.get();
if (topology.getNode() != null) {
for (Node psNode : topology.getNode()) {
- PhysicalSwitchAugmentation ps = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation ps = psNode.augmentation(PhysicalSwitchAugmentation.class);
if (ps != null) {
InstanceIdentifier<Node> iid = (InstanceIdentifier<Node>)ps.getManagedBy().getValue();
String nodeIdVal = iid.firstKeyOf(Node.class).getNodeId().getValue();
return;
}
Node node = nodeOptional.get();
- HwvtepGlobalAugmentation globalAugmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation globalAugmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (globalAugmentation == null) {
return;
}
@Override
public InstanceIdentifier<LocalMcastMacs> generateId(InstanceIdentifier<Node> id, LocalMcastMacs node) {
- HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
+ HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.key().getLogicalSwitchRef(), id);
LocalMcastMacsKey key = new LocalMcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(LocalMcastMacs.class, key);
ucmlBuilder.setMacEntryUuid(HwvtepHAUtil.getUUid(src.getMacEntryKey().getValue()));
LocalMcastMacsKey key = new LocalMcastMacsKey(ucmlBuilder.getLogicalSwitchRef(), ucmlBuilder.getMacEntryKey());
- ucmlBuilder.setKey(key);
+ ucmlBuilder.withKey(key);
return ucmlBuilder.build();
}
@Override
public Identifier getKey(LocalMcastMacs mac) {
- return mac.getKey();
+ return mac.key();
}
@Override
@Override
public InstanceIdentifier<LocalUcastMacs> generateId(InstanceIdentifier<Node> id, LocalUcastMacs node) {
- HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
+ HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.key().getLogicalSwitchRef(), id);
LocalUcastMacsKey key = new LocalUcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class, key);
HwvtepHAUtil.convertLogicalSwitchRef(src.getLogicalSwitchRef(), nodePath));
ucmlBuilder.setMacEntryUuid(HwvtepHAUtil.getUUid(src.getMacEntryKey().getValue()));
LocalUcastMacsKey key = new LocalUcastMacsKey(ucmlBuilder.getLogicalSwitchRef(), ucmlBuilder.getMacEntryKey());
- ucmlBuilder.setKey(key);
+ ucmlBuilder.withKey(key);
return ucmlBuilder.build();
}
@Override
public Identifier getKey(LocalUcastMacs data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public InstanceIdentifier<LogicalSwitches> generateId(InstanceIdentifier<Node> id, LogicalSwitches node) {
- return id.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, node.getKey());
+ return id.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, node.key());
}
@Override
@Override
public Identifier getKey(LogicalSwitches data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public InstanceIdentifier<TerminationPoint> generateId(InstanceIdentifier<Node> id, TerminationPoint node) {
- return id.child(TerminationPoint.class, node.getKey());
+ return id.child(TerminationPoint.class, node.key());
}
@Override
@Override
public Identifier getKey(TerminationPoint data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public boolean areEqual(TerminationPoint updated, TerminationPoint orig) {
HwvtepPhysicalLocatorAugmentation updatedPhysicalLocator =
- updated.getAugmentation(HwvtepPhysicalLocatorAugmentation.class);
+ updated.augmentation(HwvtepPhysicalLocatorAugmentation.class);
HwvtepPhysicalLocatorAugmentation origPhysicalLocator =
- orig.getAugmentation(HwvtepPhysicalLocatorAugmentation.class);
+ orig.augmentation(HwvtepPhysicalLocatorAugmentation.class);
return updatedPhysicalLocator.getDstIp().equals(origPhysicalLocator.getDstIp())
&& updatedPhysicalLocator.getEncapsulationType() == origPhysicalLocator.getEncapsulationType();
}
@Override
public InstanceIdentifier<RemoteMcastMacs> generateId(InstanceIdentifier<Node> id, RemoteMcastMacs node) {
- HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
+ HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.key().getLogicalSwitchRef(), id);
RemoteMcastMacsKey key = new RemoteMcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(RemoteMcastMacs.class, key);
RemoteMcastMacsKey key = new RemoteMcastMacsKey(ucmlBuilder.getLogicalSwitchRef(),
ucmlBuilder.getMacEntryKey());
- ucmlBuilder.setKey(key);
+ ucmlBuilder.withKey(key);
return ucmlBuilder.build();
}
@Override
public Identifier getKey(RemoteMcastMacs data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public InstanceIdentifier<RemoteUcastMacs> generateId(InstanceIdentifier<Node> id, RemoteUcastMacs node) {
- HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
+ HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.key().getLogicalSwitchRef(), id);
RemoteUcastMacsKey key = new RemoteUcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, key);
}
RemoteUcastMacsKey key = new RemoteUcastMacsKey(ucmlBuilder.getLogicalSwitchRef(),
ucmlBuilder.getMacEntryKey());
- ucmlBuilder.setKey(key);
+ ucmlBuilder.withKey(key);
return ucmlBuilder.build();
}
@Override
public Identifier getKey(RemoteUcastMacs data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public InstanceIdentifier<Switches> generateId(InstanceIdentifier<Node> id, Switches node) {
- SwitchesKey switchesKey = transform(id, node).getKey();
+ SwitchesKey switchesKey = transform(id, node).key();
return id.augmentation(HwvtepGlobalAugmentation.class).child(Switches.class, switchesKey);
}
InstanceIdentifier<Node> id2 = HwvtepHAUtil.convertToInstanceIdentifier(dstNodeId);
builder.setSwitchRef(new HwvtepPhysicalSwitchRef(id2));
- builder.setKey(new SwitchesKey(new HwvtepPhysicalSwitchRef(id2)));
+ builder.withKey(new SwitchesKey(new HwvtepPhysicalSwitchRef(id2)));
return builder.build();
}
@Override
public InstanceIdentifier<TerminationPoint> generateId(InstanceIdentifier<Node> id, TerminationPoint node) {
- return id.child(TerminationPoint.class, node.getKey());
+ return id.child(TerminationPoint.class, node.key());
}
@Override
public TerminationPoint transform(InstanceIdentifier<Node> nodePath, TerminationPoint src) {
- HwvtepPhysicalPortAugmentation augmentation = src.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ HwvtepPhysicalPortAugmentation augmentation = src.augmentation(HwvtepPhysicalPortAugmentation.class);
if (augmentation == null) {
return new TerminationPointBuilder(src).build();
}
@Override
public Identifier getKey(TerminationPoint data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public boolean areEqual(TerminationPoint updated, TerminationPoint orig) {
- if (!updated.getKey().equals(orig.getKey())) {
+ if (!updated.key().equals(orig.key())) {
return false;
}
HwvtepPhysicalPortAugmentation updatedAugmentation = updated
- .getAugmentation(HwvtepPhysicalPortAugmentation.class);
- HwvtepPhysicalPortAugmentation origAugmentation = orig.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ .augmentation(HwvtepPhysicalPortAugmentation.class);
+ HwvtepPhysicalPortAugmentation origAugmentation = orig.augmentation(HwvtepPhysicalPortAugmentation.class);
List<VlanBindings> up = updatedAugmentation != null ? updatedAugmentation.getVlanBindings() : null;
List<VlanBindings> or = origAugmentation != null ? origAugmentation.getVlanBindings() : null;
if (orig == null) {
return 1;
}
- if (updated.getKey().equals(orig.getKey())) {
+ if (updated.key().equals(orig.key())) {
return 0;
}
- updated.getKey();
+ updated.key();
return 1;
}
}
for (TerminationPoint origItem : orig) {
boolean found = false;
for (TerminationPoint newItem : updated) {
- if (newItem.getKey().equals(origItem.getKey())) {
+ if (newItem.key().equals(origItem.key())) {
found = true;
}
}
if (!found) {
boolean existsInConfig = false;
for (TerminationPoint existingItem : existing) {
- if (existingItem.getKey().equals(origItem.getKey())) {
+ if (existingItem.key().equals(origItem.key())) {
existsInConfig = true;
}
}
HwvtepPhysicalLocatorRef hwvtepPhysicalLocatorRef1 =
HwvtepHAUtil.convertLocatorRef(src.getRemoteLocatorRef(), nodePath);
- tunnelsBuilder.setKey(new TunnelsKey(hwvtepPhysicalLocatorRef,hwvtepPhysicalLocatorRef1));
+ tunnelsBuilder.withKey(new TunnelsKey(hwvtepPhysicalLocatorRef,hwvtepPhysicalLocatorRef1));
return tunnelsBuilder.build();
}
@Override
public Identifier getKey(Tunnels data) {
- return data.getKey();
+ return data.key();
}
@Override
@Override
public InstanceIdentifier<TunnelIps> generateId(InstanceIdentifier<Node> id, TunnelIps src) {
- return id.augmentation(PhysicalSwitchAugmentation.class).child(TunnelIps.class, src.getKey());
+ return id.augmentation(PhysicalSwitchAugmentation.class).child(TunnelIps.class, src.key());
}
@Override
@Override
public Identifier getKey(TunnelIps data) {
- return data.getKey();
+ return data.key();
}
@Override
return;
}
LOG.info("HA ps node not present cleanup child {}" , childNode);
- HwvtepGlobalAugmentation augmentation = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = childNode.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null) {
List<Switches> switches = augmentation.getSwitches();
if (switches != null) {
ReadWriteTransaction tx)
throws ReadFailedException {
- if (childGlobalNode == null || childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
+ if (childGlobalNode == null || childGlobalNode.augmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
- List<Switches> switches = childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches();
+ List<Switches> switches = childGlobalNode.augmentation(HwvtepGlobalAugmentation.class).getSwitches();
if (switches == null) {
return;
}
if (srcNode == null) {
return;
}
- HwvtepGlobalAugmentation src = srcNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation src = srcNode.augmentation(HwvtepGlobalAugmentation.class);
if (src == null) {
return;
}
if (childNode == null) {
return;
}
- HwvtepGlobalAugmentation childData = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation childData = childNode.augmentation(HwvtepGlobalAugmentation.class);
if (childData == null) {
return;
}
NodeBuilder childPsBuilder = HwvtepHAUtil.getNodeBuilderForPath(childPsPath);
PhysicalSwitchAugmentationBuilder dstBuilder = new PhysicalSwitchAugmentationBuilder();
- PhysicalSwitchAugmentation src = haPsNode.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation src = haPsNode.augmentation(PhysicalSwitchAugmentation.class);
psAugmentationMerger.mergeConfigData(dstBuilder, src, childPath);
psNodeMerger.mergeConfigData(childPsBuilder, haPsNode, childPath);
NodeBuilder haPSNodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(haPspath);
PhysicalSwitchAugmentationBuilder dstBuilder = new PhysicalSwitchAugmentationBuilder();
- PhysicalSwitchAugmentation src = childPsNode.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation src = childPsNode.augmentation(PhysicalSwitchAugmentation.class);
Node existingHAPSNode = HwvtepHAUtil.readNode(tx, OPERATIONAL, haPspath);
PhysicalSwitchAugmentation existingHAPSAugumentation =
return;
}
HwvtepGlobalAugmentation srcGlobalAugmentation =
- srcGlobalNodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class);
+ srcGlobalNodeOptional.get().augmentation(HwvtepGlobalAugmentation.class);
if (srcGlobalAugmentation == null) {
/**
* If Source HA Global Node is not present
//Also update the manager section in config which helps in cluster reboot scenarios
haBuilder.getManagers().forEach((manager) -> {
InstanceIdentifier<Managers> managerIid = dstPath.augmentation(HwvtepGlobalAugmentation.class)
- .child(Managers.class, manager.getKey());
+ .child(Managers.class, manager.key());
tx.put(CONFIGURATION, managerIid, manager, true);
});
PhysicalSwitchAugmentationBuilder dstPsAugmentationBuilder = new PhysicalSwitchAugmentationBuilder();
PhysicalSwitchAugmentation srcPsAugmenatation =
- srcPsNodeOptional.get().getAugmentation(PhysicalSwitchAugmentation.class);
+ srcPsNodeOptional.get().augmentation(PhysicalSwitchAugmentation.class);
Node existingDstPsNode = HwvtepHAUtil.readNode(tx, logicalDatastoreType, dstPsPath);
PhysicalSwitchAugmentation existingDstPsAugmentation =
private void readAndCopyChildPsOpToParent(Node childNode, ReadWriteTransaction tx) {
String childGlobalNodeId = childNode.getNodeId().getValue();
List<InstanceIdentifier> childPsIids = new ArrayList<>();
- HwvtepGlobalAugmentation hwvtepGlobalAugmentation = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation hwvtepGlobalAugmentation = childNode.augmentation(HwvtepGlobalAugmentation.class);
if (hwvtepGlobalAugmentation == null || HwvtepHAUtil.isEmpty(hwvtepGlobalAugmentation.getSwitches())) {
haOpClusteredListener.getConnectedNodes()
.stream()
new ImmutableMap.Builder<Class, Function<DataObject, String>>()
.put(LogicalSwitches.class, data -> ((LogicalSwitches) data).getHwvtepNodeName().getValue())
.put(RemoteMcastMacs.class, data -> {
- return logicalSwitchNameFromIid(((RemoteMcastMacs) data).getKey().getLogicalSwitchRef()
+ return logicalSwitchNameFromIid(((RemoteMcastMacs) data).key().getLogicalSwitchRef()
.getValue());
})
.put(RemoteUcastMacs.class, data -> {
- return logicalSwitchNameFromIid(((RemoteUcastMacs) data).getKey().getLogicalSwitchRef()
+ return logicalSwitchNameFromIid(((RemoteUcastMacs) data).key().getLogicalSwitchRef()
.getValue());
}).build();
*/
protected void addToHACacheIfBecameHAChild(InstanceIdentifier<Node> childPath, Node updatedChildNode,
Node beforeChildNode) {
- HwvtepGlobalAugmentation updatedAugmentaion = updatedChildNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation updatedAugmentaion = updatedChildNode.augmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation beforeAugmentaion = null;
if (beforeChildNode != null) {
- beforeAugmentaion = beforeChildNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ beforeAugmentaion = beforeChildNode.augmentation(HwvtepGlobalAugmentation.class);
}
List<Managers> up = null;
List<Managers> be = null;
@Override
protected void add(InstanceIdentifier<Managers> key, Managers managers) {
InstanceIdentifier<Node> parent = key.firstIdentifierOf(Node.class);
- if (managers.getKey().getTarget().getValue().contains(HwvtepHAUtil.MANAGER_KEY)
+ if (managers.key().getTarget().getValue().contains(HwvtepHAUtil.MANAGER_KEY)
&& managers.getManagerOtherConfigs() != null) {
managers.getManagerOtherConfigs().stream()
- .filter(otherConfig -> otherConfig.getKey().getOtherConfigKey().contains(HwvtepHAUtil.HA_CHILDREN))
+ .filter(otherConfig -> otherConfig.key().getOtherConfigKey().contains(HwvtepHAUtil.HA_CHILDREN))
.flatMap(otherConfig -> Arrays.stream(otherConfig.getOtherConfigValue().split(",")))
.map(HwvtepHAUtil::convertToInstanceIdentifier)
.forEach(childIid -> hwvtepNodeHACache.addChild(parent, childIid));
@Override
protected void remove(InstanceIdentifier<Group> identifier, Group del) {
- LOG.trace("received group removed {}", del.getKey().getGroupId());
+ LOG.trace("received group removed {}", del.key().getGroupId());
}
@Override
protected void update(InstanceIdentifier<Group> identifier, Group original, Group update) {
- LOG.trace("received group updated {}", update.getKey().getGroupId());
+ LOG.trace("received group updated {}", update.key().getGroupId());
final BigInteger dpnId = getDpnId(identifier.firstKeyOf(Node.class).getId().getValue());
if (dpnId == null) {
return;
List<L2GatewayDevice> allDevices = ElanL2GwCacheUtils.getAllElanDevicesFromCache();
if (allDevices == null || allDevices.isEmpty()) {
- LOG.trace("no elan devices present in cache {}", update.getKey().getGroupId());
+ LOG.trace("no elan devices present in cache {}", update.key().getGroupId());
return;
}
int expectedElanFootprint = 0;
final ElanInstance elanInstance = getElanInstanceFromGroupId(update);
if (elanInstance == null) {
- LOG.trace("no elan instance is null {}", update.getKey().getGroupId());
+ LOG.trace("no elan instance is null {}", update.key().getGroupId());
return;
}
ElanL2GwCacheUtils.getInvolvedL2GwDevices(elanInstance.getElanInstanceName());
if (devices == null || devices.isEmpty()) {
LOG.trace("no elan devices in elan cache {} {}", elanInstance.getElanInstanceName(),
- update.getKey().getGroupId());
+ update.key().getGroupId());
return;
}
boolean updateGroup = false;
updateGroup = true;
} else {
LOG.trace("no of buckets matched perfectly {} {}", elanInstance.getElanInstanceName(),
- update.getKey().getGroupId());
+ update.key().getGroupId());
}
}
if (updateGroup) {
return;
}
LOG.trace("no of buckets mismatched {} {}", elanInstance.getElanInstanceName(),
- update.getKey().getGroupId());
+ update.key().getGroupId());
elanClusterUtils.runOnlyInOwnerNode(elanInstance.getElanInstanceName(), "updating broadcast group", () -> {
elanL2GatewayMulticastUtils.setupElanBroadcastGroups(elanInstance, dpnId);
return null;
});
} else {
LOG.trace("no buckets in the update {} {}", elanInstance.getElanInstanceName(),
- update.getKey().getGroupId());
+ update.key().getGroupId());
}
}
@Override
protected void add(InstanceIdentifier<Group> identifier, Group added) {
- LOG.trace("received group add {}", added.getKey().getGroupId());
+ LOG.trace("received group add {}", added.key().getGroupId());
update(identifier, null/*original*/, added);
}
InstanceIdentifier<L2gatewayConnection> iid =
InstanceIdentifier.create(Neutron.class).child(
L2gatewayConnections.class).child(
- L2gatewayConnection.class, connection.getKey());
+ L2gatewayConnection.class, connection.key());
tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
}
});
protected void removed(InstanceIdentifier<TerminationPoint> identifier, TerminationPoint del) {
LOG.trace("physical locator removed {}", identifier);
final HwvtepPhysicalPortAugmentation portAugmentation =
- del.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ del.augmentation(HwvtepPhysicalPortAugmentation.class);
if (portAugmentation != null) {
elanClusterUtils.runOnlyInOwnerNode(HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
"Handling Physical port delete",
@Override
protected void added(InstanceIdentifier<TerminationPoint> identifier, final TerminationPoint add) {
final HwvtepPhysicalPortAugmentation portAugmentation =
- add.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ add.augmentation(HwvtepPhysicalPortAugmentation.class);
if (portAugmentation != null) {
final NodeId nodeId = identifier.firstIdentifierOf(Node.class).firstKeyOf(Node.class).getNodeId();
elanClusterUtils.runOnlyInOwnerNode(HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
private List<ListenableFuture<Void>> handlePortAdded(TerminationPoint portAdded, NodeId psNodeId) {
Node psNode = HwvtepUtils.getHwVtepNode(broker, LogicalDatastoreType.OPERATIONAL, psNodeId);
if (psNode != null) {
- String psName = psNode.getAugmentation(PhysicalSwitchAugmentation.class).getHwvtepNodeName().getValue();
+ String psName = psNode.augmentation(PhysicalSwitchAugmentation.class).getHwvtepNodeName().getValue();
L2GatewayDevice l2GwDevice = l2GatewayCache.get(psName);
if (l2GwDevice != null) {
if (isL2GatewayConfigured(l2GwDevice)) {
HwvtepHAUtil.getPsName(psIid) != null;
private static final Predicate<Node> IS_HA_PARENT_NODE = (node) -> {
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getManagers() != null) {
return augmentation.getManagers().stream().anyMatch(
- manager -> manager.getKey().getTarget().getValue().equals(HwvtepHAUtil.MANAGER_KEY));
+ manager -> manager.key().getTarget().getValue().equals(HwvtepHAUtil.MANAGER_KEY));
}
return false;
};
l2GwDevice.setConnected(true);
l2GwDevice.setHwvtepNodeId(globalNode.getNodeId().getValue());
- List<TunnelIps> tunnelIps = psNode.getAugmentation(PhysicalSwitchAugmentation.class) != null
- ? psNode.getAugmentation(PhysicalSwitchAugmentation.class).getTunnelIps() : null;
+ List<TunnelIps> tunnelIps = psNode.augmentation(PhysicalSwitchAugmentation.class) != null
+ ? psNode.augmentation(PhysicalSwitchAugmentation.class).getTunnelIps() : null;
if (tunnelIps != null) {
for (TunnelIps tunnelIp : tunnelIps) {
IpAddress tunnelIpAddr = tunnelIp.getTunnelIpsKey();
LocalUcastMacs mac = afterMac != null ? afterMac : (LocalUcastMacs)childMod.getDataBefore();
InstanceIdentifier<LocalUcastMacs> iid = parentIid
.augmentation(HwvtepGlobalAugmentation.class)
- .child(LocalUcastMacs.class, mac.getKey());
+ .child(LocalUcastMacs.class, mac.key());
result.put(iid, (DataObjectModification<LocalUcastMacs>) childMod);
});
}
InstanceIdentifier<LocalUcastMacs> getMacIid(InstanceIdentifier<Node> nodeIid, LocalUcastMacs mac) {
return nodeIid.augmentation(HwvtepGlobalAugmentation.class)
- .child(LocalUcastMacs.class, mac.getKey());
+ .child(LocalUcastMacs.class, mac.key());
}
private Set<LocalUcastMacs> getMacs(@Nullable Node node) {
if (node != null) {
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getLocalUcastMacs() != null) {
return new HashSet<>(augmentation.getLocalUcastMacs());
}
}
public void setupLeavesEtreeBroadcastGroups(ElanInstance elanInfo, DpnInterfaces dpnInterfaces, BigInteger dpnId) {
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance != null) {
long etreeLeafTag = etreeInstance.getEtreeLeafTagVal().getValue();
List<Bucket> listBucket = new ArrayList<>();
try {
operElanInstance = new SingleTransactionDataBroker(broker).syncReadOptional(
LogicalDatastoreType.OPERATIONAL,
- InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, elanInfo.getKey())
+ InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, elanInfo.key())
.build()).orNull();
} catch (ReadFailedException e) {
LOG.error("Failed to read elan instance operational path {}", elanInfo, e);
InstanceIdentifier<TerminationPoint> iid =
HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, phyLocatorAug);
TerminationPoint terminationPoint = new TerminationPointBuilder()
- .setKey(HwvtepSouthboundUtils.getTerminationPointKey(phyLocatorAug))
+ .withKey(HwvtepSouthboundUtils.getTerminationPointKey(phyLocatorAug))
.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, phyLocatorAug).build();
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY,
iid, terminationPoint);
.setMacEntryKey(new MacAddress(ElanConstants.UNKNOWN_DMAC)).setLogicalSwitchRef(lsRef)
.setLocatorSet(locators).build();
InstanceIdentifier<RemoteMcastMacs> iid = HwvtepSouthboundUtils.createRemoteMcastMacsInstanceIdentifier(nodeId,
- remoteMcastMac.getKey());
+ remoteMcastMac.key());
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY,
iid, remoteMcastMac);
@Override
public void onSuccess(Optional<Node> configNode) {
if (configNode != null && configNode.isPresent()) {
- HwvtepGlobalAugmentation augmentation = configNode.get().getAugmentation(
+ HwvtepGlobalAugmentation augmentation = configNode.get().augmentation(
HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getLocalUcastMacs() != null) {
macs.addAll(augmentation.getLocalUcastMacs().stream()
List<MacAddress> lstMacs = Collections.emptyList();
Node hwvtepNode = HwvtepUtils.getHwVtepNode(broker, datastoreType, hwvtepNodeId);
if (hwvtepNode != null) {
- List<RemoteUcastMacs> remoteUcastMacs = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class)
+ List<RemoteUcastMacs> remoteUcastMacs = hwvtepNode.augmentation(HwvtepGlobalAugmentation.class)
.getRemoteUcastMacs();
if (remoteUcastMacs != null && !remoteUcastMacs.isEmpty()) {
// Filtering remoteUcastMacs based on the logical switch and
Optional<Node> configNode = MDSALUtil.read(broker, LogicalDatastoreType.CONFIGURATION,
HwvtepSouthboundUtils.createInstanceIdentifier(new NodeId(l2gwDevice.getHwvtepNodeId())));
if (configNode.isPresent()) {
- HwvtepGlobalAugmentation augmentation = configNode.get().getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = configNode.get().augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getLocalUcastMacs() != null) {
macs.addAll(augmentation.getLocalUcastMacs().stream()
.filter(mac -> getLogicalSwitchName(mac).equals(elanName))
public void addL2GatewayConnection(final L2gatewayConnection input,
final String l2GwDeviceName ,
L2gateway l2Gateway) {
- LOG.info("Adding L2gateway Connection with ID: {}", input.getKey().getUuid());
+ LOG.info("Adding L2gateway Connection with ID: {}", input.key().getUuid());
Uuid networkUuid = input.getNetworkId();
}
public void deleteL2GatewayConnection(L2gatewayConnection input) {
- LOG.info("Deleting L2gateway Connection with ID: {}", input.getKey().getUuid());
+ LOG.info("Deleting L2gateway Connection with ID: {}", input.key().getUuid());
Uuid networkUuid = input.getNetworkId();
String elanName = networkUuid.getValue();
List<L2GatewayDevice> l2Devices = ElanL2GwCacheUtils.getAllElanDevicesFromCache();
List<Devices> l2gwDevicesToBeDeleted = new ArrayList<>();
for (L2GatewayDevice elanL2gwDevice : l2Devices) {
- if (elanL2gwDevice.getL2GatewayIds().contains(input.getKey().getUuid())) {
- l2gwDevicesToBeDeleted.addAll(elanL2gwDevice.getDevicesForL2gwConnectionId(input.getKey().getUuid()));
+ if (elanL2gwDevice.getL2GatewayIds().contains(input.key().getUuid())) {
+ l2gwDevicesToBeDeleted.addAll(elanL2gwDevice.getDevicesForL2gwConnectionId(input.key().getUuid()));
}
}
if (l2gwDevicesToBeDeleted.isEmpty()) {
ElanL2GwCacheUtils.removeL2GatewayDeviceFromCache(elanName, hwvtepNodeId);
isLastL2GwConnDeleted = true;
} else {
- Uuid l2GwConnId = input.getKey().getUuid();
+ Uuid l2GwConnId = input.key().getUuid();
LOG.debug("Elan L2Gw Conn cache with id {} is being referred by other L2Gw Conns; so only "
+ "L2 Gw Conn {} reference is removed", hwvtepNodeId, l2GwConnId);
if (elanL2GwDevice != null) {
L2gateway l2Gateway, L2gatewayConnection input, String l2GwDeviceName) {
String elanName = elanInstance.getElanInstanceName();
Integer defaultVlan = input.getSegmentId();
- Uuid l2GwConnId = input.getKey().getUuid();
+ Uuid l2GwConnId = input.key().getUuid();
List<Devices> l2Devices = l2Gateway.getDevices();
LOG.trace("Associating ELAN {} with L2Gw Conn Id {} having below L2Gw devices {}", elanName, l2GwConnId,
Optional<Node> nodeOptional = resultNode;
if (nodeOptional.isPresent()) {
Node node = nodeOptional.get();
- if (node.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
+ if (node.augmentation(HwvtepGlobalAugmentation.class) != null) {
List<LocalUcastMacs> localUcastMacs =
- node.getAugmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
+ node.augmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
if (localUcastMacs == null) {
return;
}
}
static InstanceIdentifier<LocalUcastMacs> getMacIid(InstanceIdentifier<Node> nodeIid, LocalUcastMacs mac) {
- return nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class, mac.getKey());
+ return nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class, mac.key());
}
}
(validNetworks, logicalSwitch) -> !validNetworks.contains(logicalSwitch);
private static Predicate<TerminationPoint> CONTAINS_VLANBINDINGS = (port) ->
- port.getAugmentation(HwvtepPhysicalPortAugmentation.class) != null
- && port.getAugmentation(HwvtepPhysicalPortAugmentation.class).getVlanBindings() != null;
+ port.augmentation(HwvtepPhysicalPortAugmentation.class) != null
+ && port.augmentation(HwvtepPhysicalPortAugmentation.class).getVlanBindings() != null;
private final DataBroker broker;
Map<String, List<InstanceIdentifier<VlanBindings>>> vlans = new HashMap<>();
ports.stream()
.filter(CONTAINS_VLANBINDINGS)
- .forEach((port) -> port.getAugmentation(HwvtepPhysicalPortAugmentation.class)
+ .forEach((port) -> port.augmentation(HwvtepPhysicalPortAugmentation.class)
.getVlanBindings()
.forEach((binding) -> putVlanBindingVsLogicalSwitch(configPsNode, vlans, port, binding)));
return vlans;
final TerminationPoint tp,
final VlanBindings vlanBinding) {
return HwvtepSouthboundUtils.createInstanceIdentifier(nodeId)
- .child(TerminationPoint.class, tp.getKey())
+ .child(TerminationPoint.class, tp.key())
.augmentation(HwvtepPhysicalPortAugmentation.class)
- .child(VlanBindings.class, vlanBinding.getKey());
+ .child(VlanBindings.class, vlanBinding.key());
}
private void cleanupStaleBindings(final String globalNodeId,
}
private List<String> getLogicalSwitchesOnDevice(final Node globalConfigNode) {
- HwvtepGlobalAugmentation augmentation = globalConfigNode.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = globalConfigNode.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation == null || augmentation.getLogicalSwitches() == null) {
return Collections.emptyList();
}
LogicalDatastoreType.OPERATIONAL, elanId);
if (existingElanInfo.isPresent()) {
ElanTagName elanTagName = existingElanInfo.get();
- return elanTagName.getAugmentation(EtreeLeafTagName.class);
+ return elanTagName.augmentation(EtreeLeafTagName.class);
}
return null;
}
MacEntry macEntry = new MacEntryBuilder().setIsStaticAddress(true)
.setMacAddress(staticMacEntries.getMacAddress())
.setIpPrefix(staticMacEntries.getIpPrefix())
- .setInterface(interfaceName).setKey(new MacEntryKey(staticMacEntries.getMacAddress())).build();
+ .setInterface(interfaceName).withKey(new MacEntryKey(staticMacEntries.getMacAddress())).build();
createElanForwardingTablesList(elanInstanceName, macEntry, tx);
createElanInterfaceForwardingTablesList(interfaceName, macEntry, tx);
if (existingInterfaceMacEntry == null) {
MacEntry macEntry = new MacEntryBuilder().setMacAddress(mac.getMacAddress()).setIpPrefix(mac.getIpPrefix())
.setInterface(interfaceName)
- .setIsStaticAddress(true).setKey(new MacEntryKey(mac.getMacAddress())).build();
+ .setIsStaticAddress(true).withKey(new MacEntryKey(mac.getMacAddress())).build();
tx.put(LogicalDatastoreType.OPERATIONAL, existingMacEntryId, macEntry,
WriteTransaction.CREATE_MISSING_PARENTS);
}
if (existingMacEntry != null && elanUtils.getElanMacTable(elanName) != null) {
MacEntry newMacEntry = new MacEntryBuilder().setInterface(interfaceName).setIsStaticAddress(true)
.setMacAddress(mac.getMacAddress()).setIpPrefix(mac.getIpPrefix())
- .setKey(new MacEntryKey(mac.getMacAddress())).build();
+ .withKey(new MacEntryKey(mac.getMacAddress())).build();
tx.put(LogicalDatastoreType.OPERATIONAL, macEntryId, newMacEntry);
}
}
Interface tunnelInterface =
ElanL2GatewayUtils.getInterfaceFromConfigDS(new InterfaceKey(tunnelInterfaceName), broker);
if (tunnelInterface != null) {
- dpnTepIp = tunnelInterface.getAugmentation(IfTunnel.class).getTunnelSource();
+ dpnTepIp = tunnelInterface.augmentation(IfTunnel.class).getTunnelSource();
} else {
LOG.warn("Tunnel interface not found for tunnelInterfaceName {}", tunnelInterfaceName);
}
if (etreeInterface == null || etreeInterface.getEtreeInterfaceType() == EtreeInterfaceType.Root) {
return elanInfo.getElanTag();
} else { // Leaf
- EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
+ EtreeInstance etreeInstance = elanInfo.augmentation(EtreeInstance.class);
if (etreeInstance == null) {
LOG.warn("EtreeInterface {} is connected to a non-Etree network: {}",
interfaceInfo.getInterfaceName(), elanInfo.getElanInstanceName());
elanTag = retrieveNewElanTag(idManager, elanInstanceName);
}
Elan elanInfo = new ElanBuilder().setName(elanInstanceName).setElanInterfaces(elanInterfaces)
- .setKey(new ElanKey(elanInstanceName)).build();
+ .withKey(new ElanKey(elanInstanceName)).build();
// Add the ElanState in the elan-state operational data-store
tx.put(LogicalDatastoreType.OPERATIONAL, getElanInstanceOperationalDataPath(elanInstanceName),
elanInfo, WriteTransaction.CREATE_MISSING_PARENTS);
// Add the ElanMacTable in the elan-mac-table operational data-store
- MacTable elanMacTable = new MacTableBuilder().setKey(new MacTableKey(elanInstanceName)).build();
+ MacTable elanMacTable = new MacTableBuilder().withKey(new MacTableKey(elanInstanceName)).build();
tx.put(LogicalDatastoreType.OPERATIONAL, getElanMacTableOperationalDataPath(elanInstanceName),
elanMacTable, WriteTransaction.CREATE_MISSING_PARENTS);
ElanTagNameBuilder elanTagNameBuilder = new ElanTagNameBuilder().setElanTag(elanTag)
- .setKey(new ElanTagNameKey(elanTag)).setName(elanInstanceName);
+ .withKey(new ElanTagNameKey(elanTag)).setName(elanInstanceName);
long etreeLeafTag = -1;
if (isEtreeInstance(elanInstanceAdded)) {
etreeLeafTag = retrieveNewElanTag(idManager,elanInstanceName + ElanConstants
.setDescription(elanInstanceAdded.getDescription())
.setMacTimeout(elanInstanceAdded.getMacTimeout() == null
? Long.valueOf(ElanConstants.DEFAULT_MAC_TIME_OUT) : elanInstanceAdded.getMacTimeout())
- .setKey(elanInstanceAdded.getKey()).setElanTag(elanTag);
+ .withKey(elanInstanceAdded.key()).setElanTag(elanTag);
if (isEtreeInstance(elanInstanceAdded)) {
EtreeInstance etreeInstance = new EtreeInstanceBuilder().setEtreeLeafTagVal(new EtreeLeafTag(etreeLeafTag))
.build();
private static void addTheLeafTagAsElanTag(String elanInstanceName, long etreeLeafTag, WriteTransaction tx) {
ElanTagName etreeTagAsElanTag = new ElanTagNameBuilder().setElanTag(etreeLeafTag)
- .setKey(new ElanTagNameKey(etreeLeafTag)).setName(elanInstanceName).build();
+ .withKey(new ElanTagNameKey(etreeLeafTag)).setName(elanInstanceName).build();
tx.put(LogicalDatastoreType.OPERATIONAL,
getElanInfoEntriesOperationalDataPath(etreeLeafTag), etreeTagAsElanTag);
}
private static boolean isEtreeInstance(ElanInstance elanInstanceAdded) {
- return elanInstanceAdded.getAugmentation(EtreeInstance.class) != null;
+ return elanInstanceAdded.augmentation(EtreeInstance.class) != null;
}
public boolean isDpnPresent(BigInteger dpnId) {
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority)
.setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
.setServicePriority(servicePriority).setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
}
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.Interface configIface =
interfaceManager.getInterfaceInfoFromConfigDataStore(interfaceName);
- IfTunnel ifTunnel = configIface.getAugmentation(IfTunnel.class);
+ IfTunnel ifTunnel = configIface.augmentation(IfTunnel.class);
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
- ParentRefs refs = configIface.getAugmentation(ParentRefs.class);
+ ParentRefs refs = configIface.augmentation(ParentRefs.class);
if (refs != null && !Strings.isNullOrEmpty(refs.getParentInterface())) {
return true; //multiple VxLAN tunnels enabled, i.e. only logical tunnel should be treated
}
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId =
new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId("openflow:" + dpnId);
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node nodeDpn =
- new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
+ new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
- nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
}
private TransportZone createZone(String subnetIp, String zoneName) {
List<Subnets> subnets = new ArrayList<>();
subnets.add(buildSubnets(subnetIp));
- TransportZoneBuilder tzb = new TransportZoneBuilder().setKey(new TransportZoneKey(zoneName))
+ TransportZoneBuilder tzb = new TransportZoneBuilder().withKey(new TransportZoneKey(zoneName))
.setTunnelType(TunnelTypeVxlan.class).setZoneName(zoneName).setSubnets(subnets);
return tzb.build();
}
private Subnets buildSubnets(String subnetIp) {
SubnetsBuilder subnetsBuilder = new SubnetsBuilder().setDeviceVteps(new ArrayList<>())
.setGatewayIp(new IpAddress(ALL_SUBNETS_GW.toCharArray()))
- .setKey(new SubnetsKey(new IpPrefix(subnetIp.toCharArray()))).setVlanId(0)
+ .withKey(new SubnetsKey(new IpPrefix(subnetIp.toCharArray()))).setVlanId(0)
.setVteps(new ArrayList<>());
return subnetsBuilder.build();
}
LogicalSwitches buildData(String name, String tunnelKey) {
LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder();
- logicalSwitchesBuilder.setKey(new LogicalSwitchesKey(new HwvtepNodeName(name)));
+ logicalSwitchesBuilder.withKey(new LogicalSwitchesKey(new HwvtepNodeName(name)));
logicalSwitchesBuilder.setTunnelKey(tunnelKey);
logicalSwitchesBuilder.setHwvtepNodeName(new HwvtepNodeName(name));
return logicalSwitchesBuilder.build();
List<Switches> switches = new ArrayList<>();
SwitchesBuilder switchesBuilder = new SwitchesBuilder();
- switchesBuilder.setKey(new SwitchesKey(new HwvtepPhysicalSwitchRef(psId)));
+ switchesBuilder.withKey(new SwitchesKey(new HwvtepPhysicalSwitchRef(psId)));
switchesBuilder.setSwitchRef(new HwvtepPhysicalSwitchRef(psId));
switches.add(switchesBuilder.build());
List<TunnelIps> tunnelIps = new ArrayList<>();
IpAddress ip = new IpAddress("192.168.122.30".toCharArray());
- tunnelIps.add(new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
+ tunnelIps.add(new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
physicalSwitchAugmentationBuilder.setTunnelIps(tunnelIps);
nodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, physicalSwitchAugmentationBuilder.build());
Map<Long, String> vlanBindingData) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId(portName));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
switchIid.firstKeyOf(Node.class);
InstanceIdentifier<TerminationPoint> tpPath = switchIid.child(TerminationPoint.class,
public static VlanBindings createVlanBinding(Long key, String logicalSwitch) {
VlanBindingsBuilder vbBuilder = new VlanBindingsBuilder();
VlanBindingsKey vbKey = new VlanBindingsKey(new VlanId(key.intValue()));
- vbBuilder.setKey(vbKey);
+ vbBuilder.withKey(vbKey);
vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
HwvtepLogicalSwitchRef hwvtepLogicalSwitchRef =
new HwvtepLogicalSwitchRef(createInstanceIdentifier(logicalSwitch));
TerminationPointKey tpKey = new TerminationPointKey(new TpId("vxlan_over_ipv4:" + ip));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
if (nodeIid != null && tpKey != null) {
- tpBuilder.setKey(tpKey);
+ tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath =
buildTpId(nodeIid, ip);
public static LogicalSwitches buildLogicalSwitch(String logicalSwitch, String tunnelKey) {
LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder();
- logicalSwitchesBuilder.setKey(new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch)));
+ logicalSwitchesBuilder.withKey(new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch)));
logicalSwitchesBuilder.setHwvtepNodeName(new HwvtepNodeName(logicalSwitch));
logicalSwitchesBuilder.setTunnelKey(tunnelKey);
Uuid lgoicalSwitchUuid = getUUid(logicalSwitch);
public static List<Managers> buildManagers() {
ManagersBuilder builder1 = new ManagersBuilder();
- builder1.setKey(new ManagersKey(new Uri("test")));
+ builder1.withKey(new ManagersKey(new Uri("test")));
List<ManagerOtherConfigs> otherConfigses = new ArrayList<>();
otherConfigses.add(buildOtherConfig("ha_enabled", "true"));
public static List<Managers> buildManagers1() {
ManagersBuilder builder1 = new ManagersBuilder();
- builder1.setKey(new ManagersKey(new Uri("test")));
+ builder1.withKey(new ManagersKey(new Uri("test")));
builder1.setManagerOtherConfigs(Collections.emptyList());
return ImmutableList.of(builder1.build());
}
public static ManagerOtherConfigs buildOtherConfig(String key, String val) {
ManagerOtherConfigsBuilder otherConfigsBuilder = new ManagerOtherConfigsBuilder();
ManagerOtherConfigsKey managerOtherConfigsKey = new ManagerOtherConfigsKey(key);
- otherConfigsBuilder.setKey(managerOtherConfigsKey);
+ otherConfigsBuilder.withKey(managerOtherConfigsKey);
otherConfigsBuilder.setOtherConfigKey(key);
otherConfigsBuilder.setOtherConfigValue(val);
return otherConfigsBuilder.build();
private TestComparators() { }
public static void verifySwitches(Node globalOpNode, Node psOpNode) {
- for (Switches switches : globalOpNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches()) {
+ for (Switches switches : globalOpNode.augmentation(HwvtepGlobalAugmentation.class).getSwitches()) {
String switchValue = switches.getSwitchRef().getValue().firstKeyOf(Node.class).getNodeId().getValue();
assertEquals("Switch Name should be equal", switchValue, psOpNode.getNodeId().getValue());
}
public static void compareLogicalSwitches(Node src, Node dst, InstanceIdentifier<Node> nodePath) {
LogicalSwitchesCmd cmd = new LogicalSwitchesCmd();
- HwvtepGlobalAugmentation d1Aug = src.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = dst.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = src.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = dst.augmentation(HwvtepGlobalAugmentation.class);
List<LogicalSwitches> d1Values =
d1Aug.getLogicalSwitches() != null ? d1Aug.getLogicalSwitches() : new ArrayList<>();
public static void compareLogicalSwitches(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LogicalSwitchesCmd cmd = new LogicalSwitchesCmd();
- HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = d1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d2Aug = d2.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = ha.augmentation(HwvtepGlobalAugmentation.class);
List<LogicalSwitches> d1Values =
d1Aug.getLogicalSwitches() != null ? d1Aug.getLogicalSwitches() : new ArrayList<>();
public static void compareRemoteUcastMacs(Node src, Node dst, InstanceIdentifier<Node> nodePath) {
RemoteUcastCmd cmd = new RemoteUcastCmd();
- HwvtepGlobalAugmentation d1Aug = src.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = dst.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = src.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = dst.augmentation(HwvtepGlobalAugmentation.class);
List<RemoteUcastMacs> d1Values =
d1Aug.getRemoteUcastMacs() != null ? d1Aug.getRemoteUcastMacs() : new ArrayList<>();
List<RemoteUcastMacs> result1 = cmd.transform(nodePath, d1Values);
public static void compareRemoteUcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
RemoteUcastCmd cmd = new RemoteUcastCmd();
- HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = d1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d2Aug = d2.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = ha.augmentation(HwvtepGlobalAugmentation.class);
List<RemoteUcastMacs> d1Values =
d1Aug.getRemoteUcastMacs() != null ? d1Aug.getRemoteUcastMacs() : new ArrayList<>();
public static void compareRemoteMcastMacs(Node src, Node dst, InstanceIdentifier<Node> nodePath) {
RemoteMcastCmd cmd = new RemoteMcastCmd();
- HwvtepGlobalAugmentation d1Aug = src.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = dst.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = src.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = dst.augmentation(HwvtepGlobalAugmentation.class);
List<RemoteMcastMacs> d1Values =
d1Aug.getRemoteMcastMacs() != null ? d1Aug.getRemoteMcastMacs() : new ArrayList<>();
List<RemoteMcastMacs> result1 = cmd.transform(nodePath, d1Values);
public static void compareRemoteMcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
RemoteMcastCmd cmd = new RemoteMcastCmd();
- HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = d1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d2Aug = d2.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = ha.augmentation(HwvtepGlobalAugmentation.class);
List<RemoteMcastMacs> d1Values =
d1Aug.getRemoteMcastMacs() != null ? d1Aug.getRemoteMcastMacs() : new ArrayList<>();
public static void compareLocalUcastMacs(Node src, Node dst, InstanceIdentifier<Node> nodePath) {
LocalUcastCmd cmd = new LocalUcastCmd();
- HwvtepGlobalAugmentation d1Aug = src.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = dst.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = src.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = dst.augmentation(HwvtepGlobalAugmentation.class);
List<LocalUcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalUcastMacs() : new ArrayList<>();
List<LocalUcastMacs> result1 = cmd.transform(nodePath, d1Values);
public static void compareLocalUcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LocalUcastCmd cmd = new LocalUcastCmd();
- HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = d1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d2Aug = d2.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = ha.augmentation(HwvtepGlobalAugmentation.class);
List<LocalUcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalUcastMacs() : new ArrayList<>();
public static void compareLocalMcastMacs(Node src, Node dst, InstanceIdentifier<Node> nodePath) {
LocalMcastCmd cmd = new LocalMcastCmd();
- HwvtepGlobalAugmentation d1Aug = src.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = dst.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = src.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = dst.augmentation(HwvtepGlobalAugmentation.class);
List<LocalMcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalMcastMacs() : new ArrayList<>();
List<LocalMcastMacs> result1 = cmd.transform(nodePath, d1Values);
public static void compareLocalMcastMacs(Node d1, Node d2, Node ha, InstanceIdentifier<Node> nodePath) {
LocalMcastCmd cmd = new LocalMcastCmd();
- HwvtepGlobalAugmentation d1Aug = d1.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation d2Aug = d2.getAugmentation(HwvtepGlobalAugmentation.class);
- HwvtepGlobalAugmentation haAug = ha.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d1Aug = d1.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation d2Aug = d2.augmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation haAug = ha.augmentation(HwvtepGlobalAugmentation.class);
List<LocalMcastMacs> d1Values =
d1Aug.getLocalUcastMacs() != null ? d1Aug.getLocalMcastMacs() : new ArrayList<>();
List<LocalMcastMacs> result1 = cmd.transform(nodePath, d1Values);
InstanceIdentifier<Node> haPsnodePath,
ReadWriteTransaction readWriteTransaction, String switchName,
Node d1, Node d2, Node ha) throws ReadFailedException {
- PhysicalSwitchAugmentation d1PsAug = d1ps.getAugmentation(PhysicalSwitchAugmentation.class);
- PhysicalSwitchAugmentation d2PsAug = d2ps.getAugmentation(PhysicalSwitchAugmentation.class);
- PhysicalSwitchAugmentation haPsAug = haps.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation d1PsAug = d1ps.augmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation d2PsAug = d2ps.augmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation haPsAug = haps.augmentation(PhysicalSwitchAugmentation.class);
HwvtepGlobalRef managerd1Ps = d1PsAug.getManagedBy();
assertEquals("Hwvtep node name should be same", d1PsAug.getHwvtepNodeName().getValue(),
ReadWriteTransaction readWriteTransaction,
String switchName, Node d1, Node ha) throws ReadFailedException {
//Compare Physical Augmentation data
- PhysicalSwitchAugmentation d1PsAug = d1ps.getAugmentation(PhysicalSwitchAugmentation.class);
- PhysicalSwitchAugmentation haPsAug = haps.getAugmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation d1PsAug = d1ps.augmentation(PhysicalSwitchAugmentation.class);
+ PhysicalSwitchAugmentation haPsAug = haps.augmentation(PhysicalSwitchAugmentation.class);
HwvtepGlobalRef managerd1Ps = d1PsAug.getManagedBy();
assertEquals("Hwvtep node name should be same", d1PsAug.getHwvtepNodeName().getValue(),
TerminationPoint tpNoded = readWriteTransaction.read(LogicalDatastoreType.OPERATIONAL, tpPathd)
.checkedGet().get();
HwvtepPhysicalPortAugmentation hwvtepPhysicalPortAugmentationD =
- tpNoded.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tpNoded.augmentation(HwvtepPhysicalPortAugmentation.class);
InstanceIdentifier<TerminationPoint> tpPathha = haPsa.child(TerminationPoint.class,
new TerminationPointKey(new TpId(portName)));
TerminationPoint tpNodeha = readWriteTransaction.read(LogicalDatastoreType.OPERATIONAL, tpPathha)
.checkedGet().get();
HwvtepPhysicalPortAugmentation hwvtepPhysicalPortAugmentationHa =
- tpNodeha.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+ tpNodeha.augmentation(HwvtepPhysicalPortAugmentation.class);
assertEquals("Termination point hwvtep-node-name should be same",
hwvtepPhysicalPortAugmentationD.getHwvtepNodeName(),
hwvtepPhysicalPortAugmentationHa.getHwvtepNodeName());
Optional<Node> nodeOptional = TestUtil.readNodeOptional(LogicalDatastoreType.CONFIGURATION, nodeId, dataBroker);
assertTrue(message, nodeOptional.isPresent());
if (nodeOptional.isPresent()) {
- nodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class).getManagers();
+ nodeOptional.get().augmentation(HwvtepGlobalAugmentation.class).getManagers();
}
}
public static void verifyHAconfigNode(Node haConfig, Node d1Node) throws Exception {
- String haid = haConfig.getAugmentation(HwvtepGlobalAugmentation.class).getManagers()
+ String haid = haConfig.augmentation(HwvtepGlobalAugmentation.class).getManagers()
.get(0).getManagerOtherConfigs().get(0).getOtherConfigValue();
String d1id = d1Node.getNodeId().getValue();
assertEquals("Other config should contain D1 as child manager", haid, d1id);
}
public static void verifyHAconfigNode(Node haConfig, Node d1Node, Node d2Node) throws Exception {
- String haid = haConfig.getAugmentation(HwvtepGlobalAugmentation.class).getManagers()
+ String haid = haConfig.augmentation(HwvtepGlobalAugmentation.class).getManagers()
.get(0).getManagerOtherConfigs().get(0).getOtherConfigValue();
String[] haids = haid.split(",");
List<String> haidSlist = Arrays.asList(haids);
new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId("openflow:" + dpnId);
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node nodeDpn =
new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder().setId(nodeId)
- .setKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes
+ .withKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes
.NodeKey(nodeId)).build();
return nodeDpn;
}
InstanceIdentifier groupInstanceId =
InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
- nodeDpn.getKey()).augmentation(FlowCapableNode.class).child(Group.class,
+ nodeDpn.key()).augmentation(FlowCapableNode.class).child(Group.class,
new GroupKey(new GroupId(Long.valueOf(groupId)))).build();
return groupInstanceId;
}
NodeId nodeId =
new NodeId("openflow:" + dpnId);
Node nodeDpn =
- new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
+ new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return InstanceIdentifier.builder(Nodes.class)
.child(Node.class,
- nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(tableId)).child(Flow.class, flowKey).build();
}
ElanInterfaceBuilder elanInterfaceBuilder = new ElanInterfaceBuilder()
.setElanInstanceName(elanInstanceName)
.setName(interfaceName)
- .setKey(new ElanInterfaceKey(interfaceName));
+ .withKey(new ElanInterfaceKey(interfaceName));
StaticMacEntriesBuilder staticMacEntriesBuilder = new StaticMacEntriesBuilder();
List<StaticMacEntries> staticMacEntries = new ArrayList<>();
physicalSwitchAugmentationBuilder.setHwvtepNodeDescription("torNode");
List<TunnelIps> tunnelIps = new ArrayList<>();
IpAddress ip = new IpAddress(tepIp.toCharArray());
- tunnelIps.add(new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
+ tunnelIps.add(new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
physicalSwitchAugmentationBuilder.setTunnelIps(tunnelIps);
nodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, physicalSwitchAugmentationBuilder.build());
singleTransactionDataBroker.syncWrite(LogicalDatastoreType.OPERATIONAL, psNodePath, nodeBuilder.build());
}
public InstanceIdentifier<LocalUcastMacs> buildMacIid(InstanceIdentifier<Node> nodeIid, LocalUcastMacs mac) {
- return nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class, mac.getKey());
+ return nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class, mac.key());
}
public void deletel2GWConnection(String connectionName) throws TransactionCommitFailedException {
private boolean checkForRemoteMcastMac(InstanceIdentifier<Node> torNodeId, String tepIp, boolean checkForExists) {
try {
Node node = singleTxdataBroker.syncRead(LogicalDatastoreType.CONFIGURATION, torNodeId);
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation == null || augmentation.getRemoteMcastMacs() == null
|| augmentation.getRemoteMcastMacs().isEmpty()) {
if (checkForExists) {
public boolean checkForRemoteUcastMac(InstanceIdentifier<Node> torNodeId, String dpnMac, boolean checkForExists) {
try {
Node node = singleTxdataBroker.syncRead(LogicalDatastoreType.CONFIGURATION, torNodeId);
- HwvtepGlobalAugmentation augmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+ HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
if (augmentation == null || augmentation.getRemoteUcastMacs() == null
|| augmentation.getRemoteUcastMacs().isEmpty()) {
if (checkForExists) {
private Set<Bucket> modifyBucketId(List<Bucket> input) {
return input.stream()
.map(bucket -> new BucketBuilder(bucket).setBucketId(new BucketId(1L))
- .setKey(new BucketKey(new BucketId(1L))).build())
+ .withKey(new BucketKey(new BucketId(1L))).build())
.collect(Collectors.toSet());
}
FlowKey flowKey = new FlowKey(new FlowId(flowid));
NodeId nodeId = GET_OPENFLOW_NODE_ID.apply(dpnId);
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node nodeDpn =
- new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
+ new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
- nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(tableId)).child(Flow.class, flowKey).build();
}
}
public void updateRdtoNetworks(ElanInstance actualElanInstances) throws TransactionCommitFailedException {
- EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder().setKey(new EvpnRdToNetworkKey(RD));
+ EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder()
+ .withKey(new EvpnRdToNetworkKey(RD));
evpnRdToNetworkBuilder.setRd(RD);
evpnRdToNetworkBuilder.setNetworkId(ELAN1);
LOG.info("updating Evpn {} with elaninstance {} and rd {}", "evpn1", actualElanInstances, RD);
public static RoutePaths buildRoutePath(String nextHop, Long label) {
RoutePathsBuilder builder = new RoutePathsBuilder()
- .setKey(new RoutePathsKey(nextHop))
+ .withKey(new RoutePathsKey(nextHop))
.setNexthopAddress(nextHop);
if (label != null) {
builder.setLabel(label);
}
public static VrfEntryBuilder getVrfEntryBuilder(String prefix, RouteOrigin origin, String parentVpnRd) {
- return new VrfEntryBuilder().setKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
+ return new VrfEntryBuilder().withKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
.setOrigin(origin.getValue()).setParentVpnRd(parentVpnRd);
}
public static VrfEntryBuilder getVrfEntryBuilder(String prefix, List<RoutePaths> routePaths,
RouteOrigin origin, String parentVpnRd) {
- return new VrfEntryBuilder().setKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
+ return new VrfEntryBuilder().withKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
.setRoutePaths(routePaths).setOrigin(origin.getValue()).setParentVpnRd(parentVpnRd);
}
Node nodeDpn = FibUtil.buildDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
if (RouteOrigin.value(vrfEntry.getOrigin()) == RouteOrigin.BGP) {
.findFirst()
.ifPresent(routes -> {
LOG.trace(" deleting remote FIB entry {}", vrfEntry);
- deleteRemoteRoute(null, dpnId, vpnId, vrfTable.get().getKey(), vrfEntry,
+ deleteRemoteRoute(null, dpnId, vpnId, vrfTable.get().key(), vrfEntry,
Optional.absent(), writeCfgTxn, subTxns);
});
}
Preconditions.checkNotNull(vpnId, "Vpn Instance with rd " + vpnInstance.getVrfId()
+ " has null vpnId!");
if (RouteOrigin.value(vrfEntry.getOrigin()) == RouteOrigin.CONNECTED) {
- SubnetRoute subnetRoute = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute subnetRoute = vrfEntry.augmentation(SubnetRoute.class);
final List<VpnToDpnList> vpnToDpnList = vpnInstance.getVpnToDpnList();
final long elanTag = subnetRoute.getElantag();
LOG.trace("SubnetRoute augmented vrfentry found for rd {} prefix {} with elantag {}",
InstanceIdentifier.InstanceIdentifierBuilder<VrfTables> idBuilder =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd));
InstanceIdentifier<VrfTables> vrfTableId = idBuilder.build();
- VrfTablesBuilder vrfTablesBuilder = new VrfTablesBuilder().setKey(new VrfTablesKey(rd))
+ VrfTablesBuilder vrfTablesBuilder = new VrfTablesBuilder().withKey(new VrfTablesKey(rd))
.setRouteDistinguisher(rd).setVrfEntry(new ArrayList<VrfEntry>());
if (writeConfigTxn != null) {
writeConfigTxn.merge(LogicalDatastoreType.CONFIGURATION, vrfTableId, vrfTablesBuilder.build());
if (targetDeviceIds.isEmpty()) {
tx.delete(LogicalDatastoreType.OPERATIONAL, nextHopsId);
} else {
- Nexthops nextHopsToGroupId = new NexthopsBuilder().setKey(new NexthopsKey(nextHopKey))
+ Nexthops nextHopsToGroupId = new NexthopsBuilder().withKey(new NexthopsKey(nextHopKey))
.setNexthopKey(nextHopKey)
.setGroupId(groupId)
.setTargetDeviceId(targetDeviceIds).build();
}
private static Nexthops buildNextHops(BigInteger dpnId, String groupIdKey, String groupId) {
- return new NexthopsBuilder().setKey(new NexthopsKey(groupIdKey))
+ return new NexthopsBuilder().withKey(new NexthopsKey(groupIdKey))
.setNexthopKey(groupIdKey)
.setGroupId(groupId)
.setTargetDeviceId(Collections.singletonList(dpnId.toString())).build();
private static DpnLbNexthops buildDpnLbNextHops(BigInteger dpnId, String destinationIp,
String groupIdKey) {
- return new DpnLbNexthopsBuilder().setKey(new DpnLbNexthopsKey(destinationIp, dpnId))
+ return new DpnLbNexthopsBuilder().withKey(new DpnLbNexthopsKey(destinationIp, dpnId))
.setDstDeviceId(destinationIp).setSrcDpId(dpnId)
.setNexthopKey(Collections.singletonList(groupIdKey)).build();
}
static Node buildDpnNode(BigInteger dpnId) {
return new NodeBuilder().setId(new NodeId("openflow:" + dpnId))
- .setKey(new NodeKey(new NodeId("openflow:" + dpnId))).build();
+ .withKey(new NodeKey(new NodeId("openflow:" + dpnId))).build();
}
public static String getBroadcastAddressFromCidr(String cidr) {
}
List<ActionInfo> listActionInfo = new ArrayList<>();
for (Action action : actions) {
- actionKey = action.getKey().getOrder() + actionKey;
+ actionKey = action.key().getOrder() + actionKey;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action
actionClass = action.getAction();
if (actionClass instanceof OutputActionCase) {
LOG.trace("Prefix {} is already present in l3nextHop {} ", currDestIpPrefix, nexthop);
} else {
IpAdjacenciesBuilder ipPrefixesBuilder =
- new IpAdjacenciesBuilder().setKey(new IpAdjacenciesKey(currDestIpPrefix));
+ new IpAdjacenciesBuilder().withKey(new IpAdjacenciesKey(currDestIpPrefix));
LOG.trace("Updating prefix {} to vpnNextHop {} Operational DS", currDestIpPrefix, nexthop);
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
getVpnNextHopIpPrefixIdentifier(vpnId, primaryIpAddress, currDestIpPrefix),
ipPrefixesList.add(prefix);
// Add nexthop to vpn node
VpnNexthop nh = new VpnNexthopBuilder()
- .setKey(new VpnNexthopKey(primaryIpAddr))
+ .withKey(new VpnNexthopKey(primaryIpAddr))
.setDpnId(dpnId)
.setIpAdjacencies(ipPrefixesList)
.setEgressPointer(egressPointer).build();
@Override
public void createFlows(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
installRouterFibEntries(vrfEntry, rd, NwConstants.ADD_FLOW, routerInt);
}
@Override
public void removeFlows(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
installRouterFibEntries(vrfEntry, rd, NwConstants.DEL_FLOW, routerInt);
}
closeables.add(evpnVrfEntryHandler);
return;
}
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
if (routerInt != null) {
// ping responder for router interfaces
routerInterfaceVrfEntryHandler.createFlows(identifier, vrfEntry, rd);
closeables.add(evpnVrfEntryHandler);
return;
}
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
if (routerInt != null) {
// ping responder for router interfaces
routerInterfaceVrfEntryHandler.removeFlows(identifier, vrfEntry, rd);
}
final Long vpnId = vpnInstance.getVpnId();
final String rd = vrfTableKey.getRouteDistinguisher();
- SubnetRoute subnetRoute = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute subnetRoute = vrfEntry.augmentation(SubnetRoute.class);
if (subnetRoute != null) {
final long elanTag = subnetRoute.getElantag();
LOG.trace("SUBNETROUTE: createFibEntries: SubnetRoute augmented vrfentry found for rd {} prefix {}"
Node nodeDpn = FibUtil.buildDpnNode(dpnId);
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
if (addOrRemove == NwConstants.ADD_FLOW) {
Node nodeDpn = FibUtil.buildDpnNode(terminatingServiceTableFlowEntity.getDpnId());
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(terminatingServiceTableFlowEntity.getTableId()))
.child(Flow.class, flowKey).build();
tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flowbld.build(),
Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build();
tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
vpnToDpnList = vpnInstance.getVpnToDpnList();
}
- SubnetRoute subnetRoute = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute subnetRoute = vrfEntry.augmentation(SubnetRoute.class);
final java.util.Optional<Long> optionalLabel = FibUtil.getLabelFromRoutePaths(vrfEntry);
List<String> nextHopAddressList = FibHelper.getNextHopListFromRoutePaths(vrfEntry);
String vpnName = fibUtil.getVpnNameFromId(vpnInstance.getVpnId());
FlowKey flowKey = new FlowKey(new FlowId(flowId));
Node nodeDpn = FibUtil.buildDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
if (addOrRemove == NwConstants.ADD_FLOW) {
synchronized (vpnInstance.getVpnInstanceName().intern()) {
futures.add(retryingTxRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
for (final VrfEntry vrfEntry : vrfTable.get().getVrfEntry()) {
- SubnetRoute subnetRoute = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute subnetRoute = vrfEntry.augmentation(SubnetRoute.class);
if (subnetRoute != null) {
long elanTag = subnetRoute.getElantag();
installSubnetRouteInFib(dpnId, elanTag, rd, vpnId, vrfEntry, tx);
tx);
continue;
}
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
if (routerInt != null) {
LOG.trace("Router augmented vrfentry found rd:{}, uuid:{}, ip:{}, mac:{}",
rd, routerInt.getUuid(), routerInt.getIpAddress(), routerInt.getMacAddress());
futures.add(retryingTxRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
for (final VrfEntry vrfEntry : vrfTable.get().getVrfEntry()) {
/* Handle subnet routes here */
- SubnetRoute subnetRoute = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute subnetRoute = vrfEntry.augmentation(SubnetRoute.class);
if (subnetRoute != null) {
LOG.trace("SUBNETROUTE: cleanUpDpnForVpn: Cleaning subnetroute {} on dpn {}"
+ " for vpn {}", vrfEntry.getDestPrefix(), dpnId, rd);
continue;
}
// ping responder for router interfaces
- RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
+ RouterInterface routerInt = vrfEntry.augmentation(RouterInterface.class);
if (routerInt != null) {
LOG.trace("Router augmented vrfentry found for rd:{}, uuid:{}, ip:{}, mac:{}",
rd, routerInt.getUuid(), routerInt.getIpAddress(),
}
if (RouteOrigin.BGP.getValue().equals(vrfEntry.getOrigin())) {
bgpRouteVrfEntryHandler.deleteRemoteRoute(null, dpnId, vpnId,
- vrfTable.get().getKey(), vrfEntry, extraRouteOptional, tx, txnObjects);
+ vrfTable.get().key(), vrfEntry, extraRouteOptional, tx, txnObjects);
} else {
- baseVrfEntryHandler.deleteRemoteRoute(null, dpnId, vpnId, vrfTable.get().getKey(),
+ baseVrfEntryHandler.deleteRemoteRoute(null, dpnId, vpnId, vrfTable.get().key(),
vrfEntry, extraRouteOptional, tx);
}
}
optNextHop.ifPresent(nextHop -> {
String flowRef = getInterVpnFibFlowRef(interVpnLinkName, vrfEntry.getDestPrefix(), nextHop);
FlowKey flowKey = new FlowKey(new FlowId(flowRef));
- Flow flow = new FlowBuilder().setKey(flowKey).setId(new FlowId(flowRef))
+ Flow flow = new FlowBuilder().withKey(flowKey).setId(new FlowId(flowRef))
.setTableId(NwConstants.L3_FIB_TABLE).setFlowName(flowRef).build();
LOG.trace("Removing flow in FIB table for interVpnLink {} key {}", interVpnLinkName, flowRef);
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie)
.setFlowPriority(flowPriority).setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority))
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority))
.setServiceName(serviceName).setServicePriority(servicePriority)
.setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
}
private String getOpenvswitchOtherConfig(Node node, String key) {
- OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNode = node.augmentation(OvsdbNodeAugmentation.class);
if (ovsdbNode == null) {
Optional<Node> nodeFromReadOvsdbNode = readOvsdbNode(node);
if (nodeFromReadOvsdbNode.isPresent()) {
- ovsdbNode = nodeFromReadOvsdbNode.get().getAugmentation(OvsdbNodeAugmentation.class);
+ ovsdbNode = nodeFromReadOvsdbNode.get().augmentation(OvsdbNodeAugmentation.class);
}
}
if (node == null) {
return null;
}
- return node.getAugmentation(OvsdbBridgeAugmentation.class);
+ return node.augmentation(OvsdbBridgeAugmentation.class);
}
}
@Override
public void remove(Node dataObjectModification) {
- NodeKey nodeKey = dataObjectModification.getKey();
+ NodeKey nodeKey = dataObjectModification.key();
BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
LOG.info("Dpn removed {}", dpnId);
centralizedSwitchScheduler.removeSwitch(dpnId);
@Override
public void add(Node dataObjectModification) {
- NodeKey nodeKey = dataObjectModification.getKey();
+ NodeKey nodeKey = dataObjectModification.key();
BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
LOG.info("Dpn added {}", dpnId);
centralizedSwitchScheduler.addSwitch(dpnId);
continue;
}
VpnInterfaceBuilder vpnIfBuilder = new VpnInterfaceBuilder(optionalVpnInterface.get());
- Adjacencies adjs = vpnIfBuilder.getAugmentation(Adjacencies.class);
+ Adjacencies adjs = vpnIfBuilder.augmentation(Adjacencies.class);
VpnInterfaceOpDataEntryBuilder vpnIfOpDataEntryBuilder = new VpnInterfaceOpDataEntryBuilder();
- vpnIfOpDataEntryBuilder.setKey(new VpnInterfaceOpDataEntryKey(interfaceName, vpnName));
+ vpnIfOpDataEntryBuilder.withKey(new VpnInterfaceOpDataEntryKey(interfaceName, vpnName));
List<Adjacency> adjacencyList = adjs != null ? adjs.getAdjacency() : new ArrayList<>();
List<Adjacency> adjacencyListToImport = new ArrayList<>();
//Check for VPN disassociation
Uuid originalVpn = original.getVpnid();
Uuid updatedVpn = update.getVpnid();
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + update.getKey(),
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + update.key(),
() -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
if (originalVpn == null && updatedVpn != null) {
//external network is dis-associated from L3VPN instance
//snatServiceManger.notify(routers, null, Action.ADD);
} else {
try {
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + routers.getKey(),
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + routers.key(),
() -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
LOG.info("add : Installing NAT default route on all dpns part of router {}", routerName);
long bgpVpnId = NatConstants.INVALID_ID;
String bgpVpnName = bgpVpnUuid.getValue();
LOG.debug("Populate the router-id-name container with the mapping BGP VPN-ID {} -> BGP VPN-NAME {}",
bgpVpnId, bgpVpnName);
- RouterIds rtrs = new RouterIdsBuilder().setKey(new RouterIdsKey(bgpVpnId))
+ RouterIds rtrs = new RouterIdsBuilder().withKey(new RouterIdsKey(bgpVpnId))
.setRouterId(bgpVpnId).setRouterName(bgpVpnName).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
getRoutersIdentifier(bgpVpnId), rtrs);
//Select the IPMap, whose external IP is the IP for which FIB is installed
if (dbExternalIp.contains(externalIp)) {
String dbInternalIp = dbIpMap.getInternalIp();
- IpMapKey dbIpMapKey = dbIpMap.getKey();
+ IpMapKey dbIpMapKey = dbIpMap.key();
LOG.debug("advToBgpAndInstallFibAndTsFlows : Setting label {} for internalIp {} "
+ "and externalIp {}", label, dbInternalIp, externalIp);
- IpMap newIpm = new IpMapBuilder().setKey(dbIpMapKey).setInternalIp(dbInternalIp)
+ IpMap newIpm = new IpMapBuilder().withKey(dbIpMapKey).setInternalIp(dbInternalIp)
.setExternalIp(dbExternalIp).setLabel(label).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
naptManager.getIpMapIdentifier(routerId, dbInternalIp), newIpm);
return;
}
final long finalBgpVpnId = bgpVpnId;
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + update.getKey(), () -> {
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + update.key(), () -> {
List<ListenableFuture<Void>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(writeFlowInvTx -> {
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(removeFlowInvTx -> {
IpMapKey ipMapKey = new IpMapKey(internalIp);
LOG.debug("allocateExternalIp : Setting label {} for internalIp {} and externalIp {}",
label, internalIp, leastLoadedExtIpAddrStr);
- IpMap newIpm = new IpMapBuilder().setKey(ipMapKey).setInternalIp(internalIp)
+ IpMap newIpm = new IpMapBuilder().withKey(ipMapKey).setInternalIp(internalIp)
.setExternalIp(leastLoadedExtIpAddrStr).setLabel(label).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
naptManager.getIpMapIdentifier(routerId, internalIp), newIpm);
centralizedSwitchScheduler.releaseCentralizedSwitch(router);
}
} else {
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + router.getKey(),
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + router.key(),
() -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
LOG.info("remove : Removing default NAT route from FIB on all dpns part of router {} ",
routerName);
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
public void updateNaptSwitch(String routerName, BigInteger naptSwitchId) {
- RouterToNaptSwitch naptSwitch = new RouterToNaptSwitchBuilder().setKey(new RouterToNaptSwitchKey(routerName))
+ RouterToNaptSwitch naptSwitch = new RouterToNaptSwitchBuilder().withKey(new RouterToNaptSwitchKey(routerName))
.setPrimarySwitchId(naptSwitchId).build();
try {
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
if (bgpVpnId != NatConstants.INVALID_ID) {
LOG.debug("changeLocalVpnIdToBgpVpnId : Populate the router-id-name container with the "
+ "mapping BGP VPN-ID {} -> BGP VPN-NAME {}", bgpVpnId, bgpVpnName);
- RouterIds rtrs = new RouterIdsBuilder().setKey(new RouterIdsKey(bgpVpnId))
+ RouterIds rtrs = new RouterIdsBuilder().withKey(new RouterIdsKey(bgpVpnId))
.setRouterId(bgpVpnId).setRouterName(bgpVpnName).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
getRoutersIdentifier(bgpVpnId), rtrs);
@Override
protected void remove(InstanceIdentifier<VpnInstance> key, VpnInstance vpnInstance) {
LOG.trace("remove : External Subnet VPN Instance remove mapping method - key:{}. value={}",
- vpnInstance.getKey(), vpnInstance);
+ vpnInstance.key(), vpnInstance);
String possibleExtSubnetUuid = vpnInstance.getVpnInstanceName();
Optional<Subnets> optionalSubnets = NatUtil.getOptionalExternalSubnets(dataBroker,
new Uuid(possibleExtSubnetUuid));
protected void update(InstanceIdentifier<VpnInstance> key, VpnInstance vpnInstanceOrig,
VpnInstance vpnInstanceNew) {
LOG.trace("update : External Subnet VPN Instance update mapping method - key:{} original:{} new:{}",
- vpnInstanceNew.getKey(), vpnInstanceOrig, vpnInstanceNew);
+ vpnInstanceNew.key(), vpnInstanceOrig, vpnInstanceNew);
}
@Override
protected void add(InstanceIdentifier<VpnInstance> key, VpnInstance vpnInstance) {
LOG.trace("add : External Subnet VPN Instance OP Data Entry add mapping method - key:{}. value={}",
- vpnInstance.getKey(), vpnInstance);
+ vpnInstance.key(), vpnInstance);
String possibleExtSubnetUuid = vpnInstance.getVpnInstanceName();
Optional<Subnets> optionalSubnets = NatUtil.getOptionalExternalSubnets(dataBroker,
new Uuid(possibleExtSubnetUuid));
@Override
protected void add(final InstanceIdentifier<InternalToExternalPortMap> identifier,
final InternalToExternalPortMap mapping) {
- LOG.trace("FloatingIPListener add ip mapping method - key: {} value: {}",mapping.getKey(), mapping);
+ LOG.trace("FloatingIPListener add ip mapping method - key: {} value: {}",mapping.key(), mapping);
processFloatingIPAdd(identifier, mapping);
}
@Override
protected void remove(InstanceIdentifier<InternalToExternalPortMap> identifier, InternalToExternalPortMap mapping) {
- LOG.trace("FloatingIPListener remove ip mapping method - kkey: {} value: {}",mapping.getKey(), mapping);
+ LOG.trace("FloatingIPListener remove ip mapping method - kkey: {} value: {}",mapping.key(), mapping);
processFloatingIPDel(identifier, mapping);
}
protected void update(InstanceIdentifier<InternalToExternalPortMap> identifier, InternalToExternalPortMap
original, InternalToExternalPortMap update) {
LOG.trace("FloatingIPListener update ip mapping method - key: {}, original: {}, update: {}",
- update.getKey(), original, update);
+ update.key(), original, update);
}
private FlowEntity buildPreDNATFlowEntity(BigInteger dpId, InternalToExternalPortMap mapping, long routerId, long
private void processFloatingIPAdd(final InstanceIdentifier<InternalToExternalPortMap> identifier,
final InternalToExternalPortMap mapping) {
- LOG.trace("processFloatingIPAdd key: {}, value: {}", mapping.getKey(), mapping);
+ LOG.trace("processFloatingIPAdd key: {}, value: {}", mapping.key(), mapping);
final String routerId = identifier.firstKeyOf(RouterPorts.class).getRouterId();
final PortsKey pKey = identifier.firstKeyOf(Ports.class);
String interfaceName = pKey.getPortName();
InstanceIdentifier<RouterPorts> portIid = identifier.firstIdentifierOf(RouterPorts.class);
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + mapping.getKey(), () -> Collections.singletonList(
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + mapping.key(), () -> Collections.singletonList(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(
tx -> createNATFlowEntries(interfaceName, mapping, portIid, routerId, tx))),
NatConstants.NAT_DJC_MAX_RETRIES);
private void processFloatingIPDel(final InstanceIdentifier<InternalToExternalPortMap> identifier,
final InternalToExternalPortMap mapping) {
- LOG.trace("processFloatingIPDel : key: {}, value: {}", mapping.getKey(), mapping);
+ LOG.trace("processFloatingIPDel : key: {}, value: {}", mapping.key(), mapping);
final String routerId = identifier.firstKeyOf(RouterPorts.class).getRouterId();
final PortsKey pKey = identifier.firstKeyOf(Ports.class);
String interfaceName = pKey.getPortName();
InstanceIdentifier<RouterPorts> portIid = identifier.firstIdentifierOf(RouterPorts.class);
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + mapping.getKey(), () -> Collections.singletonList(
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + mapping.key(), () -> Collections.singletonList(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(
tx -> removeNATFlowEntries(interfaceName, mapping, portIid, routerId, null, tx))),
NatConstants.NAT_DJC_MAX_RETRIES);
Optional<Ports> optPorts =
SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker,
LogicalDatastoreType.OPERATIONAL, portsId);
- InternalToExternalPortMap intExtPortMap = new InternalToExternalPortMapBuilder().setKey(new
+ InternalToExternalPortMap intExtPortMap = new InternalToExternalPortMapBuilder().withKey(new
InternalToExternalPortMapKey(internalIp)).setInternalIp(internalIp).setExternalIp(externalIp)
.setLabel(label).build();
if (optPorts.isPresent()) {
interfaceName, internalIp);
List<InternalToExternalPortMap> intExtPortMapList = new ArrayList<>();
intExtPortMapList.add(intExtPortMap);
- Ports ports = new PortsBuilder().setKey(new PortsKey(interfaceName)).setPortName(interfaceName)
+ Ports ports = new PortsBuilder().withKey(new PortsKey(interfaceName)).setPortName(interfaceName)
.setInternalToExternalPortMap(intExtPortMapList).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, portsId, ports);
}
return;
}
List<ActionInfo> actionInfos = new ArrayList<>();
- IfL2vlan ifL2vlan = iface.getAugmentation(IfL2vlan.class);
+ IfL2vlan ifL2vlan = iface.augmentation(IfL2vlan.class);
if (ifL2vlan != null && ifL2vlan.getVlanId() != null) {
vlanId = ifL2vlan.getVlanId().getValue() == null ? 0 : ifL2vlan.getVlanId().getValue();
}
private static Node buildInventoryDpnNode(BigInteger dpnId) {
NodeId nodeId = new NodeId("openflow:" + dpnId);
- Node nodeDpn = new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
+ Node nodeDpn = new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return nodeDpn;
}
Node nodeDpn = buildInventoryDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId =
InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, flowKey)
.build();
}
updateCounter(segmentId, externalIp, true);
//update the actual ip-map
- IpMap ipm = new IpMapBuilder().setKey(new IpMapKey(internalIp)).setInternalIp(internalIp)
+ IpMap ipm = new IpMapBuilder().withKey(new IpMapKey(internalIp)).setInternalIp(internalIp)
.setExternalIp(externalIp).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
getIpMapIdentifier(segmentId, internalIp), ipm);
//update the new counter value for this externalIp
ExternalIpCounter externalIpCounterData = new ExternalIpCounterBuilder()
- .setKey(new ExternalIpCounterKey(externalIp)).setExternalIp(externalIp).setCounter(counter).build();
+ .withKey(new ExternalIpCounterKey(externalIp)).setExternalIp(externalIp).setCounter(counter).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
getExternalIpsIdentifier(segmentId, externalIp), externalIpCounterData);
}
// Write to ip-port-map before returning
IpPortExternalBuilder ipExt = new IpPortExternalBuilder();
IpPortExternal ipPortExt = ipExt.setIpAddress(extIp).setPortNum(extPort).build();
- IpPortMap ipm = new IpPortMapBuilder().setKey(new IpPortMapKey(internalIpPort))
+ IpPortMap ipm = new IpPortMapBuilder().withKey(new IpPortMapKey(internalIpPort))
.setIpPortInternal(internalIpPort).setIpPortExternal(ipPortExt).build();
LOG.debug("getExternalAddressMapping : writing into ip-port-map with "
+ "externalIP {} and port {}",
IntIpProtoTypeBuilder builder = new IntIpProtoTypeBuilder();
IntIpProtoType intIpProtocolType =
- builder.setKey(new IntIpProtoTypeKey(protocolType)).setPorts(portList).build();
+ builder.withKey(new IntIpProtoTypeKey(protocolType)).setPorts(portList).build();
try {
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
NatUtil.buildSnatIntIpPortIdentifier(segmentId, internalIpAddress, protocolType),
IntIpProtoTypeBuilder builder = new IntIpProtoTypeBuilder();
IntIpProtoType intIpProtocolType =
- builder.setKey(new IntIpProtoTypeKey(protocolType)).setPorts(portList).build();
+ builder.withKey(new IntIpProtoTypeKey(protocolType)).setPorts(portList).build();
try {
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
NatUtil.buildSnatIntIpPortIdentifier(segmentId, address.getIpAddress(), protocolType),
protected void initialiseNewExternalIpCounter(long routerId, String externalIp) {
ExternalIpCounter externalIpCounterData = new ExternalIpCounterBuilder()
- .setKey(new ExternalIpCounterKey(externalIp)).setExternalIp(externalIp).setCounter((short) 0).build();
+ .withKey(new ExternalIpCounterKey(externalIp)).setExternalIp(externalIp).setCounter((short) 0).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
getExternalIpsIdentifier(routerId, externalIp), externalIpCounterData);
}
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
public boolean updateNaptSwitch(String routerName, BigInteger naptSwitchId) {
- RouterToNaptSwitch naptSwitch = new RouterToNaptSwitchBuilder().setKey(new RouterToNaptSwitchKey(routerName))
+ RouterToNaptSwitch naptSwitch = new RouterToNaptSwitchBuilder().withKey(new RouterToNaptSwitchKey(routerName))
.setPrimarySwitchId(naptSwitchId).build();
try {
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
protected void add(InstanceIdentifier<Interfaces> identifier, Interfaces interfaceInfo) {
- LOG.trace("add : Add event - key: {}, value: {}", interfaceInfo.getKey(), interfaceInfo);
+ LOG.trace("add : Add event - key: {}, value: {}", interfaceInfo.key(), interfaceInfo);
final String routerId = identifier.firstKeyOf(RouterInterfaces.class).getRouterId().getValue();
final String interfaceName = interfaceInfo.getInterfaceId();
@Override
protected void remove(InstanceIdentifier<Interfaces> identifier, Interfaces interfaceInfo) {
- LOG.trace("remove : Remove event - key: {}, value: {}", interfaceInfo.getKey(), interfaceInfo);
+ LOG.trace("remove : Remove event - key: {}, value: {}", interfaceInfo.key(), interfaceInfo);
final String routerId = identifier.firstKeyOf(RouterInterfaces.class).getRouterId().getValue();
final String interfaceName = interfaceInfo.getInterfaceId();
@Override
protected void update(InstanceIdentifier<Interfaces> identifier, Interfaces original, Interfaces update) {
- LOG.trace("update key: {}, original: {}, update: {}", update.getKey(), original, update);
+ LOG.trace("update key: {}, original: {}, update: {}", update.key(), original, update);
}
static RouterInterface getRouterInterface(String interfaceName, String routerName) {
- return new RouterInterfaceBuilder().setKey(new RouterInterfaceKey(interfaceName))
+ return new RouterInterfaceBuilder().withKey(new RouterInterfaceKey(interfaceName))
.setInterfaceName(interfaceName).setRouterName(routerName).build();
}
}
String ifaceName = stateTunnelList.getTunnelInterfaceName();
if (getTunnelType(stateTunnelList) == NatConstants.ITMTunnelLocType.Internal.getValue()) {
Interface configIface = interfaceManager.getInterfaceInfoFromConfigDataStore(ifaceName);
- IfTunnel ifTunnel = configIface != null ? configIface.getAugmentation(IfTunnel.class) : null;
+ IfTunnel ifTunnel = configIface != null ? configIface.augmentation(IfTunnel.class) : null;
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
- ParentRefs refs = configIface.getAugmentation(ParentRefs.class);
+ ParentRefs refs = configIface.augmentation(ParentRefs.class);
if (refs != null && !Strings.isNullOrEmpty(refs.getParentInterface())) {
return true; //multiple VxLAN tunnels enabled, i.e. only logical tunnel should be treated
}
LogicalDatastoreType.OPERATIONAL, dpnVpnInterfacesListIdentifier);
org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns
.router.dpn.list.dpn.vpninterfaces.list.RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(interfaceName))
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(interfaceName))
.setInterface(interfaceName).build();
if (optionalDpnVpninterfacesList.isPresent()) {
LOG.debug("addToNeutronRouterDpnsMap : RouterDpnList already present for the Router {} and DPN {} for the "
LogicalDatastoreType.OPERATIONAL, dpnRoutersListIdentifier);
if (optionalDpnRoutersList.isPresent()) {
- RoutersList routersList = new RoutersListBuilder().setKey(new RoutersListKey(routerName))
+ RoutersList routersList = new RoutersListBuilder().withKey(new RoutersListKey(routerName))
.setRouter(routerName).build();
List<RoutersList> routersListFromDs = optionalDpnRoutersList.get().getRoutersList();
if (!routersListFromDs.contains(routersList)) {
optionalRouterDpnList.get().getRouterInterfaces();
org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router
.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(interfaceName))
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(interfaceName))
.setInterface(interfaceName).build();
if (routerInterfaces != null && routerInterfaces.remove(routerInterface)) {
if (routerInterfaces.isEmpty()) {
optionalRouterDpnList.get().getRouterInterfaces();
org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn
.list.dpn.vpninterfaces.list.RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(vpnInterfaceName))
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(vpnInterfaceName))
.setInterface(vpnInterfaceName).build();
if (routerInterfaces != null && routerInterfaces.remove(routerInterface)) {
LOG.error("createRouterIdsConfigDS : invalid routerId for routerName {}", routerName);
return;
}
- RouterIds rtrs = new RouterIdsBuilder().setKey(new RouterIdsKey(routerId))
+ RouterIds rtrs = new RouterIdsBuilder().withKey(new RouterIdsKey(routerId))
.setRouterId(routerId).setRouterName(routerName).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, buildRouterIdentifier(routerId), rtrs);
}
@Override
protected void add(final InstanceIdentifier<DpnVpninterfacesList> identifier, final DpnVpninterfacesList dpnInfo) {
- LOG.trace("add : key: {}, value: {}", dpnInfo.getKey(), dpnInfo);
+ LOG.trace("add : key: {}, value: {}", dpnInfo.key(), dpnInfo);
final String routerUuid = identifier.firstKeyOf(RouterDpnList.class).getRouterId();
BigInteger dpnId = dpnInfo.getDpnId();
//check router is associated to external network
natServiceManager.notify(router, naptSwitch, dpnId,
SnatServiceManager.Action.SNAT_ROUTER_ENBL);
} else {
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + dpnInfo.getKey(), () -> {
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + dpnInfo.key(), () -> {
List<ListenableFuture<Void>> futures = new ArrayList<>(2);
LOG.debug("add : Router {} is associated with ext nw {}", routerUuid, networkId);
Uuid vpnName = NatUtil.getVpnForRouter(dataBroker, routerUuid);
@Override
protected void remove(InstanceIdentifier<DpnVpninterfacesList> identifier, DpnVpninterfacesList dpnInfo) {
- LOG.trace("remove : key: {}, value: {}", dpnInfo.getKey(), dpnInfo);
+ LOG.trace("remove : key: {}, value: {}", dpnInfo.key(), dpnInfo);
final String routerUuid = identifier.firstKeyOf(RouterDpnList.class).getRouterId();
Long routerId = NatUtil.getVpnId(dataBroker, routerUuid);
if (routerId == NatConstants.INVALID_ID) {
natServiceManager.notify(router, naptSwitch, dpnId,
SnatServiceManager.Action.SNAT_ROUTER_DISBL);
} else {
- coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + dpnInfo.getKey(), () -> {
+ coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + dpnInfo.key(), () -> {
LOG.debug("remove : Router {} is associated with ext nw {}", routerUuid, networkId);
Uuid vpnName = NatUtil.getVpnForRouter(dataBroker, routerUuid);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
@Override
protected void update(InstanceIdentifier<DpnVpninterfacesList> identifier, DpnVpninterfacesList original,
DpnVpninterfacesList update) {
- LOG.trace("Update key: {}, original: {}, update: {}", update.getKey(), original, update);
+ LOG.trace("Update key: {}, original: {}, update: {}", update.key(), original, update);
}
// TODO Clean up the exception handling
@Override
protected void add(final InstanceIdentifier<RouterPorts> identifier, final RouterPorts routerPorts) {
- LOG.trace("add : key:{} value:{}",routerPorts.getKey(), routerPorts);
+ LOG.trace("add : key:{} value:{}",routerPorts.key(), routerPorts);
Optional<RouterPorts> optRouterPorts =
SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker,
LogicalDatastoreType.OPERATIONAL, identifier);
RouterPorts ports = optRouterPorts.get();
String routerName = ports.getRouterId();
MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.OPERATIONAL, identifier,
- new RouterPortsBuilder().setKey(new RouterPortsKey(routerName)).setRouterId(routerName)
+ new RouterPortsBuilder().withKey(new RouterPortsKey(routerName)).setRouterId(routerName)
.setExternalNetworkId(routerPorts.getExternalNetworkId()).build());
} else {
String routerName = routerPorts.getRouterId();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, identifier,
- new RouterPortsBuilder().setKey(new RouterPortsKey(routerName)).setRouterId(routerName)
+ new RouterPortsBuilder().withKey(new RouterPortsKey(routerName)).setRouterId(routerName)
.setExternalNetworkId(routerPorts.getExternalNetworkId()).build());
}
//Check if the router is associated with any BGP VPN and update the association
if (!optRouterMapping.isPresent()) {
Long vpnId = NatUtil.getVpnId(dataBroker, vpnName.getValue());
LOG.debug("add : Updating router {} to VPN {} association with Id {}", routerName, vpnName, vpnId);
- Routermapping routerMapping = new RoutermappingBuilder().setKey(new RoutermappingKey(routerName))
+ Routermapping routerMapping = new RoutermappingBuilder().withKey(new RoutermappingKey(routerName))
.setRouterName(routerName).setVpnName(vpnName.getValue()).setVpnId(vpnId).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, routerMappingId, routerMapping);
}
@Override
protected void remove(InstanceIdentifier<RouterPorts> identifier, RouterPorts routerPorts) {
- LOG.trace("remove : key:{} value:{}",routerPorts.getKey(), routerPorts);
+ LOG.trace("remove : key:{} value:{}",routerPorts.key(), routerPorts);
//MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.OPERATIONAL, identifier);
//Remove the router to vpn association mapping entry if at all present
String routerName = routerPorts.getRouterId();
@Override
protected void update(InstanceIdentifier<RouterPorts> identifier, RouterPorts original, RouterPorts update) {
- LOG.trace("Update : key: {}, original:{}, update:{}",update.getKey(), original, update);
+ LOG.trace("Update : key: {}, original:{}, update:{}",update.key(), original, update);
}
}
@Override
protected void remove(InstanceIdentifier<Subnetmap> identifier, Subnetmap subnetmap) {
- LOG.trace("remove key: {} value: {}", subnetmap.getKey(), subnetmap);
+ LOG.trace("remove key: {} value: {}", subnetmap.key(), subnetmap);
NatServiceCounters.subnetmap_remove.inc();
externalNetworkGroupInstaller.removeExtNetGroupEntries(subnetmap);
}
@Override
protected void update(InstanceIdentifier<Subnetmap> identifier,
Subnetmap subnetmapBefore, Subnetmap subnetmapAfter) {
- LOG.trace("update key: {}, original: {}, update: {}", subnetmapAfter.getKey(), subnetmapBefore, subnetmapAfter);
+ LOG.trace("update key: {}, original: {}, update: {}", subnetmapAfter.key(), subnetmapBefore, subnetmapAfter);
NatServiceCounters.subnetmap_update.inc();
externalNetworkGroupInstaller.installExtNetGroupEntries(subnetmapAfter);
}
@Override
protected void add(InstanceIdentifier<Subnetmap> identifier, Subnetmap subnetmap) {
- LOG.trace("add key: {} value: {}", subnetmap.getKey(), subnetmap);
+ LOG.trace("add key: {} value: {}", subnetmap.key(), subnetmap);
NatServiceCounters.subnetmap_add.inc();
externalNetworkGroupInstaller.installExtNetGroupEntries(subnetmap);
}
ipmapId = InstanceIdentifier.builder(
IntextIpMap.class).child(IpMapping.class, new IpMappingKey(5L))
.child(IpMap.class, new IpMapKey("10.0.0.1")).build();
- ipmap = new IpMapBuilder().setKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
+ ipmap = new IpMapBuilder().withKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
.setExternalIp("192.17.13.1").build();
try {
PowerMockito.doNothing()
// TODO : This needs to be modified to make it work
ipmapId = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(5L)).child(IpMap.class, new IpMapKey("10.0.0.1")).build();
- ipmap = new IpMapBuilder().setKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
+ ipmap = new IpMapBuilder().withKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
.setExternalIp("192.17.13.1/24").build();
try {
PowerMockito.doNothing()
// TODO : This needs to be modified to make it work
ipmapId = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(6L)).child(IpMap.class, new IpMapKey("10.0.2.1/16")).build();
- ipmap = new IpMapBuilder().setKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
+ ipmap = new IpMapBuilder().withKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1")
.setExternalIp("192.19.15.3").build();
try {
PowerMockito.doNothing()
// TODO : This needs to be modified to make it work
ipmapId = InstanceIdentifier.builder(IntextIpMap.class)
.child(IpMapping.class, new IpMappingKey(6L)).child(IpMap.class, new IpMapKey("10.2.0.2/24")).build();
- ipmap = new IpMapBuilder().setKey(new IpMapKey("10.2.0.2/24")).setInternalIp("10.2.0.2/24")
+ ipmap = new IpMapBuilder().withKey(new IpMapKey("10.2.0.2/24")).setInternalIp("10.2.0.2/24")
.setExternalIp("192.21.16.1/16").build();
try {
PowerMockito.doNothing()
}
public static boolean isPortVnicTypeNormal(Port port) {
- PortBindingExtension portBinding = port.getAugmentation(PortBindingExtension.class);
+ PortBindingExtension portBinding = port.augmentation(PortBindingExtension.class);
if (portBinding == null || portBinding.getVnicType() == null) {
// By default, VNIC_TYPE is NORMAL
return true;
public static <T extends NetworkTypeBase> String getSegmentationIdFromNeutronNetwork(Network network,
Class<T> networkType) {
String segmentationId = null;
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
segmentationId = providerExtension.getSegmentationId();
if (segmentationId == null) {
public static <T extends NetworkTypeBase> boolean isNetworkSegmentType(Network network, Long index,
Class<T> expectedNetworkType) {
Class<? extends NetworkTypeBase> segmentType = null;
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
List<Segments> providerSegments = providerExtension.getSegments();
if (providerSegments != null && providerSegments.size() > 0) {
}
public static Long getNumberSegmentsFromNeutronNetwork(Network network) {
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
Integer numSegs = 0;
if (providerExtension != null) {
List<Segments> providerSegments = providerExtension.getSegments();
public static String getSegmentationIdFromNeutronNetworkSegment(Network network, Long index) {
String segmentationId = null;
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
List<Segments> providerSegments = providerExtension.getSegments();
if (providerSegments != null && providerSegments.size() > 0) {
LOG.debug("Creating new routerPorts node {} in floatingIpInfo DS for floating IP {} on fixed "
+ "neutron port {} : ", routerName, floatingIpAddress, fixedNeutronPortName);
routerPortsBuilder =
- new RouterPortsBuilder().setKey(new RouterPortsKey(routerName)).setRouterId(routerName);
+ new RouterPortsBuilder().withKey(new RouterPortsKey(routerName)).setRouterId(routerName);
}
if (extNetworkId != null) {
routerPortsBuilder.setExternalNetworkId(extNetworkId);
}
}
if (fixedNeutronPortBuilder == null) {
- fixedNeutronPortBuilder = new PortsBuilder().setKey(new PortsKey(fixedNeutronPortName))
+ fixedNeutronPortBuilder = new PortsBuilder().withKey(new PortsKey(fixedNeutronPortName))
.setPortName(fixedNeutronPortName);
}
if (fixedIpAddress != null) {
if (intExtPortMapList == null) {
intExtPortMapList = new ArrayList<>();
}
- InternalToExternalPortMap intExtPortMap = new InternalToExternalPortMapBuilder().setKey(new
+ InternalToExternalPortMap intExtPortMap = new InternalToExternalPortMapBuilder().withKey(new
InternalToExternalPortMapKey(fixedIpAddress)).setInternalIp(fixedIpAddress)
.setExternalIp(floatingIpAddress).setExternalId(floatingIpId).setLabel(null).build();
intExtPortMapList.add(intExtPortMap);
private InstanceIdentifier<Hostconfig> createInstanceIdentifier(Hostconfig hostconfig) {
return InstanceIdentifier.create(Neutron.class)
.child(Hostconfigs.class)
- .child(Hostconfig.class, hostconfig.getKey());
+ .child(Hostconfig.class, hostconfig.key());
}
}
LOG.error("Neutronvpn doesn't support the provider type for given network {}", networkId);
return;
}
- Class<? extends NetworkTypeBase> networkType = input.getAugmentation(NetworkProviderExtension.class)
+ Class<? extends NetworkTypeBase> networkType = input.augmentation(NetworkProviderExtension.class)
.getNetworkType();
if (NeutronvpnUtils.isVlanOrVxlanNetwork(networkType)
&& NeutronUtils.getSegmentationIdFromNeutronNetwork(input, networkType) == null) {
@Nonnull
private List<ElanSegments> buildSegments(Network input) {
- NetworkProviderExtension providerExtension = input.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = input.augmentation(NetworkProviderExtension.class);
if (providerExtension == null || providerExtension.getSegments() == null) {
return Collections.emptyList();
}
elanInstanceBuilder.setElanSegments(segments);
elanInstanceBuilder.setExternal(isExternal);
- elanInstanceBuilder.setKey(new ElanInstanceKey(elanInstanceName));
+ elanInstanceBuilder.withKey(new ElanInstanceKey(elanInstanceName));
return elanInstanceBuilder;
}
private String getPortHostId(final Port port) {
if (port != null) {
- PortBindingExtension portBinding = port.getAugmentation(PortBindingExtension.class);
+ PortBindingExtension portBinding = port.augmentation(PortBindingExtension.class);
if (portBinding != null) {
return portBinding.getHostId();
}
}
private boolean isPortVnicTypeDirect(Port port) {
- PortBindingExtension portBinding = port.getAugmentation(PortBindingExtension.class);
+ PortBindingExtension portBinding = port.augmentation(PortBindingExtension.class);
if (portBinding == null || portBinding.getVnicType() == null) {
// By default, VNIC_TYPE is NORMAL
return false;
return false;
}
- PortBindingExtension portBinding = port.getAugmentation(PortBindingExtension.class);
+ PortBindingExtension portBinding = port.augmentation(PortBindingExtension.class);
String profile = portBinding.getProfile();
if (profile == null || profile.isEmpty()) {
LOG.debug("Port {} has no binding:profile values", port.getUuid());
} else {
if (updatedSecurityEnabled) {
// handle SG add/delete delta
- InterfaceAcl interfaceAcl = interfaceBuilder.getAugmentation(InterfaceAcl.class);
+ InterfaceAcl interfaceAcl = interfaceBuilder.augmentation(InterfaceAcl.class);
interfaceAclBuilder = new InterfaceAclBuilder(interfaceAcl);
interfaceAclBuilder.setSecurityGroups(
NeutronvpnUtils.getUpdatedSecurityGroups(interfaceAcl.getSecurityGroups(),
InstanceIdentifier<ElanInterface> id = InstanceIdentifier.builder(ElanInterfaces.class).child(ElanInterface
.class, new ElanInterfaceKey(name)).build();
ElanInterface elanInterface = new ElanInterfaceBuilder().setElanInstanceName(elanInstanceName)
- .setName(name).setStaticMacEntries(staticMacEntries).setKey(new ElanInterfaceKey(name)).build();
+ .setName(name).setStaticMacEntries(staticMacEntries).withKey(new ElanInterfaceKey(name)).build();
wrtConfigTxn.put(LogicalDatastoreType.CONFIGURATION, id, elanInterface);
LOG.debug("Creating new ELan Interface {}", elanInterface);
}
InstanceIdentifier id = buildfloatingIpIdToPortMappingIdentifier(floatingIpId);
try {
FloatingIpIdToPortMappingBuilder floatingipIdToPortMacMappingBuilder = new
- FloatingIpIdToPortMappingBuilder().setKey(new FloatingIpIdToPortMappingKey(floatingIpId))
+ FloatingIpIdToPortMappingBuilder().withKey(new FloatingIpIdToPortMappingKey(floatingIpId))
.setFloatingIpId(floatingIpId).setFloatingIpPortId(floatingIpPortId)
.setFloatingIpPortSubnetId(floatingIpPortSubnetId)
.setFloatingIpPortMacAddress(floatingIpPortMacAddress);
actionsBuilder.setPacketHandling(new PermitBuilder().setPermit(true).build());
AceBuilder aceBuilder = new AceBuilder();
- aceBuilder.setKey(new AceKey(securityRule.getUuid().getValue()));
+ aceBuilder.withKey(new AceKey(securityRule.getUuid().getValue()));
aceBuilder.setRuleName(securityRule.getUuid().getValue());
aceBuilder.setMatches(matchesBuilder.build());
aceBuilder.setActions(actionsBuilder.build());
if (optionalNetworkMap.isPresent()) {
nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
} else {
- nwMapBuilder = new NetworkMapBuilder().setKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
+ nwMapBuilder = new NetworkMapBuilder().withKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
LOG.debug("Adding a new network node in NetworkMaps DS for network {}", networkId.getValue());
}
List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
InstanceIdentifier<Feature> iid = InstanceIdentifier.builder(
Neutron.class).child(Features.class).child(
Feature.class, new FeatureKey(OperationalPortStatus.class)).build();
- Feature feature = new FeatureBuilder().setKey(new FeatureKey(OperationalPortStatus.class)).build();
+ Feature feature = new FeatureBuilder().withKey(new FeatureKey(OperationalPortStatus.class)).build();
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, iid, feature);
} catch (TransactionCommitFailedException e) {
subnetId.getValue());
return;
}
- SubnetmapBuilder subnetmapBuilder = new SubnetmapBuilder().setKey(new SubnetmapKey(subnetId))
+ SubnetmapBuilder subnetmapBuilder = new SubnetmapBuilder().withKey(new SubnetmapKey(subnetId))
.setId(subnetId).setSubnetIp(subnetIp).setTenantId(tenantId).setNetworkId(networkId)
.setNetworkType(networkType).setSegmentationId(segmentationId);
LOG.debug("createSubnetmapNode: Adding a new subnet node in Subnetmaps DS for subnet {}",
builder = new VpnInstanceBuilder(optionalVpn.get());
LOG.debug("updating existing vpninstance node");
} else {
- builder = new VpnInstanceBuilder().setKey(new VpnInstanceKey(vpnName)).setVpnInstanceName(vpnName)
+ builder = new VpnInstanceBuilder().withKey(new VpnInstanceKey(vpnName)).setVpnInstanceName(vpnName)
.setType(type).setL3vni(l3vni);
}
if (irt != null && !irt.isEmpty()) {
irt.remove(common);
ert.remove(common);
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(common)).setVrfRTValue(common)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(common)).setVrfRTValue(common)
.setVrfRTType(VpnTarget.VrfRTType.Both).build();
vpnTargetList.add(vpnTarget);
}
}
for (String importRT : irt) {
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(importRT)).setVrfRTValue(importRT)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(importRT)).setVrfRTValue(importRT)
.setVrfRTType(VpnTarget.VrfRTType.ImportExtcommunity).build();
vpnTargetList.add(vpnTarget);
}
if (ert != null && !ert.isEmpty()) {
for (String exportRT : ert) {
VpnTarget vpnTarget =
- new VpnTargetBuilder().setKey(new VpnTargetKey(exportRT)).setVrfRTValue(exportRT)
+ new VpnTargetBuilder().withKey(new VpnTargetKey(exportRT)).setVrfRTValue(exportRT)
.setVrfRTType(VpnTarget.VrfRTType.ExportExtcommunity).build();
vpnTargetList.add(vpnTarget);
}
if (optionalVpnMap.isPresent()) {
builder = new VpnMapBuilder(optionalVpnMap.get());
} else {
- builder = new VpnMapBuilder().setKey(new VpnMapKey(vpnId)).setVpnId(vpnId);
+ builder = new VpnMapBuilder().withKey(new VpnMapKey(vpnId)).setVpnId(vpnId);
}
if (name != null) {
WriteTransaction wrtConfigTxn, Subnetmap sn, VpnInterface vpnIface) {
List<Adjacency> adjList = new ArrayList<>();
if (vpnIface != null) {
- adjList = vpnIface.getAugmentation(Adjacencies.class).getAdjacency();
+ adjList = vpnIface.augmentation(Adjacencies.class).getAdjacency();
}
String infName = port.getUuid().getValue();
LOG.trace("neutronVpnManager: create config adjacencies for Port: {}", infName);
neutronvpnUtils.createVpnPortFixedIpToPort(vpnId.getValue(), ipValue,
infName, port.getMacAddress().getValue(), isRouterInterface, wrtConfigTxn);
//Create Neutron port adjacency if VPN presence is existing for subnet
- Adjacency vmAdj = new AdjacencyBuilder().setKey(new AdjacencyKey(ipPrefix)).setIpAddress(ipPrefix)
+ Adjacency vmAdj = new AdjacencyBuilder().withKey(new AdjacencyKey(ipPrefix)).setIpAddress(ipPrefix)
.setMacAddress(port.getMacAddress().getValue()).setAdjacencyType(AdjacencyType.PrimaryAdjacency)
.setSubnetId(ip.getSubnetId()).build();
if (!adjList.contains(vmAdj)) {
}
LOG.trace("withdraw adjacencies for Port: {} subnet {}", port.getUuid().getValue(),
sn != null ? sn.getSubnetIp() : "null");
- List<Adjacency> vpnAdjsList = optionalVpnInterface.get().getAugmentation(Adjacencies.class).getAdjacency();
+ List<Adjacency> vpnAdjsList = optionalVpnInterface.get().augmentation(Adjacencies.class).getAdjacency();
List<Adjacency> updatedAdjsList = new ArrayList<>();
boolean isIpFromAnotherSubnet = false;
for (Adjacency adj : vpnAdjsList) {
}
VpnInterfaceBuilder vpnIfBuilder = new VpnInterfaceBuilder(optionalVpnInterface.get())
.setVpnInstanceNames(listVpn);
- Adjacencies adjs = vpnIfBuilder.getAugmentation(Adjacencies.class);
+ Adjacencies adjs = vpnIfBuilder.augmentation(Adjacencies.class);
LOG.debug("Updating vpn interface {}", infName);
List<Adjacency> adjacencyList = adjs != null ? adjs.getAdjacency() : new ArrayList<>();
Iterator<Adjacency> adjacencyIter = adjacencyList.iterator();
.setVpnInstanceNames(listVpn);
LOG.debug("Updating vpn interface {}", infName);
if (!isBeingAssociated) {
- Adjacencies adjs = vpnIfBuilder.getAugmentation(Adjacencies.class);
+ Adjacencies adjs = vpnIfBuilder.augmentation(Adjacencies.class);
List<Adjacency> adjacencyList = adjs != null ? adjs.getAdjacency() : new ArrayList<>();
Iterator<Adjacency> adjacencyIter = adjacencyList.iterator();
while (adjacencyIter.hasNext()) {
Optional<RouterInterfaces> optRouterInterfaces =
SingleTransactionDataBroker.syncReadOptional(dataBroker, LogicalDatastoreType.CONFIGURATION,
routerInterfacesId);
- Interfaces routerInterface = new InterfacesBuilder().setKey(new InterfacesKey(interfaceName))
+ Interfaces routerInterface = new InterfacesBuilder().withKey(new InterfacesKey(interfaceName))
.setInterfaceId(interfaceName).build();
if (optRouterInterfaces.isPresent()) {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
Optional<RouterInterfaces> optRouterInterfaces =
SingleTransactionDataBroker.syncReadOptional(dataBroker, LogicalDatastoreType.CONFIGURATION,
routerInterfacesId);
- Interfaces routerInterface = new InterfacesBuilder().setKey(new InterfacesKey(interfaceName))
+ Interfaces routerInterface = new InterfacesBuilder().withKey(new InterfacesKey(interfaceName))
.setInterfaceId(interfaceName).build();
if (optRouterInterfaces.isPresent()) {
RouterInterfaces routerInterfaces = optRouterInterfaces.get();
final List<String> ipList = entry.getValue();
Adjacency erAdj = new AdjacencyBuilder().setIpAddress(destination)
.setAdjacencyType(AdjacencyType.ExtraRoute).setNextHopIpList(ipList)
- .setKey(new AdjacencyKey(destination)).build();
+ .withKey(new AdjacencyKey(destination)).build();
adjList.add(erAdj);
}
return adjList;
continue;
}
Adjacency erAdj = new AdjacencyBuilder().setIpAddress(destination)
- .setNextHopIpList(Collections.singletonList(nextHop)).setKey(new AdjacencyKey(destination))
+ .setNextHopIpList(Collections.singletonList(nextHop)).withKey(new AdjacencyKey(destination))
.setAdjacencyType(AdjacencyType.ExtraRoute).build();
isLockAcquired = interfaceLock.tryLock(infName, LOCK_WAIT_TIME, TimeUnit.SECONDS);
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
VpnInterfaces.class).child(VpnInterface.class, new VpnInterfaceKey(infName)).build();
Adjacency newAdj = new AdjacencyBuilder(adjacency.get()).setIpAddress(destination)
.setNextHopIpList(nextHopList)
- .setKey(new AdjacencyKey(destination))
+ .withKey(new AdjacencyKey(destination))
.build();
Adjacencies erAdjs =
new AdjacenciesBuilder().setAdjacency(Collections.singletonList(newAdj)).build();
- VpnInterface vpnIf = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(infName))
+ VpnInterface vpnIf = new VpnInterfaceBuilder().withKey(new VpnInterfaceKey(infName))
.addAugmentation(Adjacencies.class, erAdjs).build();
SingleTransactionDataBroker.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION,
vpnIfIdentifier, vpnIf);
nw.getValue()));
continue;
}
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
if (providerExtension.getSegments() != null && providerExtension.getSegments().size() > 1) {
LOG.error("associateNetworksToVpn: MultiSegmented network {} not supported in BGPVPN {}",
nw.getValue(), vpnId.getValue());
}
InstanceIdentifier<VpnInterface> vpnIfIdentifier = NeutronvpnUtils.buildVpnInterfaceIdentifier(infName);
- VpnInterfaceBuilder vpnb = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(infName))
+ VpnInterfaceBuilder vpnb = new VpnInterfaceBuilder().withKey(new VpnInterfaceKey(infName))
.setName(infName)
.setVpnInstanceNames(vpnIdListStruct)
.setRouterInterface(isRouterInterface);
return;
}
NetworksBuilder builder = null;
- builder = new NetworksBuilder().setKey(new NetworksKey(extNetId)).setId(extNetId);
+ builder = new NetworksBuilder().withKey(new NetworksKey(extNetId)).setId(extNetId);
builder.setVpnid(neutronvpnUtils.getVpnForNetwork(extNetId));
builder.setRouterIds(new ArrayList<>());
builder.setProviderNetworkType(provType);
if (optionalRouters.isPresent()) {
builder = new RoutersBuilder(optionalRouters.get());
} else {
- builder = new RoutersBuilder().setKey(new RoutersKey(routerId.getValue()));
+ builder = new RoutersBuilder().withKey(new RoutersKey(routerId.getValue()));
}
builder.setRouterName(routerId.getValue());
builder.setNetworkId(extNetId);
private Subnets createSubnets(Uuid subnetId, Uuid networkId, List<Uuid> routerIds) {
SubnetsBuilder subnetsBuilder = new SubnetsBuilder();
- subnetsBuilder.setKey(new SubnetsKey(subnetId));
+ subnetsBuilder.withKey(new SubnetsKey(subnetId));
subnetsBuilder.setId(subnetId);
subnetsBuilder.setVpnId(subnetId);
subnetsBuilder.setExternalNetworkId(networkId);
Uuid subnetId = fixedIps.getSubnetId();
String ip = fixedIps.getIpAddress().getIpv4Address().getValue();
ExternalIpsBuilder externalIpsBuilder = new ExternalIpsBuilder();
- externalIpsBuilder.setKey(new ExternalIpsKey(ip, subnetId));
+ externalIpsBuilder.withKey(new ExternalIpsKey(ip, subnetId));
externalIpsBuilder.setIpAddress(ip);
externalIpsBuilder.setSubnetId(subnetId);
externalIps.add(externalIpsBuilder.build());
// router interface, dhcp port and floating ip.
return false;
}
- PortSecurityExtension portSecurity = port.getAugmentation(PortSecurityExtension.class);
+ PortSecurityExtension portSecurity = port.augmentation(PortSecurityExtension.class);
if (portSecurity != null) {
return portSecurity.isPortSecurityEnabled();
}
.AllowedAddressPairs allowedAddressPair1 = iterator.next();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes
.AllowedAddressPairs allowedAddressPair2 : list2) {
- if (allowedAddressPair1.getKey().equals(allowedAddressPair2.getKey())) {
+ if (allowedAddressPair1.key().equals(allowedAddressPair2.key())) {
iterator.remove();
break;
}
String portId = port.getUuid().getValue();
InstanceIdentifier<PortSubnet> portSubnetIdentifier = buildPortSubnetIdentifier(portId);
- PortSubnetBuilder portSubnetBuilder = new PortSubnetBuilder().setKey(new PortSubnetKey(portId))
+ PortSubnetBuilder portSubnetBuilder = new PortSubnetBuilder().withKey(new PortSubnetKey(portId))
.setPortId(portId).setSubnetInfo(portSubnetInfo);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
NeutronSecurityRuleConstants.IP_VERSION_MAP.get(subnet.getIpVersion());
Class<? extends Dhcpv6Base> raMode = subnet.getIpv6RaMode() == null ? null
: NeutronSecurityRuleConstants.RA_MODE_MAP.get(subnet.getIpv6RaMode());
- SubnetInfo subnetInfo = new SubnetInfoBuilder().setKey(new SubnetInfoKey(subnetId))
+ SubnetInfo subnetInfo = new SubnetInfoBuilder().withKey(new SubnetInfoKey(subnetId))
.setIpVersion(ipVersion).setIpPrefix(new IpPrefixOrAddress(subnet.getCidr()))
.setIpv6RaMode(raMode).setGatewayIp(subnet.getGatewayIp()).build();
subnetInfoList.add(subnetInfo);
boolean isSubnetIp, WriteTransaction writeConfigTxn) {
InstanceIdentifier<VpnPortipToPort> id = NeutronvpnUtils.buildVpnPortipToPortIdentifier(vpnName, fixedIp);
VpnPortipToPortBuilder builder = new VpnPortipToPortBuilder()
- .setKey(new VpnPortipToPortKey(fixedIp, vpnName))
+ .withKey(new VpnPortipToPortKey(fixedIp, vpnName))
.setVpnName(vpnName).setPortFixedip(fixedIp)
.setPortName(portName).setMacAddress(macAddress).setSubnetIp(isSubnetIp);
try {
public static String getSegmentationIdFromNeutronNetwork(Network network) {
String segmentationId = null;
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
Class<? extends NetworkTypeBase> networkType = providerExtension.getNetworkType();
segmentationId = NeutronUtils.getSegmentationIdFromNeutronNetwork(network, networkType);
}
public static Class<? extends SegmentTypeBase> getSegmentTypeFromNeutronNetwork(Network network) {
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
return providerExtension != null ? NETWORK_MAP.get(providerExtension.getNetworkType()) : null;
}
public static String getPhysicalNetworkName(Network network) {
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
return providerExtension != null ? providerExtension.getPhysicalNetwork() : null;
}
}
static Boolean getIsExternal(Network network) {
- return network.getAugmentation(NetworkL3Extension.class) != null
- && network.getAugmentation(NetworkL3Extension.class).isExternal();
+ return network.augmentation(NetworkL3Extension.class) != null
+ && network.augmentation(NetworkL3Extension.class).isExternal();
}
public void addToQosPolicyCache(QosPolicy qosPolicy) {
}
public static Class<? extends NetworkTypeBase> getNetworkType(Network network) {
- NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension providerExtension = network.augmentation(NetworkProviderExtension.class);
return providerExtension != null ? providerExtension.getNetworkType() : null;
}
LOG.error("Error in getting provider network type since network is null");
return null;
}
- NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension npe = network.augmentation(NetworkProviderExtension.class);
if (npe != null) {
Class<? extends NetworkTypeBase> networkTypeBase = npe.getNetworkType();
if (networkTypeBase != null) {
}
static boolean isNetworkTypeSupported(Network network) {
- NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension npe = network.augmentation(NetworkProviderExtension.class);
return npe != null && npe.getNetworkType() != null && SUPPORTED_NETWORK_TYPES.contains(npe.getNetworkType());
}
static boolean isNetworkOfType(Network network, Class<? extends NetworkTypeBase> type) {
- NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
+ NetworkProviderExtension npe = network.augmentation(NetworkProviderExtension.class);
if (npe != null && npe.getNetworkType() != null) {
return type.isAssignableFrom(npe.getNetworkType());
}
EvpnAugmentationBuilder evpnAugmentationBuilder = new EvpnAugmentationBuilder();
ElanInstanceBuilder elanInstanceBuilder = new ElanInstanceBuilder(elanInstanceOptional.get());
- if (elanInstanceBuilder.getAugmentation(EvpnAugmentation.class) != null) {
+ if (elanInstanceBuilder.augmentation(EvpnAugmentation.class) != null) {
evpnAugmentationBuilder =
- new EvpnAugmentationBuilder(elanInstanceBuilder.getAugmentation(EvpnAugmentation.class));
+ new EvpnAugmentationBuilder(elanInstanceBuilder.augmentation(EvpnAugmentation.class));
}
if (operation == Operation.ADD) {
evpnAugmentationBuilder.setEvpnName(vpnName);
LOG.debug("Deleting Evpn-Network with key {}", rd);
tx.delete(LogicalDatastoreType.CONFIGURATION, rdToNetworkIdentifier);
} else {
- EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder().setKey(
+ EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder().withKey(
new EvpnRdToNetworkKey(rd));
evpnRdToNetworkBuilder.setRd(rd);
evpnRdToNetworkBuilder.setNetworkId(elanInstanceName);
Futures.addCallback(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
for (L2gatewayConnection connection : connections) {
InstanceIdentifier<L2gatewayConnection> iid = InstanceIdentifier.create(Neutron.class)
- .child(L2gatewayConnections.class).child(L2gatewayConnection.class, connection.getKey());
+ .child(L2gatewayConnections.class).child(L2gatewayConnection.class, connection.key());
tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
}
}), new FutureCallback<Void>() {
SubnetOpDataEntry data = optionalSubs.get();
System.out.println("Fetching subnetmap for given subnetId\n");
System.out.println("------------------------------------------------------------------------------");
- System.out.println("Key: " + data.getKey() + "\n" + "VrfId: " + data.getVrfId() + "\n" + "ElanTag: "
+ System.out.println("Key: " + data.key() + "\n" + "VrfId: " + data.getVrfId() + "\n" + "ElanTag: "
+ "" + data.getElanTag() + "\n" + "NhDpnId: " + data.getNhDpnId() + "\n" + "RouteAdvState: "
+ data.getRouteAdvState() + "\n" + "SubnetCidr: " + data.getSubnetCidr() + "\n"
+ "SubnetToDpnList: " + data.getSubnetToDpn() + "\n" + "VpnName: " + data.getVpnName() + "\n");
System.out.println("Fetching subnetmapdataentry for given subnetId\n");
System.out.println("------------------------"
+ "------------------------------------------------------");
- System.out.println("Key: " + data.getKey() + "\n" + "VrfId: " + data.getVrfId() + "\n"
+ System.out.println("Key: " + data.key() + "\n" + "VrfId: " + data.getVrfId() + "\n"
+ "ElanTag: " + "" + data.getElanTag() + "\n" + "NhDpnId: " + data.getNhDpnId() + "\n"
+ "RouteAdvState: " + data.getRouteAdvState() + "\n" + "SubnetCidr: " + data.getSubnetCidr()
+ "\n" + "SubnetToDpnList: " + data.getSubnetToDpn() + "\n" + "VpnName: "
System.out.println("------------------------------------------------------------------------------");
String getRouterInterfacePortId = (data.getRouterInterfacePortId() != null
? data.getRouterInterfacePortId().getValue() : "null");
- System.out.println("Key: " + data.getKey() + "\n" + "VpnId: " + data.getVpnId() + "\n"
+ System.out.println("Key: " + data.key() + "\n" + "VpnId: " + data.getVpnId() + "\n"
+ "InternetVpnId: " + data.getInternetVpnId() + "\n"
+ "DirectPortList: " + data.getDirectPortList() + "\n" + "NetworkId: " + data.getNetworkId()
+ "\n" + "Network-type: " + data.getNetworkType() + "\n" + "Network-segmentation-Id: "
System.out.println("------------------------------------------------------------------------------");
String getRouterInterfacePortId = (data.getRouterInterfacePortId() != null
? data.getRouterInterfacePortId().getValue() : "null");
- System.out.println("Key: " + data.getKey() + "\n" + "VpnId: " + data.getVpnId() + "\n"
+ System.out.println("Key: " + data.key() + "\n" + "VpnId: " + data.getVpnId() + "\n"
+ "InternetVpnId: " + data.getInternetVpnId() + "\n"
+ "DirectPortList: " + data.getDirectPortList() + "\n" + "NetworkId: " + data.getNetworkId()
+ "\n" + "Network-type: " + data.getNetworkType() + "\n" + "Network-segmentation-Id: "
SubnetOpDataEntry data = optionalSubs.get();
System.out.println("Fetching subnetmap for given subnetId\n");
System.out.println("------------------------------------------------------------------------------");
- System.out.println("Key: " + data.getKey() + "\n" + "VrfId: " + data.getVrfId() + "\n" + "ElanTag: "
+ System.out.println("Key: " + data.key() + "\n" + "VrfId: " + data.getVrfId() + "\n" + "ElanTag: "
+ "" + data.getElanTag() + "\n" + "NhDpnId: " + data.getNhDpnId() + "\n" + "RouteAdvState: "
+ data.getRouteAdvState() + "\n" + "SubnetCidr: " + data.getSubnetCidr() + "\n"
+ "SubnetToDpnList: " + data.getSubnetToDpn() + "\n" + "VpnName: " + data.getVpnName() + "\n");
System.out.println("Fetching subnetmap for given subnetId\n");
System.out.println("------------------------"
+ "------------------------------------------------------");
- System.out.println("Key: " + data.getKey() + "\n" + "VrfId: " + data.getVrfId() + "\n"
+ System.out.println("Key: " + data.key() + "\n" + "VrfId: " + data.getVrfId() + "\n"
+ "ElanTag: " + "" + data.getElanTag() + "\n" + "NhDpnId: " + data.getNhDpnId() + "\n"
+ "RouteAdvState: " + data.getRouteAdvState() + "\n" + "SubnetCidr: " + data.getSubnetCidr()
+ "\n" + "SubnetToDpnList: " + data.getSubnetToDpn() + "\n" + "VpnName: "
}
private Optional<PolicyAceFlowWrapper> getPolicyAceFlowWrapper(Matches matches) {
- IngressInterface ingressInterface = matches.getAugmentation(IngressInterface.class);
+ IngressInterface ingressInterface = matches.augmentation(IngressInterface.class);
if (ingressInterface != null) {
Optional<PolicyAceFlowWrapper> interfaceFlowOpt = getIngressInterfaceFlow(ingressInterface);
if (interfaceFlowOpt.isPresent()) {
}
}
- Service service = matches.getAugmentation(Service.class);
+ Service service = matches.augmentation(Service.class);
if (service != null) {
Optional<PolicyAceFlowWrapper> serviceFlowOpt = getPolicyServiceFlow(service);
if (serviceFlowOpt.isPresent()) {
public Optional<String> getAcePolicyClassifier(Ace ace) {
Actions actions = ace.getActions();
- SetPolicyClassifier setPolicyClassifier = actions.getAugmentation(SetPolicyClassifier.class);
+ SetPolicyClassifier setPolicyClassifier = actions.augmentation(SetPolicyClassifier.class);
if (setPolicyClassifier == null) {
LOG.warn("No valid policy action found for ACE rule {}", ace.getRuleName());
return Optional.absent();
}
private boolean isVlanMemberInterface(Interface iface, VlanId vlanId) {
- IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class);
+ IfL2vlan l2vlan = iface.augmentation(IfL2vlan.class);
if (l2vlan == null || !L2vlanMode.TrunkMember.equals(l2vlan.getL2vlanMode())) {
LOG.warn("Interface {} is not VLAN member", iface.getName());
return false;
getNeutronPort(interfaceName).ifPresent(port -> {
Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
LOG.trace("Qos Service : Received interface {} PORT UP event ", interfaceName);
- if (port.getAugmentation(QosPortExtension.class) != null) {
- Uuid portQosUuid = port.getAugmentation(QosPortExtension.class).getQosPolicyId();
+ if (port.augmentation(QosPortExtension.class) != null) {
+ Uuid portQosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
if (portQosUuid != null) {
qosNeutronUtils.addToQosPortsCache(portQosUuid, port);
qosNeutronUtils.handleQosInterfaceAdd(port, portQosUuid);
}
} else {
- if (network.getAugmentation(QosNetworkExtension.class) != null) {
- Uuid networkQosUuid = network.getAugmentation(QosNetworkExtension.class).getQosPolicyId();
+ if (network.augmentation(QosNetworkExtension.class) != null) {
+ Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
if (networkQosUuid != null) {
qosNeutronUtils.handleQosInterfaceAdd(port, networkQosUuid);
}
String lowerLayerIf = intrf.getLowerLayerIf().get(0);
LOG.trace("lowerLayerIf {}", lowerLayerIf);
qosAlertManager.removeLowerLayerIfFromQosAlertCache(lowerLayerIf);
- QosPortExtension removeQos = port.getAugmentation(QosPortExtension.class);
+ QosPortExtension removeQos = port.augmentation(QosPortExtension.class);
if (removeQos != null) {
qosNeutronUtils.handleNeutronPortRemove(port, removeQos.getQosPolicyId(), intrf);
qosNeutronUtils.removeFromQosPortsCache(removeQos.getQosPolicyId(), port);
} else {
Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
- if (network != null && network.getAugmentation(QosNetworkExtension.class) != null) {
- Uuid networkQosUuid = network.getAugmentation(QosNetworkExtension.class).getQosPolicyId();
+ if (network != null && network.augmentation(QosNetworkExtension.class) != null) {
+ Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
if (networkQosUuid != null) {
qosNeutronUtils.handleNeutronPortRemove(port, networkQosUuid, intrf);
}
protected void update(InstanceIdentifier<Network> instanceIdentifier, Network original, Network update) {
qosNeutronUtils.addToNetworkCache(update);
- QosNetworkExtension updateQos = update.getAugmentation(QosNetworkExtension.class);
- QosNetworkExtension originalQos = original.getAugmentation(QosNetworkExtension.class);
+ QosNetworkExtension updateQos = update.augmentation(QosNetworkExtension.class);
+ QosNetworkExtension originalQos = original.augmentation(QosNetworkExtension.class);
if (originalQos == null && updateQos != null) {
// qosservice policy add
qosNeutronUtils.addToQosNetworksCache(updateQos.getQosPolicyId(), update);
protected void add(InstanceIdentifier<Network> instanceIdentifier, Network network) {
qosNeutronUtils.addToNetworkCache(network);
- QosNetworkExtension networkQos = network.getAugmentation(QosNetworkExtension.class);
+ QosNetworkExtension networkQos = network.augmentation(QosNetworkExtension.class);
if (networkQos != null) {
qosNeutronUtils.addToQosNetworksCache(networkQos.getQosPolicyId(), network);
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, networkQos.getQosPolicyId());
protected void update(InstanceIdentifier<Port> instanceIdentifier, Port original, Port update) {
qosNeutronUtils.addToPortCache(update);
// check for QoS updates
- QosPortExtension updateQos = update.getAugmentation(QosPortExtension.class);
- QosPortExtension originalQos = original.getAugmentation(QosPortExtension.class);
+ QosPortExtension updateQos = update.augmentation(QosPortExtension.class);
+ QosPortExtension originalQos = original.augmentation(QosPortExtension.class);
if (originalQos == null && updateQos != null) {
// qosservice policy add
// check for network qosservice to apply
Network network = neutronVpnManager.getNeutronNetwork(port.getNetworkId());
- if (network != null && network.getAugmentation(QosNetworkExtension.class) != null) {
- Uuid networkQosUuid = network.getAugmentation(QosNetworkExtension.class).getQosPolicyId();
+ if (network != null && network.augmentation(QosNetworkExtension.class) != null) {
+ Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
if (networkQosUuid != null) {
handleNeutronPortQosUpdate(port, networkQosUuid, qosUuid);
}
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = getNeutronPort(portId);
- if (port != null && (port.getAugmentation(QosPortExtension.class) == null
- || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
+ if (port != null && (port.augmentation(QosPortExtension.class) == null
+ || port.augmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(),
() -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
if (qosPolicy.getBandwidthLimitRules() != null
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = getNeutronPort(portId);
- if (port != null && (port.getAugmentation(QosPortExtension.class) == null
- || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
+ if (port != null && (port.augmentation(QosPortExtension.class) == null
+ || port.augmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(),
() -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
if (qosPolicy != null && qosPolicy.getBandwidthLimitRules() != null
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = getNeutronPort(portId);
- if (port != null && (port.getAugmentation(QosPortExtension.class) == null
- || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
+ if (port != null && (port.augmentation(QosPortExtension.class) == null
+ || port.augmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(), () -> Collections.singletonList(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(
tx -> setPortBandwidthLimits(port, zeroBwLimitRule, tx))));
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = getNeutronPort(portId);
- if (port != null && (port.getAugmentation(QosPortExtension.class) == null
- || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
+ if (port != null && (port.augmentation(QosPortExtension.class) == null
+ || port.augmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(), () -> {
unsetPortDscpMark(port);
return Collections.emptyList();
TerminationPoint tp = SouthboundUtils.getTerminationPointByExternalId(bridgeNode.get(),
port.getUuid().getValue());
- OvsdbTerminationPointAugmentation ovsdbTp = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ OvsdbTerminationPointAugmentation ovsdbTp = tp.augmentation(OvsdbTerminationPointAugmentation.class);
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
tpAugmentationBuilder.setName(ovsdbTp.getName());
tpAugmentationBuilder.setIngressPolicingBurst(bwLimit.getMaxBurstKbps().longValue());
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(tp.getKey());
+ tpBuilder.withKey(tp.key());
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
try {
if (writeConfigTxn != null) {
writeConfigTxn.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(SouthboundUtils.OVSDB_TOPOLOGY_ID))
- .child(Node.class, bridgeNode.get().getKey())
- .child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build(), true);
+ .child(Node.class, bridgeNode.get().key())
+ .child(TerminationPoint.class, new TerminationPointKey(tp.key())), tpBuilder.build(), true);
} else {
MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(SouthboundUtils.OVSDB_TOPOLOGY_ID))
- .child(Node.class, bridgeNode.get().getKey())
- .child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build());
+ .child(Node.class, bridgeNode.get().key())
+ .child(TerminationPoint.class, new TerminationPointKey(tp.key())), tpBuilder.build());
}
} catch (Exception e) {
LOG.error("Failure while setting BwLimitRule {} to port {}", bwLimit, port, e);
BigInteger cookieQosTable, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookieQosTable)
.setFlowPriority(priority).setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(qosServiceIndex)).setServiceName(serviceName)
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(qosServiceIndex)).setServiceName(serviceName)
.setServicePriority(qosServiceIndex).setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
}
public boolean portHasQosPolicy(Port port) {
LOG.trace("checking qos policy for port: {}", port.getUuid());
- boolean isQosPolicy = port.getAugmentation(QosPortExtension.class) != null
- && port.getAugmentation(QosPortExtension.class).getQosPolicyId() != null;
+ boolean isQosPolicy = port.augmentation(QosPortExtension.class) != null
+ && port.augmentation(QosPortExtension.class).getQosPolicyId() != null;
LOG.trace("portHasQosPolicy for port: {} return value {}", port.getUuid(), isQosPolicy);
return isQosPolicy;
Uuid qosUuid = null;
QosPolicy qosPolicy = null;
- if (port.getAugmentation(QosPortExtension.class) != null) {
- qosUuid = port.getAugmentation(QosPortExtension.class).getQosPolicyId();
+ if (port.augmentation(QosPortExtension.class) != null) {
+ qosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
} else {
Network network = neutronVpnManager.getNeutronNetwork(port.getNetworkId());
- if (network.getAugmentation(QosNetworkExtension.class) != null) {
- qosUuid = network.getAugmentation(QosNetworkExtension.class).getQosPolicyId();
+ if (network.augmentation(QosNetworkExtension.class) != null) {
+ qosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
}
}
List<Options> tpOptions = tp.getOptions();
for (Options tpOption : tpOptions) {
// From the VXLAN Tunnels, we want the one with the GPE option set
- if (tpOption.getKey().getOption().equals(OPTION_KEY_EXTS)) {
+ if (tpOption.key().getOption().equals(OPTION_KEY_EXTS)) {
if (tpOption.getValue().equals(OPTION_VALUE_EXTS_GPE)) {
return Optional.ofNullable(tp.getOfport());
}
public Optional<String> getRemoteIpAddress(String interfaceName) {
return Optional.ofNullable(interfaceMgr.getInterfaceInfoFromConfigDataStore(interfaceName))
- .map(anInterface -> anInterface.getAugmentation(IfTunnel.class))
+ .map(anInterface -> anInterface.augmentation(IfTunnel.class))
.map(IfTunnel::getTunnelDestination)
.map(IpAddress::getIpv4Address)
.map(Ipv4Address::getValue);
.child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
- .child(Flow.class, flow.getKey())
+ .child(Flow.class, flow.key())
.build();
tx.put(LogicalDatastoreType.CONFIGURATION, iidFlow, flow, WriteTransaction.CREATE_MISSING_PARENTS);
.child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
- .child(Flow.class, flow.getKey())
+ .child(Flow.class, flow.key())
.build();
tx.delete(LogicalDatastoreType.CONFIGURATION, iidFlow);
LOG.trace("Ace details: {}", ace);
Optional<NetvirtsfcAclActions> sfcActions = Optional.ofNullable(ace.getActions())
- .map(actions -> actions.getAugmentation(RedirectToSfc.class));
+ .map(actions -> actions.augmentation(RedirectToSfc.class));
String rspName = sfcActions.map(NetvirtsfcAclActions::getRspName).map(Strings::emptyToNull).orElse(null);
String sfpName = sfcActions.map(NetvirtsfcAclActions::getSfpName).map(Strings::emptyToNull).orElse(null);
return Collections.emptySet();
}
- NeutronNetwork network = matches.getAugmentation(NeutronNetwork.class);
+ NeutronNetwork network = matches.augmentation(NeutronNetwork.class);
if (sfpName != null && network != null) {
LOG.warn("Ace {} ignored: SFP redirect action with neutron network match not supported", ruleName);
return Collections.emptySet();
}
- String sourcePort = Optional.ofNullable(matches.getAugmentation(NeutronPorts.class))
+ String sourcePort = Optional.ofNullable(matches.augmentation(NeutronPorts.class))
.map(NeutronPorts::getSourcePortUuid)
.map(Strings::emptyToNull)
.orElse(null);
- String destinationPort = Optional.ofNullable(matches.getAugmentation(NeutronPorts.class))
+ String destinationPort = Optional.ofNullable(matches.augmentation(NeutronPorts.class))
.map(NeutronPorts::getDestinationPortUuid)
.map(Strings::emptyToNull)
.orElse(null);
private static void addExtension(MatchBuilder match, Class<? extends ExtensionKey> extensionKey,
NxAugMatchNodesNodeTableFlow am) {
GeneralAugMatchNodesNodeTableFlow existingAugmentations = match
- .getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ .augmentation(GeneralAugMatchNodesNodeTableFlow.class);
List<ExtensionList> extensions = null;
if (existingAugmentations != null) {
extensions = existingAugmentations.getExtensionList();
public static ActionBuilder createActionBuilder(int order) {
ActionBuilder ab = new ActionBuilder();
ab.setOrder(order);
- ab.setKey(new ActionKey(order));
+ ab.withKey(new ActionKey(order));
return ab;
}
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
List<Instruction> instructions = new ArrayList<>();
InstructionsBuilder isb) {
FlowBuilder flow = new FlowBuilder();
flow.setId(new FlowId(flowIdStr));
- flow.setKey(new FlowKey(new FlowId(flowIdStr)));
+ flow.withKey(new FlowKey(new FlowId(flowIdStr)));
flow.setTableId(table);
flow.setFlowName(flowName);
flow.setCookie(new FlowCookie(cookieValue));
public static Instruction createGotoTableInstruction(short nextTableId, int order) {
GoToTableBuilder gotoIngress = createActionGotoTable(nextTableId);
- return new InstructionBuilder().setKey(new InstructionKey(order)).setOrder(order)
+ return new InstructionBuilder().withKey(new InstructionKey(order)).setOrder(order)
.setInstruction(new GoToTableCaseBuilder().setGoToTable(gotoIngress.build()).build()).build();
}
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action, int order) {
return new ActionBuilder()
.setOrder(order)
- .setKey(new ActionKey(order))
+ .withKey(new ActionKey(order))
.setAction(action)
.build();
}
assertNull(match.getIpMatch());
assertNull(match.getLayer3Match());
assertNull(match.getLayer4Match());
- assertNull(match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class));
+ assertNull(match.augmentation(GeneralAugMatchNodesNodeTableFlow.class));
}
private void checkMatchVxgpeNsh(Match match) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxTunGpeNp() != null) {
assertEquals(nxAugMatch.getNxmNxTunGpeNp().getValue().shortValue(), OpenFlow13Utils.TUN_GPE_NP_NSH);
private void checkMatchTunId(Match match, long value) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxTunId() != null) {
assertEquals(nxAugMatch.getNxmNxTunId().getValue().longValue(), value);
private void checkMatchTunDstIp(Match match, Ipv4Address value) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxTunIpv4Dst() != null) {
assertEquals(nxAugMatch.getNxmNxTunIpv4Dst().getIpv4Address(), value);
private void checkMatchEthNsh(Match match) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxEncapEthType() != null) {
assertEquals(nxAugMatch.getNxmNxEncapEthType().getValue().intValue(), OpenFlow13Utils.ETHERTYPE_NSH);
private void checkMatchNshMdType1(Match match) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNshMdtype() != null) {
assertEquals(nxAugMatch.getNxmNxNshMdtype().getValue().shortValue(),
private void checkMatchC1(Match match, long c1) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNshc1() != null) {
assertEquals(nxAugMatch.getNxmNxNshc1().getValue().longValue(), c1);
private void checkMatchC2(Match match, long c2) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNshc2() != null) {
assertEquals(nxAugMatch.getNxmNxNshc2().getValue().longValue(), c2);
private void checkMatchNsp(Match match, long nsp) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNsp() != null) {
assertEquals(nxAugMatch.getNxmNxNsp().getValue().longValue(), nsp);
private void checkMatchNsi(Match match, short nsi) {
GeneralAugMatchNodesNodeTableFlow genAug =
- match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
- NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
+ NxAugMatchNodesNodeTableFlow nxAugMatch = extension.augmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNsi() != null) {
assertEquals(nxAugMatch.getNxmNxNsi().getNsi().shortValue(), nsi);
if (createSffDpl) {
List<SffDataPlaneLocator> sffDpls = new ArrayList<>();
- sffDplBuilder.setKey(new SffDataPlaneLocatorKey(new SffDataPlaneLocatorName(SFF_DPL_NAME)));
+ sffDplBuilder.withKey(new SffDataPlaneLocatorKey(new SffDataPlaneLocatorName(SFF_DPL_NAME)));
sffDplBuilder.setName(new SffDataPlaneLocatorName(SFF_DPL_NAME));
sffDpls.add(sffDplBuilder.build());
sffBuilder.setSffDataPlaneLocator(sffDpls);
List<Options> opsList = new ArrayList<>();
if (dpnId != GeniusProviderTestParams.DPN_ID_NO_OPTIONS) {
OptionsBuilder opsBuilder = new OptionsBuilder();
- opsBuilder.setKey(new OptionsKey(GeniusProvider.OPTION_KEY_EXTS));
+ opsBuilder.withKey(new OptionsKey(GeniusProvider.OPTION_KEY_EXTS));
opsBuilder.setValue(GeniusProvider.OPTION_VALUE_EXTS_GPE);
opsList.add(opsBuilder.build());
}
//ACL Flow Classifier data store utility methods
public void addAclFlowClassifier(Acl aclFlowClassifier) {
- InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.getKey());
+ InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.key());
LOG.info("Write ACL FlowClassifier {} to config data store at {}",aclFlowClassifier, aclIid);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, aclIid,
}
public void updateAclFlowClassifier(Acl aclFlowClassifier) {
- InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.getKey());
+ InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.key());
LOG.info("Update ACL FlowClassifier {} in config data store at {}",aclFlowClassifier, aclIid);
try {
SingleTransactionDataBroker.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, aclIid,
}
public void removeAclFlowClassifier(Acl aclFlowClassifier) {
- InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.getKey());
+ InstanceIdentifier<Acl> aclIid = getAclPath(aclFlowClassifier.key());
LOG.info("Remove ACL FlowClassifier {} from config data store at {}",aclFlowClassifier, aclIid);
try {
SingleTransactionDataBroker.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, aclIid);
}
public void addServiceFunction(ServiceFunction sf) {
- InstanceIdentifier<ServiceFunction> sfIid = getSFPath(sf.getKey());
+ InstanceIdentifier<ServiceFunction> sfIid = getSFPath(sf.key());
LOG.info("Write Service Function {} to config data store at {}",sf, sfIid);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, sfIid, sf);
}
public void updateServiceFunction(ServiceFunction sf) {
- InstanceIdentifier<ServiceFunction> sfIid = getSFPath(sf.getKey());
+ InstanceIdentifier<ServiceFunction> sfIid = getSFPath(sf.key());
LOG.info("Update Service Function {} in config data store at {}",sf, sfIid);
try {
SingleTransactionDataBroker.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, sfIid, sf);
}
public void addServiceFunctionForwarder(ServiceFunctionForwarder sff) {
- InstanceIdentifier<ServiceFunctionForwarder> sffIid = getSFFPath(sff.getKey());
+ InstanceIdentifier<ServiceFunctionForwarder> sffIid = getSFFPath(sff.key());
LOG.info("Write Service Function Forwarder {} to config data store at {}",sff, sffIid);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, sffIid, sff);
}
public void updateServiceFunctionForwarder(ServiceFunctionForwarder sff) {
- InstanceIdentifier<ServiceFunctionForwarder> sffIid = getSFFPath(sff.getKey());
+ InstanceIdentifier<ServiceFunctionForwarder> sffIid = getSFFPath(sff.key());
LOG.info("Update Service Function Forwarder {} to config data store at {}",sff, sffIid);
try {
SingleTransactionDataBroker.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, sffIid, sff);
}
public void addServiceFunctionChain(ServiceFunctionChain sfc) {
- InstanceIdentifier<ServiceFunctionChain> sfcIid = getSFCPath(sfc.getKey());
+ InstanceIdentifier<ServiceFunctionChain> sfcIid = getSFCPath(sfc.key());
LOG.info("Write Service Function Chain {} to config data store at {}",sfc, sfcIid);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, sfcIid, sfc);
}
public void addServiceFunctionPath(ServiceFunctionPath sfp) {
- InstanceIdentifier<ServiceFunctionPath> sfpIid = getSFPPath(sfp.getKey());
+ InstanceIdentifier<ServiceFunctionPath> sfpIid = getSFPPath(sfp.key());
LOG.info("Write Service Function Path {} to config data store at {}",sfp, sfpIid);
try {
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, sfpIid, sfp);
//with the actions.
aceBuilder.setRuleName(aclBuilder.getAclName() + RULE);
- aceBuilder.setKey(new AceKey(aceBuilder.getRuleName()));
+ aceBuilder.withKey(new AceKey(aceBuilder.getRuleName()));
ArrayList<Ace> aceList = new ArrayList<>();
aceList.add(aceBuilder.build());
accessListEntriesBuilder.setAce(aceList);
aclBuilder.setAccessListEntries(accessListEntriesBuilder.build());
- aclBuilder.setKey(new AclKey(aclBuilder.getAclName(),aclBuilder.getAclType()));
+ aclBuilder.withKey(new AclKey(aclBuilder.getAclName(),aclBuilder.getAclType()));
LOG.info("Translated ACL Flow classfier : {}", aclBuilder.toString());
PortChain portChain, List<ServiceFunction> sfList) {
ServiceFunctionChainBuilder sfcBuilder = new ServiceFunctionChainBuilder();
sfcBuilder.setName(new SfcName(portChain.getName()));
- sfcBuilder.setKey(new ServiceFunctionChainKey(sfcBuilder.getName()));
+ sfcBuilder.withKey(new ServiceFunctionChainKey(sfcBuilder.getName()));
//By default set it to false. If user specify it in chain parameters, it
//will be overridden.
SfcServiceFunctionBuilder sfcSfBuilder = new SfcServiceFunctionBuilder();
sfcSfBuilder.setName(sf.getName().getValue());
sfcSfBuilder.setType(sf.getType());
- sfcSfBuilder.setKey(new SfcServiceFunctionKey(sfcSfBuilder.getName()));
+ sfcSfBuilder.withKey(new SfcServiceFunctionKey(sfcSfBuilder.getName()));
//NOTE: no explicit order is set.
sfcSfList.add(sfcSfBuilder.build());
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority)
.setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName)
.setServicePriority(servicePriority).setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, augBuilder.build()).build();
}
tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
.builder(IngressElementCountersRequestConfig.class)
.child(CounterRequests.class,
- new CounterRequestsKey(counterRequest.getKey().getRequestId()))
+ new CounterRequestsKey(counterRequest.key().getRequestId()))
.build());
} else if (ElementCountersDirection.EGRESS.equals(direction)) {
tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
.builder(EgressElementCountersRequestConfig.class)
.child(CounterRequests.class,
- new CounterRequestsKey(counterRequest.getKey().getRequestId()))
+ new CounterRequestsKey(counterRequest.key().getRequestId()))
.build());
}
}), LOG, "Error deleting counter");
List<CounterRequests> counterRequests) {
transaction.delete(LogicalDatastoreType.CONFIGURATION, path);
CounterRequests counterRequest = requestData.get();
- if (shouldUnbindCountersService(counterRequest.getPortId(), counterRequest.getKey().getRequestId(),
+ if (shouldUnbindCountersService(counterRequest.getPortId(), counterRequest.key().getRequestId(),
counterRequests)) {
unbindCountersServiceIfBound(counterRequest.getPortId(),
ElementCountersDirection.valueOf(counterRequest.getTrafficDirection()));
private boolean shouldUnbindCountersService(String portId, String requesId, List<CounterRequests> counterRequests) {
for (CounterRequests counterRequest : counterRequests) {
- if (portId.equals(counterRequest.getPortId()) && !requesId.equals(counterRequest.getKey().getRequestId())) {
+ if (portId.equals(counterRequest.getPortId()) && !requesId.equals(counterRequest.key().getRequestId())) {
return false;
}
}
IngressElementCountersRequestConfig requestConfig = iecrcOpt.get();
CounterRequestsBuilder crb = new CounterRequestsBuilder();
crb.setRequestId(requestKey);
- crb.setKey(new CounterRequestsKey(requestKey));
+ crb.withKey(new CounterRequestsKey(requestKey));
crb.setFilters(input.getOutgoingTraffic().getFilters());
crb.setPortId(input.getPortId());
crb.setLportTag(getLportTag(input.getPortId()));
EgressElementCountersRequestConfig requestConfig = eecrcOpt.get();
CounterRequestsBuilder crb = new CounterRequestsBuilder();
crb.setRequestId(requestKey);
- crb.setKey(new CounterRequestsKey(requestKey));
+ crb.withKey(new CounterRequestsKey(requestKey));
crb.setFilters(input.getIncomingTraffic().getFilters());
crb.setPortId(input.getPortId());
crb.setLportTag(getLportTag(input.getPortId()));
for (CounterRequests counterRequest : counterRequests) {
if (portId.equals(counterRequest.getPortId()) && dirction.equals(counterRequest.getTrafficDirection())
- && !counterRequest.getKey().getRequestId().equals(requesId)) {
+ && !counterRequest.key().getRequestId().equals(requesId)) {
if (areFiltersEqual(filters, counterRequest.getFilters())) {
return true;
}
BigInteger cookie, List<Instruction> instructions) {
StypeOpenflowBuilder augBuilder =
new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority).setInstruction(instructions);
- return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority))
+ return new BoundServicesBuilder().withKey(new BoundServicesKey(servicePriority))
.setServiceName(serviceName).setServicePriority(servicePriority)
.setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class,
augBuilder.build()).build();
}
ip = VpnUtil.getIpPrefix(ip);
AdjacencyBuilder newAdjBuilder = new AdjacencyBuilder().setIpAddress(ip)
- .setKey(new AdjacencyKey(ip)).setAdjacencyType(AdjacencyType.PrimaryAdjacency)
+ .withKey(new AdjacencyKey(ip)).setAdjacencyType(AdjacencyType.PrimaryAdjacency)
.setMacAddress(mipMacAddress).setSubnetId(new Uuid(subnetId)).setPhysNetworkFunc(true);
List<Adjacency> adjacencyList = adjacencies.isPresent()
}
String nextHopIp = nextHopIpAddr.split("/")[0];
AdjacencyBuilder newAdjBuilder =
- new AdjacencyBuilder().setIpAddress(ip).setKey(new AdjacencyKey(ip)).setNextHopIpList(
+ new AdjacencyBuilder().setIpAddress(ip).withKey(new AdjacencyKey(ip)).setNextHopIpList(
Collections.singletonList(nextHopIp)).setAdjacencyType(AdjacencyType.LearntIp);
if (mipMacAddress != null && !mipMacAddress.equalsIgnoreCase(nextHopMacAddress)) {
newAdjBuilder.setMacAddress(mipMacAddress);
+ " already seen in datastore", subnetId.getValue(), dpnId);
return null;
}
- SubnetToDpnBuilder subDpnBuilder = new SubnetToDpnBuilder().setKey(new SubnetToDpnKey(dpnId));
+ SubnetToDpnBuilder subDpnBuilder = new SubnetToDpnBuilder().withKey(new SubnetToDpnKey(dpnId));
List<VpnInterfaces> vpnIntfList = new ArrayList<>();
subDpnBuilder.setVpnInterfaces(vpnIntfList);
SubnetToDpn subDpn = subDpnBuilder.build();
SubnetToDpnBuilder subDpnBuilder = new SubnetToDpnBuilder(subDpn);
List<VpnInterfaces> vpnIntfList = subDpnBuilder.getVpnInterfaces();
VpnInterfaces vpnIntfs =
- new VpnInterfacesBuilder().setKey(new VpnInterfacesKey(intfName)).setInterfaceName(intfName).build();
+ new VpnInterfacesBuilder().withKey(new VpnInterfacesKey(intfName)).setInterfaceName(intfName).build();
vpnIntfList.add(vpnIntfs);
subDpnBuilder.setVpnInterfaces(vpnIntfList);
subDpn = subDpnBuilder.build();
if (!optionalPortOp.isPresent()) {
// Create PortOpDataEntry only if not present
portOpBuilder =
- new PortOpDataEntryBuilder().setKey(new PortOpDataEntryKey(intfName)).setPortId(intfName);
+ new PortOpDataEntryBuilder().withKey(new PortOpDataEntryKey(intfName)).setPortId(intfName);
List<Uuid> listSubnet = new ArrayList<>();
listSubnet.add(subnetId);
portOpBuilder.setSubnetIds(listSubnet);
SubnetToDpnBuilder subDpnBuilder = new SubnetToDpnBuilder(optionalSubDpn.get());
List<VpnInterfaces> vpnIntfList = subDpnBuilder.getVpnInterfaces();
VpnInterfaces vpnIntfs =
- new VpnInterfacesBuilder().setKey(new VpnInterfacesKey(intfName)).setInterfaceName(intfName).build();
+ new VpnInterfacesBuilder().withKey(new VpnInterfacesKey(intfName)).setInterfaceName(intfName).build();
vpnIntfList.remove(vpnIntfs);
if (vpnIntfList.isEmpty()) {
// Remove the DPN as well
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.Interface configIface =
interfaceManager.getInterfaceInfoFromConfigDataStore(interfaceName);
- IfTunnel ifTunnel = configIface.getAugmentation(IfTunnel.class);
+ IfTunnel ifTunnel = configIface.augmentation(IfTunnel.class);
if (ifTunnel != null) {
return true;
}
intfName, vpnName);
if (opVpnInterface.isPresent()) {
VpnInterfaceOpDataEntry vpnInterface = opVpnInterface.get();
- AdjacenciesOp adjacencies = vpnInterface.getAugmentation(AdjacenciesOp.class);
+ AdjacenciesOp adjacencies = vpnInterface.augmentation(AdjacenciesOp.class);
List<Adjacency> adjList = adjacencies != null ? adjacencies.getAdjacency()
: Collections.emptyList();
String prefix = null;
String ifaceName = stateTunnelList.getTunnelInterfaceName();
if (getTunnelType(stateTunnelList) == VpnConstants.ITMTunnelLocType.Internal.getValue()) {
Interface configIface = InterfaceUtils.getInterface(dataBroker, stateTunnelList.getTunnelInterfaceName());
- IfTunnel ifTunnel = configIface != null ? configIface.getAugmentation(IfTunnel.class) : null;
+ IfTunnel ifTunnel = configIface != null ? configIface.augmentation(IfTunnel.class) : null;
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
- ParentRefs refs = configIface.getAugmentation(ParentRefs.class);
+ ParentRefs refs = configIface.augmentation(ParentRefs.class);
if (refs != null && !Strings.isNullOrEmpty(refs.getParentInterface())) {
return true; //multiple VxLAN tunnels enabled, i.e. only logical tunnel should be treated
}
.getVpnInterfaceVpnInstanceNames(vpnId.getValue(), AssociatedSubnetType.V4AndV6Subnets);
List<VpnInstanceNames> listVpn = new ArrayList<>();
listVpn.add(vpnInstance);
- VpnInterface vpnInterface = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(interfaceName))
+ VpnInterface vpnInterface = new VpnInterfaceBuilder().withKey(new VpnInterfaceKey(interfaceName))
.setVpnInstanceNames(listVpn)
.setScheduledForRemove(Boolean.FALSE)
.build();
Optional<VpnToDpnList> dpnInVpn = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
IpAddressesBuilder ipAddressesBldr = new IpAddressesBuilder()
.setIpAddressSource(ipAddressSourceValuePair.getKey());
- ipAddressesBldr.setKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()));
+ ipAddressesBldr.withKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()));
ipAddressesBldr.setIpAddress(ipAddressSourceValuePair.getValue());
ListenableFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
}
IpAddresses currIpAddress = new IpAddressesBuilder()
- .setKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()))
+ .withKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()))
.setIpAddressSource(ipAddressSourceValuePair.getKey()).build();
if (ipAddresses.remove(currIpAddress)) {
try {
if (vpnTargetList != null) {
for (VpnTarget vpnTarget : vpnTargetList) {
VpnTargetBuilder vpnTargetBuilder =
- new VpnTargetBuilder().setKey(new VpnTargetKey(vpnTarget.getKey().getVrfRTValue()))
+ new VpnTargetBuilder().withKey(new VpnTargetKey(vpnTarget.key().getVrfRTValue()))
.setVrfRTType(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn
.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget.VrfRTType
.forValue(vpnTarget.getVrfRTType().getIntValue())).setVrfRTValue(
String srcTepIp = String.valueOf(stateTunnelList.getSrcInfo().getTepIp().getValue());
BigInteger srcDpnId = new BigInteger(stateTunnelList.getSrcInfo().getTepDeviceId());
- AdjacenciesOp adjacencies = vpnInterface.getAugmentation(AdjacenciesOp.class);
+ AdjacenciesOp adjacencies = vpnInterface.augmentation(AdjacenciesOp.class);
List<Adjacency> adjList = adjacencies != null ? adjacencies.getAdjacency() : new ArrayList<>();
if (adjList.isEmpty()) {
LOG.trace("updateVpnInterfaceOnTepAdd: Adjacencies are empty for vpnInterface {} on dpn {}",
}
AdjacenciesOp aug = VpnUtil.getVpnInterfaceOpDataEntryAugmentation(value);
VpnInterfaceOpDataEntry opInterface = new VpnInterfaceOpDataEntryBuilder(vpnInterface)
- .setKey(new VpnInterfaceOpDataEntryKey(vpnInterface.getName(), vpnName))
+ .withKey(new VpnInterfaceOpDataEntryKey(vpnInterface.getName(), vpnName))
.addAugmentation(AdjacenciesOp.class, aug).build();
InstanceIdentifier<VpnInterfaceOpDataEntry> interfaceId =
VpnUtil.getVpnInterfaceOpDataEntryIdentifier(vpnInterface.getName(), vpnName);
WriteTransaction writeConfigTxn,
WriteTransaction writeOperTxn) {
- AdjacenciesOp adjacencies = vpnInterface.getAugmentation(AdjacenciesOp.class);
+ AdjacenciesOp adjacencies = vpnInterface.augmentation(AdjacenciesOp.class);
List<Adjacency> adjList = adjacencies != null ? adjacencies.getAdjacency() : new ArrayList<>();
String prefix = null;
long label = 0;
}
AdjacenciesOp aug = VpnUtil.getVpnInterfaceOpDataEntryAugmentation(value);
VpnInterfaceOpDataEntry opInterface = new VpnInterfaceOpDataEntryBuilder(vpnInterface)
- .setKey(new VpnInterfaceOpDataEntryKey(vpnInterface.getName(), vpnName))
+ .withKey(new VpnInterfaceOpDataEntryKey(vpnInterface.getName(), vpnName))
.addAugmentation(AdjacenciesOp.class, aug).build();
InstanceIdentifier<VpnInterfaceOpDataEntry> interfaceId =
VpnUtil.getVpnInterfaceOpDataEntryIdentifier(vpnInterface.getName(), vpnName);
LOG.info("handleVpnsExportingRoutes: Importing subnet route fib entry rd {} "
+ "prefix {} nexthop {} label {} to vpn {} vpnRd {}",
vpn.getVrfId(), prefix, nh, label, vpnName, vpnRd);
- SubnetRoute route = vrfEntry.getAugmentation(SubnetRoute.class);
+ SubnetRoute route = vrfEntry.augmentation(SubnetRoute.class);
importSubnetRouteForNewVpn(vpnRd, prefix, nh, label, route, vpn.getVrfId(),
confTx);
}
update.getVpnInstanceNames());
final String vpnInterfaceName = update.getName();
final BigInteger dpnId = InterfaceUtils.getDpnForInterface(ifaceMgrRpcService, vpnInterfaceName);
- final Adjacencies origAdjs = original.getAugmentation(Adjacencies.class);
+ final Adjacencies origAdjs = original.augmentation(Adjacencies.class);
final List<Adjacency> oldAdjs = origAdjs != null && origAdjs.getAdjacency()
!= null ? origAdjs.getAdjacency() : new ArrayList<>();
- final Adjacencies updateAdjs = update.getAugmentation(Adjacencies.class);
+ final Adjacencies updateAdjs = update.augmentation(Adjacencies.class);
final List<Adjacency> newAdjs = updateAdjs != null && updateAdjs.getAdjacency()
!= null ? updateAdjs.getAdjacency() : new ArrayList<>();
if (!VpnUtil.isVpnPendingDelete(dataBroker, primaryRd)) {
LOG.info("handleVpnSwapForVpnInterface: VPN Interface update event - intfName {} onto vpnName {}"
+ "running config-driven swap addition", interfaceName, newVpnName);
- final Adjacencies origAdjs = original.getAugmentation(Adjacencies.class);
+ final Adjacencies origAdjs = original.augmentation(Adjacencies.class);
final List<Adjacency> oldAdjs = (origAdjs != null && origAdjs.getAdjacency() != null)
? origAdjs.getAdjacency() : new ArrayList<>();
- final Adjacencies updateAdjs = update.getAugmentation(Adjacencies.class);
+ final Adjacencies updateAdjs = update.augmentation(Adjacencies.class);
final List<Adjacency> newAdjs = (updateAdjs != null && updateAdjs.getAdjacency() != null)
? updateAdjs.getAdjacency() : new ArrayList<>();
Optional<DpnVpninterfacesList> optionalRouterDpnList = VpnUtil.read(dataBroker, LogicalDatastoreType
.OPERATIONAL, routerDpnListIdentifier);
RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
vpnInterfaceName).build();
if (optionalRouterDpnList.isPresent()) {
writeOperTxn.merge(LogicalDatastoreType.OPERATIONAL, routerDpnListIdentifier.child(
if (optionalRouterDpnList.isPresent()) {
List<RouterInterfaces> routerInterfaces = optionalRouterDpnList.get().getRouterInterfaces();
RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
vpnInterfaceName).build();
if (routerInterfaces != null && routerInterfaces.remove(routerInterface)) {
if (optionalRouterDpnList.isPresent()) {
List<RouterInterfaces> routerInterfaces = optionalRouterDpnList.get().getRouterInterfaces();
RouterInterfaces routerInterface =
- new RouterInterfacesBuilder().setKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
+ new RouterInterfacesBuilder().withKey(new RouterInterfacesKey(vpnInterfaceName)).setInterface(
vpnInterfaceName).build();
if (routerInterfaces != null && routerInterfaces.remove(routerInterface)) {
if (routerInterfaces.isEmpty()) {
protected void deleteFibEntryForRouterInterface(VpnInterface vpnInterface,
WriteTransaction writeConfigTxn, String vpnName) {
- Adjacencies adjs = vpnInterface.getAugmentation(Adjacencies.class);
+ Adjacencies adjs = vpnInterface.augmentation(Adjacencies.class);
String rd = VpnUtil.getVpnRd(dataBroker, vpnName);
if (adjs != null) {
List<Adjacency> adjsList = adjs.getAdjacency();
return;
}
List<Adjacency> operationVpnAdjacencies = vpnInterfaceOptional.get()
- .getAugmentation(AdjacenciesOp.class).getAdjacency();
+ .augmentation(AdjacenciesOp.class).getAdjacency();
// Due to insufficient rds, some of the extra route wont get processed when it is added.
// The unprocessed adjacencies will be present in config vpn interface DS but will be missing
// in operational DS. These unprocessed adjacencies will be handled below.
VpnInstanceOpDataEntry vpnInstOp = VpnUtil.getVpnInstanceOpData(dataBroker, rd);
- AdjacenciesOp adjs = del.getAugmentation(AdjacenciesOp.class);
+ AdjacenciesOp adjs = del.augmentation(AdjacenciesOp.class);
List<Adjacency> adjList = adjs != null ? adjs.getAdjacency() : null;
if (vpnInstOp != null && adjList != null && adjList.size() > 0) {
}
public static VpnInstance makeVpnInstance(String vpnName, String vpnRd, Long vpnTag) {
- return new VpnInstanceBuilder().setKey(new VpnInstanceKey(vpnName)).setVpnInstanceName(vpnName)
+ return new VpnInstanceBuilder().withKey(new VpnInstanceKey(vpnName)).setVpnInstanceName(vpnName)
.setVrfId(vpnRd).setVpnId(vpnTag).build();
}
static List<VpnTarget> makeVpnTargets(List<String> rtList, VpnTarget.VrfRTType type) {
return rtList.stream()
- .map(rt -> new VpnTargetBuilder().setKey(new VpnTargetKey(rt))
+ .map(rt -> new VpnTargetBuilder().withKey(new VpnTargetKey(rt))
.setVrfRTValue(rt).setVrfRTType(type).build())
.collect(Collectors.toList());
}
}
LOG.debug("{} onSubnetAddedToVpn: Creating new SubnetOpDataEntry node for subnet {} subnetIp {} "
+ "vpn {}", LOGGING_PREFIX, subnetId.getValue(), subnetIp, vpnName);
- subOpBuilder = new SubnetOpDataEntryBuilder().setKey(new SubnetOpDataEntryKey(subnetId));
+ subOpBuilder = new SubnetOpDataEntryBuilder().withKey(new SubnetOpDataEntryKey(subnetId));
subOpBuilder.setSubnetId(subnetId);
subOpBuilder.setSubnetCidr(subnetIp);
String primaryRd = VpnUtil.getPrimaryRd(dataBroker, vpnName);
optionalSubs = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, subOpIdentifier);
subOpBuilder =
- new SubnetOpDataEntryBuilder(optionalSubs.get()).setKey(new SubnetOpDataEntryKey(subnetId));
+ new SubnetOpDataEntryBuilder(optionalSubs.get()).withKey(new SubnetOpDataEntryKey(subnetId));
List<Uuid> portList = subMap.getPortList();
if (portList != null) {
for (Uuid port : portList) {
static VpnInterfaceOpDataEntry getVpnInterfaceOpDataEntry(String intfName, String vpnName,
AdjacenciesOp aug, BigInteger dpnId,
Boolean isSheduledForRemove, long lportTag, String gwMac) {
- return new VpnInterfaceOpDataEntryBuilder().setKey(new VpnInterfaceOpDataEntryKey(intfName, vpnName))
+ return new VpnInterfaceOpDataEntryBuilder().withKey(new VpnInterfaceOpDataEntryKey(intfName, vpnName))
.setDpnId(dpnId).setScheduledForRemove(isSheduledForRemove).addAugmentation(AdjacenciesOp.class, aug)
.setLportTag(lportTag).setGatewayMacAddress(gwMac).build();
}
}
static VpnIds getPrefixToInterface(long vpnId) {
- return new VpnIdsBuilder().setKey(new VpnIdsKey(vpnId)).setVpnId(vpnId).build();
+ return new VpnIdsBuilder().withKey(new VpnIdsKey(vpnId)).setVpnId(vpnId).build();
}
static Prefixes getPrefixToInterface(BigInteger dpId, String vpnInterfaceName, String ipPrefix, Uuid subnetId,
}
static AllocatedRdsBuilder getRdsBuilder(String nexthop, String rd) {
- return new AllocatedRdsBuilder().setKey(new AllocatedRdsKey(nexthop)).setNexthop(nexthop).setRd(rd);
+ return new AllocatedRdsBuilder().withKey(new AllocatedRdsKey(nexthop)).setNexthop(nexthop).setRd(rd);
}
static Adjacencies getVpnInterfaceAugmentation(List<Adjacency> nextHopList) {
for (VrfEntry vrfEntry : vrfTables.getVrfEntry()) {
if (origin == RouteOrigin.value(vrfEntry.getOrigin())) {
tx.delete(LogicalDatastoreType.CONFIGURATION,
- vpnVrfTableIid.child(VrfEntry.class, vrfEntry.getKey()));
+ vpnVrfTableIid.child(VrfEntry.class, vrfEntry.key()));
}
}
}), LOG, "Error removing VRF entries by origin");
new ManagedNewTransactionRunnerImpl(broker).callWithNewWriteOnlyTransactionAndSubmit(tx -> {
for (VrfEntry vrfEntry : vrfEntries) {
tx.delete(LogicalDatastoreType.CONFIGURATION,
- vpnVrfTableIid.child(VrfEntry.class, vrfEntry.getKey()));
+ vpnVrfTableIid.child(VrfEntry.class, vrfEntry.key()));
}
}), LOG, "Error removing VRF entries");
}
}
static RouterInterface getRouterInterface(String interfaceName, String routerName) {
- return new RouterInterfaceBuilder().setKey(new RouterInterfaceKey(interfaceName))
+ return new RouterInterfaceBuilder().withKey(new RouterInterfaceKey(interfaceName))
.setInterfaceName(interfaceName).setRouterName(routerName).build();
}
InstanceIdentifier<VpnInterfaceOpDataEntry> interfaceId =
VpnUtil.getVpnInterfaceOpDataEntryIdentifier(interfaceName, vpnInstanceName);
VpnInterfaceOpDataEntry interfaceToUpdate =
- new VpnInterfaceOpDataEntryBuilder().setKey(new VpnInterfaceOpDataEntryKey(interfaceName,
+ new VpnInterfaceOpDataEntryBuilder().withKey(new VpnInterfaceOpDataEntryKey(interfaceName,
vpnInstanceName)).setName(interfaceName).setDpnId(dpnId).setVpnInstanceName(vpnInstanceName)
.setScheduledForRemove(isScheduledToRemove).build();
if (writeOperTxn != null) {
synchronized ((vpnName + fixedIp).intern()) {
InstanceIdentifier<LearntVpnVipToPort> id = buildLearntVpnVipToPortIdentifier(vpnName, fixedIp);
LearntVpnVipToPortBuilder builder =
- new LearntVpnVipToPortBuilder().setKey(new LearntVpnVipToPortKey(fixedIp, vpnName)).setVpnName(
+ new LearntVpnVipToPortBuilder().withKey(new LearntVpnVipToPortKey(fixedIp, vpnName)).setVpnName(
vpnName).setPortFixedip(fixedIp).setPortName(portName)
.setMacAddress(macAddress.toLowerCase(Locale.getDefault()))
.setCreationTime(new SimpleDateFormat("MM/dd/yyyy h:mm:ss a").format(new Date()));
String eventId = MicroTimestamp.INSTANCE.get();
InstanceIdentifier<LearntVpnVipToPortEvent> id = buildLearntVpnVipToPortEventIdentifier(eventId);
- LearntVpnVipToPortEventBuilder builder = new LearntVpnVipToPortEventBuilder().setKey(
+ LearntVpnVipToPortEventBuilder builder = new LearntVpnVipToPortEventBuilder().withKey(
new LearntVpnVipToPortEventKey(eventId)).setVpnName(vpnName).setSrcFixedip(srcIp)
.setDestFixedip(destIP).setPortName(portName)
.setMacAddress(macAddress.toLowerCase(Locale.getDefault())).setEventAction(action);
}
static Boolean getIsExternal(Network network) {
- return network.getAugmentation(NetworkL3Extension.class) != null
- && network.getAugmentation(NetworkL3Extension.class).isExternal();
+ return network.augmentation(NetworkL3Extension.class) != null
+ && network.augmentation(NetworkL3Extension.class).isExternal();
}
@SuppressWarnings("checkstyle:linelength")
public static ListenableFuture<Void> unsetScheduledToRemoveForVpnInterface(ManagedNewTransactionRunner txRunner,
String interfaceName) {
- VpnInterfaceBuilder builder = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(interfaceName))
+ VpnInterfaceBuilder builder = new VpnInterfaceBuilder().withKey(new VpnInterfaceKey(interfaceName))
.setScheduledForRemove(false);
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.merge(LogicalDatastoreType.OPERATIONAL,
VpnUtil.getVpnInterfaceIdentifier(interfaceName), builder.build(),
if (!elanInterfaceList.contains(routerInterfacePortId)) {
elanInterfaceList.add(routerInterfacePortId);
dpnInterface = new DpnInterfacesBuilder().setDpId(dpnId).setInterfaces(elanInterfaceList)
- .setKey(new DpnInterfacesKey(dpnId)).build();
+ .withKey(new DpnInterfacesKey(dpnId)).build();
VpnUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
elanDpnInterfaceId, dpnInterface);
}
}
elanInterfaceList.remove(routerInterfacePortId);
dpnInterface = new DpnInterfacesBuilder().setDpId(dpnId).setInterfaces(elanInterfaceList)
- .setKey(new DpnInterfacesKey(dpnId)).build();
+ .withKey(new DpnInterfacesKey(dpnId)).build();
VpnUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL,
elanDpnInterfaceId, dpnInterface);
String leakedOrigin = forcedOrigin != null ? forcedOrigin.getValue() : RouteOrigin.INTERVPN.getValue();
FibHelper.buildRoutePath(endpointIp, label);
VrfEntry newVrfEntry =
- new VrfEntryBuilder().setKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
+ new VrfEntryBuilder().withKey(new VrfEntryKey(prefix)).setDestPrefix(prefix)
.setRoutePaths(Collections.singletonList(FibHelper.buildRoutePath(endpointIp, label)))
.setOrigin(leakedOrigin).build();
InterVpnLinkState vpnLinkState = new InterVpnLinkStateBuilder().setInterVpnLinkName(ivpnLinkName).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, vpnLinkStateIid, vpnLinkState);
- InterVpnLinkKey key = add.getKey();
+ InterVpnLinkKey key = add.key();
Uuid vpn1Uuid = add.getFirstEndpoint().getVpnUuid();
String vpn1Name = vpn1Uuid.getValue();
Uuid vpn2Uuid = add.getSecondEndpoint().getVpnUuid();
// Release idManager with LPortTag associated to endpoints
LOG.debug("Releasing InterVpnLink {} endpoints LportTags", del.getName());
- InterVpnLinkKey key = del.getKey();
+ InterVpnLinkKey key = del.key();
Uuid firstEndpointVpnUuid = del.getFirstEndpoint().getVpnUuid();
Uuid secondEndpointVpnUuid = del.getSecondEndpoint().getVpnUuid();
releaseVpnLinkLPortTag(key.getName() + firstEndpointVpnUuid.getValue());
// Removing flow from LportDispatcher table
String flowRef = InterVpnLinkUtil.getLportDispatcherFlowRef(interVpnLinkName, otherEndpointLportTag);
FlowKey flowKey = new FlowKey(new FlowId(flowRef));
- Flow flow = new FlowBuilder().setKey(flowKey).setId(new FlowId(flowRef))
+ Flow flow = new FlowBuilder().withKey(flowKey).setId(new FlowId(flowRef))
.setTableId(NwConstants.LPORT_DISPATCHER_TABLE).setFlowName(flowRef)
.build();
mdsalManager.removeFlow(dpnId, flow);
private void installLPortDispatcherTable(InterVpnLinkState interVpnLinkState, List<BigInteger> firstDpnList,
List<BigInteger> secondDpnList) {
- String ivpnLinkName = interVpnLinkState.getKey().getInterVpnLinkName();
+ String ivpnLinkName = interVpnLinkState.key().getInterVpnLinkName();
Optional<InterVpnLinkDataComposite> optVpnLink = interVpnLinkCache.getInterVpnLinkByName(ivpnLinkName);
if (!optVpnLink.isPresent()) {
LOG.warn("installLPortDispatcherTable: Could not find interVpnLink {}", ivpnLinkName);
interVpnLinkCache.addInterVpnLinkStateToCaches(newVpnLinkState);
} else {
InterVpnLinkState newIVpnLinkState =
- new InterVpnLinkStateBuilder().setKey(new InterVpnLinkStateKey(vpnLinkName))
+ new InterVpnLinkStateBuilder().withKey(new InterVpnLinkStateKey(vpnLinkName))
.setInterVpnLinkName(vpnLinkName)
.setFirstEndpointState(newFirstEndpointState)
.setSecondEndpointState(newSecondEndpointState)
: nextHopIp == null ? Collections.emptyList() : Collections.singletonList(nextHopIp);
return new AdjacencyBuilder(nextHop).setLabel(label).setNextHopIpList(nextHopList)
- .setIpAddress(prefix).setVrfId(rd).setKey(new AdjacencyKey(prefix))
+ .setIpAddress(prefix).setVrfId(rd).withKey(new AdjacencyKey(prefix))
.setAdjacencyType(nextHop.getAdjacencyType())
.setSubnetGatewayMacAddress(nextHop.getSubnetGatewayMacAddress()).build();
}
: nextHopIp == null ? Collections.emptyList() : Collections.singletonList(nextHopIp);
return new AdjacencyBuilder(nextHop).setNextHopIpList(nextHopList).setIpAddress(prefix).setVrfId(rd)
- .setKey(new AdjacencyKey(prefix)).setAdjacencyType(nextHop.getAdjacencyType())
+ .withKey(new AdjacencyKey(prefix)).setAdjacencyType(nextHop.getAdjacencyType())
.setSubnetGatewayMacAddress(nextHop.getSubnetGatewayMacAddress()).build();
}
}
static List<VpnTarget> makeVpnTargetsByType(List<String> rtList, VpnTarget.VrfRTType type) {
return rtList.stream()
- .map(rt -> new VpnTargetBuilder().setKey(new VpnTargetKey(rt))
+ .map(rt -> new VpnTargetBuilder().withKey(new VpnTargetKey(rt))
.setVrfRTValue(rt).setVrfRTType(type).build())
.collect(Collectors.toList());
}
List<VpnInterfaces> vpnInterfaces = new ArrayList<>();
List<Uuid> subnetIdList = new ArrayList<>();
subnetIdList.add(subnetId);
- subnetToDpn = new SubnetToDpnBuilder().setDpnId(dpId).setKey(new SubnetToDpnKey(dpId)).setVpnInterfaces(
+ subnetToDpn = new SubnetToDpnBuilder().setDpnId(dpId).withKey(new SubnetToDpnKey(dpId)).setVpnInterfaces(
vpnInterfaces).build();
- portOp = new PortOpDataEntryBuilder().setDpnId(dpId).setKey(new PortOpDataEntryKey(infName)).setSubnetIds(
+ portOp = new PortOpDataEntryBuilder().setDpnId(dpId).withKey(new PortOpDataEntryKey(infName)).setSubnetIds(
subnetIdList).setPortId(portId).build();
doReturn(mockReadTx).when(dataBroker).newReadOnlyTransaction();
doReturn(mockWriteTx).when(dataBroker).newWriteOnlyTransaction();
List<VpnTarget> vpnTargetList = new ArrayList<>();
- VpnTarget vpneRTarget = new VpnTargetBuilder().setKey(new VpnTargetKey("100:1")).setVrfRTValue("100:1")
+ VpnTarget vpneRTarget = new VpnTargetBuilder().withKey(new VpnTargetKey("100:1")).setVrfRTValue("100:1")
.setVrfRTType(VpnTarget.VrfRTType.ExportExtcommunity).build();
- VpnTarget vpniRTarget = new VpnTargetBuilder().setKey(new VpnTargetKey("100:2")).setVrfRTValue("100:2")
+ VpnTarget vpniRTarget = new VpnTargetBuilder().withKey(new VpnTargetKey("100:2")).setVrfRTValue("100:2")
.setVrfRTType(VpnTarget.VrfRTType.ImportExtcommunity).build();
vpnTargetList.add(vpneRTarget);
new PerRouteBuilder().setApplyLabelPerRoute(true).build()).build()).build();
VpnInstanceBuilder builder =
- new VpnInstanceBuilder().setKey(new VpnInstanceKey("Vpn1")).setIpv4Family(ipv4Family);
+ new VpnInstanceBuilder().withKey(new VpnInstanceKey("Vpn1")).setIpv4Family(ipv4Family);
VpnInstance instance = builder.build();
//TODO: Need to enhance the test case to handle ds read/write ops
//vpnManager.onDataChanged(event);
longId = Long.valueOf("100");
nodeConnectorId = buildNodeConnectorId(dpId, 2L);
ipAddress = IpAddressBuilder.getDefaultInstance(nexthopIp);
- vpnIntfaces = new VpnInterfacesBuilder().setInterfaceName(interfaceName).setKey(
+ vpnIntfaces = new VpnInterfacesBuilder().setInterfaceName(interfaceName).withKey(
new VpnInterfacesKey(interfaceName)).build();
List<VpnInterfaces> vpnInterfaces = new ArrayList<>();
final List<SubnetToDpn> subToDpn = new ArrayList<>();
subnetIdList.add(subnetId);
vpnInterfaces.add(vpnIntfaces);
lowerLayerIfList.add(nodeConnectorId.getValue());
- portOp = new PortOpDataEntryBuilder().setDpnId(dpId).setKey(new PortOpDataEntryKey(tenantId.getValue()))
+ portOp = new PortOpDataEntryBuilder().setDpnId(dpId).withKey(new PortOpDataEntryKey(tenantId.getValue()))
.setSubnetIds(subnetIdList).setPortId(tenantId.getValue()).build();
- subnetToDpn = new SubnetToDpnBuilder().setDpnId(dpId).setKey(new SubnetToDpnKey(dpId)).setVpnInterfaces(
+ subnetToDpn = new SubnetToDpnBuilder().setDpnId(dpId).withKey(new SubnetToDpnKey(dpId)).setVpnInterfaces(
vpnInterfaces).build();
allocateIdOutput = new AllocateIdOutputBuilder().setIdValue(longId).build();
allocateIdInput = new AllocateIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build();
ifaceBuilder.setLowerLayerIf(lowerLayerIfList).setType(L2vlan.class)
.setAdminStatus(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508
.interfaces.state.Interface.AdminStatus.Up).setOperStatus(Interface.OperStatus.Up)
- .setIfIndex(100).setKey(new InterfaceKey(interfaceName)).setName(interfaceName)
+ .setIfIndex(100).withKey(new InterfaceKey(interfaceName)).setName(interfaceName)
.setPhysAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715
.PhysAddress.getDefaultInstance("AA:AA:AA:AA:AA:AA"));
stateInterface = ifaceBuilder.build();
subnetOp = new SubnetOpDataEntryBuilder().setElanTag(elanTag).setNhDpnId(dpId).setSubnetCidr(subnetIp)
- .setSubnetId(subnetId).setKey(new SubnetOpDataEntryKey(subnetId)).setVpnName(interfaceName)
+ .setSubnetId(subnetId).withKey(new SubnetOpDataEntryKey(subnetId)).setVpnName(interfaceName)
.setVrfId(primaryRd).setSubnetToDpn(subToDpn).setRouteAdvState(TaskState.Advertised).build();
vpnInstance = new VpnInstanceBuilder().setVpnId(elanTag).setVpnInstanceName(interfaceName)
- .setVrfId(interfaceName).setKey(new VpnInstanceKey(interfaceName)).build();
- subnetmap = new SubnetmapBuilder().setSubnetIp(subnetIp).setId(subnetId).setNetworkId(portId).setKey(new
+ .setVrfId(interfaceName).withKey(new VpnInstanceKey(interfaceName)).build();
+ subnetmap = new SubnetmapBuilder().setSubnetIp(subnetIp).setId(subnetId).setNetworkId(portId).withKey(new
SubnetmapKey(subnetId)).setRouterId(portId).setVpnId(subnetId)
.setTenantId(tenantId).setPortList(portList).build();
portOpData = new PortOpDataBuilder().setPortOpDataEntry(listPortOpDataEntry).build();
- dpntePsInfo = new DPNTEPsInfoBuilder().setDPNID(dpId).setUp(true).setKey(new DPNTEPsInfoKey(dpId))
+ dpntePsInfo = new DPNTEPsInfoBuilder().setDPNID(dpId).setUp(true).withKey(new DPNTEPsInfoKey(dpId))
.setTunnelEndPoints(tunnelEndPoints).build();
tunlEndPts =
new TunnelEndPointsBuilder().setInterfaceName(interfaceName).setVLANID(10).setIpAddress(ipAddress).build();
tunnelEndPoints.add(tunlEndPts);
ipv4Family = new Ipv4FamilyBuilder().setRouteDistinguisher(routeDistinguishers).build();
vpnInstnce = new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances
- .VpnInstanceBuilder().setKey(new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn
+ .VpnInstanceBuilder().withKey(new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn
.rev140815.vpn.instances.VpnInstanceKey(interfaceName)).setVpnInstanceName(interfaceName)
.setIpv4Family(ipv4Family).build();
- networks = new NetworksBuilder().setId(portId).setKey(new NetworksKey(portId)).build();
+ networks = new NetworksBuilder().setId(portId).withKey(new NetworksKey(portId)).build();
doReturn(mockReadTx).when(dataBroker).newReadOnlyTransaction();
doReturn(mockWriteTx).when(dataBroker).newWriteOnlyTransaction();
doReturn(Futures.immediateCheckedFuture(null)).when(mockWriteTx).submit();
}
session.getConsole().println(
"VpnInstanceName: " + check.getVpnInstanceName() + "\nVpnId: " + check.getVpnId() + "\nVrfId: "
- + check.getVrfId() + "\nKey: " + check.getKey() + "\nVpnInterfaceCount: "
+ + check.getVrfId() + "\nKey: " + check.key() + "\nVpnInterfaceCount: "
+ intfCount + "\nVpnToDpnList: " + check.getVpnToDpnList() + "\n");
session.getConsole().println(
"------------------------------------------------------------------------------");