Fixup Augmentable and Identifiable methods changing 32/72532/4
authorStephen Kitt <skitt@redhat.com>
Thu, 31 May 2018 16:48:50 +0000 (18:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jun 2018 16:44:25 +0000 (18:44 +0200)
This is a fixup of the change in binding codegen, adjusting:
- getKey() -> key()
- setKey() -> withKey()
- getAugmentation() -> augmentation()

Change-Id: I19a391660f0bc30b0ec8d043859d9d20b81f3dfd
JIRA: TSC-101
Signed-off-by: Stephen Kitt <skitt@redhat.com>
165 files changed:
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclEventListener.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclInterfaceListener.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclInterfaceStateListener.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/recovery/AclInstanceRecoveryHandler.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtils.java
aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/AclServiceTestBase.java
aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/IdentifiedAceBuilder.java
aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/IdentifiedPortSubnetBuilder.java
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java
cloud-servicechain/impl/src/main/java/org/opendaylight/netvirt/cloudservicechain/jobs/AddVpnPseudoPortDataJob.java
cloud-servicechain/impl/src/main/java/org/opendaylight/netvirt/cloudservicechain/listeners/CloudScVpnInterfaceListener.java
cloud-servicechain/impl/src/main/java/org/opendaylight/netvirt/cloudservicechain/utils/ElanServiceChainUtils.java
cloud-servicechain/impl/src/test/java/org/opendaylight/netvirt/cloudservicechain/VPNServiceChainHandlerTest.java
coe/impl/src/main/java/org/opendaylight/netvirt/coe/utils/CoeUtils.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpExternalTunnelManager.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpInterfaceConfigListener.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpL2GwUtil.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpNeutronPortListener.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpServiceUtils.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpSubnetListener.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/jobs/DhcpInterfaceAddJob.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/jobs/DhcpInterfaceRemoveJob.java
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/jobs/DhcpInterfaceUpdateJob.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cache/ElanInterfaceCache.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/etree/EtreeGet.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/etree/EtreeInterfaceAdd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/etree/EtreeInterfaceDelete.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/etree/EtreeInterfaceGet.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/l2gw/L2GwValidateCli.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/cli/l2gw/NetworkL2gwDeviceInfoCli.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/evpn/listeners/EvpnElanInstanceListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/evpn/utils/EvpnMacVrfUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/evpn/utils/EvpnUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanBridgeManager.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanDpnInterfaceClusteredListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInstanceManager.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceConfigListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanLearntVpnVipToPortListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanPacketInHandler.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanServiceProvider.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/HwvtepHAUtil.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/LocalMcastCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/LocalUcastCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/LogicalSwitchesCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/PhysicalLocatorCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/RemoteMcastCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/RemoteUcastCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/SwitchesCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/TerminationPointCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/TunnelCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/commands/TunnelIpCmd.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/handlers/NodeConnectedHandler.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/handlers/NodeCopier.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/listeners/HAOpNodeListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/listeners/HwvtepNodeBaseListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/ha/listeners/ManagerListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/listeners/ElanGroupListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/listeners/ElanInstanceListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/listeners/HwvtepTerminationPointListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/listeners/L2GatewayConnectionListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/listeners/LocalUcastMacListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/utils/ElanL2GatewayMulticastUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/utils/ElanL2GatewayUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/utils/L2GatewayConnectionUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/l2gw/utils/StaleVlanBindingsCleaner.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanEtreeUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanForwardingEntriesHandler.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanItmUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanUtils.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/TransportZoneNotificationUtil.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/LogicalSwitchesCmdTest.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/GlobalAugmentationHelper.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/NodeConnectedHandlerUtils.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/PhysicalSwitchHelper.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/TestBuilders.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/TestComparators.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elan/l2gw/nodehandlertest/TestUtil.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elanmanager/tests/DpnNodeBuilders.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elanmanager/tests/ElanServiceTestBase.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elanmanager/tests/L2gwBuilders.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elanmanager/tests/Verifications.java
elanmanager/impl/src/test/java/org/opendaylight/netvirt/elanmanager/tests/utils/EvpnTestHelper.java
fibmanager/api/src/main/java/org/opendaylight/netvirt/fibmanager/api/FibHelper.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/BaseVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/BgpRouteVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/EvpnVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibUtil.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/NexthopManager.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/RouterInterfaceVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java
ipv6service/impl/src/main/java/org/opendaylight/netvirt/ipv6service/utils/Ipv6ServiceUtils.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/cli/DisplayNaptSwithcesCli.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/ha/SnatNodeEventListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/EvpnDnatFlowProgrammer.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalNetworksChangeListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalRoutersListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalSubnetVpnInstanceListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/FloatingIPListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptEventHandler.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptManager.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptSwitchHA.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatRouterInterfaceListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatTunnelInterfaceStateListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatUtil.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/RouterDpnChangeListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/RouterPortsListener.java
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/SubnetmapListener.java
natservice/impl/src/test/java/org/opendaylight/netvirt/natservice/internal/test/NaptManagerTest.java
neutronvpn/api/src/main/java/org/opendaylight/netvirt/neutronvpn/api/utils/NeutronUtils.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronFloatingToFixedIpMappingChangeListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronHostConfigChangeListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronNetworkChangeListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronPortChangeListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronSecurityRuleListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronSubnetChangeListener.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnManager.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnNatManager.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnUtils.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/evpn/utils/NeutronEvpnUtils.java
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/l2gw/L2GatewayListener.java
neutronvpn/shell/src/main/java/org/opendaylight/netvirt/neutronvpn/shell/ShowSubnet.java
policyservice/impl/src/main/java/org/opendaylight/netvirt/policyservice/PolicyAceFlowProgrammer.java
policyservice/impl/src/main/java/org/opendaylight/netvirt/policyservice/util/PolicyServiceUtil.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosInterfaceStateChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronNetworkChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronPortChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronUtils.java
sfc/classifier/impl/src/main/java/org/opendaylight/netvirt/sfc/classifier/providers/GeniusProvider.java
sfc/classifier/impl/src/main/java/org/opendaylight/netvirt/sfc/classifier/providers/OpenFlow13Provider.java
sfc/classifier/impl/src/main/java/org/opendaylight/netvirt/sfc/classifier/service/domain/impl/ConfigurationClassifierImpl.java
sfc/classifier/impl/src/main/java/org/opendaylight/netvirt/sfc/classifier/utils/OpenFlow13Utils.java
sfc/classifier/impl/src/test/java/org/opendaylight/netvirt/sfc/classifier/providers/OpenFlow13ProviderTest.java
sfc/classifier/impl/src/test/java/org/opendaylight/netvirt/sfc/classifier/providers/SfcProviderTest.java
sfc/classifier/impl/src/test/java/org/opendaylight/netvirt/sfc/classifier/providers/TestInterfaceManager.java
sfc/translator/src/main/java/org/opendaylight/netvirt/sfc/translator/SfcMdsalHelper.java
sfc/translator/src/main/java/org/opendaylight/netvirt/sfc/translator/flowclassifier/FlowClassifierTranslator.java
sfc/translator/src/main/java/org/opendaylight/netvirt/sfc/translator/portchain/PortChainTranslator.java
statistics/impl/src/main/java/org/opendaylight/netvirt/statistics/CountersServiceUtils.java
statistics/impl/src/main/java/org/opendaylight/netvirt/statistics/StatisticsImpl.java
vpnmanager/api/src/main/java/org/opendaylight/netvirt/vpnmanager/api/InterfaceUtils.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/LearntVpnVipToPortEventProcessor.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/SubnetOpDpnManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/SubnetRoutePacketInHandler.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/TunnelInterfaceStateListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnElanInterfaceChangeListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnFootprintService.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInstanceListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceOpListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnOperDsUtils.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnSubnetRouteHandler.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/IVpnLinkServiceImpl.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/InterVpnLinkListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/InterVpnLinkNodeAddTask.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/InterVpnLinkUtil.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/populator/impl/L3vpnOverMplsGrePopulator.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/populator/impl/L3vpnOverVxlanPopulator.java
vpnmanager/impl/src/test/java/org/opendaylight/netvirt/vpnmanager/intervpnlink/L3VpnTestCatalog.java
vpnmanager/impl/src/test/java/org/opendaylight/netvirt/vpnmanager/test/SubnetOpDpnManagerTest.java
vpnmanager/impl/src/test/java/org/opendaylight/netvirt/vpnmanager/test/VpnServiceTest.java
vpnmanager/impl/src/test/java/org/opendaylight/netvirt/vpnmanager/test/VpnSubnetRouteHandlerTest.java
vpnmanager/shell/src/main/java/org/opendaylight/netvirt/vpnmanager/shell/ShowVpnInstanceOpData.java

index d2282f9532dc413c6c2c05b055031836d2288294..38e19785d2e20cae1d53c968745e77d78ce96c32 100644 (file)
@@ -400,7 +400,7 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
             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,
@@ -432,7 +432,7 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
             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,
index bd437ecdd48151cf2f69ecbb77192213756ffc7c..f97fa81a4716caae9f3f48394ad99d457fd8da9c 100644 (file)
@@ -178,7 +178,7 @@ public class AclEventListener extends AsyncDataTreeChangeListenerBase<Acl, AclEv
             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),
index e8675b68aaebab7ae2a3b4fa2ec9e2a273419d8a..ce8dd8d966beeeccc3ed786930274eb9fd8c4fb3 100644 (file)
@@ -101,14 +101,14 @@ public class AclInterfaceListener extends AsyncDataTreeChangeListenerBase<Interf
 
     @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
@@ -240,7 +240,7 @@ public class AclInterfaceListener extends AsyncDataTreeChangeListenerBase<Interf
     @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);
index ee49260d3674d9a6557fc95764fdbcaf358c951c..4e92980c1d7bb26ae2c7f551d8da32a4b71257f1 100644 (file)
@@ -137,7 +137,7 @@ public class AclInterfaceStateListener extends AsyncDataTreeChangeListenerBase<I
                     + "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());
index 8a0cb3e6a5935fe028d237240c5a252703c97c55..c84c70d04446657674f7191d7ecc915e7c432e0f 100644 (file)
@@ -63,7 +63,7 @@ public class AclInstanceRecoveryHandler implements ServiceRecoveryInterface {
             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)
index b64d68005b626e95568cb22cc2eedf360cb1d4ac..b90dcecf00b76c97b17109cb96a34d185ee061e6 100644 (file)
@@ -310,7 +310,7 @@ public final class AclServiceUtils {
             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());
