openflowplugin.git
4 years agoMerge "Cleanup JobEntry"
Anil Vishnoi [Mon, 8 Jul 2019 22:17:56 +0000 (22:17 +0000)]
Merge "Cleanup JobEntry"

4 years agoMerge "Simplify job NodeConfiguratorImpl dispatch"
Anil Vishnoi [Mon, 8 Jul 2019 20:27:21 +0000 (20:27 +0000)]
Merge "Simplify job NodeConfiguratorImpl dispatch"

4 years agoMerge "Add task termination traces"
Anil Vishnoi [Mon, 8 Jul 2019 19:16:50 +0000 (19:16 +0000)]
Merge "Add task termination traces"

4 years agoOPNFLWPLUG-644 : Documentation for openflowplugin event logging using 05/82205/6
Somashekhar Javalagi [Wed, 22 May 2019 04:42:32 +0000 (10:12 +0530)]
OPNFLWPLUG-644 : Documentation for openflowplugin event logging using
log4j

Change-Id: Ic85a0a2f212437af223a854ab6e7e162d9f46cd8
Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
4 years agoCleanup JobEntry 68/82568/4
Robert Varga [Wed, 19 Jun 2019 11:26:40 +0000 (13:26 +0200)]
Cleanup JobEntry

This is an implementation-private class, which is just a holder
DTO. The fields are not really mutable, hence make them final
and make sure we can communicate failures through it.

Change-Id: I5106329af0e193fb420ac0603033972bb56dea62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSimplify job NodeConfiguratorImpl dispatch 67/82567/4
Robert Varga [Wed, 19 Jun 2019 11:21:04 +0000 (13:21 +0200)]
Simplify job NodeConfiguratorImpl dispatch

This simplifies the logic by eliminating an unneeded indirection.

Change-Id: Ia254d64d783ed4d465d70d2df4b9aa03bef27be4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd task termination traces 66/82566/3
Robert Varga [Wed, 19 Jun 2019 10:57:35 +0000 (12:57 +0200)]
Add task termination traces

This adds trace messages to discern when execution of callbacks
is completed.

Change-Id: I61cee9098c9ef29e1e02b6e87edd06ade9178370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMerge "Migrate to LoggingFutures"
Anil Vishnoi [Fri, 28 Jun 2019 19:01:56 +0000 (19:01 +0000)]
Merge "Migrate to LoggingFutures"

4 years agoMerge "Simplify DeviceContextImpl flow counting"
Anil Vishnoi [Fri, 28 Jun 2019 18:47:10 +0000 (18:47 +0000)]
Merge "Simplify DeviceContextImpl flow counting"

4 years agoMerge "Simplify DeviceFlowRegistryImpl streaming"
Anil Vishnoi [Fri, 28 Jun 2019 18:46:59 +0000 (18:46 +0000)]
Merge "Simplify DeviceFlowRegistryImpl streaming"

4 years agoMerge "Remove dead code from DeviceFlowRegistryImpl"
Anil Vishnoi [Fri, 28 Jun 2019 18:46:40 +0000 (18:46 +0000)]
Merge "Remove dead code from DeviceFlowRegistryImpl"

4 years agoMerge "Update flow during arbitrator reconciliation should be handled as delete bundl...
Anil Vishnoi [Fri, 28 Jun 2019 18:26:11 +0000 (18:26 +0000)]
Merge "Update flow during arbitrator reconciliation should be handled as delete bundle message for original flow followed by add bundle message for updated flow."

4 years agoMigrate to LoggingFutures 47/82547/2
Robert Varga [Tue, 18 Jun 2019 11:23:22 +0000 (13:23 +0200)]
Migrate to LoggingFutures

LoggingFutures provide more flexible method overrides, hence
allowing faster execution for known types (like ListenableFuture).

This migrates to use LoggingFutures instead of JdkFutures, also
eliminating unneeded temporary Future variables.

Change-Id: If2b1f99ffa6d09633706eb8c0ac323e116f3179e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSimplify DeviceContextImpl flow counting 81/82581/5
Robert Varga [Thu, 20 Jun 2019 10:20:38 +0000 (12:20 +0200)]
Simplify DeviceContextImpl flow counting

The code to count flows for debugging purposes is a rather arcane
stream. Simplify it by transforming some amount of code from
functional to imperative programming and taking advantage of
nonnullFoo() methods.

Change-Id: Ifa61e38b4a4e4ac786d598ba6199ed2d55304407
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSimplify DeviceFlowRegistryImpl streaming 80/82580/3
Robert Varga [Thu, 20 Jun 2019 10:12:01 +0000 (12:12 +0200)]
Simplify DeviceFlowRegistryImpl streaming

This patch takes advantage of Optional.ifPresent() and nonnullFoo()
methods to simplify the stream processing pipeline.

