openflowplugin.git
3 years agoRemove use of Optional from DeviceInitializationUtil 63/94363/3
Robert Varga [Sun, 3 Jan 2021 14:00:25 +0000 (15:00 +0100)]
Remove use of Optional from DeviceInitializationUtil

The use here is completely unneeded -- we can serve the same thing
with checks for null.

Change-Id: Ic5958cd97f91676a2ab6b34c9f049a7f73eaa1d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoReduce use of Optional in ContextChainHolderImpl 62/94362/3
Robert Varga [Sun, 3 Jan 2021 13:52:08 +0000 (14:52 +0100)]
Reduce use of Optional in ContextChainHolderImpl

Optional.ofNullable().ifPresent() can easily be replaced with
a null check, making code clearer. We also end up rewrapping
ownership state -- just drop to using nullable, as that makes
the corresponding check easier.

Change-Id: I74efb538cdf3cf66350a8bcb23d0207070864dc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup MultipartReplyTranslatorUtil 61/94361/3
Robert Varga [Sun, 3 Jan 2021 13:39:57 +0000 (14:39 +0100)]
Cleanup MultipartReplyTranslatorUtil

Rather than using Optional.flatMap(), which seems to be an all-time
favorite switch to using null checks and explicit returns. While we
are here, also make sure we use Builders' fluent capacity.

Change-Id: Ib27cbc4e290620ddb53139349079f0349f84e0ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup MatchUtil 58/94358/7
Robert Varga [Sun, 3 Jan 2021 10:41:41 +0000 (11:41 +0100)]
Cleanup MatchUtil

Switch MatchUtil.resolveExtensions() to return a map, removing
a source of needless copying.

Change-Id: I3343be5cb848774d7047ad27c2ec96a24e343aa8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup AbstractActionInstructionSerializer 55/94355/6
Robert Varga [Sun, 3 Jan 2021 10:16:44 +0000 (11:16 +0100)]
Cleanup AbstractActionInstructionSerializer

Do not use Optional.ofNullable() for null checks, leading to cleaner
and meaner code.

Change-Id: I302bccbadbaeb6633c8f12afdea6ffe3a751826c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup ConfigurationServiceFactoryOsgiImpl 57/94357/6
Robert Varga [Sun, 3 Jan 2021 10:36:26 +0000 (11:36 +0100)]
Cleanup ConfigurationServiceFactoryOsgiImpl

Do not use Optional.ofNullable() for null checks and also properly
unget service after use.

Change-Id: I0360904dcec7ee25d6702a943f2d6782540a79c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup TableFeaturesMatchFieldDeserializer 56/94356/6
Robert Varga [Sun, 3 Jan 2021 10:25:06 +0000 (11:25 +0100)]
Cleanup TableFeaturesMatchFieldDeserializer

Remove overzealous use of optionals to make the logic cleaner
and more performant.

Change-Id: I8305b49877e309971222954f8a0a5e8cce9b8f59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup MatchSerializer 54/94354/4
Robert Varga [Sun, 3 Jan 2021 09:53:58 +0000 (10:53 +0100)]
Cleanup MatchSerializer

Remove use of Optional.ofNullable() as a null guard, improving
overall performance and readability.

Change-Id: I028537276720697b7109c92096719a55df53e6a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup ExtensionSessionManagerImpl 53/94353/4
Robert Varga [Sun, 3 Jan 2021 09:58:19 +0000 (10:58 +0100)]
Cleanup ExtensionSessionManagerImpl

Use a properly-constant singleton and remove unused logger.

Change-Id: I0ed7bc521aaa121a13f07ad8f72b37e00d2b522a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup MultipartRequestExperimenterSerializer 52/94352/5
Robert Varga [Sun, 3 Jan 2021 09:49:05 +0000 (10:49 +0100)]
Cleanup MultipartRequestExperimenterSerializer

Split fallback serialization into its own method and remove use
of Optional.ofNullable().ifPresent() in favor of null checks.

Change-Id: Ic4581efbc383de4b2c6028c6be654280fae0605d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge changes Ia53720b0,I9f54d265
Robert Varga [Sun, 3 Jan 2021 09:51:01 +0000 (09:51 +0000)]
Merge changes Ia53720b0,I9f54d265

* changes:
  Cleanup GroupMessageSerializer
  Cleanup MultipartRequestTableFeaturesSerializer

3 years agoCleanup GroupMessageSerializer 51/94351/1
Robert Varga [Sun, 3 Jan 2021 08:30:46 +0000 (09:30 +0100)]
Cleanup GroupMessageSerializer

Do not use Optional for logic decisions, making translation clearer
and more performant.

Change-Id: Ia53720b0b18753e77de5f74614bb5a7ea775fd42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup MultipartRequestTableFeaturesSerializer 50/94350/1
Robert Varga [Sun, 3 Jan 2021 08:19:27 +0000 (09:19 +0100)]
Cleanup MultipartRequestTableFeaturesSerializer