@@ -329,7 +329,7 @@ public final class AclServiceUtils {
             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;
@@ -441,7 +441,7 @@ public final class AclServiceUtils {
             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();
     }
@@ -480,7 +480,7 @@ public final class AclServiceUtils {
         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;
                 }
@@ -494,7 +494,7 @@ public final class AclServiceUtils {
             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;
@@ -1118,7 +1118,7 @@ public final class AclServiceUtils {
         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;
@@ -1314,7 +1314,7 @@ public final class AclServiceUtils {
                 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,
index 32556c644af68caa0f9b80f3bcde0def6a347c39..678d081607f6e1c8e8ed7333d917bf4d0fc14c2b 100644 (file)
@@ -626,7 +626,7 @@ public abstract class AclServiceTestBase {
 
     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();
     }
index ba5d6eff313ba70dcdf139c40cc6b24d7ca6e795..a0be0564b643277eb1f0ab6d0d5c6c96de1fc6fe 100644 (file)
@@ -57,7 +57,7 @@ public class IdentifiedAceBuilder implements DataTreeIdentifierDataObjectPairBui
     @Override
     public Ace dataObject() {
         return new AceBuilder()
-            .setKey(new AceKey(ruleName))
+            .withKey(new AceKey(ruleName))
             .setRuleName(ruleName)
             .setMatches(matches)
             .setActions(new ActionsBuilder()
index ea2ad381e557946eed47ec37e2f9a9669ae9abb9..401d8331da1350b95b0ec6aa8e3daee95a23c197 100644 (file)
@@ -30,7 +30,7 @@ public class IdentifiedPortSubnetBuilder implements DataTreeIdentifierDataObject
     @Override
     public PortSubnet dataObject() {
         return new PortSubnetBuilder()
-            .setKey(new PortSubnetKey(newInterfaceName))
+            .withKey(new PortSubnetKey(newInterfaceName))
             .setPortId(newInterfaceName)
             .setSubnetInfo(subnetInfoList)
             .build();
index cad127397b5339f8e0c3156b3468e67ee2f9fe9f..005b907f99aefacba86c41c473c26e03b72cff2f 100755 (executable)
@@ -220,7 +220,7 @@ public class BgpUtil implements AutoCloseable {
         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());
     }
index 8459725e591b35080864b878a9f28d4a381ae0a6..71bfd50e41581f6d0f88c965bbf003d9578751e5 100644 (file)
@@ -44,7 +44,7 @@ public class AddVpnPseudoPortDataJob extends VpnPseudoPortDataBaseJob {
                   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);
index 872099f1cc4203277e089de1f5a2ed60ac36452b..522bef3f1ddffb5663d972f3ba6ebe6303d92d90 100644 (file)
@@ -77,7 +77,7 @@ public class CloudScVpnInterfaceListener
             }
             break;
         }
-        vpnScHandler.unbindScfOnVpnInterface(vpnIfaceRemoved.getKey().getName());
+        vpnScHandler.unbindScfOnVpnInterface(vpnIfaceRemoved.key().getName());
     }
 
     @Override
@@ -99,7 +99,7 @@ public class CloudScVpnInterfaceListener
                     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);
index 80c491ad891750a2785b2c7ad8cbb676d61d69f5..677fb430def5ea97f1f42766724965c3519bb843 100755 (executable)
@@ -265,7 +265,7 @@ public final class ElanServiceChainUtils {
 
         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 {
index ae757564dc6ec01b371ae3834fb2fb11690f88b6..c420779d70d642218c39f575dcb157cbdf9629c8 100755 (executable)
@@ -149,7 +149,7 @@ public class VPNServiceChainHandlerTest {
     }
 
     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);
@@ -183,17 +183,17 @@ public class VPNServiceChainHandlerTest {
     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();
@@ -206,7 +206,7 @@ public class VPNServiceChainHandlerTest {
     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));
@@ -220,7 +220,7 @@ public class VPNServiceChainHandlerTest {
 
         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());
 
index ccc5221c3ffa68b2801dac04d23418255c12d535..487fab62c5fcfbcacd6190ec60d7dd2618261334 100644 (file)
@@ -136,7 +136,7 @@ public final class CoeUtils {
         }
 
         elanInstanceBuilder.setExternal(isExternal);
-        elanInstanceBuilder.setKey(new ElanInstanceKey(elanInstanceName));
+        elanInstanceBuilder.withKey(new ElanInstanceKey(elanInstanceName));
         return elanInstanceBuilder.build();
     }
 
@@ -145,7 +145,7 @@ public final class CoeUtils {
         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);
     }
@@ -157,11 +157,11 @@ public final class CoeUtils {
                 .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);
     }
@@ -170,7 +170,7 @@ public final class CoeUtils {
                                                  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);
@@ -297,7 +297,7 @@ public final class CoeUtils {
         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()) {
@@ -309,14 +309,14 @@ public final class CoeUtils {
                     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);
             }
@@ -325,7 +325,7 @@ public final class CoeUtils {
         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);
             }
@@ -374,10 +374,10 @@ public final class CoeUtils {
                                           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);
@@ -408,7 +408,7 @@ public final class CoeUtils {
         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)) {
index 71a4e11427502036f7ab6cd886fc0e8246cc62b8..3dc0241bcc8c332dde72ccd535ffb45e1b52c813 100644 (file)
@@ -291,7 +291,7 @@ public class DhcpExternalTunnelManager implements IDhcpExternalTunnelManager {
         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);
@@ -813,7 +813,7 @@ public class DhcpExternalTunnelManager implements IDhcpExternalTunnelManager {
                 .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
@@ -870,7 +870,7 @@ public class DhcpExternalTunnelManager implements IDhcpExternalTunnelManager {
                 }
                 return Collections.singletonList(txRunner.callWithNewReadWriteTransactionAndSubmit(
                     tx -> putRemoteMcastMac(tx, elanInstanceName, device,
-                            tunnelInterface.getAugmentation(IfTunnel.class).getTunnelSource())));
+                            tunnelInterface.augmentation(IfTunnel.class).getTunnelSource())));
             }
             return Collections.emptyList();
         });
index 5dbcd6bb642ca32a20227dc6e3972b0bbad000ff..0c18dbc3089be76838702038381786124aec2dfd 100644 (file)
@@ -59,12 +59,12 @@ public class DhcpInterfaceConfigListener
     @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 {}",
@@ -91,7 +91,7 @@ public class DhcpInterfaceConfigListener
     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();
             }
index a9ca8421bb04c79913fe699f6e017ae4fc1cb660..bdef37d70fb457e0555a10ab38ad237ed098fceb 100644 (file)
@@ -32,11 +32,11 @@ public class DhcpL2GwUtil {
 
     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;
@@ -66,7 +66,7 @@ public class DhcpL2GwUtil {
         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;
         }
@@ -75,11 +75,11 @@ public class DhcpL2GwUtil {
         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();
     }
 
 }
index 5bfe0e4a75569ab252398e53edf0ddff24c3ea7a..394becb549d7fab2571f33b822841f4db4176b06 100644 (file)
@@ -245,7 +245,7 @@ public class DhcpNeutronPortListener
     }
 
     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;
index 378c5193c9c8950740d94bfc70017cc0651fad34..99311467beae87ea0ebaf0977974fc0c104b4609 100644 (file)
@@ -375,7 +375,7 @@ public final class DhcpServiceUtils {
                                           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();
@@ -460,7 +460,7 @@ public final class DhcpServiceUtils {
 
     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();
     }
@@ -510,7 +510,7 @@ public final class DhcpServiceUtils {
             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);
index accb4f78f05e047724d2b76b529721bb75e470ad..00b3d0ab26cf0577d6dc9b67e25613fb25c0b22c 100644 (file)
@@ -244,7 +244,7 @@ public class DhcpSubnetListener extends AsyncClusteredDataTreeChangeListenerBase
         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;
     }
index 337ad2bcc251cc3c802ad45c5d9ece2e02a2bc97..9e983f37f756dc92013a88380b1fb6596dba04cd 100644 (file)
@@ -71,7 +71,7 @@ public class DhcpInterfaceAddJob implements Callable<List<ListenableFuture<Void>
         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);
index 6f8e33400fe58fbd5e611bef37aa4f01a1827664..e1048eaf3a152e8fec62562263e66183ae2c6da5 100644 (file)
@@ -86,7 +86,7 @@ public class DhcpInterfaceRemoveJob implements Callable<List<ListenableFuture<Vo
         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);
index bd069d0147b69f15f02834ea41ac52e6dfd5f6ac..5fd79148357b9cd2a2089b7ce09c1f1daf5b7659 100644 (file)
@@ -53,7 +53,7 @@ public class DhcpInterfaceUpdateJob implements Callable<List<ListenableFuture<Vo
             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);
index c9a7fd151fdd7ce2d7daadf7625f4f3827239b15..2755a1e52a04e32ecc1070c6918c5c877ad7eaf6 100644 (file)
@@ -61,7 +61,7 @@ public class ElanInterfaceCache extends InstanceIdDataObjectCache<ElanInterface>
     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
index 1e6c7abfa2f9875374fbe614a8454f81c03c95df..b93bc924eb1a9ab7ec67b642bc22e09eee653c09 100644 (file)
@@ -36,7 +36,7 @@ public class EtreeGet extends OsgiCommandSupport {
         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());
@@ -51,11 +51,11 @@ public class EtreeGet extends OsgiCommandSupport {
             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()));
                     }
                 }
index 8fa054386aef348bc195dd0f2b662928d12015af..633b6e269b67cc54ff84d978454020385c4e8a1d 100644 (file)
@@ -59,7 +59,7 @@ public class EtreeInterfaceAdd extends OsgiCommandSupport {
             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;
             }
index 474c4f44d34211934cb465385369ee5442a4f989..81273ea4f21721f08c700048f974a56899a2a0f9 100644 (file)
@@ -35,7 +35,7 @@ public class EtreeInterfaceDelete extends OsgiCommandSupport {
         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);
         }
index 459a4a4cfdaa01818f366ce5cde835027ec43327..2331afc197b7efbbe98526f8211b6464242e4ab2 100644 (file)
@@ -44,7 +44,7 @@ public class EtreeInterfaceGet extends OsgiCommandSupport {
         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;
             }
index 14eacfffb05862d28ea77290b37fc1932066ff8d..75f007f3641be9b680ce953c1911bdf18ad5a04d 100644 (file)
@@ -133,13 +133,13 @@ public class L2GwValidateCli extends OsgiCommandSupport {
 
             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);
                 }
             }
@@ -187,9 +187,9 @@ public class L2GwValidateCli extends OsgiCommandSupport {
             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);
@@ -215,7 +215,7 @@ public class L2GwValidateCli extends OsgiCommandSupport {
      */
     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);
         }
     }
@@ -266,9 +266,9 @@ public class L2GwValidateCli extends OsgiCommandSupport {
     }
 
     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;