Change-Id: I9395a011fd7956d909b0b22d334aa9dcee601db6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove dead code from DeviceFlowRegistryImpl 78/82578/4
Robert Varga [Thu, 20 Jun 2019 10:03:06 +0000 (12:03 +0200)]
Remove dead code from DeviceFlowRegistryImpl

newReadOnlyTransaction() and read() do not return nulls, hence
the code checking for them is dead. Remove it and refactor the
code to close the transaction immediately after issuing the read.

Change-Id: I9f02a19358c2bb0019b66a5778e489d52159499f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMerge "Declare reconciliation artifacts"
Anil Vishnoi [Thu, 27 Jun 2019 01:18:01 +0000 (01:18 +0000)]
Merge "Declare reconciliation artifacts"

4 years agoMerge "Reduce use of JdkFutureAdapters"
Anil Vishnoi [Thu, 27 Jun 2019 01:15:46 +0000 (01:15 +0000)]
Merge "Reduce use of JdkFutureAdapters"

4 years agoMerge "Cleanup use of Guava Function"
Anil Vishnoi [Thu, 27 Jun 2019 00:57:22 +0000 (00:57 +0000)]
Merge "Cleanup use of Guava Function"

4 years agoMerge "Remove use of Objects.{is,non}Null"
Anil Vishnoi [Thu, 27 Jun 2019 00:41:50 +0000 (00:41 +0000)]
Merge "Remove use of Objects.{is,non}Null"

4 years agoMerge "Take advantage of nonnullFoo()"
Anil Vishnoi [Wed, 26 Jun 2019 17:38:15 +0000 (17:38 +0000)]
Merge "Take advantage of nonnullFoo()"

4 years agoUpdate flow during arbitrator reconciliation should be handled as delete 49/82249/20
Somashekhar Javalagi [Wed, 20 Feb 2019 09:18:49 +0000 (14:48 +0530)]
Update flow during arbitrator reconciliation should be handled as delete
bundle message for original flow followed by add bundle message for
updated flow.

This was not followed, so ended up in stale flows on computes after RBU.

Change-Id: Iff10dd6380a0636cf9f251ddd1e07c1bd88aad8f
Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
4 years agoRemove use of StringBuffer 37/82637/1
Robert Varga [Fri, 21 Jun 2019 05:24:12 +0000 (07:24 +0200)]
Remove use of StringBuffer

StringBuilder is the more modern replacement, use that.

Change-Id: If2a4cee7d41787b88800790830b09e4f6f01196d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove use of Objects.{is,non}Null 79/82579/2
Robert Varga [Thu, 20 Jun 2019 09:53:53 +0000 (11:53 +0200)]
Remove use of Objects.{is,non}Null

As noted in API documentation, these methods are to be used with
method handles. Replace their use with simple null checks.

Change-Id: Ifa02d42d5b38f62ab871be9768fffb1ea86d7463
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce use of JdkFutureAdapters 26/80526/8
Robert Varga [Thu, 21 Feb 2019 18:01:20 +0000 (19:01 +0100)]
Reduce use of JdkFutureAdapters

All of our infra is on ListenableFuture these days, there is no
point in squashing that to Future and then going back to
ListenableFuture.

Change-Id: I887a4bab29465c90202a66a352b7ffe1f63d6e6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeclare reconciliation artifacts 36/82136/3
Robert Varga [Thu, 16 May 2019 11:17:02 +0000 (13:17 +0200)]
Declare reconciliation artifacts

This reduces the use of project.version and publishes reconciliation
framework to artifacts, so it can be consumed without references to
features.

Change-Id: I79ed1ff4909d8e15aaed5a7adf6d71d239f8ec5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup use of Guava Function 25/80525/6
Robert Varga [Thu, 21 Feb 2019 17:39:54 +0000 (18:39 +0100)]
Cleanup use of Guava Function

We do not need to explicitly reference Function, but can use
java.util.function.Function and lambdas.

Change-Id: Ic2c84ab14fc5e014d8aaba09274ebb3a45fd649f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTake advantage of nonnullFoo() 68/82168/3
Robert Varga [Mon, 20 May 2019 06:50:49 +0000 (08:50 +0200)]
Take advantage of nonnullFoo()

Rather then having inline checks for nulls, take advantage of
built-in nonnullFull() method.

Change-Id: I20cc90de516ab8d335ad0a7353653218e5f47ae2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 4.0.2 69/82369/2
Robert Varga [Fri, 31 May 2019 14:18:45 +0000 (16:18 +0200)]
Bump mdsal to 4.0.2

This picks up latest fixes.

Change-Id: Ic8d7b12750d3335233905bfad5cf742d96a8ceac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge "OPNFLWPLUG-1027 : Topology manager writes link information everytime topology...
Anil Vishnoi [Wed, 22 May 2019 16:12:53 +0000 (16:12 +0000)]
Merge "OPNFLWPLUG-1027 : Topology manager writes link information everytime topology-lldp-discovery publish the linkAdded/linkRemove notificaiton"