Remove use of Optional for logic decisions. Also do not convert
string to bytes twice.

Change-Id: I9f54d2653fbbb86525c6dfd1cbbaf76d187d573e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoClean up ListeningExecutorService usage 20/67420/10
Robert Varga [Fri, 19 Jan 2018 18:28:30 +0000 (19:28 +0100)]
Clean up ListeningExecutorService usage

It turns out we do not really need ListeningExecutorService at all,
but can live with a normal ExecutorService. Furthermore most contexts
where we used ExecutorService can completely get by through a simple
Executor, which makes lifecycle more predictable.

Change-Id: Ic1b2a3d49433557d0c5934445a79e06391d24fe8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup FlowMessageSerializer 34/94334/14
Robert Varga [Sat, 2 Jan 2021 10:49:07 +0000 (11:49 +0100)]
Cleanup FlowMessageSerializer

Further reduce use of Optional.ofNullable().map() crud and also
reduce Guava use as per modernizer warnings.

Change-Id: Ic060c95941b9ac0f1b40b1350dce50c004e0fd0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize SetAsyncInputMessageFactory 48/94348/2
Robert Varga [Sun, 3 Jan 2021 00:11:40 +0000 (01:11 +0100)]
Optimize SetAsyncInputMessageFactory

This class is very similar to GetAsyncReplyMessageFactory, apply
same optimizations.

Change-Id: Iaeacd426fb99aaf1ce527d53bcb935aaf0551fcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize AsyncConfigMessageSerializer 47/94347/2
Robert Varga [Sat, 2 Jan 2021 23:45:05 +0000 (00:45 +0100)]
Optimize AsyncConfigMessageSerializer

Do not use optionals to dispatch on nullable properties. Also do not
create a Map for bitmap conversion.

Change-Id: I4205d127c2e78e67671d8a599b065f9afe7c6f2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate a few convertors 44/94344/6
Robert Varga [Sat, 2 Jan 2021 16:49:14 +0000 (17:49 +0100)]
Migrate a few convertors

Be a bit smarter about dealing with units, fixing related warnings.

JIRA: OPNFLWPLUG-1099
Change-Id: I9ab33dc6634f37bb38735d948741424c9c2fa07f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize GetAsyncReplyMessageFactory bitmasks 46/94346/3
Robert Varga [Sat, 2 Jan 2021 20:04:25 +0000 (21:04 +0100)]
Optimize GetAsyncReplyMessageFactory bitmasks

Do not instantiate a HashMap just to store offsets we have readily
available. Use direct bitmask construction instead, speedings things
up quite a bit.

Since we are doing the same thing for three difference enumerations,
introduce a common methods to do the heavy lifting.

Change-Id: I2999b00df64f596f3d025d9e83c5e3dcca376d90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove a reference to org.mockito.Matchers 36/94336/7
Robert Varga [Sat, 2 Jan 2021 12:12:17 +0000 (13:12 +0100)]
Remove a reference to org.mockito.Matchers

These methods are deprecated, migrate to ArgumentMatchers. Also
remove a few unused constants.

Change-Id: Ida46bc436184374a851a5a4eee7ad034e80b02bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate .setXid() callers 39/94339/8
Robert Varga [Sat, 2 Jan 2021 12:29:44 +0000 (13:29 +0100)]
Migrate .setXid() callers

Use ByteBufUtils to readUint32() instead. While we are at it, apply
the same pattern to other methods as well.

JIRA: OPNFLWPLG-1099
Change-Id: Ifcd4beab39ed00e93db3b4b062a56a0d8bad6b35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate EncodeConstants.OF13_VERSION_ID users 38/94338/5
Robert Varga [Sat, 2 Jan 2021 12:21:54 +0000 (13:21 +0100)]
Migrate EncodeConstants.OF13_VERSION_ID users

This is a search-and-replace for the correct constant.

JIRA: OPNFLWPLUG-1099
Change-Id: Ia912773d9fb299922fd1a68158e4f275b16682be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix ServiceException 37/94337/3
Robert Varga [Sat, 2 Jan 2021 12:19:33 +0000 (13:19 +0100)]
Fix ServiceException

We do not have an UUID here, fix that. Since this has been out there
for some time, start with a generated UUID.

Change-Id: I9322717e5cd1f845275aa56cb756139a7304d3fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup FlowMessageSerializer.isSetVlanIdActionCasePresent() 33/94333/2
Robert Varga [Sat, 2 Jan 2021 10:25:13 +0000 (11:25 +0100)]
Cleanup FlowMessageSerializer.isSetVlanIdActionCasePresent()

Rather than bouncing through Optional.ofNullable(), use an explicit
null check to significantly simplify this method.