@@ -286,11 +286,11 @@ public class L2GwValidateCli extends OsgiCommandSupport {
         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;
@@ -469,7 +469,7 @@ public class L2GwValidateCli extends OsgiCommandSupport {
         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)) {
@@ -530,7 +530,7 @@ public class L2GwValidateCli extends OsgiCommandSupport {
                 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()
@@ -539,7 +539,7 @@ public class L2GwValidateCli extends OsgiCommandSupport {
                 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
@@ -549,7 +549,7 @@ public class L2GwValidateCli extends OsgiCommandSupport {
             }
             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)) {
index 926ec7bcf590ca2795c2456e247b6bef76dc7d76..a1368692d9ec0c84d31b5e2c11069475136d5d82 100644 (file)
@@ -190,11 +190,11 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
     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;
         }
@@ -214,11 +214,11 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
     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;
         }
@@ -238,11 +238,11 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
     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;
         }
@@ -265,11 +265,11 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
     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;
         }
@@ -301,7 +301,7 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
         }
         for (TerminationPoint terminationPoint : terminationPoints) {
             HwvtepPhysicalPortAugmentation aug =
-                    terminationPoint.getAugmentation(HwvtepPhysicalPortAugmentation.class);
+                    terminationPoint.augmentation(HwvtepPhysicalPortAugmentation.class);
             if (aug == null || aug.getVlanBindings() == null) {
                 continue;
             }
@@ -334,9 +334,9 @@ public class NetworkL2gwDeviceInfoCli extends OsgiCommandSupport {
     }
 
     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);
             }
index cdf478f52fc57feb436253e81ffd5ce7e485a572..745d93ff318379d1ab2b5216ff9d0a663ec0d5fc 100644 (file)
@@ -69,13 +69,13 @@ public class EvpnElanInstanceListener extends AsyncDataTreeChangeListenerBase<El
                           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),
index 621192c23c7df4958771a9b97e90698b6df74c16..0d9d8555e4bcaf3bf1e3e2ff2adcc41f5c6c799c 100644 (file)
@@ -108,7 +108,7 @@ public class EvpnMacVrfUtils {
 
     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) {
index 822f2f620567dce1f61e30990f58f15b1c67c21f..7e41ff6b26306d5d4a24bc6cdc7d8c609e5a24a9 100644 (file)
@@ -179,7 +179,7 @@ public class EvpnUtils {
             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;
     }
 
@@ -188,7 +188,7 @@ public class EvpnUtils {
             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;
     }
 
index 0585e1751618fca23dd175f25c50d9a1fae40fd9..8e7d530ccd7dad62c67b9cbbd99d07d0da98376b 100644 (file)
@@ -271,7 +271,7 @@ public class ElanBridgeManager implements IElanBridgeManager {
             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 =
index 5d4f4f702306a0f76100e7a7b4a31054db2bc155..bfa976170743556bb8c496c7f1c0ef6d5a66bb2a 100644 (file)
@@ -121,7 +121,7 @@ public class ElanDpnInterfaceClusteredListener
         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);
         }
index 2c1d9e64412a52c6c125418d17f4c4ca395895e3..d7cfca1d9ec23a3bfdc80254babee3aa41ee480b 100644 (file)
@@ -128,7 +128,7 @@ public class ElanInstanceManager extends AsyncDataTreeChangeListenerBase<ElanIns
                 })), 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);
         }
     }
@@ -140,7 +140,7 @@ public class ElanInstanceManager extends AsyncDataTreeChangeListenerBase<ElanIns
 
         ElanUtils.delete(broker, LogicalDatastoreType.OPERATIONAL,
                 ElanUtils.getElanInfoEntriesOperationalDataPath(
-                        deletedElan.getAugmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue()));
+                        deletedElan.augmentation(EtreeInstance.class).getEtreeLeafTagVal().getValue()));
     }
 
     @Override
index 2267764c3630649fd23afc0cca85c52a6d842922..3e9b2b440ea35621836501d67d733639466381da 100644 (file)
@@ -69,7 +69,7 @@ public class ElanInterfaceConfigListener
         // 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;
         }
index 8e5a48897dfc12d8004e31b89efddbdbd612892b..73f1acd623cb81a04c1160b85e175e41558f79a1 100644 (file)
@@ -316,7 +316,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
 
     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());
@@ -332,7 +332,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
 
     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;
@@ -372,7 +372,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
                     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);
         }
@@ -827,7 +827,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
         }
 
         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);
     }
@@ -960,7 +960,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
         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);
@@ -1148,7 +1148,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
 
     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;
@@ -1309,7 +1309,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
 
     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);
         }
@@ -1419,11 +1419,11 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
 
     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());
@@ -1435,7 +1435,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
     }
 
     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 {
@@ -1472,7 +1472,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
     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);
@@ -1502,7 +1502,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
         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);
@@ -1518,7 +1518,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
         // 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);
@@ -1538,7 +1538,7 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
             }
             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);
         }
index 33022de7a1b85552a11dbe0c92d033517b38be3a..8ce0936a925db2fed3545b3c723b6d973a5620cb 100644 (file)
@@ -138,7 +138,7 @@ public class ElanLearntVpnVipToPortListener extends
             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);
index 6ad81a0fad0ff2123339e457d0bb0443d24ff094..0a8c18fd66adba9a791c7f847cd355de3bf0d4b2 100755 (executable)
@@ -121,12 +121,12 @@ public class ElanPacketInHandler implements PacketProcessingListener {
                 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();
                 }
index 84e07785e4ede96438d6c0c6b96e707f8409b7bf..6a29bac0cba44f5a14b575f9866f37d06978e145 100644 (file)
@@ -178,7 +178,7 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
             } 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 {}",
@@ -186,8 +186,8 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
             }
         } 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);
@@ -207,7 +207,7 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
                 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);
@@ -217,7 +217,8 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
         } 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);
@@ -271,19 +272,19 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
             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,
@@ -300,7 +301,7 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
             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);
@@ -324,7 +325,7 @@ public class ElanServiceProvider extends AbstractLifecycle implements IElanServi
         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);
     }
index 4653806a3d74398e3743114eb0f3272ce71c40b2..48c67bd36125cda3abee09330ed65f384f96d194 100644 (file)
@@ -150,7 +150,7 @@ public final class HwvtepHAUtil {
     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;
@@ -313,10 +313,10 @@ public final class HwvtepHAUtil {
     }
 
     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) {
@@ -342,7 +342,7 @@ public final class HwvtepHAUtil {
             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);
@@ -368,7 +368,7 @@ public final class HwvtepHAUtil {
     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();
@@ -379,7 +379,7 @@ public final class HwvtepHAUtil {
     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();
@@ -403,7 +403,7 @@ public final class HwvtepHAUtil {
 
         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());
@@ -428,7 +428,7 @@ public final class HwvtepHAUtil {
         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) {
@@ -438,7 +438,7 @@ public final class HwvtepHAUtil {
             }
         }
         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) {
@@ -495,7 +495,7 @@ public final class HwvtepHAUtil {
                                            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;
         }
@@ -516,7 +516,7 @@ public final class HwvtepHAUtil {
             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();
@@ -549,7 +549,7 @@ public final class HwvtepHAUtil {
             return;
         }
         Node node = nodeOptional.get();
-        HwvtepGlobalAugmentation globalAugmentation = node.getAugmentation(HwvtepGlobalAugmentation.class);
+        HwvtepGlobalAugmentation globalAugmentation = node.augmentation(HwvtepGlobalAugmentation.class);
         if (globalAugmentation == null) {
             return;
         }
index 24e7502a593eb0815d8536aeb77d87a73c200206..962e65f00e6aee794c454df7c2a42ed4d7f240d6 100644 (file)
@@ -45,7 +45,7 @@ public class LocalMcastCmd
 
     @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);
@@ -64,14 +64,14 @@ public class LocalMcastCmd
         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
index 8491b27f8f002055828ab2fdfd6170cdf1f1f234..1599816d225b316374fc5052c4aaad431fc27283 100644 (file)
@@ -44,7 +44,7 @@ public class LocalUcastCmd
 
     @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);
@@ -58,13 +58,13 @@ public class LocalUcastCmd
                 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
index 3b6a97cd1d0aac1776780be8c49fe997c5bf2f51..94de5168fbaac2a7a415b161dd4eb20af4b73335 100644 (file)
@@ -38,7 +38,7 @@ public class LogicalSwitchesCmd extends MergeCommand<LogicalSwitches,
 
     @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
@@ -50,7 +50,7 @@ public class LogicalSwitchesCmd extends MergeCommand<LogicalSwitches,
 
     @Override
     public Identifier getKey(LogicalSwitches data) {
-        return data.getKey();
+        return data.key();
     }
 
     @Override
index ec4be06012575ff65ec665239243a05930fdca5b..b03e8a201859e8dfa12eed4f85eafa2b6784102f 100644 (file)
@@ -35,7 +35,7 @@ public class PhysicalLocatorCmd extends MergeCommand<TerminationPoint, NodeBuild
 
     @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
@@ -45,7 +45,7 @@ public class PhysicalLocatorCmd extends MergeCommand<TerminationPoint, NodeBuild
 
     @Override
     public Identifier getKey(TerminationPoint data) {
-        return data.getKey();
+        return data.key();
     }
 
     @Override
@@ -56,9 +56,9 @@ public class PhysicalLocatorCmd extends MergeCommand<TerminationPoint, NodeBuild
     @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();
     }
index d9b79297f7b8223aba95585bc6937396c28ff2bb..763825bc0499c4fe20252b5a45f3545187b9dd2e 100644 (file)
@@ -45,7 +45,7 @@ public class RemoteMcastCmd extends
 
     @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);
@@ -65,14 +65,14 @@ public class RemoteMcastCmd extends
 
         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
index 5627101ac74f0315f369571ce1196635221d2251..f73e37d8d64121598afc232d8eaef8fb5ff700db 100644 (file)
@@ -42,7 +42,7 @@ public class RemoteUcastCmd extends MergeCommand<RemoteUcastMacs,
 
     @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);
     }
@@ -56,14 +56,14 @@ public class RemoteUcastCmd extends MergeCommand<RemoteUcastMacs,
 
         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
index c3e4fb6268f4f9bc44cc80729d27ddae5aa65e1f..1ff791928525fcd662dccadd83e1ada7a89b4e29 100644 (file)
@@ -38,7 +38,7 @@ public class SwitchesCmd extends MergeCommand<Switches, HwvtepGlobalAugmentation
 
     @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);
     }
 
@@ -59,7 +59,7 @@ public class SwitchesCmd extends MergeCommand<Switches, HwvtepGlobalAugmentation
         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();
     }
 
index c09de145333955587d51d92f4e9c60a1d5f55ef8..e2e80a8430f43cda67c344e79419c23ff499ce15 100644 (file)
@@ -43,12 +43,12 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
 
     @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();
         }
@@ -80,7 +80,7 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
 
     @Override
     public Identifier getKey(TerminationPoint data) {
-        return data.getKey();
+        return data.key();
     }
 
     @Override
@@ -95,12 +95,12 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
 
     @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;
@@ -134,10 +134,10 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
             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;
         }
     }