5 years agoOPNFLWPLUG-1056 : Default table flows missing 34/80434/22
SOMASHEKHAR MANOHARA JAVALAGI [Fri, 22 Mar 2019 01:45:23 +0000 (07:15 +0530)]
OPNFLWPLUG-1056 : Default table flows missing

FRM registers for ownership callback and will get notified once master
is elected for a device. In some cases, Rolecontext is taking time for
ownership election but deviceContext is going ahead and writing the node
information to the oper inventory. So, apps which listen for node DTCL
will go ahead and push default table flows which might be dropped by FRM
as it has not yet got ownership callback.

The new implementation would be for devicecontext to wait for mastership
election to go through and then write the switch information to the oper
inventory. This will make sure FRM always has the mastership details
when it receives flow information.

Change-Id: I55d467aae68219adc1dfa6ad980bc27342d65191
Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
5 years agoMerge "OPNFLWPLUG-644: Openflow Event logging using log4j"
Anil Vishnoi [Mon, 20 May 2019 15:48:01 +0000 (15:48 +0000)]
Merge "OPNFLWPLUG-644: Openflow Event logging using log4j"

5 years agoOPNFLWPLUG-1027 : Topology manager writes link information everytime topology-lldp... 75/74175/30
Andrej Leitner [Tue, 17 Jul 2018 22:23:30 +0000 (00:23 +0200)]
OPNFLWPLUG-1027 : Topology manager writes link information everytime topology-lldp-discovery publish the linkAdded/linkRemove notificaiton

 Send new notifications only when the links are discovered
 and ignore already present links.

Change-Id: I5ec6ae4d2cd8d2c83eb6e918f12cf12927056633
JIRA: OPNFLWPLUG-1027
Signed-off-by: Gobinath <gobinath@ericsson.com>
5 years agoOPNFLWPLUG-644: Openflow Event logging using log4j 15/75415/17
Somashekhar Javalagi [Thu, 23 Aug 2018 10:35:12 +0000 (16:05 +0530)]
OPNFLWPLUG-644: Openflow Event logging using log4j

Main events of openflowplugin can be logged using a separate common
logger, which will be using log4j logging framework. This can be
configured as a log appender in etc/org.ops4j.pax.logging file, through
which we can redirect main openflowplugin event logs to a separate file.
This can be helpful in debugging the problems with different phases of
device connection to the SDN controller.

The log appender can be configured as below:
========================================================================
log4j2.logger.ofp.name = OfEventLog
log4j2.logger.ofp.level = DEBUG
log4j2.logger.ofp.additivity = false
log4j2.logger.ofp.appenderRef.OfEventRollingFile.ref = OfEventRollingFile

log4j2.appender.ofp.type = RollingRandomAccessFile
log4j2.appender.ofp.name = OfEventRollingFile
log4j2.appender.ofp.fileName = \${karaf.data}/events/openflow/openflow.log
log4j2.appender.ofp.filePattern = \${karaf.data}/events/openflow/openflow.log.%i
log4j2.appender.ofp.append = true
log4j2.appender.ofp.layout.type = PatternLayout
log4j2.appender.ofp.layout.pattern = %d{ISO8601} | %m%n
log4j2.appender.ofp.policies.type = Policies
log4j2.appender.ofp.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.ofp.policies.size.size = 10MB
log4j2.appender.ofp.strategy.type = DefaultRolloverStrategy
log4j2.appender.ofp.strategy.max = 10
========================================================================

Change-Id: I5e86e58fb4fcbd8048dae4fea92f2021bfdbdd04
Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
5 years agoBump mdsal to 4.0.1 43/81843/2
Robert Varga [Wed, 1 May 2019 11:40:32 +0000 (13:40 +0200)]
Bump mdsal to 4.0.1

This bumps mdsal to 4.0.1.

Change-Id: Id1c38ee68b29d240d8f7a1fc25851afa7bfec6be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge "Delete ScenarioService"
Anil Vishnoi [Wed, 1 May 2019 22:07:31 +0000 (22:07 +0000)]
Merge "Delete ScenarioService"

5 years agoMerge "Add IpConversionUtil.hasIpv4Prefix()"
Anil Vishnoi [Wed, 1 May 2019 20:27:32 +0000 (20:27 +0000)]
Merge "Add IpConversionUtil.hasIpv4Prefix()"

5 years agoMerge "Remove Optional.ofNullable() antipatterns"
Anil Vishnoi [Wed, 1 May 2019 20:23:21 +0000 (20:23 +0000)]
Merge "Remove Optional.ofNullable() antipatterns"

5 years agoMerge "Use ClassToInstanceMap instead of a HashMap"
Anil Vishnoi [Wed, 1 May 2019 20:16:36 +0000 (20:16 +0000)]
Merge "Use ClassToInstanceMap instead of a HashMap"

