bgpcep.git
2 years agoRefactor PathAttributeParserTest 32/96732/2
Robert Varga [Wed, 30 Jun 2021 13:38:17 +0000 (15:38 +0200)]
Refactor PathAttributeParserTest

We have a few interestng asserts here and we are using global state,
factor that out.

Change-Id: I93fd890baacb7fb8a22acd244341f6491c4efe43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRefactor ParserTest 31/96731/1
Robert Varga [Wed, 30 Jun 2021 13:26:43 +0000 (15:26 +0200)]
Refactor ParserTest

Do not use ServiceLoaderBGPExtensionProviderContext() and use
assertThrows().

Change-Id: Idba5dd5e58deea555dfa7673c88fc385c77889ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ServiceLoaderPCEPExtensionProviderContext 29/96729/1
Robert Varga [Wed, 30 Jun 2021 11:18:36 +0000 (13:18 +0200)]
Remove ServiceLoaderPCEPExtensionProviderContext

We have DefaultPCEPExtensionConsumerContext which serves the activation
purposes without having global state lurking in singletons. Remove
ServiceLoaderPCEPExtensionProviderContext and replace its use in tests.

Change-Id: Ib09c7f93ad00b4cfb2cc293c0fa65004749b1fab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ServiceLoaderRSVPExtensionProviderContext 28/96728/2
Robert Varga [Wed, 30 Jun 2021 10:49:35 +0000 (12:49 +0200)]
Remove ServiceLoaderRSVPExtensionProviderContext

Carrying global static state is ill-advised, remove
ServiceLoaderRSVPExtensionProviderContext as it is superseded
through normal injection mechanisms.

Change-Id: I0996b3fb5dc69153def89fd4e57beea4c9e4054b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out PCEPExtensionProviderActivator 21/96721/3
Robert Varga [Tue, 29 Jun 2021 19:48:35 +0000 (21:48 +0200)]
Split out PCEPExtensionProviderActivator

This is a really simple extension, split it out into a component.

JIRA: BGPCEP-968
Change-Id: I9d4abb0c54f169ef6715db8c1243cc008271b710
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out PCEPExtensionProviderActivators 20/96720/4
Robert Varga [Tue, 29 Jun 2021 19:39:05 +0000 (21:39 +0200)]
Split out PCEPExtensionProviderActivators

PCEPExtensionProviderActivator is a simple whiteboard pattern, split
the activators into OSGi DS components.

JIRA: BGPCEP-969
Change-Id: I24feced4a4af71ab35b831a8b99f8dd1125cea7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate pcep-spi to OSGi DS 26/96726/3
Robert Varga [Wed, 30 Jun 2021 09:07:12 +0000 (11:07 +0200)]
Migrate pcep-spi to OSGi DS

This is a simple whiteboard, refactor it to use OSGi DS (and others).
The changes here cascade through all extensions, making them properly
stateless.

JIRA: BGPCEP-961
Change-Id: I1e8f253f2ea7a2eef494c84612a867b6318a93c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove a superfluous service specification 25/96725/1
Robert Varga [Wed, 30 Jun 2021 08:37:17 +0000 (10:37 +0200)]
Remove a superfluous service specification

DefaultRSVPExtensionConsumerContext directly implements the service,
there is no point in spelling it out.

Change-Id: Ie97a021375d1db9017416764e7d337babc5b5800
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out BmpDeployerImpl 16/96716/1
Robert Varga [Tue, 29 Jun 2021 11:57:37 +0000 (13:57 +0200)]
Split out BmpDeployerImpl

We have a rather contrived service routing here, ditch it in favor of
OSGi DS. Also eliminate BmpDeployerDependencies, as they are just
getting in the way.

JIRA: BGPCEP-953
Change-Id: Ie114a01b8ec1f87926f752b31cd7762a542e5db3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out BmpDispatcherImpl 15/96715/1
Robert Varga [Tue, 29 Jun 2021 11:44:02 +0000 (13:44 +0200)]
Split out BmpDispatcherImpl

The dispatcher is a simple component, split it out into OSGi DS.

JIRA: BGPCEP-953
Change-Id: Idbdfbfdc1730bfbbdc44ed903584fb307dd4aeb6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out DefaultBmpSessionFactory wiring 14/96714/1
Robert Varga [Tue, 29 Jun 2021 11:29:10 +0000 (13:29 +0200)]
Split out DefaultBmpSessionFactory wiring

DefaultBmpSessionFactory is a simple service, use usual DI frameworks
to activate it.

JIRA: BGPCEP-953
Change-Id: Ie4c120b652f8e60e0f451052201ec355ab4f61be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify peer group check 10/96710/2
Robert Varga [Tue, 29 Jun 2021 09:39:20 +0000 (11:39 +0200)]
Simplify peer group check

We do not need to perform an explicit nullness check, as we can simply
call equals on a constant.

Change-Id: Ibb713ea423dcc7b17e4a9a90541cd475bf03de35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out BGPDispatcherImpl 99/96699/4
Robert Varga [Mon, 28 Jun 2021 15:51:52 +0000 (17:51 +0200)]
Split out BGPDispatcherImpl

BGPDispatcherImpl is a rather trivial component, split it out of
blueprint to make things a tad more clear.

JIRA: BGPCEP-958
Change-Id: I8d01ced1ce17ac5d52d78171d17bba39918c01c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out OSGiBGPStateConsumer 00/96700/2
Robert Varga [Mon, 28 Jun 2021 17:25:17 +0000 (19:25 +0200)]
Split out OSGiBGPStateConsumer