@@ -172,14 +172,14 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
         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;
                     }
                 }
index 11ec4350230ae4e9e9edb1b5ac213a8e818f8ca1..d5a15c29956cf84736fe8185146d16ec28481a1b 100644 (file)
@@ -60,13 +60,13 @@ public class TunnelCmd  extends MergeCommand<Tunnels, PhysicalSwitchAugmentation
         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
index ead41d385409b7610a962c0ed84b23ec66b6d68b..66aa92e752886373b15dd6e8eb7c4acad9a6ac84 100644 (file)
@@ -37,7 +37,7 @@ public class TunnelIpCmd extends
 
     @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
@@ -47,7 +47,7 @@ public class TunnelIpCmd extends
 
     @Override
     public Identifier getKey(TunnelIps data) {
-        return data.getKey();
+        return data.key();
     }
 
     @Override
index b297c85a752323201c4a205d93522f4965aad71e..8fd9585c6aa3a5bb5c57fd9be330cdcfbe3e3345 100644 (file)
@@ -115,7 +115,7 @@ public class NodeConnectedHandler {
             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) {
@@ -141,10 +141,10 @@ public class NodeConnectedHandler {
                                     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;
         }
@@ -171,7 +171,7 @@ public class NodeConnectedHandler {
         if (srcNode == null) {
             return;
         }
-        HwvtepGlobalAugmentation src = srcNode.getAugmentation(HwvtepGlobalAugmentation.class);
+        HwvtepGlobalAugmentation src = srcNode.augmentation(HwvtepGlobalAugmentation.class);
         if (src == null) {
             return;
         }
@@ -200,7 +200,7 @@ public class NodeConnectedHandler {
         if (childNode == null) {
             return;
         }
-        HwvtepGlobalAugmentation childData = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
+        HwvtepGlobalAugmentation childData = childNode.augmentation(HwvtepGlobalAugmentation.class);
         if (childData == null) {
             return;
         }
@@ -253,7 +253,7 @@ public class NodeConnectedHandler {
 
         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);
@@ -281,7 +281,7 @@ public class NodeConnectedHandler {
         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 =
index f045129b077321a37a92086607e32d9bad5d1e0f..629b67a0818bb72918af7e97c4c39946be2c19c8 100644 (file)
@@ -92,7 +92,7 @@ public class NodeCopier implements INodeCopier {
             return;
         }
         HwvtepGlobalAugmentation srcGlobalAugmentation =
-                srcGlobalNodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class);
+                srcGlobalNodeOptional.get().augmentation(HwvtepGlobalAugmentation.class);
         if (srcGlobalAugmentation == null) {
             /**
              * If Source HA Global Node is not present
@@ -122,7 +122,7 @@ public class NodeCopier implements INodeCopier {
             //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);
             });
 
@@ -176,7 +176,7 @@ public class NodeCopier implements INodeCopier {
         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 =
index 7e69b4ff7b302231254f3f7b1f9b403b5c81f9f0..bdecafcd10e51039a959f5bce9fee1de0a58cdd5 100644 (file)
@@ -208,7 +208,7 @@ public class HAOpNodeListener extends HwvtepNodeBaseListener {
     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()
index 07c24b4ead65d7c66b50b4033be458cf8f109068..1251064d614842e1792cc5e72bc013f8c8a12e0f 100644 (file)
@@ -68,11 +68,11 @@ public abstract class HwvtepNodeBaseListener implements DataTreeChangeListener<N
             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();
 
@@ -114,10 +114,10 @@ public abstract class HwvtepNodeBaseListener implements DataTreeChangeListener<N
      */
     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;
index eb3d05e969ee2267312cb3d7b61bd6f939d03830..b8e9559ea444edc633074298ffdd5d6ee73f54f8 100644 (file)
@@ -62,10 +62,10 @@ public final class ManagerListener extends AsyncClusteredDataTreeChangeListenerB
     @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));
index 829a8369e12f39790399302a0073485ca17f9e9a..76be486ff531a4ca24e4442867f4cdf6e72c6281 100644 (file)
@@ -63,7 +63,7 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
 
     @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());
     }
 
 
@@ -91,7 +91,7 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
 
     @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;
@@ -99,13 +99,13 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
 
         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;
         }
 
@@ -113,7 +113,7 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
                 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;
@@ -129,7 +129,7 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
                 updateGroup = true;
             } else {
                 LOG.trace("no of buckets matched perfectly {} {}", elanInstance.getElanInstanceName(),
-                        update.getKey().getGroupId());
+                        update.key().getGroupId());
             }
         }
         if (updateGroup) {
@@ -141,20 +141,20 @@ public class ElanGroupListener extends AsyncClusteredDataTreeChangeListenerBase<
                 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);
     }
 
index 5fd0d3ff91dab89eaac68f2dbeb16779786fe75f..048a2eec9f50c87373449da9ec0976085a5ca629 100644 (file)
@@ -69,7 +69,7 @@ public class ElanInstanceListener extends AsyncClusteredDataTreeChangeListenerBa
                         InstanceIdentifier<L2gatewayConnection> iid =
                                 InstanceIdentifier.create(Neutron.class).child(
                                         L2gatewayConnections.class).child(
-                                        L2gatewayConnection.class, connection.getKey());
+                                        L2gatewayConnection.class, connection.key());
                         tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
                     }
                 });
index 07b154b0fbb21a056bc875a38085ad141a41bbb1..0c0929b1e6b5b48516e0eebbc55b4e7f7faf414c 100644 (file)
@@ -80,7 +80,7 @@ public class HwvtepTerminationPointListener
     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",
@@ -97,7 +97,7 @@ public class HwvtepTerminationPointListener
     @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,
@@ -123,7 +123,7 @@ public class HwvtepTerminationPointListener
     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)) {
index a1d21b4d23c9b1a9d67e18a5b92792a10185e2f1..a4f528bcdfff4dd3781056b8ea46da84bd767275 100644 (file)
@@ -72,10 +72,10 @@ public class L2GatewayConnectionListener extends AsyncClusteredDataTreeChangeLis
             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;
     };
@@ -218,8 +218,8 @@ public class L2GatewayConnectionListener extends AsyncClusteredDataTreeChangeLis
         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();
index 3b790e9593e421e18fa23401e7a249351fac956f..67374d6f3987b154ce3a4124f448dcf28cf8cd0a 100644 (file)
@@ -191,7 +191,7 @@ public class LocalUcastMacListener extends ChildListener<Node, LocalUcastMacs, S
                     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);
                 });
         }
@@ -220,12 +220,12 @@ public class LocalUcastMacListener extends ChildListener<Node, LocalUcastMacs, S
 
     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());
             }
index 62cc8e7b438eacde479d61f0e61cfe7555b0800a..be13492035d6cb9ae7199d2c5d1039e96f0209d3 100644 (file)
@@ -261,7 +261,7 @@ public class ElanL2GatewayMulticastUtils {
     }
 
     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<>();
@@ -359,7 +359,7 @@ public class ElanL2GatewayMulticastUtils {
         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);
@@ -454,7 +454,7 @@ public class ElanL2GatewayMulticastUtils {
                 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);
@@ -502,7 +502,7 @@ public class ElanL2GatewayMulticastUtils {
                 .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);
 
index 617f12ab1b2ad16a5c0cec2fbb40448da5a58ba8..9c44bab10e83566e170a862f4429f486b46f832d 100644 (file)
@@ -533,7 +533,7 @@ public class ElanL2GatewayUtils {
                     @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()
@@ -619,7 +619,7 @@ public class ElanL2GatewayUtils {
         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
@@ -1152,7 +1152,7 @@ public class ElanL2GatewayUtils {
         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))
index 248ec280670e5aafb973693bb43924404e170efe..15adbcff05b09c05e56a8e0cf29fbd2ab1ef9fd2 100644 (file)
@@ -186,7 +186,7 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
     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();
 
@@ -215,7 +215,7 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
     }
 
     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();
@@ -227,8 +227,8 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
         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()) {
@@ -254,7 +254,7 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
                 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) {
@@ -277,7 +277,7 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
             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,
@@ -378,9 +378,9 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
                             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;
                                     }
@@ -423,6 +423,6 @@ public class L2GatewayConnectionUtils implements AutoCloseable {
     }
 
     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());
     }
 }
index 620b2ebebc0a9f6106ef297dc7707221d82a8f1c..95f54369d14a453f7c4dcacc5afff653f48c5b41 100644 (file)
@@ -62,8 +62,8 @@ public class StaleVlanBindingsCleaner {
         (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;
@@ -157,7 +157,7 @@ public class StaleVlanBindingsCleaner {
         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;
@@ -176,9 +176,9 @@ public class StaleVlanBindingsCleaner {
                                                            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,
@@ -198,7 +198,7 @@ public class StaleVlanBindingsCleaner {
     }
 
     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();
         }
index d1953a9a351d4431b60c23482cf374b49b67c727..3ee407e19513a925f8b227e5fcd5aa69b51141d7 100644 (file)
@@ -31,7 +31,7 @@ public class ElanEtreeUtils {
                 LogicalDatastoreType.OPERATIONAL, elanId);
         if (existingElanInfo.isPresent()) {
             ElanTagName elanTagName = existingElanInfo.get();
-            return elanTagName.getAugmentation(EtreeLeafTagName.class);
+            return elanTagName.augmentation(EtreeLeafTagName.class);
         }
         return null;
     }
index 2bdb2e7d72027c0bf0d86a3bfb50ba120526dc79..26f7e719777cada38c409c032e7202f1f92700ec 100644 (file)
@@ -72,7 +72,7 @@ public class ElanForwardingEntriesHandler {
         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);
@@ -96,7 +96,7 @@ public class ElanForwardingEntriesHandler {
         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);
         }
@@ -110,7 +110,7 @@ public class ElanForwardingEntriesHandler {
         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);
         }
     }
index eb22c38c43fd8161e6df9ec8b5b496f287fd9e4c..db9fd89eca802d2acb709211bfda67377a57f20f 100644 (file)
@@ -247,7 +247,7 @@ public class ElanItmUtils {
             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);
             }
index 6076f036c66448a11ac14b9ddbb07445649adcbf..7d1888b7f5f06ed5c2aedd892c6b51bdc539b52f 100755 (executable)
@@ -674,7 +674,7 @@ public class ElanUtils {
         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());