5 years agoMerge "Add NodeConfiguratorImpl enqueue trace"
Anil Vishnoi [Wed, 1 May 2019 20:15:50 +0000 (20:15 +0000)]
Merge "Add NodeConfiguratorImpl enqueue trace"

5 years agoMerge "OPNFLWPLUG-1062 Include additional LLDP fields in liblldp"
Anil Vishnoi [Wed, 1 May 2019 20:14:47 +0000 (20:14 +0000)]
Merge "OPNFLWPLUG-1062 Include additional LLDP fields in liblldp"

5 years agoDelete ScenarioService 34/77934/4
Stephen Kitt [Mon, 19 Nov 2018 10:22:38 +0000 (11:22 +0100)]
Delete ScenarioService

This isn’t used anywhere, if it’s not going to be then we might as
well delete it.

Change-Id: Iaec40bb9b96f8e8eb588370e3d45633af9596cc6
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUpdate docs version for Sodium 05/81805/1
Luis Gomez [Mon, 29 Apr 2019 18:17:42 +0000 (11:17 -0700)]
Update docs version for Sodium

Change-Id: Id447d10f96ae7c59baf6c974ff3479d4cf27b2e8
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
5 years agoAutorelease sodium-mvn35-openjdk11 failed to build 89/81789/3
Shweta Chaturvedi [Fri, 26 Apr 2019 07:13:27 +0000 (12:43 +0530)]
Autorelease sodium-mvn35-openjdk11 failed to build
openflowplugin-extension-api from openflowplugin

Change-Id: Ib0bccc0e2507cf0bd52b652ae990a3b7c640a9b1
Signed-off-by: Shweta Chaturvedi <shweta.chaturvedi@ericsson.com>
5 years agoBump mdsal to 4.0.0 82/81282/17
Robert Varga [Thu, 28 Mar 2019 21:46:26 +0000 (22:46 +0100)]
Bump mdsal to 4.0.0

This bumps mdsal to 4.0.0, adjusting for codegen changes.

Change-Id: If3d2e2c6ec1c70b95b3aae2105fe54de6c447000
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 5.0.0 81/81281/9
Robert Varga [Thu, 28 Mar 2019 21:46:57 +0000 (22:46 +0100)]
Bump odlparent to 5.0.0

This bumps odlparent to 5.0.0, adding JSR305 dependencies where
needed.

Useless annotations in methods specified by a contract
are removed, as SpotBugs reports them (rightfully) as errors,
namely NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION, due to Guava
using checker.qual instead of JSR305.

Change-Id: I7646f5a01b9cf39f7eba316baa8d37c790630c29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix spotbugs logging complaints 80/81280/7
Robert Varga [Thu, 28 Mar 2019 22:35:21 +0000 (23:35 +0100)]
Fix spotbugs logging complaints

Logging empty or sign-only messages, as well squashing exceptions
draws complaints from newer SpotBugs, fix them up.

Change-Id: I33e9e23c2c347f269517d293b99c1a80ef37f5d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not use deprecated Futures methods 83/81283/3
Robert Varga [Thu, 28 Mar 2019 23:04:51 +0000 (00:04 +0100)]
Do not use deprecated Futures methods

Futures require an executor, pass down directExecutor() to be
future-proof.

Change-Id: Ib68c29186ba3e57f4c59a4782f1604b17c4dae38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOPNFLWPLUG-1069 : Openflow service state is not marked as operational in showsvcstatus 35/81435/2
Somashekhar Javalagi [Mon, 8 Apr 2019 04:43:01 +0000 (10:13 +0530)]
OPNFLWPLUG-1069 : Openflow service state is not marked as operational in showsvcstatus

Openflow service status depends on OPENFLOW_SERVER_6633 and
OPENFLOW_SERVER_6653 services. As OPENFLOW_SERVER_6653 marked along with
ip address, there was problem in deciding openflow service state.
Removing ip address from OPENFLOW_SERVER_6653 service name.

Change-Id: I4b650310ae8ef925a2f1aeb6a5de236d57433c3f
Signed-off-by: Somashekhar Javalagi <somashekhar.manohara.javalagi@ericsson.com>
5 years agoAdd IpConversionUtil.hasIpv4Prefix() 43/80543/8
Robert Varga [Fri, 22 Feb 2019 12:09:35 +0000 (13:09 +0100)]
Add IpConversionUtil.hasIpv4Prefix()

This is a mirror method to the IPv6 case. The IPv6 version is
also optimized to prevent unnecessary reboxing via a shared internal
utility method.

JIRA: OPNFLWPLUG-1067
Change-Id: Ic32b95a52a197e5735f1740cbd7b2cb3530baa99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove Objects.{is,non}Null abuse 42/80442/9
Robert Varga [Wed, 20 Feb 2019 23:31:31 +0000 (00:31 +0100)]
Remove Objects.{is,non}Null abuse