BGPStateCollectorImpl is a weird bit of code. We essentially have an
OSGi whiteboard pattern going on here, except we drive it through an
otherwise-unused BGPStateProducer interface.

Turn GPStateCollectorImpl into a @Singleton for things like Guice et al,
but it will need some more integration work to get it operation.

Add OSGiBGPStateConsumer which is a trivial OSGi DS whiteboard consumer
and thus eliminate a chunk of blueprint wiring.

JIRA: BGPCEP-958
Change-Id: I92fd2ecb0ef3f1ecb1069536c8b2a4d6261f23c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out StrictBGPPeerRegistry 98/96698/2
Robert Varga [Mon, 28 Jun 2021 15:40:53 +0000 (17:40 +0200)]
Split out StrictBGPPeerRegistry

StrictBGPPeerRegistry is a very simple service, split out of blueprint.

JIRA: BGPCEP-958
Change-Id: I51ac52bb979e727d510a6b56f5e56d020b01bcff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate initial convergence message 95/96695/1
Robert Varga [Mon, 28 Jun 2021 12:31:57 +0000 (14:31 +0200)]
Update initial convergence message

This is a slight improvement on messages logged after commit on
initial convergence.

Change-Id: Ic70949d69d4683fe4c9e0e4018e86f88af244106
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean EffectiveRibIn on ApplicationPeer convergence 86/96686/2
Robert Varga [Sat, 26 Jun 2021 08:45:31 +0000 (10:45 +0200)]
Clean EffectiveRibIn on ApplicationPeer convergence

If we converge with empty application peer RIB we should make sure the
operation effective-rib-in is wiped.

Change-Id: I6c7536406888e1d04f3624a8b3d2450746bd4cd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFlush session on AdjRibOutListener convergence 85/96685/3
Robert Varga [Sat, 26 Jun 2021 08:43:41 +0000 (10:43 +0200)]
Flush session on AdjRibOutListener convergence

AdjRibOutListener should send out a flush session when it reaches
initial convergence without any data.

Change-Id: I3844a2912e0d23f679c4fcb620c8da451e6958c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert pcep-server-provider to OSGi DS 91/96691/1
Robert Varga [Mon, 28 Jun 2021 10:31:33 +0000 (12:31 +0200)]
Convert pcep-server-provider to OSGi DS

The blueprint here is a very simple single component, refactor it to use
OSGi Declarative Services instead.

JIRA: BGPCEP-963
Change-Id: Id396abaf268fce5ec01cea0e96a1d834551cb852
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert bmp-spi to OSGi DS 90/96690/2
Robert Varga [Mon, 28 Jun 2021 09:17:40 +0000 (11:17 +0200)]
Convert bmp-spi to OSGi DS

Follow the same pattern as we've done in bgp-parser-spi, ditching yet
another BluePrint container.

JIRA: BGPCEP-950
Change-Id: I9a787edf34fe9a6fb667b2f7f63d583f387a2a37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse mdsal-8.0.0 artifacts 81/96681/3
Robert Varga [Fri, 25 Jun 2021 18:18:59 +0000 (20:18 +0200)]
Use mdsal-8.0.0 artifacts

mdsal-8.0.0, switch to using released artifacts.

Change-Id: I932810194ac4293ce584c4f317f1794c278b5f7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd onInitialData() callbacks 84/96684/1
Robert Varga [Sat, 26 Jun 2021 08:38:57 +0000 (10:38 +0200)]
Add onInitialData() callbacks

DOMDataTreeChangeListener provides an empty-source callback for initial
convergence. Add instances of it along with FIXMEs to implement it.

Change-Id: I661622eecbd4a137bbac1e83d8209cc5a95a4379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded references to ODL blueprint extension 26/96626/1
Robert Varga [Wed, 23 Jun 2021 12:11:59 +0000 (14:11 +0200)]
Remove unneeded references to ODL blueprint extension

We have a few blueprints which are not using ODL extensions, yet
they are declaring a dependency on it. Remove such references, making
future migration more obvious.

JIRA: BGPCEP-881
Change-Id: I4c5fffb4806f0beade7f7d9533b5ff6cef48f3d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert bmp-parser-impl to OSGi DS 94/96594/5
Robert Varga [Mon, 21 Jun 2021 21:34:57 +0000 (23:34 +0200)]
Convert bmp-parser-impl to OSGi DS

BmpActivator is essentially a simple whiteboard dispatch, let's express
it that way, eliminating some blueprint wiring.

JIRA: BGPCEP-951
Change-Id: I77b4d0d3a53fb73adb72c8affb84e0c593919675
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert programming-impl to OSGi DS 27/93127/2
Robert Varga [Sat, 17 Oct 2020 01:55:25 +0000 (03:55 +0200)]
Convert programming-impl to OSGi DS

This is a rather simple blueprint, convert it to OSGi DS.

JIRA: BGPCEP-922
Change-Id: I33b455490123cad6d20fb735ab72177b62d6cc09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump MRI upstreams 57/96357/17
Robert Varga [Tue, 25 May 2021 09:00:50 +0000 (11:00 +0200)]
Bump MRI upstreams

Adopt:
- odlparent-9.0.2
- infrautils-2.0.2
- yangtools-7.0.3
- mdsal-8.0.0-SNAPSHOT
- aaa-0.14.0-SNAPSHOT
- netconf-2.0.0-SNAPSHOT
- controller-4.0.0-SNAPSHOT

Also adjust to API changes, mostly coming from yang-data-api, but there
is also a change in mapping for attributes-{reach,unreach} children,
which no longer are based on augmentation path.