@@ -1141,19 +1141,19 @@ public class ElanUtils {
             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
@@ -1176,7 +1176,7 @@ public class ElanUtils {
                 .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();
@@ -1190,13 +1190,13 @@ public class ElanUtils {
 
     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) {
@@ -1221,7 +1221,7 @@ public class ElanUtils {
             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();
     }
@@ -1625,9 +1625,9 @@ public class ElanUtils {
         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
             }
@@ -1640,10 +1640,10 @@ public class ElanUtils {
         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();
     }
 
index 2266cba718c8a7eba5fa159a6dcb3f16f2e566cf..ad0435f409c720fb7b98188eda22acd91e51605f 100644 (file)
@@ -122,7 +122,7 @@ public class TransportZoneNotificationUtil {
     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();
     }
@@ -427,7 +427,7 @@ public class TransportZoneNotificationUtil {
     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();
     }
index 3cf06b4eab342f046498144cc6f7cb0ec49af7d8..c9c518337ecd56a743db089ae62046747f20d4a6 100644 (file)
@@ -178,7 +178,7 @@ public class LogicalSwitchesCmdTest extends AbstractConcurrentDataBrokerTest {
 
     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();
index c1e5b73f6dca82dbfead57ca89c3d986c628e993..d17088eef7f6bc75c2c872cddfb799ddb748347c 100644 (file)
@@ -114,7 +114,7 @@ public final class GlobalAugmentationHelper {
         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());
 
index ef09c2acee1080064e0107caaabe040135bcc765..37ac6ee41ec84e1bb7179b840391b1e76c7c11f2 100644 (file)
@@ -78,7 +78,7 @@ public class NodeConnectedHandlerUtils {
 
         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());
index 1e9f0f98a6088ea88f6d0b415d582464b2f9bf99..f840487dd33448842113a60770f6473d46fd2634 100644 (file)
@@ -79,7 +79,7 @@ public final class PhysicalSwitchHelper {
                                                                           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,
@@ -125,7 +125,7 @@ public final class PhysicalSwitchHelper {
     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));
index 1c11ad6b0d20ca4854391e36e1deda3f36b9b90d..11b092e1a17c5c754a96aa29e8fbaab1c58b424b 100644 (file)
@@ -94,7 +94,7 @@ public final class TestBuilders {
         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);
@@ -110,7 +110,7 @@ public final class TestBuilders {
 
     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);
@@ -161,7 +161,7 @@ public final class TestBuilders {
     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"));
@@ -174,7 +174,7 @@ public final class TestBuilders {
 
     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());
     }
@@ -182,7 +182,7 @@ public final class TestBuilders {
     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();
index ec0f0444a0f1d981a5195b26c30c573ec197227f..6fb9ddcd1795155e769eb235950e6c130dc45e54 100644 (file)
@@ -51,7 +51,7 @@ public final class TestComparators {
     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());
         }
@@ -59,8 +59,8 @@ public final class TestComparators {
 
     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<>();
@@ -75,9 +75,9 @@ public final class TestComparators {
 
     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<>();
@@ -97,8 +97,8 @@ public final class TestComparators {
 
     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);
@@ -115,9 +115,9 @@ public final class TestComparators {
 
     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<>();
@@ -139,8 +139,8 @@ public final class TestComparators {
 
     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);
@@ -154,9 +154,9 @@ public final class TestComparators {
 
     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<>();
@@ -179,8 +179,8 @@ public final class TestComparators {
 
     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);
@@ -194,9 +194,9 @@ public final class TestComparators {
 
     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<>();
@@ -218,8 +218,8 @@ public final class TestComparators {
 
     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);
@@ -233,9 +233,9 @@ public final class TestComparators {
 
     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);
@@ -260,9 +260,9 @@ public final class TestComparators {
                                                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(),
@@ -300,8 +300,8 @@ public final class TestComparators {
                                                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(),
@@ -332,14 +332,14 @@ public final class TestComparators {
             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());
index 2bac67803dffcd1cccd8ff7963e64469cb1c7c52..4b5f20bfca5c2d4cda9b548538c322824c30feaf 100644 (file)
@@ -127,19 +127,19 @@ public final class TestUtil {
         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);
index f353f69cd7d969cc42307f2398af57db7be427eb..1b0818f9324cf8450d3aea04a8e298bf81be96fe 100644 (file)
@@ -28,7 +28,7 @@ public final class DpnNodeBuilders {
                 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;
     }
@@ -45,7 +45,7 @@ public final class DpnNodeBuilders {
         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;
     }
index 89840ea598dddbee30595873affb20f9164a123b..84f1b4aaafc019153dfeb8e32601763fb350c6c1 100644 (file)
@@ -383,10 +383,10 @@ public class ElanServiceTestBase {
         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();
     }
 
@@ -405,7 +405,7 @@ public class ElanServiceTestBase {
             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<>();
index c743df28f6f2cfd07552bfc6551684a7c064af82..9da17a36c1f168e06aae7cb6274deed71d7a240d 100644 (file)
@@ -157,7 +157,7 @@ public class L2gwBuilders {
         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());
@@ -194,7 +194,7 @@ public class L2gwBuilders {
     }
 
     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 {
index 9c364f0dbe528d9843402b1051e43a9d36525626..4394507e154b36650a959e02356463af4bceff7c 100644 (file)
@@ -117,7 +117,7 @@ public class Verifications {
     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) {
@@ -161,7 +161,7 @@ public class Verifications {
     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) {
@@ -273,7 +273,7 @@ public class Verifications {
     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());
     }
 
@@ -408,10 +408,10 @@ public class Verifications {
         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();
     }
 
index 0c1f2acb41db895643f6d7dbcc734ee381e60f46..e5c401ddc06b89c9839de14089392dd35207afdf 100644 (file)
@@ -63,7 +63,8 @@ public class EvpnTestHelper  {
     }
 
     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);
index 03cbe14e149284f928dbf6b2964a9d91e0a5224f..d48349cd3e96507150a849e395d479ed24a8e5d9 100644 (file)
@@ -41,7 +41,7 @@ public final class FibHelper {
 
     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);
@@ -50,13 +50,13 @@ public final class FibHelper {
     }
 
     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);
     }
 
index 55a321da5c5b441f25f83295926027441a2e7ddb..a0fabd57b98bae093101bb6526dae21d39ae39cb 100644 (file)
@@ -267,7 +267,7 @@ public class BaseVrfEntryHandler implements AutoCloseable {
         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) {
index 02dfaff04a91312a81b073cc088c8498aa5e5bd6..556b7d9a5e94e9268d2dd8bfb75bc12f1dea839d 100644 (file)
@@ -379,7 +379,7 @@ public class BgpRouteVrfEntryHandler extends BaseVrfEntryHandler
                 .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);
                 });
     }
index b6e31d088030a3363f6c1f95f3125038842951ec..bf51a8cdc762af80d1dbda178c0eca18463369a7 100644 (file)
@@ -76,7 +76,7 @@ public class EvpnVrfEntryHandler extends BaseVrfEntryHandler implements IVrfEntr
         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 {}",
index 89f7a8414fb0e62dbb0bcc50bcec0612cadc644e..3d9f75ecf4c8e900feabf438a881adf52c8cde34 100644 (file)
@@ -489,7 +489,7 @@ public class FibUtil {
         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());
@@ -696,7 +696,7 @@ public class FibUtil {
         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();
@@ -717,7 +717,7 @@ public class FibUtil {
     }
 
     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();
@@ -725,7 +725,7 @@ public class FibUtil {
 
     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();
     }
@@ -820,7 +820,7 @@ public class FibUtil {
 
     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) {
index 13be7913ef6abc3ece1fb86a65a2965472f59937..c273476e225a4ae94048df915374d6f341f5995b 100644 (file)
@@ -278,7 +278,7 @@ public class NexthopManager implements AutoCloseable {
             }
             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) {
@@ -432,7 +432,7 @@ public class NexthopManager implements AutoCloseable {
                             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),
@@ -482,7 +482,7 @@ public class NexthopManager implements AutoCloseable {
         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();
index a1eed62557b3685b93443ab12a0b0c34b7219c5b..9da255909cbbae2ea4b51d305ea1b7005bd3fe80 100644 (file)
@@ -51,7 +51,7 @@ public class RouterInterfaceVrfEntryHandler extends BaseVrfEntryHandler implemen
 
     @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);
     }
 
@@ -62,7 +62,7 @@ public class RouterInterfaceVrfEntryHandler extends BaseVrfEntryHandler implemen
 
     @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);
     }
 
index 60c6f95b934e0b7a8d99de68174b46c8b56fb09c..cc9d3b2ad909bf50f2ea88114f590930fd16b545 100755 (executable)
@@ -211,7 +211,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
             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);
@@ -245,7 +245,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
             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);
@@ -368,7 +368,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         }
         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 {}"
@@ -567,7 +567,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         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) {
@@ -973,7 +973,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
 
         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(),
@@ -994,7 +994,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         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);
@@ -1389,7 +1389,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
             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());
@@ -1536,7 +1536,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         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) {
@@ -1570,7 +1570,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                 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);
@@ -1578,7 +1578,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                                         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());
@@ -1723,7 +1723,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                         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);
@@ -1745,7 +1745,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                                     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(),
@@ -1791,9 +1791,9 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                                 }
                                 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);
                                 }
                             }
@@ -1882,7 +1882,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         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);
index fdcdf151eb49439cf884ad2bbe1ab18a5aa815af..277533780690451c9a4f1ff11bf4399ca3c4c888 100644 (file)
@@ -441,7 +441,7 @@ public class Ipv6ServiceUtils {
                                           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();
index a91d60ca846bab102c0f08d5dc67347fb45b09f2..12d38d74f5de83053ac1fca1ae414d9a83dcb392 100644 (file)
@@ -82,11 +82,11 @@ public class DisplayNaptSwithcesCli extends OsgiCommandSupport {
     }
 
     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);
             }
         }
 
@@ -118,7 +118,7 @@ public class DisplayNaptSwithcesCli extends OsgiCommandSupport {
         if (node == null) {
             return null;
         }
-        return node.getAugmentation(OvsdbBridgeAugmentation.class);
+        return node.augmentation(OvsdbBridgeAugmentation.class);
     }
 
 }
index e6c493f16167a7324865b1cb4d7870e6d982a856..fdd8af8762ac7db20e358529756afa7eec31f91d 100644 (file)
@@ -47,7 +47,7 @@ public class SnatNodeEventListener  extends AbstractClusteredAsyncDataTreeChange
 
     @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);
@@ -61,7 +61,7 @@ public class SnatNodeEventListener  extends AbstractClusteredAsyncDataTreeChange
 
     @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);
index 453d43f3079864dbcc5bbac236b359df64353ae4..92a1f72f3156badebc874d77a708d9877b08a095 100644 (file)
@@ -218,9 +218,9 @@ public class EvpnDnatFlowProgrammer {
                         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<>();
index 0f04056a856b0c840134e633745ca17380984819..1e5e35bd7e2fd12bedd6b1c081cd97897d10c264 100644 (file)
@@ -121,7 +121,7 @@ public class ExternalNetworksChangeListener
         //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
index d07072baa14a1c4dfb1c60abbe2ddbb6584f632a..bd83938d187f2f1bcc8ede6363101f7049690017 100644 (file)
@@ -266,7 +266,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
             //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;
@@ -498,7 +498,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                 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);
@@ -1037,10 +1037,10 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                         //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);
@@ -1249,7 +1249,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                 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 -> {
@@ -1623,7 +1623,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                 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);
@@ -1694,7 +1694,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
                     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);