These utility methods are primarily destined for use with method
handles, not for use in if statements and the like. They also have
more concise representation in bytecode -- through IFNONNULL.

Remove the abuse, resulting in shorter code and bytecode.

JIRA: OPNFLWPLUG-1066
Change-Id: Iff9073d27f65defcfb5e31e8fdea7d7c02c03d0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPrevent Ipv4Address rewrap in OfToSalIpv4DstCase 42/80542/6
Robert Varga [Fri, 22 Feb 2019 11:59:16 +0000 (12:59 +0100)]
Prevent Ipv4Address rewrap in OfToSalIpv4DstCase

We have an Ipv4Address on input, there is no point in unwrapping
and then rewrapping it -- just use it as is.

Change-Id: I271f0886e904077b3193d65407963e327779090b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix IpConversionUtil.extractIpv4AddressMask() 46/80546/11
Robert Varga [Fri, 22 Feb 2019 14:08:04 +0000 (15:08 +0100)]
Fix IpConversionUtil.extractIpv4AddressMask()

The algorithm here is wrong when prefix length is 0, as it
returns 255.255.255.255, where it should be returning 0.0.0.0.
This turns out to be an error coming from the fact we use a long
bitmask and incorrect masks to mask out the topmost long bits.

Use an int bitmask and switch to non-sign-extending shifts, which
fixes the problem.

JIRA: OPNFLWPLUG-1063
Change-Id: Idd42ba510a3a9d2032646f07b0bde8061ecd2637
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPre-construct prefix masks 45/80545/6
Robert Varga [Fri, 22 Feb 2019 14:03:26 +0000 (15:03 +0100)]
Pre-construct prefix masks

IPV4 can hold at most 33 different masks, which are being held
in immutable arrays. We can save significant amount of allocation
and parsing if we just pre-compute these quads.

JIRA: OPNFLWPLUG-1067
Change-Id: I8eb5507b9615373f0526e7bb2e8a1d7132634295
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize IpConversionUtil.extractIpv4AddressMask() 44/80544/7
Robert Varga [Fri, 22 Feb 2019 13:14:11 +0000 (14:14 +0100)]
Optimize IpConversionUtil.extractIpv4AddressMask()

Rather than going through String.format() use simple pre-allocated
StringBuilder.

Furthermore, Ipv4Prefix is guaranteed to always contain a slash,
hence we can use a simple indexOf/substring instead of splitting
the string.

Finally, if the prefix is 32, we can reuse the DottedQuad we keep
around for full arbitrary mask.

JIRA: OPNFLWPLUG-1067
Change-Id: I99f036c86606142a9f844507789293cd9822692f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize IpConversionUtil.isArbitraryBitMask() string splitting 41/80541/6
Robert Varga [Fri, 22 Feb 2019 11:48:06 +0000 (12:48 +0100)]
Optimize IpConversionUtil.isArbitraryBitMask() string splitting

We do not need two intermediate lists to iterate over the result
of splitting. We also can pre-compile the splitting pattern.

JIRA: OPNFLWPLUG-1067
Change-Id: I2ff6b50d203ef90d8953364368cbbbe289d34935
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove duplicate IpConversionUtil.isArbitraryBitMask() 40/80540/5
Robert Varga [Fri, 22 Feb 2019 11:35:18 +0000 (12:35 +0100)]
Remove duplicate IpConversionUtil.isArbitraryBitMask()

The ipv4 and ipv6 versions can be shared by passing an address
length argument, reducing code duplication.

JIRA: OPNFLWPLUG-1067
Change-Id: I11dcafa9823a05463164c343aa83f9f4826702a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize IpConversionUtil.createArbitraryBitMask() 39/80539/4
Robert Varga [Fri, 22 Feb 2019 11:20:15 +0000 (12:20 +0100)]
Optimize IpConversionUtil.createArbitraryBitMask()

Refactor the method to use a constant DottedQuad for the no mask
case and clean up error logging.

JIRA: OPNFLWPLUG-1067
Change-Id: I377002d60d26d8a7c0c10e2a59de68186761326b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize splitter usage 38/80538/2
Robert Varga [Fri, 22 Feb 2019 11:06:18 +0000 (12:06 +0100)]
Optimize splitter usage

Do not instantiate short-lived splitters, but reuse shared
instances. Also use splitToList() instead of rolling our own
conversion.

JIRA: OPNFLWPLUG-1067
Change-Id: I515a30bbb2b2cbfbd165a593915151cb52dd6474
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize IpConversionUtil.extractIpv4Address() 37/80537/2
Robert Varga [Fri, 22 Feb 2019 11:04:08 +0000 (12:04 +0100)]
Optimize IpConversionUtil.extractIpv4Address()

Rather than instantiating Ipv4Address ourselves, use IetfInetUtil
just as we do in the IPv6 case.