Since augmentation sorting has been relaxed, this wrecks havoc in
odl-pcep-sync-optimizations.yang, which relies on the (illogical)
sorting rules of previous implementation. These are nailed down via
augment-identifier extension and sorted in a more logical way.

Change-Id: I54f7637a9443c9c577c6f397fe102a461f617229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert algo-impl to OSGi DS 57/93757/6
Robert Varga [Tue, 10 Nov 2020 18:46:04 +0000 (19:46 +0100)]
Convert algo-impl to OSGi DS

This is a very simple component wiring-wise, convert it to OSGi DS.

JIRA: BGPCEP-925
Change-Id: Idbad3b4fa4c92d41b6debe02865b59154c32f5bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert graph-impl to OSGi DS 55/93755/7
Robert Varga [Tue, 10 Nov 2020 18:05:16 +0000 (19:05 +0100)]
Convert graph-impl to OSGi DS

This is a very simple component wiring, convert it to OSGi DS
and allowing it to work in other environments as well.

JIRA: BGPCEP-931
Change-Id: I8f94dcdee1dad419cd6ef844697678a1c11611b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix absolute leafref 61/96361/2
Robert Varga [Tue, 25 May 2021 11:42:43 +0000 (13:42 +0200)]
Fix absolute leafref

Leafrefs are namespace-bound at the point where they are instantiated,
hence we need to use absolute addressing to resolve references to
top-level BGP container.

Change-Id: Ie153e7a142396103adf32eee9a2c5180aab69be3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRename multiprotocol augmentations 60/96360/4
Robert Varga [Tue, 25 May 2021 09:22:15 +0000 (11:22 +0200)]
Rename multiprotocol augmentations

'attributes-1' and 'attributes-2' are counter-intuitive, rename them
to attributes-reach and attributes-unreach. This cascades all over the
place, but is completely compatible at YANG level.

Change-Id: Iae3039fecb352e8a055a54375b9e6b57f701da76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse GuicedEE javax.inject 56/96356/1
Robert Varga [Tue, 25 May 2021 09:08:05 +0000 (11:08 +0200)]
Use GuicedEE javax.inject

Update references to a more modern packaging of javax.inject.

Change-Id: I16c68ed0b73d1918c8e9f396c400d19399d52f7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse OSGi R7 55/96355/1
Robert Varga [Tue, 25 May 2021 09:02:10 +0000 (11:02 +0200)]
Use OSGi R7

Update osgi.core dependencies to point to OSGi R7 artifact instead
of R6.

Change-Id: Ia23ad2271bdfe58d60be92acf58e1a2cbe7f9a87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoImprove mvpn parsing and serialization 33/96133/4
Robert Varga [Wed, 12 May 2021 13:46:02 +0000 (15:46 +0200)]
Improve mvpn parsing and serialization

Require MvpnSerializer implementations to provide a properly-specialized
class. Centralize implementations in AbstractMvpnNlri, so that we do not
get a virtual dispatch here.

Also specialize SimpleMvpnNlriRegistry to use ImmutableMap/EnumMap rather
than HandlerRegistry, which is using the overly-dynamic MultiRegistry --
which ends up speeding up lookups significantly.

Change-Id: I09058410b4b8c3042c6273fe470530594387a09e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse OSGi DS in bgp-parser-spi 27/96127/5
Robert Varga [Wed, 12 May 2021 08:10:15 +0000 (10:10 +0200)]
Use OSGi DS in bgp-parser-spi

Eliminate use of blueprint in favor of binding with proper whiteboard
pattern in OSGi DS/ServiceLoader.

We also eliminate AbstractBGPExtensionProviderActivator, as the
activators are now completely stateless -- paving way for even better
registration mechanics in the future.

JIRA: BGPCEP-945
Change-Id: I0d6e2358c9419e11ef7f3c62984974802633b712
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge OSGiBGPRibRoutingPolicyFactory 29/96129/2
Robert Varga [Wed, 12 May 2021 08:55:47 +0000 (10:55 +0200)]
Merge OSGiBGPRibRoutingPolicyFactory

We have OSGi R7, hence we can use constructor injection and side-step
the need to have two additional classes.

Change-Id: I4b2bc45dc09c0be729b23452b65cc65633586f02
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge OSGiBGPTableTypeRegistryConsumer 28/96128/2
Robert Varga [Wed, 12 May 2021 08:50:16 +0000 (10:50 +0200)]
Merge OSGiBGPTableTypeRegistryConsumer

We have OSGi R7, hence we can use constructor injection and side-step
the need to have two additional classes.

Change-Id: Ibb950d4c85fecf9597440c881fada94477498a5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge OSGiRSVPExtensionConsumerContext 26/96126/1
Robert Varga [Wed, 12 May 2021 07:54:14 +0000 (09:54 +0200)]
Merge OSGiRSVPExtensionConsumerContext

We have OSGi R7, hence we can use constructor injection and side-step
the need to have two additional classes.

Change-Id: Ida7548cca129e477a98de26967e641bc63f26f95
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate blueprint from BGP linkstate extension 11/96111/4
Robert Varga [Mon, 10 May 2021 20:37:17 +0000 (22:37 +0200)]
Eliminate blueprint from BGP linkstate extension

Switch the BGP-LS extension to use OSGi DS/Config Admin for activation
and configuration. This necessitates a change in operational procedure
to enable the legacy BGP-LS attribute type. This is a low-risk change,
as that type has been superseded 5 years ago.