Change-Id: I59237a4ccef3c407c033d3e1588b7958840d9c06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoCleanup FlowMessageSerializer.isVlanMatchPresent() 32/94332/2
Robert Varga [Sat, 2 Jan 2021 10:18:00 +0000 (11:18 +0100)]
Cleanup FlowMessageSerializer.isVlanMatchPresent()

Rather than doing silly ofNullable()/flatMap() things, just perform
two non-null checks -- making things much simpler to see.

Change-Id: I7be0f55e58427e29b9310c55989faf126b3bb7cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate OpenflowPluginBulkTransactionProvider 31/94331/3
Robert Varga [Sat, 2 Jan 2021 10:07:59 +0000 (11:07 +0100)]
Migrate OpenflowPluginBulkTransactionProvider

Use BindingMap to eliminate deprecation warnings and also clean up
builder use.

Change-Id: I3dc94c38c48eaeff9727da5048fe907acf522846
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFinal round of isFoo() migration 29/94329/7
Robert Varga [Fri, 1 Jan 2021 21:51:20 +0000 (22:51 +0100)]
Final round of isFoo() migration

Finish up remaining components, so that we do not use isFoo()
anywhere.

Change-Id: I4da07dd94b689176ecc07ffb64ecfc36890e73b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoOptimize LLDPUtil.colonize() 30/94330/3
Robert Varga [Fri, 1 Jan 2021 21:58:00 +0000 (22:58 +0100)]
Optimize LLDPUtil.colonize()

We are performing a regex-based replacement here, pre-compile the
Pattern so we get faster replacements.

Change-Id: Ib1b09e3fbb5975ad18dd6f41e45022661bb1e220
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFurther warning removal 24/94324/6
Robert Varga [Fri, 1 Jan 2021 13:29:20 +0000 (14:29 +0100)]
Further warning removal

Migrate further call sites of isFoo(), as well as various other
deprecated constructs.

Change-Id: If840e14f523eaafc596ef1a6ccd5354e19cb826f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUn-deprecate OpenflowVersion 25/94325/1
Robert Varga [Fri, 1 Jan 2021 14:53:45 +0000 (15:53 +0100)]
Un-deprecate OpenflowVersion

Our API vs. annotations do not agree on deprecation here. Let's
drop the JavaDoc and replace it with a FIXME.

A follow-up patch will address the enum's future and introduce
a proper @Deprecated once we have reigned-in our current warnings.

Change-Id: Iae325d1cf167890f299e0b31faef235b8ee4a3d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate openflow-protocol-impl isFoo() users 15/94315/1
Robert Varga [Wed, 30 Dec 2020 20:11:05 +0000 (21:11 +0100)]
Migrate openflow-protocol-impl isFoo() users

Mass-migrate boolean getter users, which have changed from isFoo()
to getFoo().