JIRA: OPNFLWPLUG-1067
Change-Id: Ie6a4b0ffe57adef2d884f1b0a3987b31f9c0795b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove Ipv{4,6}Address-based splitToParts() methods 36/80536/2
Robert Varga [Fri, 22 Feb 2019 11:01:28 +0000 (12:01 +0100)]
Remove Ipv{4,6}Address-based splitToParts() methods

These methods are marked as abuse, are inefficient and are actually
not used anywhere. Remove them.

JIRA: OPNFLWPLUG-1067
Change-Id: I58a75c96fa057faafadc27b459ae2412c7ae3f1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove Optional.ofNullable() antipatterns 43/80443/4
Robert Varga [Wed, 20 Feb 2019 22:21:13 +0000 (23:21 +0100)]
Remove Optional.ofNullable() antipatterns

Use of Optional.ofNullable().{map,orElseGet,...} are an antipattern
which is inefficient (as it hides logic from the compiler) and
places burden on EA to prove the objects can actually not be allocated.

This patch eliminates the trivial uses, leaving some more complex
flows to be untangled later.

Change-Id: Id05292b125dcfac4f77d2ea0a70a01ef04a78a0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse ClassToInstanceMap instead of a HashMap 41/80441/4
Robert Varga [Wed, 20 Feb 2019 22:58:51 +0000 (23:58 +0100)]
Use ClassToInstanceMap instead of a HashMap

ClassToInstanceMap provides a type-safe equivalent of what is
being coded up here.

Change-Id: I682a935ba2c255443b4fd4689d0c589bc0c2bac2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge "Remove redundant exception declarations"
Arunprakash D [Thu, 7 Mar 2019 06:02:35 +0000 (06:02 +0000)]
Merge "Remove redundant exception declarations"

5 years agoMerge "Remove redundant type specifiers"
Arunprakash D [Thu, 7 Mar 2019 05:59:30 +0000 (05:59 +0000)]
Merge "Remove redundant type specifiers"

5 years agoRemove redundant exception declarations 62/80062/2
Stephen Kitt [Tue, 6 Nov 2018 17:11:26 +0000 (18:11 +0100)]
Remove redundant exception declarations

This allows callers to be simplified.

JIRA: OPNFLWPLUG-1045
Change-Id: I8ed5eecc20bb66c0b322ef3716612cad24bd8ff1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoRemove redundant type specifiers 59/77459/7
Stephen Kitt [Fri, 2 Nov 2018 15:45:15 +0000 (16:45 +0100)]
Remove redundant type specifiers

This removes generic types and casts which aren’t necessary.

JIRA: OPNFLWPLUG-1044
Change-Id: I267045bb85b7c1c657fe9f9a2ac869d9914f3eb0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoOPNFLWPLUG-1064: Openflow diagstatus: Merge all 93/79793/22
Shweta Chaturvedi [Mon, 21 Jan 2019 12:14:40 +0000 (17:44 +0530)]
OPNFLWPLUG-1064: Openflow diagstatus: Merge all
the 3 openflow services into one "OPENFLOW"

Change-Id: I6d192ca72153f48892d8ee14c6e0d10f41c40dfc
Signed-off-by: Shweta Chaturvedi <shweta.chaturvedi@ericsson.com>
5 years agoAdd missing annotation dependencies 17/80317/2
Stephen Kitt [Wed, 13 Feb 2019 15:52:52 +0000 (16:52 +0100)]
Add missing annotation dependencies

This ensures they are correctly flagged as optional.

Change-Id: I16931ddc763fe2150ebbd0f701ddf24a7df65748
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch to MD-SAL APIs 64/80164/8
Robert Varga [Tue, 5 Feb 2019 16:29:43 +0000 (17:29 +0100)]
Switch to MD-SAL APIs

This mass-converts all components to use MD-SAL APIs.

Change-Id: Ied51c12836fc1fc91038557e66f02f4d9f0d6b0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use of internal Netty class 63/80163/2
Robert Varga [Tue, 5 Feb 2019 16:53:18 +0000 (17:53 +0100)]
Remove use of internal Netty class

Java 8 offers ConcurrentHashMap.newKeySet(), which returns
a concurrent set. Use that instead of Netty's internal class.

Change-Id: I1be0dd7325aa8f3c9dc604afebe55f30221d37a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOPNFLWPLUG-1058: Changing INFO to DEBUG 68/80168/2
Shweta Chaturvedi [Tue, 5 Feb 2019 12:11:49 +0000 (17:41 +0530)]
OPNFLWPLUG-1058: Changing INFO  to DEBUG