@@ -1846,7 +1846,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
     // 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,
@@ -2504,7 +2504,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
             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);
index 1e3f3c52968bca6ed3410a56a380e049712b5730..9091ea67b6da37f505bd0b31eea510977748ab57 100644 (file)
@@ -73,7 +73,7 @@ public class ExternalSubnetVpnInstanceListener extends AsyncDataTreeChangeListen
     @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));
@@ -87,13 +87,13 @@ public class ExternalSubnetVpnInstanceListener extends AsyncDataTreeChangeListen
     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));
index 4267deacda0734f733a2dbfb2f236ae114c06c33..e943de3a524c76b313cd698286cadc207130d46c 100644 (file)
@@ -113,13 +113,13 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
     @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);
     }
 
@@ -127,7 +127,7 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
     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
@@ -378,14 +378,14 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
 
     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);
@@ -393,14 +393,14 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
 
     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);
@@ -687,7 +687,7 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
         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()) {
@@ -700,7 +700,7 @@ public class FloatingIPListener extends AsyncDataTreeChangeListenerBase<Internal
                     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);
         }
index 20a5b491eb36fab32dd906a691faf78a3236c043..fe6e388ccd08611e140fef77bcddf34ff38b92f5 100644 (file)
@@ -349,7 +349,7 @@ public class NaptEventHandler {
             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();
         }
@@ -466,7 +466,7 @@ public class NaptEventHandler {
 
     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;
     }
 
@@ -481,7 +481,7 @@ public class NaptEventHandler {
         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();
index 22d2e2c1b420e43cf3223bfc512f825d5ccf4bc4..0eced3cc024b9c41db1003a38cef9cce9040b235 100644 (file)
@@ -171,7 +171,7 @@ public class NaptManager {
         }
         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);
@@ -204,7 +204,7 @@ public class NaptManager {
 
         //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);
     }
@@ -315,7 +315,7 @@ public class NaptManager {
                         // 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 {}",
@@ -339,7 +339,7 @@ public class NaptManager {
 
                         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),
@@ -596,7 +596,7 @@ public class NaptManager {
 
         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),
@@ -764,7 +764,7 @@ public class NaptManager {
 
     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);
     }
index a93f1f6aec7aff0cf30496dc4dd43eac53644eef..519e99c26a53d15c63959fe5e0bb8956091d94ea 100644 (file)
@@ -800,7 +800,7 @@ public class NaptSwitchHA {
     // 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,
index ce7ea592b596f023ca7f4c74b3e821dc1953ac42..a9211a030882421b3c2c804dd08a8e92fcfdf410 100644 (file)
@@ -68,7 +68,7 @@ public class NatRouterInterfaceListener
     // 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();
 
@@ -100,7 +100,7 @@ public class NatRouterInterfaceListener
 
     @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();
 
@@ -120,11 +120,11 @@ public class NatRouterInterfaceListener
 
     @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();
     }
 }
index ab77e9a5569731088f51372060a1a4f25d407ef6..d2874eb264ae52be7e1dccba7c798a7944ee1aa6 100644 (file)
@@ -1137,9 +1137,9 @@ public class NatTunnelInterfaceStateListener
         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
                 }
index 3c4f16f1813a0a5945b390b095f3d4617f0d04b0..33e4e9c0dc7d036435aaf238d4cf068987516ac9 100644 (file)
@@ -978,7 +978,7 @@ public final class NatUtil {
                         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 "
@@ -1021,7 +1021,7 @@ public final class NatUtil {
                         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)) {
@@ -1066,7 +1066,7 @@ public final class NatUtil {
                 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()) {
@@ -1121,7 +1121,7 @@ public final class NatUtil {
                 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)) {
@@ -1554,7 +1554,7 @@ public final class NatUtil {
             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);
     }
index f600a89429a17de7c52e13376afc0d738ca488f3..af397a4da9e2b4bd6563f7351ed54ed88411603b 100644 (file)
@@ -112,7 +112,7 @@ public class RouterDpnChangeListener
 
     @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
@@ -138,7 +138,7 @@ public class RouterDpnChangeListener
                     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);
@@ -210,7 +210,7 @@ public class RouterDpnChangeListener
 
     @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) {
@@ -241,7 +241,7 @@ public class RouterDpnChangeListener
                     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 -> {
@@ -289,7 +289,7 @@ public class RouterDpnChangeListener
     @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
index 72508df8ffe262e5a695bf23f9a11b484adb2651..c92ba06d62d145387d497a11ce19aae4d26fdd01 100644 (file)
@@ -60,7 +60,7 @@ public class RouterPortsListener
 
     @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);
@@ -68,12 +68,12 @@ public class RouterPortsListener
             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
@@ -87,7 +87,7 @@ public class RouterPortsListener
             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);
             }
@@ -96,7 +96,7 @@ public class RouterPortsListener
 
     @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();
@@ -109,6 +109,6 @@ public class RouterPortsListener
 
     @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);
     }
 }
index 5e167ed4eec987b48a07480248b01fbd934b033c..dde911a3a916b304210a3f4f446de8c3ee75488a 100644 (file)
@@ -47,7 +47,7 @@ public class SubnetmapListener extends AsyncDataTreeChangeListenerBase<Subnetmap
 
     @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);
     }
@@ -55,14 +55,14 @@ public class SubnetmapListener extends AsyncDataTreeChangeListenerBase<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);
     }
index 51e32fe1ec7f400757798d6c8ef8a0e1f33f2a9a..4a7577bb0a22d0fdec059b1d7379e45224666364 100644 (file)
@@ -74,7 +74,7 @@ public class NaptManagerTest {
         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()
@@ -98,7 +98,7 @@ public class NaptManagerTest {
         // 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()
@@ -121,7 +121,7 @@ public class NaptManagerTest {
         // 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()
@@ -144,7 +144,7 @@ public class NaptManagerTest {
         // 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()
index 882edfc12462800142998f0bf061aadf9916858c..4fcd56c802451da524643f081579d5a4941cd4a3 100644 (file)
@@ -115,7 +115,7 @@ public final class NeutronUtils {
     }
 
     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;
@@ -127,7 +127,7 @@ public final class NeutronUtils {
     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) {
@@ -154,7 +154,7 @@ public final class NeutronUtils {
     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) {
@@ -170,7 +170,7 @@ public final class NeutronUtils {
     }
 
     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();
@@ -183,7 +183,7 @@ public final class NeutronUtils {
 
     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) {
index 701628feb276c8dab338e963b379f00d3f695315..c1d6176fb169b0ca2b2cc75eab9ad1dbef2567b7 100644 (file)
@@ -142,7 +142,7 @@ public class NeutronFloatingToFixedIpMappingChangeListener extends AsyncDataTree
                 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);
@@ -160,7 +160,7 @@ public class NeutronFloatingToFixedIpMappingChangeListener extends AsyncDataTree
                     }
                 }
                 if (fixedNeutronPortBuilder == null) {
-                    fixedNeutronPortBuilder = new PortsBuilder().setKey(new PortsKey(fixedNeutronPortName))
+                    fixedNeutronPortBuilder = new PortsBuilder().withKey(new PortsKey(fixedNeutronPortName))
                             .setPortName(fixedNeutronPortName);
                 }
                 if (fixedIpAddress != null) {
@@ -169,7 +169,7 @@ public class NeutronFloatingToFixedIpMappingChangeListener extends AsyncDataTree
                     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);
index 46a8b6a9ae88e0c96d2930e29fba43bafd229121..12a62a44967a58a883a6cadb294fd86b9bc34790 100644 (file)
@@ -189,6 +189,6 @@ public class NeutronHostConfigChangeListener
     private InstanceIdentifier<Hostconfig> createInstanceIdentifier(Hostconfig hostconfig) {
         return InstanceIdentifier.create(Neutron.class)
                 .child(Hostconfigs.class)
-                .child(Hostconfig.class, hostconfig.getKey());
+                .child(Hostconfig.class, hostconfig.key());
     }
 }
index ffeabfbe2c8e93eb80bbc302749959c59a841ccb..b8262d74b9150b31fa88603f85d177d286290ce3 100644 (file)
@@ -94,7 +94,7 @@ public class NeutronNetworkChangeListener
             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) {
@@ -190,7 +190,7 @@ public class NeutronNetworkChangeListener
 
     @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();
         }
@@ -266,7 +266,7 @@ public class NeutronNetworkChangeListener
 
         elanInstanceBuilder.setElanSegments(segments);
         elanInstanceBuilder.setExternal(isExternal);
-        elanInstanceBuilder.setKey(new ElanInstanceKey(elanInstanceName));
+        elanInstanceBuilder.withKey(new ElanInstanceKey(elanInstanceName));
         return elanInstanceBuilder;
     }
 
index 490de022c36d9758f8e8721ab99804ceb4271ab7..66c9f18b7397bb6ab8c0a07f1a6464e832738189 100644 (file)
@@ -466,7 +466,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
 
     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();
             }
@@ -495,7 +495,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
     }
 
     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;
@@ -531,7 +531,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
             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());
@@ -762,7 +762,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         } 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(),
@@ -848,7 +848,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         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);
     }
@@ -866,7 +866,7 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         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);
index 2dca04bc77d7987cca37957bba7d3362db5f02ed..74339be8f64bcadfb138f324e00e6c6b598cbebb 100644 (file)
@@ -150,7 +150,7 @@ public class NeutronSecurityRuleListener
         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());
index f8ef3167e8d39109724ef21522f3c4ebeae0bb88..a0fefa4acef748272e5ce8ad2cd2784a324bd447 100644 (file)
@@ -143,7 +143,7 @@ public class NeutronSubnetChangeListener extends AsyncDataTreeChangeListenerBase
             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();
index e439940a09877b2b7cab1f94fa990ccdf39137df..4fb2c375af7445943f6375343c343198375d7ea8 100644 (file)
@@ -235,7 +235,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
         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) {
@@ -262,7 +262,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                         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 {}",
@@ -549,7 +549,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 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()) {
@@ -561,14 +561,14 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                         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);
                 }
@@ -577,7 +577,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
             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);
                 }
@@ -647,7 +647,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
             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) {
@@ -770,7 +770,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                                   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);
@@ -786,7 +786,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 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)) {
@@ -846,7 +846,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
         }
         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) {
@@ -973,7 +973,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 }
                 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();
@@ -1053,7 +1053,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                          .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()) {
@@ -1746,7 +1746,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 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,
@@ -1775,7 +1775,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                 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();
@@ -1912,7 +1912,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
             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;
@@ -1948,7 +1948,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                             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,
@@ -2123,11 +2123,11 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                                 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);
@@ -2285,7 +2285,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
                                                    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());
@@ -2950,7 +2950,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable, Even
         }
 
         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);