JIRA: BGPCEP-949
Change-Id: Iac6da9ba7968e0a1efc86bede77018ff739fcd3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRe-create transaction chain upon failure in TopologyStatsProvider 50/95950/8
Oleksii Mozghovyi [Tue, 27 Apr 2021 17:16:18 +0000 (20:16 +0300)]
Re-create transaction chain upon failure in TopologyStatsProvider

Transaction failures can occur as a side-effect of various datastore
failure scenarios. In case of TopologyStatsProviderImpl, such a failure
requires manual intervention to restart the component (and thus
re-establish exports).

Rework transaction chain lifecycle, so that we close it down on failures
and establish a new chain when we need it for the periodic updates
and/or unbind operations.

Since we are modifying lifecycle, also make sure we work in terms of a
TimerTask with an externally-provided timer -- we really do not care how
we are scheduled.

JIRA: BGPCEP-920
Change-Id: I6f2be6a5c14ac6e191988c3b7bfd56b78b94abb6
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRework synchronization of SessionStateImpl 48/95948/5
Oleksii Mozghovyi [Mon, 26 Apr 2021 22:49:50 +0000 (01:49 +0300)]
Rework synchronization of SessionStateImpl

SessionStateImpl is a simple state tracker, but its lifecycle was
needlessly complex due to it not being inherently tied to its session.

Make sure SessionStateImpl is instantiated only when we have a session,
which makes a number of operations clearer: we no longer need to deal
with partial initialization and need to protect only internal state.

While we are at it, simplify all of that by keeping simple longs
instead of LongAdder -- and use saturatedOf(long) to convert these to
Uint objects, preventing possible runtime exceptions when overflows
occur.

JIRA: BGPCEP-920
Change-Id: I57b33c7dc33fe63500f5ad96a80d39889c6c5a67
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoHandle TopologyNodeState release properly 49/95949/8
Oleksii Mozghovyi [Mon, 26 Apr 2021 23:58:43 +0000 (02:58 +0300)]
Handle TopologyNodeState release properly

- Close transaction chain when PCEP session goes down
- Remove NodeState from the corresponding map in SessionManager properly

JIRA: BGPCEP-920
Change-Id: Ica9dc0a6f43420b5b57694252cb13d2b5350b103
Signed-off-by: Deepthi V V <dvv@luminanetworks.com>
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRevert "Fix issues during connection flap with scaled pcc sessions." 02/96102/1
Robert Varga [Mon, 10 May 2021 08:03:28 +0000 (10:03 +0200)]
Revert "Fix issues during connection flap with scaled pcc sessions."

This reverts commit a162197f9be41a2296e7571ba7bbfac73dce50f7. The patch
needed to be split up, which unfortuantely did not happen on the same
change-id. We will follow up on this with properly split up patches.

JIRA: BGPCEP-920
Change-Id: I06d5326de134c9b70c703a761498365643a4f7df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix issues during connection flap with scaled pcc sessions. 39/92039/5
Deepthi V V [Tue, 11 Aug 2020 12:31:55 +0000 (18:01 +0530)]
Fix issues during connection flap with scaled pcc sessions.

Back to back pcep sessions results in exceptions and sessions cannot
be established further.

1. Close tx chain when Topology Node State is released
2. Deadlock occurs in TopologyStatsProviderImpl.
T1: Unbind call creates a tx using tx chain and commits it. This
triggers onTxChainFailed call. Lock acquired order:
TopologyStatsProviderImpl -> PingPongTransactionChain
T2: 2nd Unbind call locks on TopologyStatsProviderImpl and tries to
create tx for which lock on PingPongTransactionChain is required.
Thus resulting in deadlock.

Fix: init, closed and recreateTxChain will synhronise on TopologyStatsProviderImpl.
All other tx will be synchronised on txChain.

JIRA: BGPCEP-920
Change-Id: I1f727121843b45a5e6fc722a94319538c7522deb
Signed-off-by: Deepthi V V <dvv@luminanetworks.com>
3 years agoInstantiate BgpPeer only once 61/95561/4
Oleksii Mozghovyi [Thu, 25 Mar 2021 17:58:00 +0000 (19:58 +0200)]
Instantiate BgpPeer only once

For some reason in clustered configuration BgpPeer might be instantiated
twice and this leads to service failure, this patch introduce additional
check to avoid this.

JIRA: BGPCEP-948
Change-Id: Icb355abf89ba1dee0281c32d6dd60c95fcdfdb61
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
3 years agoBump versions by x.(y+1).z 85/95285/1
jenkins-releng [Mon, 22 Feb 2021 23:02:56 +0000 (23:02 +0000)]
Bump versions by x.(y+1).z

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I6c8ee6ac4bc2f346444b612de2c16f606cda4074

3 years agoBump netconf to 1.13.0 44/95244/2
Robert Varga [Sun, 21 Feb 2021 17:48:20 +0000 (18:48 +0100)]
Bump netconf to 1.13.0

Adjust version for MRI-integrated NETCONF.

Change-Id: Idc87d256c0f034efe14c194a05bbf1bd6f9620d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAbstractPeer.createPeerPath() should not be synchronized 94/94494/10
Robert Varga [Thu, 7 Jan 2021 21:14:37 +0000 (22:14 +0100)]
AbstractPeer.createPeerPath() should not be synchronized

This method depends only on peerID and RIB, let the caller provide
the intended ID -- and we can be unsynchronized, reducing cognitive
load.

Change-Id: I931f3242d077dfb0894a0a828cfb5ec4c89c4f2b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove unneeded AbstractRIBTestSetup mocks 97/94497/7
Robert Varga [Fri, 8 Jan 2021 09:42:44 +0000 (10:42 +0100)]
Remove unneeded AbstractRIBTestSetup mocks