Change-Id: I61260b9deea227a99b927b5550bf54eeaa064598
Signed-off-by: Shweta Chaturvedi <shweta.chaturvedi@ericsson.com>
5 years agoBump versions by x.y.(z+1) 93/80093/1
jenkins-releng [Fri, 1 Feb 2019 13:06:30 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I2068a98cf1f178671f9b8c3809ffbee71b0bfa15
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoremove 2 old fixed Maven plugin versions for Java 11 08/80008/2
Michael Vorburger [Tue, 29 Jan 2019 22:17:12 +0000 (23:17 +0100)]
remove 2 old fixed Maven plugin versions for Java 11

In the hope that this fixes the problem seen on
https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/autorelease-release-neon-mvn35-openjdk11/7/

Change-Id: Ie4bc450adbef1a69491e5a7e6134ac7de91f6000
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoDo not override javadoc plugin version 07/80007/1
Robert Varga [Tue, 29 Jan 2019 22:11:33 +0000 (23:11 +0100)]
Do not override javadoc plugin version

We are currently at version 3.0.1, do not use an outdated version.

Change-Id: Ia8d3948bdf9b3a88708e0f1a8620f69d898d9dcf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge "Rework bit-copying functions and re-enable tests"
Arunprakash D [Fri, 25 Jan 2019 05:05:12 +0000 (05:05 +0000)]
Merge "Rework bit-copying functions and re-enable tests"

5 years agoMerge "Fix BitBufferHelper::toNumber()"
Arunprakash D [Fri, 25 Jan 2019 05:04:51 +0000 (05:04 +0000)]
Merge "Fix BitBufferHelper::toNumber()"

5 years agoMerge "Clean up instance checks and casts"
Arunprakash D [Fri, 25 Jan 2019 05:04:32 +0000 (05:04 +0000)]
Merge "Clean up instance checks and casts"

5 years agoRework bit-copying functions and re-enable tests 01/78101/6
Stephen Kitt [Fri, 23 Nov 2018 16:03:17 +0000 (17:03 +0100)]
Rework bit-copying functions and re-enable tests

This patch addresses the discrepancy between the insertBits() tests
and setBytes(), by making the source of the bits explicit (MSB or
LSB).

Change-Id: Ib88398b08730149dd4bb45382c84732dfbd6903b
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix BitBufferHelper::toNumber() 90/77990/6
Stephen Kitt [Tue, 20 Nov 2018 16:04:48 +0000 (17:04 +0100)]
Fix BitBufferHelper::toNumber()

Static analysis suggested that toNumber() was incorrect (there was a
redundant write to value). Adding test cases to the UT showed that
this was the case; this patch adds the new test cases and fixes
toNumber(). It also switches assertTrue() to assertEquals() where
appropriate and cleans up a number of redundant initialisers.

Change-Id: Ia31bc91bd63f2f406dfc2d9194bf0ae4c4274055
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoClean up instance checks and casts 82/77982/4
Stephen Kitt [Tue, 20 Nov 2018 13:43:26 +0000 (14:43 +0100)]
Clean up instance checks and casts

Change-Id: Ic343131694d71e5d775bd8519492da153541fb18
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdd javax.annotation-api dependencies 02/79202/8
Robert Varga [Thu, 3 Jan 2019 18:48:51 +0000 (19:48 +0100)]
Add javax.annotation-api dependencies

Java 11 no longer ships these annotations, hence they need to be
declared. The annotations are provided by the container, hence
we scope them as provided.

Change-Id: Idc66357f723eb62f8b7a8af3db533f11215fefbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse scope=provided for karaf shell 01/79201/6
Robert Varga [Thu, 3 Jan 2019 18:47:44 +0000 (19:47 +0100)]
Use scope=provided for karaf shell

This dependency is actively filtered by odlparent, but its transitive
dependencies are still leaking to our features.

Lower the scope to provided to get rid of those dependencies.

Change-Id: I4d9b30f4d94c15c1f27f74ca63c0defe430ec598
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd jaxb-api dependencies 00/79200/5
Robert Varga [Thu, 3 Jan 2019 18:22:10 +0000 (19:22 +0100)]
Add jaxb-api dependencies

Java9+ does not ship JAXB, add dependecies on jaxb-api to make
Java 11 build pass.

Change-Id: I8eca4865d8029a5b29c1abdca6ac08befa5f6aa2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge "minor: clean up TcpConnectionInitializer / SwitchConnectionProviderImpl"
Arunprakash D [Thu, 24 Jan 2019 06:32:27 +0000 (06:32 +0000)]
Merge "minor: clean up TcpConnectionInitializer / SwitchConnectionProviderImpl"

5 years agoMerge "add getFullyStarted() to OpenFlowPluginProviderImpl"
Arunprakash D [Thu, 24 Jan 2019 06:32:11 +0000 (06:32 +0000)]
Merge "add getFullyStarted() to OpenFlowPluginProviderImpl"

5 years agominor: clean up TcpConnectionInitializer / SwitchConnectionProviderImpl 99/78899/3
Michael Vorburger [Fri, 21 Dec 2018 00:55:55 +0000 (01:55 +0100)]
minor: clean up TcpConnectionInitializer / SwitchConnectionProviderImpl

also make TcpConnectionInitializer getIsOnlineFuture() actually work;
even though this, as far as I can tell, was over engineered and does not
actually appear to be used, it still nicer to be correct as it helps
understand how OnlineProvider / ServerFacade appears to have been
intended.

Change-Id: Ide74d22a42960432b6114d666c7067f66803baf0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoBump to mdsal 3.0.6 09/79809/1
Stephen Kitt [Tue, 22 Jan 2019 08:51:41 +0000 (09:51 +0100)]
Bump to mdsal 3.0.6

Change-Id: I8c4ad63fd4a9f271ddb2318c3cf33afcfd9d539a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdd NodeConfiguratorImpl enqueue trace 90/79790/2
Robert Varga [Mon, 21 Jan 2019 10:44:53 +0000 (11:44 +0100)]
Add NodeConfiguratorImpl enqueue trace

This adds traces about when a task is enqueued.

Change-Id: I250d2165d303daf1323fc98d3dd2c5f4c711b3d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 3.0.5 84/79784/1
Robert Varga [Mon, 21 Jan 2019 09:18:16 +0000 (10:18 +0100)]
Bump mdsal to 3.0.5

This aligns with odlparent-4.0.9 and yangtools-2.1.8.

Change-Id: Id26aac37a504d62c7352d47b84c1e9a83df6e958
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.9 74/79674/1
Stephen Kitt [Fri, 18 Jan 2019 15:33:41 +0000 (16:33 +0100)]
Bump to odlparent 4.0.9

Change-Id: Ia744d7a9c4b1f6b5c7e3743b0fbf40228a452787
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoMerge "mv log4j.xml from src/main => src/test"
Arunprakash D [Thu, 17 Jan 2019 01:59:03 +0000 (01:59 +0000)]
Merge "mv log4j.xml from src/main => src/test"

5 years agoMerge "Bump mdsal to 3.0.4"
Anil Vishnoi [Thu, 10 Jan 2019 19:00:15 +0000 (19:00 +0000)]
Merge "Bump mdsal to 3.0.4"

5 years agoMerge "Bump odlparent to 4.0.8"
Anil Vishnoi [Thu, 10 Jan 2019 19:00:11 +0000 (19:00 +0000)]
Merge "Bump odlparent to 4.0.8"

5 years agoMerge "Log the address and port when binding fails"
Anil Vishnoi [Thu, 10 Jan 2019 17:17:51 +0000 (17:17 +0000)]
Merge "Log the address and port when binding fails"

5 years agoBump mdsal to 3.0.4 36/79436/1
Robert Varga [Thu, 10 Jan 2019 15:51:07 +0000 (16:51 +0100)]
Bump mdsal to 3.0.4

This realigns odlparent/yangtools/mdsal and brings in the latest
improvements.

Change-Id: I8fa610d61cf5d82012b72153c10efe14ee8de753
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 4.0.8 21/79121/4
Stephen Kitt [Wed, 2 Jan 2019 10:24:49 +0000 (11:24 +0100)]
Bump odlparent to 4.0.8

Change-Id: Ia352d37507b22347944c13843c05dee2e8cc2819
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoOPNFLWPLUG-1062 Include additional LLDP fields in liblldp 90/79390/1
priyankachopra [Thu, 10 Jan 2019 04:18:50 +0000 (09:48 +0530)]
OPNFLWPLUG-1062 Include additional LLDP fields in liblldp

Change-Id: Ibf3f34c77921fbe032198d8f390b834ced3e6c6a
Signed-off-by: priyankachopra <priyanka71188@gmail.com>
5 years agoadd getFullyStarted() to OpenFlowPluginProviderImpl 98/78898/4
Michael Vorburger [Fri, 21 Dec 2018 00:46:15 +0000 (01:46 +0100)]
add getFullyStarted() to OpenFlowPluginProviderImpl

and fix the order of isOnlineFuture vs readyRunnable: For a test to be
able to await getFullyStarted() and then check diagstatus, that
(diagstatus) needs to be set BEFORE, otherwise there is a race
condition.

This has come up while writing the testDiagStatus() for the
OpenFlowPluginWiringTest for opendaylight-simple.

JIRA: OPNFLWPLUG-1061
Change-Id: Ic9b5f9b49038fa75451e81ebaa1e6fbdbc41c683
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoRevert "Change log level for noisy disconnect log" 99/79299/2
Anil Vishnoi [Tue, 8 Jan 2019 09:14:47 +0000 (09:14 +0000)]
Revert "Change log level for noisy disconnect log"

This reverts commit 00188709ae7cebe12da693f8dbe11108f940a4e3.

Change-Id: Ibd34cdc79d52ad74786c94f6f0cd25179c590970
Signed-off-by: Victor Pickard <vpickard@redhat.com>
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>