index d581380272e973f1a447a9f3d06b3aad0366a2f5..1c63f954a286856836a78dde690555598f36470f 100644 (file)
@@ -243,7 +243,7 @@ public class NeutronvpnNatManager implements AutoCloseable {
                 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);
@@ -451,7 +451,7 @@ public class NeutronvpnNatManager implements AutoCloseable {
             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);
@@ -690,7 +690,7 @@ public class NeutronvpnNatManager implements AutoCloseable {
 
     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);
@@ -758,7 +758,7 @@ public class NeutronvpnNatManager implements AutoCloseable {
         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());
index c250d2d45de9e09f87de990d6d47f1535e2f3ecb..cbd31f01b976f82b20f7a87ea6fc0ed2d86f90f2 100644 (file)
@@ -419,7 +419,7 @@ public class NeutronvpnUtils {
             // 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();
         }
@@ -520,7 +520,7 @@ public class NeutronvpnUtils {
                 .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;
                 }
@@ -708,7 +708,7 @@ public class NeutronvpnUtils {
             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,
@@ -735,7 +735,7 @@ public class NeutronvpnUtils {
                         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);
@@ -810,7 +810,7 @@ public class NeutronvpnUtils {
             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 {
@@ -910,7 +910,7 @@ public class NeutronvpnUtils {
 
     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);
@@ -920,12 +920,12 @@ public class NeutronvpnUtils {
     }
 
     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;
     }
 
@@ -948,8 +948,8 @@ public class NeutronvpnUtils {
     }
 
     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) {
@@ -1051,7 +1051,7 @@ public class NeutronvpnUtils {
     }
 
     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;
     }
 
@@ -1060,7 +1060,7 @@ public class NeutronvpnUtils {
             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) {
@@ -1081,12 +1081,12 @@ public class NeutronvpnUtils {
     }
 
     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());
         }
index d4a06370a4dced8af50ea8bc3bf4452a0f1e8e55..ed3e1fc930228fc06b8af66a9315dbe9ef1b6e83 100644 (file)
@@ -90,9 +90,9 @@ public class NeutronEvpnUtils {
 
             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);
@@ -119,7 +119,7 @@ public class NeutronEvpnUtils {
                     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);
index b6e517a18d6dd2fc1904f4efb1a706747c03a4f5..a1cf06092c304d3e9cf59b7785f4e73837122409 100644 (file)
@@ -104,7 +104,7 @@ public class L2GatewayListener extends AsyncClusteredDataTreeChangeListenerBase<
         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>() {
index 11f3c5427ea9dafd7bf8d497285ccabcacfc900c..25449f51cb248e8e0c93955f73d38f906b763d1a 100644 (file)
@@ -88,7 +88,7 @@ public class ShowSubnet extends OsgiCommandSupport {
             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");
@@ -105,7 +105,7 @@ public class ShowSubnet extends OsgiCommandSupport {
                     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: "
@@ -124,7 +124,7 @@ public class ShowSubnet extends OsgiCommandSupport {
             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: "
@@ -143,7 +143,7 @@ public class ShowSubnet extends OsgiCommandSupport {
             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: "
@@ -160,7 +160,7 @@ public class ShowSubnet extends OsgiCommandSupport {
             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");
@@ -191,7 +191,7 @@ public class ShowSubnet extends OsgiCommandSupport {
                     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: "
index 2bb8fc7b48681621369b0dcd2ea4e15f62404b1f..1eeec5fae1889b82de0314b5e9ca6f7828e3c549 100644 (file)
@@ -151,7 +151,7 @@ public class PolicyAceFlowProgrammer {
     }
 
     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()) {
@@ -159,7 +159,7 @@ public class PolicyAceFlowProgrammer {
             }
         }
 
-        Service service = matches.getAugmentation(Service.class);
+        Service service = matches.augmentation(Service.class);
         if (service != null) {
             Optional<PolicyAceFlowWrapper> serviceFlowOpt = getPolicyServiceFlow(service);
             if (serviceFlowOpt.isPresent()) {
index 7d4e433025ba60aa4b2b12cdce5f6d077f197938..eb85fe3dcc311ac78d428b12f8085ca9ecf9dcfe 100644 (file)
@@ -103,7 +103,7 @@ public class PolicyServiceUtil {
 
     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();
@@ -501,7 +501,7 @@ public class PolicyServiceUtil {
     }
 
     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;
index 169bdf442a3f751695c65d852f09ae086245105e..99167461b18ccb62c191c1cdaf68a33aa25f5f1b 100644 (file)
@@ -90,15 +90,15 @@ public class QosInterfaceStateChangeListener extends AsyncClusteredDataTreeChang
                 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);
                             }
@@ -143,14 +143,14 @@ public class QosInterfaceStateChangeListener extends AsyncClusteredDataTreeChang
                 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);
                         }
index 50c6f763660f5009b331fea007098ccb697ba5fc..097364eb0c7010f721f73ce8aa41ae05b7a02b96 100644 (file)
@@ -74,8 +74,8 @@ public class QosNeutronNetworkChangeListener extends AsyncClusteredDataTreeChang
     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);
@@ -97,7 +97,7 @@ public class QosNeutronNetworkChangeListener extends AsyncClusteredDataTreeChang
     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());
index 61029f17d95c48cb975b7c48f12ff3cc68182bb7..98eadb2cb9db89fc9fd20423579e1c288aa8dd0c 100644 (file)
@@ -78,8 +78,8 @@ public class QosNeutronPortChangeListener extends AsyncClusteredDataTreeChangeLi
     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
index 91ed174ee0e29146ea63677300329effff606a60..401a1e98003c6eb97f5e28dd599128446f2b2206 100644 (file)
@@ -270,8 +270,8 @@ public class QosNeutronUtils {
 
         // 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);
             }
@@ -339,8 +339,8 @@ public class QosNeutronUtils {
             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
@@ -366,8 +366,8 @@ public class QosNeutronUtils {
             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
@@ -396,8 +396,8 @@ public class QosNeutronUtils {
             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))));
@@ -415,8 +415,8 @@ public class QosNeutronUtils {
             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();
@@ -448,7 +448,7 @@ public class QosNeutronUtils {
 
         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());
@@ -456,21 +456,21 @@ public class QosNeutronUtils {
         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);
@@ -714,7 +714,7 @@ public class QosNeutronUtils {
                                                   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();
     }
@@ -727,8 +727,8 @@ public class QosNeutronUtils {
     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;
@@ -739,13 +739,13 @@ public class QosNeutronUtils {
         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();
             }
         }
 
index 9b1411cda2f7eedbccc8ea6350499b210e7bb18d..1645f4a219ddc4db6dafbce367ccbf018bed34b2 100644 (file)
@@ -275,7 +275,7 @@ public class GeniusProvider {
                 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());
                         }
@@ -362,7 +362,7 @@ public class GeniusProvider {
 
     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);
index bee241632b2f2418a3a91646073abfc5482f094f..234676b0af3711ad8ba641a25f28b1bd9631930a 100644 (file)
@@ -96,7 +96,7 @@ public class OpenFlow13Provider {
             .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);
@@ -108,7 +108,7 @@ public class OpenFlow13Provider {
             .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);
index 464d80117c2c718b5e83a228636f5c1d379342ae..68a461d6abe42c2584f2c7dc39ba5279d657e0bc 100644 (file)
@@ -95,7 +95,7 @@ public class ConfigurationClassifierImpl implements ClassifierState {
         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);
 
@@ -114,17 +114,17 @@ public class ConfigurationClassifierImpl implements ClassifierState {
             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);
index bf9a8873caf6138a24f49d77818d0c5d90290291..b65f16418b57666a5a8c088445f15560107c43ca 100644 (file)
@@ -157,7 +157,7 @@ public final class OpenFlow13Utils {
     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();
@@ -343,7 +343,7 @@ public final class OpenFlow13Utils {
     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;
     }
@@ -357,7 +357,7 @@ public final class OpenFlow13Utils {
         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<>();
@@ -370,7 +370,7 @@ public final class OpenFlow13Utils {
                                                 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));
@@ -401,7 +401,7 @@ public final class OpenFlow13Utils {
     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();
     }
 
@@ -428,7 +428,7 @@ public final class OpenFlow13Utils {
             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();
     }
index 07c8e5876ee342e13f822cd5b7ed02de5553a40b..68cb553ffe69b2a89da5dbd764bd39c2c45a1ef4 100644 (file)
@@ -357,19 +357,19 @@ public class OpenFlow13ProviderTest {
         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);
@@ -379,14 +379,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -396,14 +396,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -413,14 +413,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -430,14 +430,14 @@ public class OpenFlow13ProviderTest {
 
     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(),
@@ -452,14 +452,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -469,14 +469,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -486,14 +486,14 @@ public class OpenFlow13ProviderTest {
 
     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);
@@ -503,14 +503,14 @@ public class OpenFlow13ProviderTest {
 
     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);
index 4a240584743322c1556065cf7b64a7cadefcd612..120136e5a27056e8b55e1f4fe34aad9d99aaea28 100644 (file)
@@ -193,7 +193,7 @@ public class SfcProviderTest extends ConstantSchemaAbstractDataBrokerTest {
 
         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);
index 90cfa2911191ddaeff7a599067470ed7ada056b6..9ce509f4b4971081fffb543cb7b8450f90dae8fb 100644 (file)
@@ -54,7 +54,7 @@ public abstract class TestInterfaceManager implements IInterfaceManager {
         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());
         }
index 57dce94fbaf52cd58714e81311916b161b860883..d83690187a076a0a8f5b3838fe8843817cc592d6 100644 (file)
@@ -55,7 +55,7 @@ public class SfcMdsalHelper {
 
     //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,
@@ -66,7 +66,7 @@ public class SfcMdsalHelper {
     }
 
     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,
@@ -77,7 +77,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -95,7 +95,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -105,7 +105,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -133,7 +133,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -143,7 +143,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -163,7 +163,7 @@ public class SfcMdsalHelper {
     }
 
     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);
@@ -183,7 +183,7 @@ public class SfcMdsalHelper {
     }
 
     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);
index a3203170fcd167606f730be475d1e799cc538e60..700dc12daeb1b1d11a457619eecce8194377d4b5 100644 (file)
@@ -161,7 +161,7 @@ public final class FlowClassifierTranslator {
         //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());
@@ -169,7 +169,7 @@ public final class FlowClassifierTranslator {
         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());
 
index fcc30cee80f0cb0fd715a68b949886f5db01d4a2..2f9702cfd6848d1a5d1a4412fbe434b702fdc7d9 100644 (file)
@@ -44,7 +44,7 @@ public final class PortChainTranslator {
             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.
@@ -56,7 +56,7 @@ public final class PortChainTranslator {
             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());
index 49734ebae607fc8cd0b14d9400c2900a47f30e44..23f6e8bf0bea9f6532ea5f34b39dbebe24a51dee 100644 (file)
@@ -92,7 +92,7 @@ public final class CountersServiceUtils {
             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();
     }
index 07a1860279f2f60b244428cb3bf504af0fa557df..2ee88b2b68f25fb037279f65f3d547c27b38d0cc 100644 (file)
@@ -543,13 +543,13 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
                     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");
@@ -597,7 +597,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
             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()));
@@ -826,7 +826,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
 
     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;
             }
         }