Change-Id: I931fb7542a88870d017bb8ad8bc23568e73a9df0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump MRI upstreams 49/94149/3
Robert Varga [Thu, 10 Dec 2020 12:43:03 +0000 (13:43 +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: I5731acb571b168f984e740441914c7867bd9b4ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUpdate active committers info 12/93412/1
Gobinath [Tue, 27 Oct 2020 10:25:54 +0000 (15:55 +0530)]
Update active committers info

Change-Id: I5e85ffdf12e629000901fca57eb4a38ca4582f76
Signed-off-by: Gobinath <gobinath@ericsson.com>
3 years agoBump infrautils to 1.9.1 06/93206/1
Robert Varga [Mon, 19 Oct 2020 23:32:43 +0000 (01:32 +0200)]
Bump infrautils to 1.9.1

Pick up mbean fixes from upstream.

Change-Id: I77f72e799f91e8214506d27ea4e02eb11986fb27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to mdsal-7.0.1/controller-3.0.1 95/93195/1
Robert Varga [Mon, 19 Oct 2020 19:32:35 +0000 (21:32 +0200)]
Bump to mdsal-7.0.1/controller-3.0.1

Pick up mdsal fixes and improvements.

Change-Id: I6a4797e108a63abf08a20cd63a0e56dfdc80380c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump upstreams for Silicon 44/92944/15
Robert Varga [Wed, 7 Oct 2020 15:39:58 +0000 (17:39 +0200)]
Bump upstreams for Silicon

Adopt the following upstream versions:
- odlparent-8.0.0
- yangtools-6.0.0
- mdsal-7.0.0
- controller-3.0.0
- infrautils-1.9.0

Since we are forced to migrate some of the code, perform related
migrations if they are trivial to do.

Quite a few tests are missing proper keys and properties, hence
these are added in the most obvious manner possible. If there is
a list/map warning in that vicinity, also use BindingMap.of() to get
rid of the warning.

Also a few obvious modernizer warnings are fixed, as it's easier
than add suppressions.

Change-Id: Ic4302fba6916dca8385633f1889e8e619fc281e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ByteBufUtils.readIpv4Address() 14/92714/5
Robert Varga [Fri, 25 Sep 2020 10:27:25 +0000 (12:27 +0200)]
Remove ByteBufUtils.readIpv4Address()

This method is not used anywhere and has a replacement in
readIetfIpv4Address(). Remove it.

Change-Id: Ia18f54b36e4974108cc65bf61207d320b4e7a134
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ByteBufUtils.readIpv6Address() 13/92713/5
Robert Varga [Fri, 25 Sep 2020 10:22:33 +0000 (12:22 +0200)]
Remove ByteBufUtils.readIpv6Address()

This method is not used anywhere, with readIetfIpv6Address() being
its replacement. Remove it along with
EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES.

Change-Id: Icc33beb47c4212f3fc187a39fc84cea74931c2dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ByteBufUtil.macAddressToString() 12/92712/5
Robert Varga [Fri, 25 Sep 2020 10:19:00 +0000 (12:19 +0200)]
Remove ByteBufUtil.macAddressToString()

All users have been migrated, remove this method along with its
test.

Change-Id: Ic8f213320a3df34f2a28c456ac686a4b47e61901
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate ByteBufUtil.macAddressToString() users 11/92711/5
Robert Varga [Fri, 25 Sep 2020 10:15:59 +0000 (12:15 +0200)]
Migrate ByteBufUtil.macAddressToString() users

We have users only in tests, perform the straightforward migration.

While we are at it, we also fix expected/actual order in tests, as
well as eliminate call sites which are better served by
Assert.assertArrayEquals().

A few places are asserting the use of upper-case letters, which runs
contrary to what the canonical format is. These are adjusted to use
canonical lower-case.

Change-Id: I4dfc342b005d1cbdec2537eb4cfdac20d6521da2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate ByteBufUtil.macAddressToString() 10/92710/3
Robert Varga [Fri, 25 Sep 2020 08:56:44 +0000 (10:56 +0200)]
Deprecate ByteBufUtil.macAddressToString()

All callers of this method are actually interfacing with
ietf-yang-types' MacAddress. IetfYangUtil provides a better alternative,
as it foregoes String checking performed by MacAddress(String).

Change-Id: Ib54218eb74936bd7c5550322829f5fa809cd3c33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ByteBufUtils.macAddressToBytes() 09/92709/3
Robert Varga [Fri, 25 Sep 2020 08:49:49 +0000 (10:49 +0200)]
Remove ByteBufUtils.macAddressToBytes()

With all callers migrated, remove the now-unused method.

Change-Id: I65412717a28c393d3e31d2cda19d8becb3278dd7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDeprecate ByteBufUtils.macAddressToBytes() 08/92708/3
Robert Varga [Fri, 25 Sep 2020 08:46:24 +0000 (10:46 +0200)]
Deprecate ByteBufUtils.macAddressToBytes()

This method operates on any string, whereas all its users are faced
with an ietf-yang-types' MacAddress. IetfYangUtil.macAddressBytes()
provides a superior alternative to this open-coded utility.

Change-Id: Id4f7448a0894a4cec5e76ec801cfde47b03e3be7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse Short.BYTES 15/92715/3
Robert Varga [Fri, 25 Sep 2020 10:30:58 +0000 (12:30 +0200)]
Use Short.BYTES

We have a few places where we a using Short.SIZE / Byte.SIZE. This
is already a constant known as Short.BYTES.

Change-Id: I51bbc7028131948d615ef2f21e9301ba1cff0fc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix switch serial number type 06/92706/2
Robert Varga [Fri, 25 Sep 2020 08:35:59 +0000 (10:35 +0200)]
Fix switch serial number type

This is a day-0 bug in the definition: X509Certificate's serial
number can be any unbounded number, not just uint64.

Change the definition to be string-based so we do not get errors
if the serial number is negative or quite large.

Change-Id: I41292cc329c4eac81a7c671821e29b6851030056
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix openflow-protocol-impl deprecation warnings 05/92705/2
Robert Varga [Fri, 25 Sep 2020 08:23:34 +0000 (10:23 +0200)]
Fix openflow-protocol-impl deprecation warnings

Convert all use of widened types to proper uint types.

JIRA: OPNFLWPLUG-1099
Change-Id: Iabdcf752965851b29be0162c70f463206d07abaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo no subclass HashMap 84/92684/1
Robert Varga [Fri, 25 Sep 2020 07:33:43 +0000 (09:33 +0200)]
Do no subclass HashMap

Eclipse is correctly pointing out we are creating a serializable
subclass without assigning a version to it. Rather than doing that,
use a simple initializer through an intermediate map.

Change-Id: I83d5a05c138bf7ee664612daf81f721fe30435f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate test-extension to use uint types 82/92682/1
Robert Varga [Thu, 24 Sep 2020 22:50:37 +0000 (00:50 +0200)]
Migrate test-extension to use uint types

This is a straightforward replacement with Uint64.

JIRA: OPNFLWPLUG-1099
Change-Id: I2cc7607ec96c31566d2fbadb4bbab7cb54ed32e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate frm-sync to use uint types 81/92681/1
Robert Varga [Thu, 24 Sep 2020 22:48:18 +0000 (00:48 +0200)]
Migrate frm-sync to use uint types

This is a simple matter of encapsulating values, make sure we do
that.

JIRA: OPNFLWPLUG-1099
Change-Id: I12f5c63b9a9935a993b52a7ce90f5ae91a55edc4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMake methods static 80/92680/1
Robert Varga [Thu, 24 Sep 2020 22:43:15 +0000 (00:43 +0200)]
Make methods static

Eclipse is pointing out a number of methods which can be made static,
fix those warnings.

Change-Id: I4691094f1e5ee098cca5d377a92a3417d667de7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate southbound-cli to use uint types 79/92679/1
Robert Varga [Thu, 24 Sep 2020 22:40:03 +0000 (00:40 +0200)]
Migrate southbound-cli to use uint types

We have some technical debt here, fix it up.

JIRA: OPNFLWPLUG-1099
Change-Id: I7c777dec680234b9c3a9978175e007b2d39c6d59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not use deprecated Mockito constructs 78/92678/1
Robert Varga [Thu, 24 Sep 2020 22:33:39 +0000 (00:33 +0200)]
Do not use deprecated Mockito constructs

Mockito has moved some functionality around, adjust to that.

Change-Id: I965d6ba5fd29e95060e9bfd6286fdad40d3a99df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFinish test code migration to uint 77/92677/1
Robert Varga [Thu, 24 Sep 2020 22:26:38 +0000 (00:26 +0200)]
Finish test code migration to uint

Fix up the few remaining users of widened types, preparing the floor
for migration of production code.

JIRA: OPNFLWPLUG-1099
Change-Id: I6a2ed96d2859244debd63aa41a16db5c8dc7f7f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate openflowplugim-impl tests to uint types 73/92673/5
Robert Varga [Thu, 24 Sep 2020 17:21:32 +0000 (19:21 +0200)]
Migrate openflowplugim-impl tests to uint types

This migrates the entire openflowplugin-impl test suite to use
Uint types.

We borrow EncodeConstants to get at Uint8-specified
protocol numbers, which is probably not what we want, but then
there seems to be variance of opinion whether to use that or
OFConstants. This is fine for this migration, we will address
the OFConstants/EncodeConstants duplicity when we migrate
production code.

JIRA: OPNFLWPLUG-1099
Change-Id: I088597573037b8a662840aff62b0593a058a10b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMigrate openflow-protocol-impl tests to Uint types 71/92671/5
Robert Varga [Thu, 24 Sep 2020 11:40:19 +0000 (13:40 +0200)]
Migrate openflow-protocol-impl tests to Uint types

There are plenty of warnings in the test suite, address all of them
without touching production code.

JIRA: OPNFLWPLUG-1099
Change-Id: I8ec19c008ef51dfdabeded610bef4bda4e11d8f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove ByteBufUtils.padBuffer() 69/92669/4
Robert Varga [Thu, 24 Sep 2020 11:22:55 +0000 (13:22 +0200)]
Remove ByteBufUtils.padBuffer()

This method has been deprecated for at least three years and is not
used anywhere, remove it.

Change-Id: Ied94f803d3a2025542a07ef1e6e9320fd9a7af4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix migration warnings in openflowjava-util 68/92668/4
Robert Varga [Thu, 24 Sep 2020 11:21:30 +0000 (13:21 +0200)]
Fix migration warnings in openflowjava-util

We have some use of legacy widened types, fix them up.

JIRA: OPNFLWPLUG-1099
Change-Id: I1266a79d5957f4ae1009258593447f0cadfff40c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove deprecated ActionSerializerKey constructor 67/92667/3
Robert Varga [Thu, 24 Sep 2020 11:18:34 +0000 (13:18 +0200)]
Remove deprecated ActionSerializerKey constructor

Legacy widened-type constructor is not used anywhere, remove it.

Change-Id: Ib1b4225657c5bba3455e2b7edbf53a659b02ce40
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove deprecated ExperimenterActionSerializerKey constructor 66/92666/2
Robert Varga [Thu, 24 Sep 2020 11:15:02 +0000 (13:15 +0200)]
Remove deprecated ExperimenterActionSerializerKey constructor

This constructor is using widened Long argument and is not used
anywhere, remove it.

Change-Id: I41ef92b1957657c50d1bb5be7a0ca985851b5bf0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge "Refactor AbstractOxmMatchEntryDeserializer"
Arunprakash D [Thu, 24 Sep 2020 06:42:05 +0000 (06:42 +0000)]
Merge "Refactor AbstractOxmMatchEntryDeserializer"

3 years agoMerge "AbstractOxmMatchEntryDeserializer should be an OFDeserializer"
Arunprakash D [Thu, 24 Sep 2020 06:41:03 +0000 (06:41 +0000)]
Merge "AbstractOxmMatchEntryDeserializer should be an OFDeserializer"

3 years agoBump MRI projects 99/92599/1
Robert Varga [Tue, 22 Sep 2020 15:46:58 +0000 (17:46 +0200)]
Bump MRI projects

This patch adopts:
- odlparent-7.0.6
- infrautils-1.8.1
- yangtools-5.0.6
- mdsal-6.0.5
- controller-2.0.4

Change-Id: I56ec950e030e1cb67bb697df85703c8d76dfa95a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor AbstractOxmMatchEntryDeserializer 94/92394/14
Robert Varga [Wed, 2 Sep 2020 20:02:28 +0000 (22:02 +0200)]
Refactor AbstractOxmMatchEntryDeserializer

All subclassses of AbstractOxmMatchEntryDeserializer follow the same
deserializer pattern. Make sure we eliminate useless getters and
streamline the implementation accordingly.

JIRA: OPNFLWPLUG-1102
Change-Id: I2417ce9f58f7f97acfab91a93d4c346ece3b1208
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAbstractOxmMatchEntryDeserializer should be an OFDeserializer 93/92393/12
Robert Varga [Wed, 2 Sep 2020 17:55:07 +0000 (19:55 +0200)]
AbstractOxmMatchEntryDeserializer should be an OFDeserializer

All subclasses already also implement OFDeserializer, centralize
that connection.

JIRA: OPNFLWPLUG-1102
Change-Id: I4105e6b71937f43bd649c26aaf4d2cb7f476590e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMake VersionAssignableFactory implement OFDeserializer 91/92391/12
Robert Varga [Wed, 2 Sep 2020 17:40:10 +0000 (19:40 +0200)]
Make VersionAssignableFactory implement OFDeserializer

All subclasses are implementing OFSerializer, hence it makes sense
to encode this in the base class. This ends up sharing the offset
of the implementation.

JIRA: OPNFLWPLUG-1102
Change-Id: I53342f0f0ec5ffe37440ee29f6e06c20be5add5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix warnings around SimpleRpcListener 90/92390/12
Robert Varga [Wed, 2 Sep 2020 17:08:44 +0000 (19:08 +0200)]
Fix warnings around SimpleRpcListener

SimpleRpcListener has generic arguments, fix warnings pointing out
unparameterized use.

Change-Id: Ia0a4bd398eddb81bfac1e6459249be685e95d931
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove an unneeded cast 89/92389/12
Robert Varga [Wed, 2 Sep 2020 17:06:27 +0000 (19:06 +0200)]
Remove an unneeded cast

We have a superfluous cast, remove it.

Change-Id: Id325d5b4c1593241a156e6f4560c10ae0bfc6501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEliminate AbstractEmptyActionDeserializer subclasses 88/92388/13
Robert Varga [Wed, 2 Sep 2020 16:57:27 +0000 (18:57 +0200)]
Eliminate AbstractEmptyActionDeserializer subclasses

Method dispatch works on particular class implementation and
individual per-type subclasses are not bringing anything to the
table.

Change AbstractEmptyActionDeserializer to a final
EmptyActionDeserializer and use its instances to perform duties
previously held by its subclasses.

JIRA: OPNFLWPLUG-1102
Change-Id: I3e1e03a498a15808cf2538fcca651c6c258e07f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse ActionContstants in ActionDeserializerInitializer 87/92387/13
Robert Varga [Wed, 2 Sep 2020 16:50:46 +0000 (18:50 +0200)]
Use ActionContstants in ActionDeserializerInitializer

Rather than using a plain constants, use symbolic names so that we
can neatly cross-reference users.

JIRA: OPNFLWPLUG-1102
Change-Id: I106798adbf77f7e9a9e917b72707ae76b49bae94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge "Eliminate AbstractEmptyActionSerializer subclasses"
Arunprakash D [Fri, 18 Sep 2020 05:52:50 +0000 (05:52 +0000)]
Merge "Eliminate AbstractEmptyActionSerializer subclasses"

3 years agoMerge "Add AbstractEmptyActionSerializer"
Arunprakash D [Fri, 18 Sep 2020 05:47:54 +0000 (05:47 +0000)]
Merge "Add AbstractEmptyActionSerializer"

3 years agoMerge "Make AbstractActionSerializer.serialize() final"
Arunprakash D [Fri, 18 Sep 2020 05:39:07 +0000 (05:39 +0000)]
Merge "Make AbstractActionSerializer.serialize() final"

3 years agoMerge "Refactor AbstractActionSerializer"
Arunprakash D [Fri, 18 Sep 2020 05:35:56 +0000 (05:35 +0000)]
Merge "Refactor AbstractActionSerializer"

3 years agoMerge "Refactor AbstractInstructionSerializer"
Arunprakash D [Thu, 17 Sep 2020 04:30:36 +0000 (04:30 +0000)]
Merge "Refactor AbstractInstructionSerializer"

3 years agoEliminate AbstractEmptyActionSerializer subclasses 86/92386/13
Robert Varga [Wed, 2 Sep 2020 16:32:26 +0000 (18:32 +0200)]
Eliminate AbstractEmptyActionSerializer subclasses

Method dispatch works on particular class implementation and
individual per-type subclasses are not bringing anything to the
table.

Change AbstractEmptyActionSerializer to a final
EmptyActionSerializer and use its instances to perform duties
previously held by its subclasses.

In order to aid debugging, we customize its toString() to list
the code being handled.

JIRA: OPNFLWPLUG-1102
Change-Id: Icf7176a62bde41d036c9251ed6e347a85aaa35ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd AbstractEmptyActionSerializer 85/92385/12
Robert Varga [Wed, 2 Sep 2020 16:18:10 +0000 (18:18 +0200)]
Add AbstractEmptyActionSerializer

Similar to AbstractEmptyActionDeserializer, we can centralize
common body reads in a single class, eliminating duplicate code.

JIRA: OPNFLWPLUG-1102
Change-Id: I91e02ac81d7f631bc7237e4ea770fad40ca5eb0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMake AbstractActionSerializer.serialize() final 84/92384/12
Robert Varga [Wed, 2 Sep 2020 16:09:10 +0000 (18:09 +0200)]
Make AbstractActionSerializer.serialize() final

We want to reduce the number of megamorphic calls in the serialization
path. Rather than overriding the serialize() method in abstract base
class and call into it, make sure the base class calls out to subclasses
to serialize the body.

This reduces the number of serialize() implementations, peeling common
code into the caller. It also makes it clear there are opportunities
to further reduction.

JIRA: OPNFLWPLUG-1102
Change-Id: I0cb421be9f84fd278039a07107254bfac9ddd9a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor AbstractActionSerializer 83/92383/12
Robert Varga [Wed, 2 Sep 2020 15:48:58 +0000 (17:48 +0200)]
Refactor AbstractActionSerializer

Current structure is causing multiple megamorphic invocations in
the serialization paths. This first step eliminates
getType()/getLength() methods, storing their values in the object
instead.

JIRA: OPNFLWPLUG-1102
Change-Id: Ie806a6a4a011b9235c9b47005927cfc5704f018b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor AbstractInstructionSerializer 82/92382/12
Robert Varga [Wed, 2 Sep 2020 15:20:35 +0000 (17:20 +0200)]
Refactor AbstractInstructionSerializer

AbstractInstructionSerializer can be made more efficient with
inlining types -- which means we will issue a simple read/load
instead of having to go through virtual dispatch.

JIRA: OPNFLWPLUG-1102
Change-Id: I8c325718715a928a1b24fc75a6de11a6b80eada1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump conf.yaml versions to Silicon 65/92065/2
Thanh Ha [Tue, 11 Aug 2020 19:28:57 +0000 (15:28 -0400)]
Bump conf.yaml versions to Silicon

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Ic81fabcf98bf798b92dc08f5d77dc72486f2c549

3 years agoOPNFLWPLUG-1105 : Fix for get-active bundle DOMRpcImplementationNotAvailableException 28/92128/4
Dheenadayalan.b [Thu, 13 Aug 2020 08:08:50 +0000 (13:38 +0530)]
OPNFLWPLUG-1105 : Fix for get-active bundle DOMRpcImplementationNotAvailableException

description: GetActive Bundles failed  with "No implementation of RPC AbsoluteSchemaPath" exception even after the path registered successfully.
              Issue Observered when multiple Switches connected to controller, and some of them were restarted.
  During restart previous bundle rpc registrations are overwritten.
  Fix done as registrations are stored and retrieved using map.

Signed-off-by: Dheenadayalan.b <dhinua@gmail.com>
Change-Id: I4de90445db2f5b29e4fefb2d5bd296cdcd73af8a
Signed-off-by: Dheenadayalan.b <dhinua@gmail.com>
3 years agoMerge "Refactor AbstractActionDeserializer"
Arunprakash D [Tue, 15 Sep 2020 10:24:41 +0000 (10:24 +0000)]
Merge "Refactor AbstractActionDeserializer"

3 years agoOPNFLWPLUG-1089 : Enable matching of a range of tcp/udp-source/destination-ports... 81/89181/10
Somashekhar Javalagi [Tue, 21 Apr 2020 05:06:04 +0000 (10:36 +0530)]
OPNFLWPLUG-1089 : Enable matching of a range of tcp/udp-source/destination-ports per flow

Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
Change-Id: I047fd49aa60f0a9e951eef9f55b0104931a15679
Signed-off-by: Dheenadayalan.b <dhinua@gmail.com>
3 years agoRefactor AbstractActionDeserializer 81/92381/12
Robert Varga [Wed, 2 Sep 2020 14:34:31 +0000 (16:34 +0200)]
Refactor AbstractActionDeserializer

Looking at AbstractActionDeserializer, we can increase performance
of parseHeader() by eagerly instantiating choice/header objects.

JIRA: OPNFLWPLUG-1102
Change-Id: Ia71bb2d865eaf83627945b1a7039a0978b76be80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRemove EncodeConstants.SIZE_OF_{BYTE,SHORT,INT,LONG}_IN_BYTES 80/92380/14
Robert Varga [Wed, 2 Sep 2020 13:03:11 +0000 (15:03 +0200)]
Remove EncodeConstants.SIZE_OF_{BYTE,SHORT,INT,LONG}_IN_BYTES

These constants are exposed since Java 8 as
{Byte,Short,Integer,Long}.BYTES use them from there instead of
brewing our own.

Change-Id: I3a47659f136165d54f3f97315b0911cc7feaec6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoMerge "Remove OFConstants.SIZE_OF_LONG_IN_BYTES"
Arunprakash D [Thu, 10 Sep 2020 08:26:55 +0000 (08:26 +0000)]
Merge "Remove OFConstants.SIZE_OF_LONG_IN_BYTES"

3 years agoMerge "Change OFConstants.OFPCML_NO_BUFFER to Uint16"
Arunprakash D [Thu, 10 Sep 2020 07:16:07 +0000 (07:16 +0000)]
Merge "Change OFConstants.OFPCML_NO_BUFFER to Uint16"

3 years agoMerge "Fix a modernizer warning"
Arunprakash D [Thu, 10 Sep 2020 06:25:24 +0000 (06:25 +0000)]
Merge "Fix a modernizer warning"

3 years agoMerge "Migrate most of openflowplugin to use Uint types"
Arunprakash D [Thu, 10 Sep 2020 06:19:56 +0000 (06:19 +0000)]
Merge "Migrate most of openflowplugin to use Uint types"

3 years agoMerge "Migrate openflowplugin tests to use Uint types"
Arunprakash D [Thu, 10 Sep 2020 06:16:15 +0000 (06:16 +0000)]
Merge "Migrate openflowplugin tests to use Uint types"

3 years agoMerge "Fix a raw type warning"
Arunprakash D [Thu, 10 Sep 2020 05:11:59 +0000 (05:11 +0000)]
Merge "Fix a raw type warning"

3 years agoMerge "Fix javadoc reference"
Arunprakash D [Thu, 10 Sep 2020 05:11:23 +0000 (05:11 +0000)]
Merge "Fix javadoc reference"

3 years agoMerge "openflow devices are getting disconnected from Controller, sending OFPBFC_BAD_...
Arunprakash D [Thu, 10 Sep 2020 05:07:25 +0000 (05:07 +0000)]
Merge "openflow devices are getting disconnected from Controller, sending OFPBFC_BAD_ID error reply"

3 years agoMerge "Fix uint warnings in sample-bundles"
Arunprakash D [Thu, 10 Sep 2020 04:09:42 +0000 (04:09 +0000)]
Merge "Fix uint warnings in sample-bundles"

3 years agoMerge "Fix for openflow devices not connecting to controller"
Arunprakash D [Thu, 10 Sep 2020 04:08:15 +0000 (04:08 +0000)]
Merge "Fix for openflow devices not connecting to controller"

3 years agoMerge "Fix deprecation warnings in learning-switch"
Arunprakash D [Wed, 9 Sep 2020 15:55:03 +0000 (15:55 +0000)]
Merge "Fix deprecation warnings in learning-switch"

3 years agoMerge "Do not parse string multiple times"
Arunprakash D [Wed, 9 Sep 2020 15:53:33 +0000 (15:53 +0000)]
Merge "Do not parse string multiple times"

3 years agoMerge "Remove unneeded boxing"
Arunprakash D [Wed, 9 Sep 2020 15:51:45 +0000 (15:51 +0000)]
Merge "Remove unneeded boxing"

3 years agoMerge "Mark static methods"
Arunprakash D [Wed, 9 Sep 2020 15:50:59 +0000 (15:50 +0000)]
Merge "Mark static methods"

3 years agoFix for openflow devices not connecting to controller 07/87907/16
dheenadayalan b [Wed, 19 Feb 2020 12:12:05 +0000 (17:42 +0530)]
Fix for openflow devices not connecting to controller

Signed-off-by: dheenadayalan b <dhinua@gmail.com>
Change-Id: I641997a74f5b5081366fcaa1fe9a56b6d1c67f5d
Signed-off-by: Dheenadayalan.b <dhinua@gmail.com>