We are not using binding interfaces anymore, do not mock them.

JIRA: BGPCEP-853
Change-Id: I5922f2eaca1a7ed87ea5ca52466191f3f7885014
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove RIBImpl's use of DataBroker 90/94490/10
Robert Varga [Thu, 7 Jan 2021 19:35:22 +0000 (20:35 +0100)]
Remove RIBImpl's use of DataBroker

We do not need the binding DataBroker anywhere in the core logic,
do not propagate it there.

JIRA: BGPCEP-853
Change-Id: I283857e7dce16b66aa6d83ab25c87adbb6b75e88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdopt akka-2.6.x 76/94976/2
Oleksii Mozghovyi [Tue, 2 Feb 2021 21:11:29 +0000 (23:11 +0200)]
Adopt akka-2.6.x

Bump upstream to controller-3.0.6 to adopt akka-2.6.x.

Change-Id: I5b8732ff17ee47b6a0acd385eeb8ceaf4f1a1280
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
3 years agoBump upstream versions 87/94787/5
Robert Varga [Mon, 25 Jan 2021 14:09:56 +0000 (15:09 +0100)]
Bump upstream versions

Adopt following upstreams:
- odlparent-8.1.0
- infrautils-1.9.5
- yangtools-6.0.4
- mdsal-7.0.5
- controller-3.0.5

Change-Id: I3bb880b1ebd3ef23b4cd15a3bcab56fc9fd9f529
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not expose Binding access through rib.impl.spi.RIB 89/94489/7
Robert Varga [Thu, 7 Jan 2021 19:27:42 +0000 (20:27 +0100)]
Do not expose Binding access through rib.impl.spi.RIB

We should not be touching binding layer at all, eliminate one avenue
of access.

JIRA: MDSAL-583
Change-Id: I4a3c7d6f864e4b69fc5d0fdc41e0aa1acd5ae341
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove Peer.getRawIdentifier() 93/94493/6
Robert Varga [Thu, 7 Jan 2021 20:52:34 +0000 (21:52 +0100)]
Remove Peer.getRawIdentifier()

This method is not used anywhere, remove it.

Change-Id: Ib28117e93de39e5d4f2ed2f728446c810b8f88f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up AbstractPeer fields 92/94492/7
Robert Varga [Thu, 7 Jan 2021 20:05:26 +0000 (21:05 +0100)]
Clean up AbstractPeer fields

Minimize fields visible to subclasses and make a note of locking
improvement.

Change-Id: If1a5f62475f642ad4edcaae635e9c801a1b303c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRework ribOut interaction 88/94488/5
Robert Varga [Thu, 7 Jan 2021 19:13:31 +0000 (20:13 +0100)]
Rework ribOut interaction

As it turns out, we are using a binding chain separately from the
main chain. The reason for this is that we use domChain for processing
towards from the peer -- which is common for both. bindingChain is
used exclusively for ribOut writeout.

Rename it and correct the guard/use mismatch we introduced in the
previous patch.