@@ -865,7 +865,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         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()));
@@ -889,7 +889,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         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()));
@@ -1024,7 +1024,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
 
         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;
                 }
index 9a553caf4fbf9a03af1c102978b3e48c51a46aa1..fc9e3519d1b7eabb9398522d5d748ec3f41102ed 100644 (file)
@@ -99,7 +99,7 @@ public final class InterfaceUtils {
         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();
index 24a2354fdf37829cabe8c8894f6e9b8bc1047745..7a0ea4f9252db5f99bd920ceb9a0bf559cbb451c 100644 (file)
@@ -204,7 +204,7 @@ public class LearntVpnVipToPortEventProcessor
                     }
                     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()
@@ -254,7 +254,7 @@ public class LearntVpnVipToPortEventProcessor
                         }
                         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);
index 5c968a97ba7a3412be902b9d4504650be3e64e63..34536c14b410f8f2669907f98ec80b7da325cc59 100644 (file)
@@ -60,7 +60,7 @@ public class SubnetOpDpnManager {
                         + " 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();
@@ -117,7 +117,7 @@ public class SubnetOpDpnManager {
             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();
@@ -147,7 +147,7 @@ public class SubnetOpDpnManager {
             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);
@@ -194,7 +194,7 @@ public class SubnetOpDpnManager {
             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
index fb733562f9c4f7ccb9b59bbdc3b8333018f7cb15..e81e8db2b34a6d33bd8adc83335c5bab7a345938 100644 (file)
@@ -374,7 +374,7 @@ public class SubnetRoutePacketInHandler implements PacketProcessingListener {
         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;
         }
index 7bedb847efe0883c10ecdd6dced9275cb849e2d6..a3946919d12295fa878126df2ad646e385f2dfde 100644 (file)
@@ -464,7 +464,7 @@ public class TunnelInterfaceStateListener extends AsyncDataTreeChangeListenerBas
                         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;
@@ -573,9 +573,9 @@ public class TunnelInterfaceStateListener extends AsyncDataTreeChangeListenerBas
         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
                 }
index 0575d20ab6147a32118c54a6261003e89787f7d7..ebacb9b3f97d949bbdd731989a5c1a7cac7f5499 100644 (file)
@@ -116,7 +116,7 @@ public class VpnElanInterfaceChangeListener
             .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();
index 453a4b83b719fea8ca87d5ff56fb96a6470ad3b2..c6e0d8f7fb692539fe41d11e0f022d77b66f47d3 100644 (file)
@@ -197,7 +197,7 @@ public class VpnFootprintService implements IVpnFootprintService {
             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 -> {
@@ -329,7 +329,7 @@ public class VpnFootprintService implements IVpnFootprintService {
             }
 
             IpAddresses currIpAddress = new IpAddressesBuilder()
-                    .setKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()))
+                    .withKey(new IpAddressesKey(ipAddressSourceValuePair.getValue()))
                     .setIpAddressSource(ipAddressSourceValuePair.getKey()).build();
             if (ipAddresses.remove(currIpAddress)) {
                 try {
index 900e3bdd7f89c92c60dcbe71caa2905d41e3272e..969dc2e171c91e14532cbe05a305df81cc2428d9 100644 (file)
@@ -271,7 +271,7 @@ public class VpnInstanceListener extends AsyncDataTreeChangeListenerBase<VpnInst
                 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(
index 86e457468a84f48e7295281184e47df0f666a1f6..e16f4f8e409ef19044c5bb3315c42626698d4c79 100755 (executable)
@@ -875,7 +875,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
 
         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 {}",
@@ -966,7 +966,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         }
         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);
@@ -984,7 +984,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                               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;
@@ -1071,7 +1071,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
             }
             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);
@@ -1150,7 +1150,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                     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);
                                 }
@@ -1458,10 +1458,10 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                 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<>();
 
@@ -1589,10 +1589,10 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                 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<>();
 
@@ -1859,7 +1859,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         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(
@@ -1890,7 +1890,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         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)) {
@@ -1930,7 +1930,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         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()) {
@@ -1981,7 +1981,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
 
     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();
@@ -2162,7 +2162,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                 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.
index b85871cf04f276bc0555a6a750d4e3c41943428d..db1803f503aed5d139f4b9b38ef4dd598bebf3c8 100644 (file)
@@ -120,7 +120,7 @@ public class VpnInterfaceOpListener extends AsyncDataTreeChangeListenerBase<VpnI
 
             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) {
index 072bd16263f9fb36d9344401d76a7fcc963f477e..dea5831bbb75a62e0df770a9ff2e29988a74a16b 100644 (file)
@@ -50,13 +50,13 @@ public final class VpnOperDsUtils {
     }
 
     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());
     }
index 1c23ec15b9177082a9aeb539453f0ec348fc2d82..e874a274ff509708c99456add1b9a7c9c0991efd 100644 (file)
@@ -163,7 +163,7 @@ public class VpnSubnetRouteHandler {
                 }
                 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);
@@ -203,7 +203,7 @@ public class VpnSubnetRouteHandler {
 
                 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) {
index 51b435257225c3d26f618949475f566a6eedf09e..bbc9e89b7927aefa1d66d4d596aa55025721d891 100755 (executable)
@@ -288,7 +288,7 @@ public final class VpnUtil {
     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();
     }
@@ -318,7 +318,7 @@ public final class VpnUtil {
     }
 
     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,
@@ -473,7 +473,7 @@ public final class VpnUtil {
     }
 
     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) {
@@ -638,7 +638,7 @@ public final class VpnUtil {
                         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");
@@ -670,7 +670,7 @@ public final class VpnUtil {
                 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");
     }
@@ -757,7 +757,7 @@ public final class VpnUtil {
     }
 
     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();
     }
 
@@ -980,7 +980,7 @@ public final class VpnUtil {
         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) {
@@ -995,7 +995,7 @@ public final class VpnUtil {
         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()));
@@ -1036,7 +1036,7 @@ public final class VpnUtil {
         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);
@@ -1657,8 +1657,8 @@ public final class VpnUtil {
     }
 
     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")
@@ -1912,7 +1912,7 @@ public final class VpnUtil {
 
     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(),
@@ -2025,7 +2025,7 @@ public final class VpnUtil {
         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);
         }
@@ -2053,7 +2053,7 @@ public final class VpnUtil {
         }
         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);
 
index 8256b715f07c3d21306ea96d5695ae5c6b0c8b56..fea4029cc0d373d64f19b660c57701afb076bd4a 100755 (executable)
@@ -167,7 +167,7 @@ public class IVpnLinkServiceImpl implements IVpnLinkService, AutoCloseable {
         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();
 
index 0034b61564a00ed4336750bc2e69ab8f2e0b28ba..5ce47217c57b6e93688596a0a475d77363c78988 100755 (executable)
@@ -152,7 +152,7 @@ public class InterVpnLinkListener extends AsyncDataTreeChangeListenerBase<InterV
         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();
@@ -343,7 +343,7 @@ public class InterVpnLinkListener extends AsyncDataTreeChangeListenerBase<InterV
 
         // 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());
@@ -383,7 +383,7 @@ public class InterVpnLinkListener extends AsyncDataTreeChangeListenerBase<InterV
                 // 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);
index fc0eb8473979e3d09334bc4ebb22f2fb21710327..6213b50f4dbad55fd248c42ec6edb6715b8c22f0 100755 (executable)
@@ -116,7 +116,7 @@ public class InterVpnLinkNodeAddTask implements Callable<List<ListenableFuture<V
 
     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);
index 0c9635da7a54fa03881d66710c8aa5ea88da982f..80464cf074e7d37fb39cf3b5eaa4a1336e354606 100755 (executable)
@@ -219,7 +219,7 @@ public final class InterVpnLinkUtil {
             interVpnLinkCache.addInterVpnLinkStateToCaches(newVpnLinkState);
         } else {
             InterVpnLinkState newIVpnLinkState =
-                new InterVpnLinkStateBuilder().setKey(new InterVpnLinkStateKey(vpnLinkName))
+                new InterVpnLinkStateBuilder().withKey(new InterVpnLinkStateKey(vpnLinkName))
                     .setInterVpnLinkName(vpnLinkName)
                     .setFirstEndpointState(newFirstEndpointState)
                     .setSecondEndpointState(newSecondEndpointState)
index 6324cb052775426f124a719a17bc003fa9ddc21c..6d6a9d89007ee36c31eace3280febc8a57ede5fa 100644 (file)
@@ -129,7 +129,7 @@ public class L3vpnOverMplsGrePopulator extends L3vpnPopulator {
                 : 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();
     }
index ea627fcb68db4873d33c503400ea9b1dcec16b2e..f6af25d745c6dcbc89642307a4f4437551e35ef1 100644 (file)
@@ -82,7 +82,7 @@ public class L3vpnOverVxlanPopulator extends L3vpnPopulator {
                 : 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();
     }
 }
index e13ce2e84783a134f7d776e792f1b51a7b107d5c..2c047e672ebb02dab9b36768b54cde932220fc34 100644 (file)
@@ -58,7 +58,7 @@ public final class L3VpnTestCatalog {
 
     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());
     }
index d27037f1bb57000485fe2d51eb2839d064c4520f..241fd9ae670af283c246fb48533b402b52cb6898 100644 (file)
@@ -92,9 +92,9 @@ public class SubnetOpDpnManagerTest {
         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();
index 76adec26a58ae5354d00b8b5c344ef015c181014..7b271926d797ab09c47dc0bbef68ff1705241a20 100644 (file)
@@ -49,9 +49,9 @@ public class VpnServiceTest {
 
         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);
@@ -64,7 +64,7 @@ public class VpnServiceTest {
                             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);
index 23bd70ba152ce01b3ad06714b16c6bd3c55463bd..c436e8d8caa1520dc17497af56a6dc88d736cbb8 100644 (file)
@@ -254,7 +254,7 @@ public class VpnSubnetRouteHandlerTest {
         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<>();
@@ -265,9 +265,9 @@ public class VpnSubnetRouteHandlerTest {
         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();
@@ -280,30 +280,30 @@ public class VpnSubnetRouteHandlerTest {
         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();
index 7105d7cbbc4af928d1f3420266fc6474ec428f32..de7f96a4d41be9c186429ba1539a51af15f47596 100644 (file)
@@ -81,7 +81,7 @@ public class ShowVpnInstanceOpData extends OsgiCommandSupport {
             }
             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(
                     "------------------------------------------------------------------------------");