JIRA: BGPCEP-853
Change-Id: Idac28712ae9603f7cbfefe613baf2b47c7daff17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump MRI upstreams 13/94513/2
Robert Varga [Fri, 8 Jan 2021 20:46:01 +0000 (21:46 +0100)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.0.3
- infrautils-1.9.4
- yangtools-6.0.3
- mdsal-7.0.4
- controller-3.0.4

Change-Id: Id098b859b916fcf34eac04467e90dd7f38785d87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix RIB documentation 91/94491/1
Robert Varga [Thu, 7 Jan 2021 19:39:02 +0000 (20:39 +0100)]
Fix RIB documentation

We have a bad reference here, fix it.

Change-Id: Ideea0ba9666274069e5d840d00dcbabaa47b11a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDocument AbstractPeer.bindingChain visibility 87/94487/1
Robert Varga [Thu, 7 Jan 2021 19:08:15 +0000 (20:08 +0100)]
Document AbstractPeer.bindingChain visibility

This field accessed by a test, annotate it as such and also make
sure we comply with synchronization rules.

Change-Id: I4d1280b140cae493ed7cb69a37cb950b0af82bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoInitialize local directly 86/94486/1
Robert Varga [Thu, 7 Jan 2021 18:34:35 +0000 (19:34 +0100)]
Initialize local directly

We are wasting a line and some clarity here, fix that.

Change-Id: I7d4c59d0a77119b26af95e61f844dc99d8acbc39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoInvert check 85/94485/1
Robert Varga [Thu, 7 Jan 2021 18:25:30 +0000 (19:25 +0100)]
Invert check

The if-body is only a single line and may easily be missed. Save
us a negation and more readable as well.

Change-Id: I7021fec717883825b371115a09da6867505ffc1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDrop <R, I> generic from RIBSupport 28/94328/13
Robert Varga [Fri, 1 Jan 2021 20:11:08 +0000 (21:11 +0100)]
Drop <R, I> generic from RIBSupport

We do not have anything depending on R, I in the interface contract,
be sure to drop the generic arguments to simplify users. This cascades
to other bgp-rib-spi constructs as well.

JIRA: BGPCEP-853
Change-Id: Ib8212f26946fe02f70a947e684aa199785f974d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove extractAdjRibInRoutes() 27/94327/12
Robert Varga [Fri, 1 Jan 2021 19:48:52 +0000 (20:48 +0100)]
Remove extractAdjRibInRoutes()

This method is not used anywhere, hence we can safely remove it.

JIRA: BGPCEP-853
Change-Id: I5c623f757e94ad28fc0c8b8e08bacf66f619b929
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert LocRibWriter to DOM APIs 31/83231/30
Robert Varga [Wed, 24 Jul 2019 10:38:30 +0000 (12:38 +0200)]
Convert LocRibWriter to DOM APIs

LocRibWriter is not very complicated, but it affects also best path
selection and add-path objects. This patch performs a straight conversion
without cleaning up RIBSupport and related classes. That part will be
done in a follow-up patch.

JIRA: BGPCEP-853
Change-Id: If6b22adf8f9a15c744ed873a5e114a251023c7a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
3 years agofix use of read-only transactions 38/93138/5
Gasparini, Claudio (cg479k) [Sun, 18 Oct 2020 09:45:47 +0000 (11:45 +0200)]
fix use of read-only transactions

 in openconfig-rp-statement

-  make sure transactions are used in a proper try-with-resources block
- use Optional.map() handling rather than the explicit isPresent()/get() combo

JIRA: BGPCEP-861
Signed-off-by: Gasparini, Claudio (cg479k) <claudio.gasparini@intl.att.com>
Change-Id: Icb46adc1e4d7be70a2151f26e25229baa64c87c9

3 years agoUse ImmutableMap.toImmutableMap() 28/84928/5
Robert Varga [Sun, 6 Oct 2019 16:19:14 +0000 (18:19 +0200)]
Use ImmutableMap.toImmutableMap()

Rather than using a temporary map followed by ImmutableMap.copyOf(),
use ImmutableMap's collector.

Change-Id: Id4cad5f8027692b4beabfc9fc532ed4249b62aa6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBe more defensive when checking nodes 91/94391/1
Robert Varga [Mon, 4 Jan 2021 09:28:05 +0000 (10:28 +0100)]
Be more defensive when checking nodes

We have a couple of failures, where we end up throwing a NPE
rather than an assertion. Clean them up.

Change-Id: Ib70a04fb398ba4ce789fcef9b08bb90f4b21c967
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup PathComputationImpl 69/94369/1
Robert Varga [Sun, 3 Jan 2021 16:16:23 +0000 (17:16 +0100)]
Cleanup PathComputationImpl

Remove superfluous braces and be smarter about filling out the
address family.

Change-Id: Idbd89c098c95a095872f2b28e460ee0828f8c055
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup boolean literals 68/94368/1
Robert Varga [Sun, 3 Jan 2021 16:12:41 +0000 (17:12 +0100)]
Cleanup boolean literals

A number of places are using explicit literals where not needed,
as pointed out by sonar. Fix these sites.

Change-Id: I0ad6a690c66fb3b53bb4cd5c549399b665e7bc98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSimplify matchAfiSafi 67/94367/1
Robert Varga [Sun, 3 Jan 2021 15:54:47 +0000 (16:54 +0100)]
Simplify matchAfiSafi

Sonar is pointing out a boolean literal, remove it by using a
smarter expression.

Change-Id: I68439a378e57122e484222e9dff08dcf7f5a9e9b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSimplify AbstractStatementRegistryTest 49/94349/1
Robert Varga [Sun, 3 Jan 2021 08:12:33 +0000 (09:12 +0100)]
Simplify AbstractStatementRegistryTest

All state here can use field initializers, hence remove mucking
with @Before.

Change-Id: I4b583dba9efb97caf578bb8b48885acc37ab56a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup AbstractStatementRegistryConsumerTest 41/94341/4
Robert Varga [Sat, 2 Jan 2021 14:09:17 +0000 (15:09 +0100)]
Cleanup AbstractStatementRegistryConsumerTest

Make sure we properly clean up the activator. While we're here,
also use read-only transactions for reads, close them as needed
and do not read more than we need to.

Also improve CheckUtil to report received messages when an
assertion fails -- and property assert errors.

Change-Id: Iee09d09df4b8fb50d19938074d7e65e55f67a6c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate boolean getters 09/94309/12
Robert Varga [Tue, 29 Dec 2020 12:47:55 +0000 (13:47 +0100)]
Migrate boolean getters

DataObject.isFoo() is now deprecated, use getFoo() instead. There
is also a bunch of drive-by updates to expressiveness, fixing various
(bogus) Eclipse warnings.

Tests relying on explicit order are documented as such and refactored
for clarity.

Change-Id: I40285b7a226a1b23c578badea78a80158325a561
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoTrim down AdvertizedRoute size 19/94319/1
Robert Varga [Wed, 30 Dec 2020 23:41:15 +0000 (00:41 +0100)]
Trim down AdvertizedRoute size

Use alignment shadow to store the additional boolean, as it Java <15
will not do that for us.

Change-Id: Ib2c9ec74614cca8d6edaf4d9ffae78b6698f6fff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize isNonAddPathBestPathTheSame() 18/94318/1
Robert Varga [Wed, 30 Dec 2020 22:54:43 +0000 (23:54 +0100)]
Optimize isNonAddPathBestPathTheSame()

This is an Eclipse automatic logic optimization: in case of bestPath
being empty/null, we do not need to evaluate the second part of the
expression.

Change-Id: I96010fd93ca24f2ac1684e6d5117e59acfe2bae0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove RIBSupport.emptyRoutesContainer() 16/94316/3
Robert Varga [Wed, 30 Dec 2020 21:24:22 +0000 (22:24 +0100)]
Remove RIBSupport.emptyRoutesContainer()

This method is not called anywhere simply because this container
has no semantics in the datastore. Remove the method and all its
implementations.

This means that extensions do not load the associated Builder and
its implementation class. The second is more important, as it means
that the routes container will have only one implementation (from
mdsal-dom-codec) -- allowing JIT to devirtualuze based on CHA.

Change-Id: I643185ee9f6d035235e6364b5832b6b128443bd3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSwitch TerminationReason to use Uint8 79/85979/6
Robert Varga [Tue, 26 Nov 2019 15:13:59 +0000 (16:13 +0100)]
Switch TerminationReason to use Uint8

As binding has switched to more expressive Uint types, embrace them
to allow smaller number of conversions.

Change-Id: I353750e1ed9fb8904b1f20be44f25d9c09592213
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse BindingMap.Builder to fix list-related warnings 31/93031/7
Robert Varga [Mon, 12 Oct 2020 18:23:51 +0000 (20:23 +0200)]
Use BindingMap.Builder to fix list-related warnings

BindingMap allows us to keep a list-like builder and result in a
Map -- thus arriving at what we want.

Change-Id: If65d10f801ad0e9e0d6e67c16e4b27911214136b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFurther algo-impl improvements 14/94314/3
Robert Varga [Wed, 30 Dec 2020 17:45:50 +0000 (18:45 +0100)]
Further algo-impl improvements

Cleanup invocations to .toString() as well as its implementations
and declarations.

Change-Id: Ic019776cc5021ddca673a61a83b131ee74b5fb78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoprecise OpenConfig models original license 05/93005/5
guillaume.lambert [Fri, 9 Oct 2020 14:21:44 +0000 (16:21 +0200)]
precise OpenConfig models original license

add a NOTICE and an openconfig.LICENSE files in the bgp module

OpenConfig YANG models are published under the Apache License version 2
a.k.a. ALv2 but they do not precise it in their description.

Though Alv2 allows redistribution under other licenses, it includes a
redistribution clause (4) that instructs to give any other recipients
of the work or the derivative works a copy of the original license.

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id64f9473ebd43df0c851a0c78533ea593634fe60

3 years agoCleanup algo-impl classes 08/94308/2
Robert Varga [Tue, 29 Dec 2020 13:11:42 +0000 (14:11 +0100)]
Cleanup algo-impl classes

Make sure we are using simple initializers and diamond-notation,
plus the usual autosave actions.

Change-Id: Ieaaa0c7294ee95a64a04f510d95bfb47ed522b91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump MRI upstreams 55/94155/6
Robert Varga [Thu, 10 Dec 2020 12:44:48 +0000 (13:44 +0100)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.0.2
- infrautils-1.9.3
- yangtools-6.0.2
- mdsal-7.0.3
- controller-3.0.3

Change-Id: I26a2d923a4509ebf5817878a29e7776acff23d3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor SimpleMvpnNlriRegistry 82/93782/2
Robert Varga [Wed, 11 Nov 2020 14:01:10 +0000 (15:01 +0100)]
Refactor SimpleMvpnNlriRegistry

This is an internal implementation singleton, populate it statically,
cutting some complexity.

Change-Id: Ie4d30e68c009319226c6adb2a22dd359b5d85a05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoWire SimpleEsiTypeRegistry statically 80/93780/2
Robert Varga [Wed, 11 Nov 2020 11:26:36 +0000 (12:26 +0100)]
Wire SimpleEsiTypeRegistry statically

This is an implementation detail, wire the registry statically.
We can optimize it afterwards.

Change-Id: I131986302bd85af80740fb70f3bef285d7f5d7c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoWire SimpleEvpnNlriRegistry statically 79/93779/4
Robert Varga [Wed, 11 Nov 2020 11:17:47 +0000 (12:17 +0100)]
Wire SimpleEvpnNlriRegistry statically

This registry is populated with invariants and is an implementation
detail. Move it to impl.nlri and make it self-populated on creation.

This will allow us to optimize it further.

Change-Id: Ic55a38eb735fd83ebf0c9712b493deb72f59bff2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not populate SimpleNlriTypeRegistry from BGPActivator 78/93778/2
Robert Varga [Wed, 11 Nov 2020 11:06:20 +0000 (12:06 +0100)]
Do not populate SimpleNlriTypeRegistry from BGPActivator

SimpleNlriTypeRegistry has static contents, populate it upon
creation, so that we can treat it as an immutable entity.

Change-Id: I31fb42f5f5cf0167639e1feb4c620233c186df8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoPopulate SimpleBindingSubTlvsRegistry statically 77/93777/2
Robert Varga [Wed, 11 Nov 2020 10:55:25 +0000 (11:55 +0100)]
Populate SimpleBindingSubTlvsRegistry statically

This is a standalone dispatch registry. Wire it statically as a
first step before we optimize it.

Change-Id: I107fc20024b83dcc4b086fae5e0caa5f012e0ca0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate Ipv4NlriParserTest 07/93707/4
Robert Varga [Mon, 9 Nov 2020 23:08:21 +0000 (00:08 +0100)]
Migrate Ipv4NlriParserTest

Use MockitoJUnitRunner instead of explicit initMocks().

Change-Id: I11a6f94c7a8b6952056bf3116dd9b257c0f24091
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor SimpleRouteTargetConstrainNlriRegistry 74/93774/3
Robert Varga [Tue, 10 Nov 2020 22:46:45 +0000 (23:46 +0100)]
Refactor SimpleRouteTargetConstrainNlriRegistry

This registry is utterly static, populated in various ways. Rather
than using Handlers, fine-tune it for the 4 cases we really care
about. We use an ImmutableMap for serializers and a switch() dispatch
to static methods for parsers.

Change-Id: Ibb6140fa5486fab3d5b2c09e1e270bf8e52bf944
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert bgp-rib-spi to OSGi DS 73/93773/2
Robert Varga [Tue, 10 Nov 2020 20:57:09 +0000 (21:57 +0100)]
Convert bgp-rib-spi to OSGi DS

This again is a plain whiteboard pattern, make the minimal changes
required to work with OSGi DS and other frameworks. Also makes
RIBExtensionProviderActivator implementations properly stateless,
taking out a chunk of static wiring out of various supports.

JIRA: BGPCEP-944
Change-Id: I5dfaf8562a3fc79ea4a8328e6b9db8b7d5537f86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove unused blueprint 56/93756/3
Robert Varga [Tue, 10 Nov 2020 18:33:50 +0000 (19:33 +0100)]
Remove unused blueprint

This blueprint is not used anywhere and references non-existent
classes. Remove it to reduce confusion.

JIRA: BGPCEP-925
Change-Id: I9afa164bba6e9f75b9049b73e6d9d51b7b332280
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge if statements 72/93772/1
Robert Varga [Tue, 10 Nov 2020 21:06:02 +0000 (22:06 +0100)]
Merge if statements

Sonar does not like this nested if, fix that.

Change-Id: I8550d8ce4a07f5c10e918af64baffe8e2171c4c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix OSGiBGPTableTypeRegistryConsumer whiteboard 43/93743/1
Robert Varga [Tue, 10 Nov 2020 17:43:25 +0000 (18:43 +0100)]
Fix OSGiBGPTableTypeRegistryConsumer whiteboard

We need to have a greedy policy here, otherwise we might miss some
extensions.

JIRA: BGPCEP-942
Change-Id: I33589f167be78d10139979dc62ab2a17e74e455a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix OSGiRSVPExtensionConsumerContext whiteboard 42/93742/1
Robert Varga [Tue, 10 Nov 2020 17:41:21 +0000 (18:41 +0100)]
Fix OSGiRSVPExtensionConsumerContext whiteboard

We need to have a greedy policy here, otherwise we might miss some
extensions.

JIRA: BGPCEP-923
Change-Id: I5111e4710d196bc26cce03eac8ebc5238de68c22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert openconfig-rp-impl to OSGi DS 41/93741/1
Robert Varga [Tue, 10 Nov 2020 16:41:19 +0000 (17:41 +0100)]
Convert openconfig-rp-impl to OSGi DS

Add proper injection of dependencies and remove blueprint. With all
the previous work this is rather trivial.

JIRA: BGPCEP-943
Change-Id: Ia8a6e745e678c7359ec1fea073978d243146bee4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert rsvp-spi to OSGi DS 12/93712/10
Robert Varga [Tue, 10 Nov 2020 05:07:53 +0000 (06:07 +0100)]
Convert rsvp-spi to OSGi DS

The SPI wiring here is a bit contrived, this performs minimal
conversion, eliminating AbstractRSVPExtensionProviderActivator.

JIRA: BGPCEP-923
Change-Id: Iff29e1ed7ea3630315553f946286cf40ac0344c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove blueprint from rsvp-impl 19/93719/1
Robert Varga [Tue, 10 Nov 2020 14:48:23 +0000 (15:48 +0100)]
Remove blueprint from rsvp-impl

rsvp-impl ends up being very simple in what it does, convert it
to OSGi DS.

JIRA: BGPCEP-924
Change-Id: I365e3daf26edc28ea842e59448144adbacbf4135
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert bgp-flowspec to OSGi DS 11/93711/9
Robert Varga [Tue, 10 Nov 2020 02:18:51 +0000 (03:18 +0100)]
Convert bgp-flowspec to OSGi DS

As it turns out, FlowspecActivator is just a bunch of static wiring,
which we do not need to inject. Refactor SimpleFlowspecTypeRegistry
into a dedicated immutable FlowspecTypeRegistry, which has provably
static lifecycle and used only for immutable access.

This cuts a ton of complexity and fixes ServiceLoader injection,
plus makes DI conversion a breeze -- eliminating static state in
process of doing so.

JIRA: BGPCEP-941
Change-Id: I0ad4fef346131b44f7f5bca2a637826e821146d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor BGPTableTypeRegistryProviderActivator 05/93705/9
Robert Varga [Mon, 9 Nov 2020 20:37:37 +0000 (21:37 +0100)]
Refactor BGPTableTypeRegistryProviderActivator

Rather than wiring through static reference extension in blueprint
and keeping stateful singletons, use a proper whiteboard injection
pattern for OSGi, ServiceLoader and Singleton worlds.

This makes bgp-openconfig-spi to completely wire natively in those
environments.

JIRA: BGPCEP-942
Change-Id: I325ab8b3cf09bc71cad217e6c1f26c6c69bc0cc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoConvert BGP extensions to OSGi DS 89/93689/6
Robert Varga [Mon, 9 Nov 2020 11:39:10 +0000 (12:39 +0100)]
Convert BGP extensions to OSGi DS

Most of these are straightforward ports.
bgp-linkstate will need a follow-up to deal with BGPActivator.
bgp-flowspace will need a follow-up to deal with BGP/RIBActivator.

JIRA: BGPCEP-941
Change-Id: Ib6ebbb41b3cd1095e1809e91a46fee38ebaf722f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoLower binding-spec-util usage 09/93709/5
Robert Varga [Tue, 10 Nov 2020 00:31:48 +0000 (01:31 +0100)]
Lower binding-spec-util usage

We do not use reflections in main artifact in most cases, hence
we should not be pulling it as a dependency.

Change-Id: If69d85a3a5a39c5049950df03b67482341c171ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>