From a7f9f10587b24644702164113f0584da5b58b6be Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Tue, 9 Apr 2024 12:46:36 +0000 Subject: [PATCH 01/30] Update .gitreview to stable/calcium Change-Id: I24ca3547a0ac202675135bdfeb811a0f00c9e367 Signed-off-by: jenkins-releng --- .gitreview | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitreview b/.gitreview index 622e9e1b7..b986e868b 100644 --- a/.gitreview +++ b/.gitreview @@ -2,4 +2,4 @@ host=git.opendaylight.org port=29418 project=openflowplugin.git -defaultbranch=master +defaultbranch=stable/calcium -- 2.43.0 From 3bc91d208ba05ae00f43c792643e92485d675112 Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Thu, 18 Apr 2024 23:51:27 +0000 Subject: [PATCH 02/30] Bump versions by x.y.(z+1) Change-Id: I12e14c129846748b5280c8b8ba1ba9f8a693790e Signed-off-by: jenkins-releng --- applications/arbitratorreconciliation/api/pom.xml | 2 +- applications/arbitratorreconciliation/impl/pom.xml | 2 +- applications/arbitratorreconciliation/pom.xml | 2 +- applications/bulk-o-matic/pom.xml | 2 +- applications/device-ownership-service/pom.xml | 2 +- applications/forwardingrules-manager/pom.xml | 2 +- applications/forwardingrules-sync/pom.xml | 2 +- applications/lldp-speaker/pom.xml | 2 +- applications/of-switch-config-pusher/pom.xml | 2 +- applications/pom.xml | 2 +- applications/reconciliation-framework/pom.xml | 2 +- applications/southbound-cli/pom.xml | 2 +- applications/table-miss-enforcer/pom.xml | 2 +- applications/topology-lldp-discovery/pom.xml | 2 +- applications/topology-manager/pom.xml | 4 ++-- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 4 ++-- drop-test-karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/openflowjava-extension-eric/pom.xml | 2 +- extension/openflowjava-extension-nicira-api/pom.xml | 2 +- extension/openflowjava-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-api/pom.xml | 2 +- extension/openflowplugin-extension-eric/pom.xml | 2 +- extension/openflowplugin-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-onf/pom.xml | 2 +- extension/pom.xml | 2 +- extension/test-extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../odl-openflowplugin-app-arbitratorreconciliation/pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-manager/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../odl-openflowplugin-app-reconciliation-framework/pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../odl-openflowplugin-app-topology-lldp-discovery/pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- features-aggregator/odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 2 +- features-aggregator/odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 2 +- features-aggregator/odl-openflowplugin-southbound/pom.xml | 4 ++-- features-aggregator/pom.xml | 2 +- libraries/liblldp/pom.xml | 2 +- libraries/pom.xml | 2 +- model/model-flow-base/pom.xml | 2 +- model/model-flow-service/pom.xml | 2 +- model/model-flow-statistics/pom.xml | 2 +- model/model-inventory/pom.xml | 2 +- model/model-topology/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 2 +- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- openflowjava/openflow-protocol-api/pom.xml | 4 ++-- openflowjava/openflow-protocol-impl/pom.xml | 2 +- openflowjava/openflow-protocol-it/pom.xml | 2 +- openflowjava/openflow-protocol-spi/pom.xml | 2 +- openflowjava/openflowjava-blueprint-config/pom.xml | 2 +- openflowjava/openflowjava-util/pom.xml | 2 +- openflowjava/pom.xml | 2 +- openflowplugin-api/pom.xml | 2 +- openflowplugin-blueprint-config/pom.xml | 2 +- openflowplugin-common/pom.xml | 2 +- openflowplugin-impl/pom.xml | 2 +- openflowplugin-it/pom.xml | 2 +- openflowplugin/pom.xml | 2 +- parent/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/learning-switch/pom.xml | 2 +- samples/pom.xml | 2 +- samples/sample-bundles/pom.xml | 2 +- samples/sample-consumer/pom.xml | 2 +- samples/simple-client/pom.xml | 2 +- test-common/pom.xml | 2 +- test-provider/pom.xml | 2 +- 85 files changed, 91 insertions(+), 91 deletions(-) diff --git a/applications/arbitratorreconciliation/api/pom.xml b/applications/arbitratorreconciliation/api/pom.xml index 3fb439acb..d6be58698 100644 --- a/applications/arbitratorreconciliation/api/pom.xml +++ b/applications/arbitratorreconciliation/api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../../parent diff --git a/applications/arbitratorreconciliation/impl/pom.xml b/applications/arbitratorreconciliation/impl/pom.xml index ef3e845ff..02a8ed4e9 100644 --- a/applications/arbitratorreconciliation/impl/pom.xml +++ b/applications/arbitratorreconciliation/impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../../parent diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index f49b1a8b4..12c4cc287 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.applications arbitratorreconciliation-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom ODL :: openflowplugin :: ${project.artifactId} diff --git a/applications/bulk-o-matic/pom.xml b/applications/bulk-o-matic/pom.xml index 567abedfe..b8d368ab0 100644 --- a/applications/bulk-o-matic/pom.xml +++ b/applications/bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/device-ownership-service/pom.xml b/applications/device-ownership-service/pom.xml index 7028f713e..ff3fe5a35 100644 --- a/applications/device-ownership-service/pom.xml +++ b/applications/device-ownership-service/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/forwardingrules-manager/pom.xml b/applications/forwardingrules-manager/pom.xml index b96931721..ef8f17c05 100644 --- a/applications/forwardingrules-manager/pom.xml +++ b/applications/forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/forwardingrules-sync/pom.xml b/applications/forwardingrules-sync/pom.xml index 5bfeb9b8f..5d8df288d 100644 --- a/applications/forwardingrules-sync/pom.xml +++ b/applications/forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/lldp-speaker/pom.xml b/applications/lldp-speaker/pom.xml index 79fdb2466..a00bebc14 100644 --- a/applications/lldp-speaker/pom.xml +++ b/applications/lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/of-switch-config-pusher/pom.xml b/applications/of-switch-config-pusher/pom.xml index 0f835e8c1..47c96c911 100644 --- a/applications/of-switch-config-pusher/pom.xml +++ b/applications/of-switch-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/pom.xml b/applications/pom.xml index 466222a38..c4e07d51a 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin applications-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/applications/reconciliation-framework/pom.xml b/applications/reconciliation-framework/pom.xml index fa8b81ba8..e8c38955c 100644 --- a/applications/reconciliation-framework/pom.xml +++ b/applications/reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/southbound-cli/pom.xml b/applications/southbound-cli/pom.xml index 24986b3db..483a10161 100644 --- a/applications/southbound-cli/pom.xml +++ b/applications/southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/table-miss-enforcer/pom.xml b/applications/table-miss-enforcer/pom.xml index d474cf54d..b6d1b68ec 100644 --- a/applications/table-miss-enforcer/pom.xml +++ b/applications/table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/applications/topology-lldp-discovery/pom.xml b/applications/topology-lldp-discovery/pom.xml index 7b219285f..a97175f5d 100644 --- a/applications/topology-lldp-discovery/pom.xml +++ b/applications/topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent org.opendaylight.openflowplugin.applications diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index c2dbb257f..c7b68fc52 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent org.opendaylight.openflowplugin.applications topology-manager - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT bundle diff --git a/artifacts/pom.xml b/artifacts/pom.xml index e0e5ce220..6c3a5991b 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -19,7 +19,7 @@ org.opendaylight.openflowplugin openflowplugin-artifacts - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 84c3768c4..4d4abe7a1 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -8,11 +8,11 @@ org.opendaylight.openflowplugin openflowplugin-karaf - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT diff --git a/drop-test-karaf/pom.xml b/drop-test-karaf/pom.xml index 51a0fa888..3133dbc65 100644 --- a/drop-test-karaf/pom.xml +++ b/drop-test-karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 360321102..01608b79a 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin-extension feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 01b9b6c09..ce722910a 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-eric-extensions feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Eric Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index 743857ed5..6df8f8947 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nxm-extensions feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Nicira Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index 76e7ff2f6..aeb054506 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-onf-extensions feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: ONF Extensions diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 471437e6d..7cb503f41 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-extension-aggregator pom - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT features-openflowplugin-extension diff --git a/extension/openflowjava-extension-eric/pom.xml b/extension/openflowjava-extension-eric/pom.xml index 7a939a03c..89a299719 100644 --- a/extension/openflowjava-extension-eric/pom.xml +++ b/extension/openflowjava-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent openflowjava-extension-eric diff --git a/extension/openflowjava-extension-nicira-api/pom.xml b/extension/openflowjava-extension-nicira-api/pom.xml index d22e9fc4e..295929905 100644 --- a/extension/openflowjava-extension-nicira-api/pom.xml +++ b/extension/openflowjava-extension-nicira-api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent openflowjava-extension-nicira-api diff --git a/extension/openflowjava-extension-nicira/pom.xml b/extension/openflowjava-extension-nicira/pom.xml index 367dec3d4..654b84176 100644 --- a/extension/openflowjava-extension-nicira/pom.xml +++ b/extension/openflowjava-extension-nicira/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent openflowjava-extension-nicira diff --git a/extension/openflowplugin-extension-api/pom.xml b/extension/openflowplugin-extension-api/pom.xml index 17beb1a18..b21ec3cf6 100644 --- a/extension/openflowplugin-extension-api/pom.xml +++ b/extension/openflowplugin-extension-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-eric/pom.xml b/extension/openflowplugin-extension-eric/pom.xml index b745493f7..f4715668f 100644 --- a/extension/openflowplugin-extension-eric/pom.xml +++ b/extension/openflowplugin-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-nicira/pom.xml b/extension/openflowplugin-extension-nicira/pom.xml index d151e8a7f..93a924f2e 100644 --- a/extension/openflowplugin-extension-nicira/pom.xml +++ b/extension/openflowplugin-extension-nicira/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-onf/pom.xml b/extension/openflowplugin-extension-onf/pom.xml index ae6914313..f7226fe0b 100644 --- a/extension/openflowplugin-extension-onf/pom.xml +++ b/extension/openflowplugin-extension-onf/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/extension/pom.xml b/extension/pom.xml index 9874299c5..8d444339d 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-extension-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/extension/test-extension/pom.xml b/extension/test-extension/pom.xml index 86bbbb677..414343aa6 100644 --- a/extension/test-extension/pom.xml +++ b/extension/test-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index c01762d82..a766b8125 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 183816967..45c37248f 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-arbitratorreconciliation feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Arbitrator Reconciliation diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 7e5a4a8d7..c9a303b26 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-bulk-o-matic feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - bulk flow operations support diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 856f458a3..06cf3d3d4 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-config-pusher feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - default config-pusher diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index 7c05d167f..4fc580839 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-manager feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - FRM diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index 021170cd9..00a13122f 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-sync feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - FRS diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index 24b6cad51..c443d8805 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-lldp-speaker feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - LLDP Speaker diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 63cc55ccf..93e4696a8 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-reconciliation-framework feature -0.18.0-SNAPSHOT +0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Reconciliation Framework diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 6fa0070b4..a94550bbb 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-southbound-cli feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Southbound CLI diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index b984defcb..627816b1d 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-table-miss-enforcer feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - table-miss-enforcer diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index aff5d5e38..3661439c1 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-lldp-discovery feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Topology LLDP Discovery diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 03e4d4f9b..24fec380f 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-manager feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Topology Manager diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index b9779bbbc..312861eb5 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - topology diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 09828499e..2ca3f1fe8 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-drop-test feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Drop Test diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 8e7b38f4a..270410cda 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services-rest feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Flow Services :: REST diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index 43ff6ef0b..c6c499865 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Flow Services diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index 48e37191d..f682d4256 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-libraries feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Libraries diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index fec57e315..dee0ad4c6 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nsf-model feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: OpenflowPlugin :: NSF :: Model diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index a5500487e..f0978c6a3 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-southbound feature - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT OpenDaylight :: Openflow Plugin :: Li southbound API implementation @@ -43,7 +43,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.0-SNAPSHOT + 0.13.1-SNAPSHOT import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 478882818..5481e88b5 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-aggregator pom - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT features-openflowplugin diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index 1e03a1997..bb958b33b 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/libraries/pom.xml b/libraries/pom.xml index 684830c7d..2fd30015e 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin libraries-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/model/model-flow-base/pom.xml b/model/model-flow-base/pom.xml index c4e0f7108..d39659b8c 100644 --- a/model/model-flow-base/pom.xml +++ b/model/model-flow-base/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/model/model-flow-service/pom.xml b/model/model-flow-service/pom.xml index 9a7dcf0e9..5e0c16393 100644 --- a/model/model-flow-service/pom.xml +++ b/model/model-flow-service/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/model/model-flow-statistics/pom.xml b/model/model-flow-statistics/pom.xml index e1c5cf748..f72d7fa1c 100644 --- a/model/model-flow-statistics/pom.xml +++ b/model/model-flow-statistics/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/model/model-inventory/pom.xml b/model/model-inventory/pom.xml index cf0305695..33ae156fc 100644 --- a/model/model-inventory/pom.xml +++ b/model/model-inventory/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/model/model-topology/pom.xml b/model/model-topology/pom.xml index 25f1950b6..fdeec6b14 100644 --- a/model/model-topology/pom.xml +++ b/model/model-topology/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/model/pom.xml b/model/pom.xml index 3911c43ed..2aaddbc22 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.openflowplugin.model model-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index d9dc75ae8..66a3333a1 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava features-openflowjava - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT feature diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 47ecff5c3..36e700d34 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.openflowjava odl-openflowjava-protocol - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT feature diff --git a/openflowjava/openflow-protocol-api/pom.xml b/openflowjava/openflow-protocol-api/pom.xml index d96f367fe..6b0799af0 100644 --- a/openflowjava/openflow-protocol-api/pom.xml +++ b/openflowjava/openflow-protocol-api/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent org.opendaylight.openflowplugin.openflowjava openflow-protocol-api - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT bundle diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index b850a1db1..6213984e3 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../ openflow-protocol-impl diff --git a/openflowjava/openflow-protocol-it/pom.xml b/openflowjava/openflow-protocol-it/pom.xml index 84c218bde..eb8a58a68 100644 --- a/openflowjava/openflow-protocol-it/pom.xml +++ b/openflowjava/openflow-protocol-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../ openflow-protocol-it diff --git a/openflowjava/openflow-protocol-spi/pom.xml b/openflowjava/openflow-protocol-spi/pom.xml index ae991e29b..35d281de2 100644 --- a/openflowjava/openflow-protocol-spi/pom.xml +++ b/openflowjava/openflow-protocol-spi/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../ openflow-protocol-spi diff --git a/openflowjava/openflowjava-blueprint-config/pom.xml b/openflowjava/openflowjava-blueprint-config/pom.xml index f41a5f389..269efa84e 100644 --- a/openflowjava/openflowjava-blueprint-config/pom.xml +++ b/openflowjava/openflowjava-blueprint-config/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../ openflowjava-blueprint-config diff --git a/openflowjava/openflowjava-util/pom.xml b/openflowjava/openflowjava-util/pom.xml index 5bbf72759..e79dabbd6 100644 --- a/openflowjava/openflowjava-util/pom.xml +++ b/openflowjava/openflowjava-util/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../ bundle diff --git a/openflowjava/pom.xml b/openflowjava/pom.xml index ceb6605fa..b9ccf3b4d 100644 --- a/openflowjava/pom.xml +++ b/openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin-api/pom.xml b/openflowplugin-api/pom.xml index ae32af498..0bc683bd1 100644 --- a/openflowplugin-api/pom.xml +++ b/openflowplugin-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin-blueprint-config/pom.xml b/openflowplugin-blueprint-config/pom.xml index 23488c3bb..b95833451 100644 --- a/openflowplugin-blueprint-config/pom.xml +++ b/openflowplugin-blueprint-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index 19a77f660..d5b968da6 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index b1d656aec..8cb244cb1 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin-it/pom.xml b/openflowplugin-it/pom.xml index f7ebc5adb..35c048d44 100644 --- a/openflowplugin-it/pom.xml +++ b/openflowplugin-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index 28eeb8052..436c3369a 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent diff --git a/parent/pom.xml b/parent/pom.xml index dc56c6fb7..d98516d79 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -19,7 +19,7 @@ 4.0.0 org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom @@ -55,7 +55,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.0-SNAPSHOT + 0.13.1-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index 3e8d9d4bb..e9d49400f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT parent openflowplugin-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT openflowplugin pom diff --git a/samples/learning-switch/pom.xml b/samples/learning-switch/pom.xml index e406627be..7f960c2dc 100644 --- a/samples/learning-switch/pom.xml +++ b/samples/learning-switch/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/samples/pom.xml b/samples/pom.xml index a92a82e7d..291b272d9 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-samples-aggregator - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT pom diff --git a/samples/sample-bundles/pom.xml b/samples/sample-bundles/pom.xml index dae66491a..23f9b9660 100644 --- a/samples/sample-bundles/pom.xml +++ b/samples/sample-bundles/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/samples/sample-consumer/pom.xml b/samples/sample-consumer/pom.xml index 654711441..d6e39af66 100644 --- a/samples/sample-consumer/pom.xml +++ b/samples/sample-consumer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/samples/simple-client/pom.xml b/samples/simple-client/pom.xml index 5bd203886..38cc82e7f 100644 --- a/samples/simple-client/pom.xml +++ b/samples/simple-client/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../../parent diff --git a/test-common/pom.xml b/test-common/pom.xml index b23e75448..4cc3ef943 100644 --- a/test-common/pom.xml +++ b/test-common/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent test-common diff --git a/test-provider/pom.xml b/test-provider/pom.xml index b8c185457..39ce98f6a 100644 --- a/test-provider/pom.xml +++ b/test-provider/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.0-SNAPSHOT + 0.18.1-SNAPSHOT ../parent test-provider -- 2.43.0 From 5ae202299fe5069a5c112fbe8c6cdd456ef528c0 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 20 May 2024 11:18:45 +0200 Subject: [PATCH 03/30] Fix checkstyle Upgraded checkstyle is finding violations around declaration/use distance. Fix those up. Change-Id: I53e5f5215ddd0977242982f3387a7ce25cc30f91 Signed-off-by: Robert Varga --- .../bulk/o/matic/FlowWriterTxChain.java | 8 ++++---- .../cli/GetFlowGroupCacheProvider.java | 8 ++++---- .../libraries/liblldp/BitBufferHelper.java | 7 +++---- .../impl/core/SwitchConnectionProviderImpl.java | 2 +- .../QueueGetConfigReplyMessageFactory.java | 2 +- .../impl/translator/PacketReceivedTranslator.java | 5 ++--- .../md/core/extension/ActionExtensionHelper.java | 7 +------ .../md/core/sal/convertor/MeterConvertor.java | 2 +- .../core/sal/convertor/common/IpConversionUtil.java | 13 +++++-------- .../convertor/match/MatchV10ResponseConvertor.java | 7 ++++--- .../convertor/match/cases/SalToOfIpv6MatchCase.java | 8 ++++++-- .../OpenflowPluginBulkGroupTransactionProvider.java | 2 +- .../OpenflowpluginGroupTestCommandProvider.java | 5 ++--- .../test/OpenflowpluginTestCommandProvider.java | 6 ++++-- 14 files changed, 39 insertions(+), 43 deletions(-) diff --git a/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChain.java b/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChain.java index 067b6d343..b66d3477e 100644 --- a/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChain.java +++ b/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChain.java @@ -109,16 +109,16 @@ public class FlowWriterTxChain implements FlowCounterMBean { @Override public void run() { writeOpStatus.set(FlowCounter.OperationStatus.IN_PROGRESS.status()); - short tableId = startTableId; - int numSubmits = flowsPerDpn / batchSize; - int sourceIp = 1; - int newBatchSize = batchSize; + final int numSubmits = flowsPerDpn / batchSize; LOG.info("Number of Txn for dpId: {} is: {}", dpId, numSubmits); txChain = dataBroker.createMergingTransactionChain(); txChain.addCallback(this); LOG.info("Creating new txChain: {} for dpid: {}", txChain, dpId); + short tableId = startTableId; + int sourceIp = 1; + int newBatchSize = batchSize; for (int i = 1; i <= numSubmits; i++) { WriteTransaction writeTransaction = txChain.newWriteOnlyTransaction(); short calculatedTableId = tableId; diff --git a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/GetFlowGroupCacheProvider.java b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/GetFlowGroupCacheProvider.java index 6f443ef14..08dc7dbfb 100644 --- a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/GetFlowGroupCacheProvider.java +++ b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/GetFlowGroupCacheProvider.java @@ -59,13 +59,13 @@ public class GetFlowGroupCacheProvider extends OsgiCommandSupport { return null; } - StringBuilder sb = new StringBuilder(); - Formatter fmt = new Formatter(sb); System.out.println(String.format("Number of flows and groups in cache for node %s : %d", nodeId, entries.size())); System.out.println(getLocalNodeHeaderOutput()); System.out.println(LINE_SEPARATOR); + StringBuilder sb = new StringBuilder(); + Formatter fmt = new Formatter(sb); for (FlowGroupInfo entry : entries) { System.out.println(fmt.format("%-10s %1s %-8s %1s %-23s %1s %-60s", entry.getDescription(), "", entry.getStatus(), "", getTime(entry), "", entry.getId()).toString()); @@ -87,10 +87,10 @@ public class GetFlowGroupCacheProvider extends OsgiCommandSupport { return; } - StringBuilder sb = new StringBuilder(); - Formatter fmt = new Formatter(sb); System.out.println(getAllLocalNodesHeaderOutput()); System.out.println(LINE_SEPARATOR); + StringBuilder sb = new StringBuilder(); + Formatter fmt = new Formatter(sb); for (Entry entry : allHistories.entrySet()) { // FIXME: just seek/substring String[] temp = entry.getKey().getValue().split(":"); diff --git a/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelper.java b/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelper.java index 90cfdaaf0..8c187243a 100644 --- a/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelper.java +++ b/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/BitBufferHelper.java @@ -166,7 +166,6 @@ public abstract class BitBufferHelper { public static byte @NonNull [] getBits(final byte[] data, final int startOffset, final int numBits) throws BufferException { int startByteOffset; - int extranumBits = numBits % NetUtils.NUM_BITS_IN_A_BYTE; final int extraOffsetBits = startOffset % NetUtils.NUM_BITS_IN_A_BYTE; int numBytes = numBits % NetUtils.NUM_BITS_IN_A_BYTE != 0 ? 1 + numBits / NetUtils.NUM_BITS_IN_A_BYTE : numBits / NetUtils.NUM_BITS_IN_A_BYTE; @@ -178,6 +177,7 @@ public abstract class BitBufferHelper { checkExceptions(data, startOffset, numBits); + final int extranumBits = numBits % NetUtils.NUM_BITS_IN_A_BYTE; if (extraOffsetBits == 0) { if (extranumBits == 0) { System.arraycopy(data, startByteOffset, bytes, 0, numBytes); @@ -539,9 +539,8 @@ public abstract class BitBufferHelper { public static byte[] shiftBitsToMSB(final byte[] inputBytes, final int numBits) { int numBitstoShiftBy; int leadZeroesMSB = 8; - int numEndRestBits; int size = inputBytes.length; - byte[] shiftedBytes = new byte[size]; + final byte[] shiftedBytes = new byte[size]; for (int i = 0; i < Byte.SIZE; i++) { if ((byte) (inputBytes[0] & getMSBMask(i + 1)) != 0) { @@ -565,7 +564,7 @@ public abstract class BitBufferHelper { shiftedBytes[0] = (byte) ((inputBytes[0] & getLSBMask(numBits)) << numBitstoShiftBy); } else { // # of bits to read from last byte - numEndRestBits = NetUtils.NUM_BITS_IN_A_BYTE + final int numEndRestBits = NetUtils.NUM_BITS_IN_A_BYTE - (inputBytes.length * NetUtils.NUM_BITS_IN_A_BYTE - numBits - numBitstoShiftBy); for (int i = 0; i < size - 1; i++) { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index 923a9e884..78ae05324 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -159,7 +159,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C private ServerFacade createAndConfigureServer() { LOG.debug("Configuring .."); - ServerFacade server; checkState(connConfig != null, "Connection not configured"); @@ -176,6 +175,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C // TODO : Add option to disable Epoll. boolean isEpollEnabled = Epoll.isAvailable(); + final ServerFacade server; if (TransportProtocol.TCP.equals(transportProtocol) || TransportProtocol.TLS.equals(transportProtocol)) { server = new TcpHandler(connConfig.getAddress(), connConfig.getPort(), () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactory.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactory.java index b0f15f047..372a02ff2 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactory.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactory.java @@ -80,7 +80,7 @@ public class QueueGetConfigReplyMessageFactory implements OFDeserializer propertiesList = new ArrayList<>(); while (propertiesLength > 0) { - int propertyStartIndex = input.readerIndex(); + final int propertyStartIndex = input.readerIndex(); QueuePropertyBuilder propertiesBuilder = new QueuePropertyBuilder(); QueueProperties property = QueueProperties.forValue(input.readUnsignedShort()); propertiesBuilder.setProperty(property); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java index 72e8d64c0..01708f3f1 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java @@ -41,7 +41,6 @@ public class PacketReceivedTranslator implements MessageTranslator convertor = null; - org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null; final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider(); if (extensionConvertorProvider == null) { @@ -58,10 +57,6 @@ public final class ActionExtensionHelper { convertor = extensionConvertorProvider.getActionConverter(key); } - if (convertor != null) { - alienAction = convertor.convert(action, actionPath); - } - - return alienAction; + return convertor != null ? convertor.convert(action, actionPath) : null; } } diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/MeterConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/MeterConvertor.java index 41c909b03..2e72405ff 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/MeterConvertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/MeterConvertor.java @@ -155,7 +155,6 @@ public class MeterConvertor extends Convertor bands = new ArrayList<>(); if (source instanceof AddMeterInput) { meterModInputBuilder.setCommand(MeterModCommand.OFPMCADD); @@ -182,6 +181,7 @@ public class MeterConvertor extends Convertor bands = new ArrayList<>(); getBandsFromSAL(source.getMeterBandHeaders(), bands); meterModInputBuilder.setBands(bands); } else { diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java index 7aa60281d..63aa80a6a 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java @@ -285,14 +285,13 @@ public final class IpConversionUtil { List partsV6Address = PERCENT_SPLITTER.splitToList(ipv6Address); int colonp; - char ch; boolean sawXdigit; /* Isn't it fun - the above variable names are the same in BSD and Sun sources */ char[] src = partsV6Address.get(0).toCharArray(); - byte[] dst = new byte[INADDR6SZ]; + final byte[] dst = new byte[INADDR6SZ]; colonp = -1; int index1 = 0; @@ -315,7 +314,7 @@ public final class IpConversionUtil { int srcLength = src.length; int val = 0; while (index1 < srcLength) { - ch = src[index1++]; + final char ch = src[index1++]; int chval = Character.digit(ch, 16); /* Business as usual - ipv6 address digit. @@ -444,16 +443,13 @@ public final class IpConversionUtil { int colonp; - char ch; boolean sawXdigit; /* Isn't it fun - the above variable names are the same in BSD and Sun sources */ char[] src = partsV6Prefix.get(0).toCharArray(); - byte[] dst = new byte[INADDR6SZ + 1]; - - int mask = initialMask; + final byte[] dst = new byte[INADDR6SZ + 1]; colonp = -1; int index1 = 0; @@ -473,10 +469,11 @@ public final class IpConversionUtil { int curtok = index1; sawXdigit = false; + int mask = initialMask; int srcLength = src.length; int val = 0; while (index1 < srcLength) { - ch = src[index1++]; + final char ch = src[index1++]; int chval = Character.digit(ch, 16); /* Business as usual - ipv6 address digit. diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java index 662ff0d3a..93ae5a8fb 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java @@ -65,9 +65,6 @@ public class MatchV10ResponseConvertor extends Convertor Date: Mon, 20 May 2024 17:20:45 +0200 Subject: [PATCH 04/30] Clean up dependencies a bit openflowjava artifacts have a warnigs about used undeclared dependencies, fix that up a bit. Change-Id: Ib07fcd06b58a286cc5fe180cfb29c5f358908280 Signed-off-by: Robert Varga (cherry picked from commit 597a7932a33b9c8d9e56dd7126d910b9c73b2515) --- openflowjava/openflow-protocol-api/pom.xml | 16 +++++---- openflowjava/openflow-protocol-spi/pom.xml | 38 ++++++++++++---------- openflowjava/openflowjava-util/pom.xml | 25 +++++++++++--- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/openflowjava/openflow-protocol-api/pom.xml b/openflowjava/openflow-protocol-api/pom.xml index 6b0799af0..be56b0389 100644 --- a/openflowjava/openflow-protocol-api/pom.xml +++ b/openflowjava/openflow-protocol-api/pom.xml @@ -21,12 +21,12 @@ - org.opendaylight.mdsal - yang-binding + io.netty + netty-buffer - org.opendaylight.yangtools - yang-common + org.opendaylight.mdsal + yang-binding org.opendaylight.mdsal.binding.model.ietf @@ -41,8 +41,12 @@ yang-ext - io.netty - netty-buffer + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-common diff --git a/openflowjava/openflow-protocol-spi/pom.xml b/openflowjava/openflow-protocol-spi/pom.xml index 35d281de2..8080301f5 100644 --- a/openflowjava/openflow-protocol-spi/pom.xml +++ b/openflowjava/openflow-protocol-spi/pom.xml @@ -15,28 +15,32 @@ ODL :: openflowjava :: ${project.artifactId} https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main - HEAD - - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.openflowjava.protocol.api.keys,* - - - - - + HEAD + ${project.groupId} openflow-protocol-api + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-inet-types + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.openflowjava.protocol.api.keys,* + + + + + diff --git a/openflowjava/openflowjava-util/pom.xml b/openflowjava/openflowjava-util/pom.xml index e79dabbd6..8913d8d96 100644 --- a/openflowjava/openflowjava-util/pom.xml +++ b/openflowjava/openflowjava-util/pom.xml @@ -15,14 +15,29 @@ ODL :: openflowjava :: ${project.artifactId} - - junit - junit - test - ${project.groupId} openflow-protocol-api + + com.google.guava + guava + + + io.netty + netty-buffer + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-inet-types + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-yang-types + + + org.opendaylight.yangtools + yang-common + -- 2.43.0 From 546d2650d3d89d94955110f74dfd1a39c697eff6 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 20 May 2024 18:14:58 +0200 Subject: [PATCH 05/30] Remove SwitchConnectionProviderList This is an utterly-superfluous construct. Revert to explicit injection of references and construct the argument List in openflowplugin-impl.xml. This allows us to ditch Aries-specific blueprint extension and rely on proper interfaces instead. JIRA: OPNFLWPLUG-1129 Change-Id: I093cfe3eae3067945bcdc5ea370a0e96488334b0 Signed-off-by: Robert Varga (cherry picked from commit 12e4f2ac6aa4697ec7b163dd82eb0781969be5c3) --- .../SwitchConnectionProviderList.java | 33 ------------------- .../OSGI-INF/blueprint/openflowjava.xml | 10 ------ .../impl/OpenFlowPluginProviderImpl.java | 3 +- .../blueprint/openflowplugin-impl.xml | 19 +++++++---- .../impl/OpenFlowPluginProviderImplTest.java | 5 ++- 5 files changed, 16 insertions(+), 54 deletions(-) delete mode 100644 openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProviderList.java diff --git a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProviderList.java b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProviderList.java deleted file mode 100644 index da8bf0c21..000000000 --- a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProviderList.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.spi.connection; - -import com.google.common.collect.ForwardingList; -import java.util.List; - -/** - * {@link List} of {@link SwitchConnectionProvider}. - * This is useful for strongly typed dependency injection, - * and makes it simpler to have a common single source of truth - * between Blueprint and other DI frameworks in a standalone environment. - * - * @author Michael Vorburger.ch - */ -public class SwitchConnectionProviderList extends ForwardingList { - - private final List switchConnectionProviders; - - public SwitchConnectionProviderList(List switchConnectionProviders) { - this.switchConnectionProviders = switchConnectionProviders; - } - - @Override - protected List delegate() { - return switchConnectionProviders; - } -} diff --git a/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml b/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml index 146faabec..0b8dffac6 100644 --- a/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml +++ b/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml @@ -23,14 +23,4 @@ - - - - - - - - - - diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index f5b4afd14..93ce99e6b 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -46,7 +46,6 @@ import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService; import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; -import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList; import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories; import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistory; import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider; @@ -136,7 +135,7 @@ public class OpenFlowPluginProviderImpl implements @Inject public OpenFlowPluginProviderImpl(final ConfigurationService configurationService, - final SwitchConnectionProviderList switchConnectionProviders, + final List switchConnectionProviders, final PingPongDataBroker pingPongDataBroker, final RpcProviderService rpcProviderRegistry, final NotificationPublishService notificationPublishService, diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml index 24e9cde40..0371850e2 100644 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml +++ b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml @@ -1,8 +1,7 @@ - + + + + + + @@ -55,9 +59,12 @@ - + + Date: Mon, 20 May 2024 21:19:25 +0200 Subject: [PATCH 06/30] Rewire SwitchConnectionProvider configuration Eliminate use of blueprint by replacing it with two components: OSGiFactorySwitchConnectionConfiguration populates default configuration into the datastore if not already present. OSGiSwitchConnectionProviders listens on datastore configuration and instantiates SwitchConnectionProviders based on observed configuration. JIRA: OPNFLWPLUG-1129 Change-Id: I7d762b7b07f010d37ba0590515dd30cbcfe3b479 Signed-off-by: Robert Varga (cherry picked from commit 5b685a5be740d0bda47b4d08203e099c75105ccf) --- .../core/ConnectionConfigurationImpl.java | 155 +++++++++++++++++ .../SwitchConnectionProviderFactoryImpl.java | 159 ------------------ .../core/SwitchConnectionProviderImpl.java | 24 +++ .../openflowjava-blueprint-config/pom.xml | 66 ++++++-- ...iFactorySwitchConnectionConfiguration.java | 108 ++++++++++++ .../mdsal/OSGiSwitchConnectionProviders.java | 113 +++++++++++++ .../OSGI-INF/blueprint/openflowjava.xml | 26 --- 7 files changed, 456 insertions(+), 195 deletions(-) create mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ConnectionConfigurationImpl.java create mode 100644 openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java create mode 100644 openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiSwitchConnectionProviders.java delete mode 100644 openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ConnectionConfigurationImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ConnectionConfigurationImpl.java new file mode 100644 index 000000000..45a913618 --- /dev/null +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ConnectionConfigurationImpl.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.core; + +import static java.util.Objects.requireNonNull; + +import java.net.InetAddress; +import java.util.List; +import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; +import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; +import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.Threads; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.Tls; + +final class ConnectionConfigurationImpl implements ConnectionConfiguration { + private final SwitchConnectionConfig config; + private final InetAddress address; + + ConnectionConfigurationImpl(final SwitchConnectionConfig config) { + this.config = requireNonNull(config); + final var addr = config.getAddress(); + address = addr != null ? IetfInetUtil.inetAddressFor(addr) : null; + } + + @Override + public InetAddress getAddress() { + return address; + } + + @Override + public int getPort() { + return config.getPort().toJava(); + } + + @Override + public Object getTransferProtocol() { + return config.getTransportProtocol(); + } + + @Override + public int getChannelOutboundQueueSize() { + return config.getChannelOutboundQueueSize().toJava(); + } + + @Override + public TlsConfiguration getTlsConfiguration() { + final Tls tlsConfig = config.getTls(); + if (tlsConfig == null || !TransportProtocol.TLS.equals(getTransferProtocol())) { + return null; + } + + return new TlsConfiguration() { + @Override + public KeystoreType getTlsTruststoreType() { + return requireNonNull(tlsConfig.getTruststoreType()); + } + + @Override + public String getTlsTruststore() { + return requireNonNull(tlsConfig.getTruststore()); + } + + @Override + public KeystoreType getTlsKeystoreType() { + return requireNonNull(tlsConfig.getKeystoreType()); + } + + @Override + public String getTlsKeystore() { + return requireNonNull(tlsConfig.getKeystore()); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType + getTlsKeystorePathType() { + return requireNonNull(tlsConfig.getKeystorePathType()); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType + getTlsTruststorePathType() { + return requireNonNull(tlsConfig.getTruststorePathType()); + } + + @Override + public String getKeystorePassword() { + return requireNonNull(tlsConfig.getKeystorePassword()); + } + + @Override + public String getCertificatePassword() { + return requireNonNull(tlsConfig.getCertificatePassword()); + } + + @Override + public String getTruststorePassword() { + return requireNonNull(tlsConfig.getTruststorePassword()); + } + + @Override + public List getCipherSuites() { + return tlsConfig.getCipherSuites(); + } + }; + } + + @Override + public long getSwitchIdleTimeout() { + return config.getSwitchIdleTimeout().toJava(); + } + + @Override + public Object getSslContext() { + return null; + } + + @Override + public ThreadConfiguration getThreadConfiguration() { + final Threads threads = config.getThreads(); + if (threads == null) { + return null; + } + + return new ThreadConfiguration() { + @Override + public int getWorkerThreadCount() { + return threads.getWorkerThreads().toJava(); + } + + @Override + public int getBossThreadCount() { + return threads.getBossThreads().toJava(); + } + }; + } + + @Override + public boolean useBarrier() { + return config.getUseBarrier(); + } + + @Override + public boolean isGroupAddModEnabled() { + return config.getGroupAddModEnabled(); + } +} \ No newline at end of file diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderFactoryImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderFactoryImpl.java index 7ee78a13f..cb8a963d5 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderFactoryImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderFactoryImpl.java @@ -9,23 +9,12 @@ package org.opendaylight.openflowjava.protocol.impl.core; import static java.util.Objects.requireNonNull; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; import org.opendaylight.infrautils.diagstatus.DiagStatusService; -import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; -import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; -import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderFactory; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.Threads; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.Tls; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -48,152 +37,4 @@ public class SwitchConnectionProviderFactoryImpl implements SwitchConnectionProv public SwitchConnectionProvider newInstance(final SwitchConnectionConfig config) { return new SwitchConnectionProviderImpl(diagStatus, new ConnectionConfigurationImpl(config)); } - - private static class ConnectionConfigurationImpl implements ConnectionConfiguration { - private final SwitchConnectionConfig config; - private InetAddress address; - - ConnectionConfigurationImpl(final SwitchConnectionConfig config) { - this.config = config; - - try { - address = getInetAddress(config.getAddress()); - } catch (UnknownHostException e) { - throw new IllegalStateException(e); - } - } - - @Override - public InetAddress getAddress() { - return address; - } - - @Override - public int getPort() { - return config.getPort().toJava(); - } - - @Override - public Object getTransferProtocol() { - return config.getTransportProtocol(); - } - - @Override - public int getChannelOutboundQueueSize() { - return config.getChannelOutboundQueueSize().toJava(); - } - - @Override - public TlsConfiguration getTlsConfiguration() { - final Tls tlsConfig = config.getTls(); - if (tlsConfig == null || !TransportProtocol.TLS.equals(getTransferProtocol())) { - return null; - } - - return new TlsConfiguration() { - @Override - public KeystoreType getTlsTruststoreType() { - return requireNonNull(tlsConfig.getTruststoreType()); - } - - @Override - public String getTlsTruststore() { - return requireNonNull(tlsConfig.getTruststore()); - } - - @Override - public KeystoreType getTlsKeystoreType() { - return requireNonNull(tlsConfig.getKeystoreType()); - } - - @Override - public String getTlsKeystore() { - return requireNonNull(tlsConfig.getKeystore()); - } - - @Override - public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType - getTlsKeystorePathType() { - return requireNonNull(tlsConfig.getKeystorePathType()); - } - - @Override - public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType - getTlsTruststorePathType() { - return requireNonNull(tlsConfig.getTruststorePathType()); - } - - @Override - public String getKeystorePassword() { - return requireNonNull(tlsConfig.getKeystorePassword()); - } - - @Override - public String getCertificatePassword() { - return requireNonNull(tlsConfig.getCertificatePassword()); - } - - @Override - public String getTruststorePassword() { - return requireNonNull(tlsConfig.getTruststorePassword()); - } - - @Override - public List getCipherSuites() { - return tlsConfig.getCipherSuites(); - } - }; - } - - @Override - public long getSwitchIdleTimeout() { - return config.getSwitchIdleTimeout().toJava(); - } - - @Override - public Object getSslContext() { - return null; - } - - @Override - public ThreadConfiguration getThreadConfiguration() { - final Threads threads = config.getThreads(); - if (threads == null) { - return null; - } - - return new ThreadConfiguration() { - @Override - public int getWorkerThreadCount() { - return threads.getWorkerThreads().toJava(); - } - - @Override - public int getBossThreadCount() { - return threads.getBossThreads().toJava(); - } - }; - } - - @Override - public boolean useBarrier() { - return config.getUseBarrier(); - } - - @Override - public boolean isGroupAddModEnabled() { - return config.getGroupAddModEnabled(); - } - - private static InetAddress getInetAddress(final IpAddress address) throws UnknownHostException { - if (address != null) { - if (address.getIpv4Address() != null) { - return InetAddress.getByName(address.getIpv4Address().getValue()); - } else if (address.getIpv6Address() != null) { - return InetAddress.getByName(address.getIpv6Address().getValue()); - } - } - return null; - } - } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index 78ae05324..cf7a88069 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -16,6 +16,7 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.Epoll; +import java.util.Map; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.infrautils.diagstatus.DiagStatusService; import org.opendaylight.infrautils.diagstatus.ServiceDescriptor; @@ -57,6 +58,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,11 +73,18 @@ import org.slf4j.LoggerFactory; * @author mirehak * @author michal.polkorab */ +@Component(service = SwitchConnectionProvider.class, factory = SwitchConnectionProviderImpl.FACTORY_NAME) public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, ConnectionInitializer { private static final Logger LOG = LoggerFactory.getLogger(SwitchConnectionProviderImpl.class); + private static final String THREAD_NAME_PREFIX = "OFP-SwitchConnectionProvider-Udp/TcpHandler"; private static final String OPENFLOW_JAVA_SERVICE_NAME_PREFIX = "OPENFLOW_SERVER"; + // OSGi DS Component Factory name + public static final String FACTORY_NAME = + "org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl"; + public static final String PROP_CONFIG = ".config"; + private SwitchConnectionHandler switchConnectionHandler; private ServerFacade serverFacade; private final ConnectionConfiguration connConfig; @@ -107,6 +120,17 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C deserializationFactory = new DeserializationFactory(deserializerRegistry); } + @Activate + public SwitchConnectionProviderImpl(@Reference final DiagStatusService diagStatus, + final Map props) { + this(diagStatus, new ConnectionConfigurationImpl((SwitchConnectionConfig) props.get(PROP_CONFIG))); + } + + @Deactivate + void deactivate() { + diagReg.close(); + } + // ID based, on configuration, used for diagstatus serviceIdentifier (ServiceDescriptor moduleServiceName) private static String createConnectionSuffix(final @Nullable ConnectionConfiguration config) { return config == null ? "-null-config" : "_" + config.getPort(); diff --git a/openflowjava/openflowjava-blueprint-config/pom.xml b/openflowjava/openflowjava-blueprint-config/pom.xml index 269efa84e..04e99bc42 100644 --- a/openflowjava/openflowjava-blueprint-config/pom.xml +++ b/openflowjava/openflowjava-blueprint-config/pom.xml @@ -23,18 +23,64 @@ https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main HEAD + + + + com.google.guava + guava + + + org.eclipse.jdt + org.eclipse.jdt.annotation + + + org.opendaylight.mdsal + mdsal-binding-api + + + org.opendaylight.mdsal + mdsal-common-api + + + org.opendaylight.mdsal + yang-binding + + + org.opendaylight.openflowplugin.openflowjava + openflow-protocol-api + + + org.opendaylight.openflowplugin.openflowjava + openflow-protocol-impl + + + org.opendaylight.openflowplugin.openflowjava + openflow-protocol-spi + + + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-common + + + org.osgi + org.osgi.framework + + + org.osgi + org.osgi.service.component + + + org.osgi + org.osgi.service.component.annotations + + + - - org.apache.felix - maven-bundle-plugin - true - - - * - - - org.codehaus.mojo build-helper-maven-plugin diff --git a/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java new file mode 100644 index 000000000..e56736509 --- /dev/null +++ b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.mdsal; + +import com.google.common.base.Stopwatch; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.List; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.CommitInfo; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfigBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.TlsBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A component responsible for populating default (factory) configuration. + */ +@Component(service = { }) +public final class OSGiFactorySwitchConnectionConfiguration { + private static final Logger LOG = LoggerFactory.getLogger(OSGiFactorySwitchConnectionConfiguration.class); + + @Activate + public OSGiFactorySwitchConnectionConfiguration(@Reference final DataBroker dataBroker) { + // Common for both cases + final var builder = new SwitchConnectionConfigBuilder() + .setTransportProtocol(TransportProtocol.TCP) + .setGroupAddModEnabled(Boolean.FALSE) + .setChannelOutboundQueueSize(Uint16.valueOf(1024)) + .setTls(new TlsBuilder() + .setKeystore("configuration/ssl/ctl.jks") + .setKeystoreType(KeystoreType.JKS) + .setKeystorePathType(PathType.PATH) + .setKeystorePassword("opendaylight") + .setTruststore("configuration/ssl/truststore.jks") + .setTruststoreType(KeystoreType.JKS) + .setTruststorePathType(PathType.PATH) + .setTruststorePassword("opendaylight") + .setCertificatePassword("opendaylight") + .setCipherSuites(List.of()) + .build()); + + // Create OF switch connection provider on port 6653 (default) + writeIfNotPresent(dataBroker, builder + .setInstanceName("openflow-switch-connection-provider-default-impl") + .setPort(Uint16.valueOf(6653)) + .build()); + // Create OF switch connection provider on port 6633 (legacy) + writeIfNotPresent(dataBroker, builder + .setInstanceName("openflow-switch-connection-provider-legacy-impl") + .setPort(Uint16.valueOf(6633)) + .build()); + } + + private static void writeIfNotPresent(final DataBroker dataBroker, final SwitchConnectionConfig config) { + final var instanceName = config.getInstanceName(); + LOG.info("Checking presence of configuration for {}", instanceName); + + final var sw = Stopwatch.createStarted(); + final var iid = InstanceIdentifier.builder(SwitchConnectionConfig.class, config.key()).build(); + final var tx = dataBroker.newReadWriteTransaction(); + tx.exists(LogicalDatastoreType.CONFIGURATION, iid).addCallback(new FutureCallback() { + @Override + public void onSuccess(final Boolean result) { + LOG.debug("Presence of configuration for {} ascertained in {}", instanceName, sw); + if (result) { + LOG.info("Configuration for {} already present", instanceName); + tx.cancel(); + return; + } + + tx.put(LogicalDatastoreType.CONFIGURATION, iid, config); + tx.commit().addCallback(new FutureCallback() { + @Override + public void onSuccess(final CommitInfo result) { + LOG.info("Configuration for {} set to factory-default", instanceName); + } + + @Override + public void onFailure(final Throwable cause) { + LOG.warn("Failed to set configuration for {} set to factory-default", instanceName, cause); + } + }, MoreExecutors.directExecutor()); + } + + @Override + public void onFailure(final Throwable cause) { + LOG.warn("Failed to ascertain presence of configuration for {} after {}", instanceName, sw, cause); + tx.cancel(); + } + }, MoreExecutors.directExecutor()); + } +} diff --git a/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiSwitchConnectionProviders.java b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiSwitchConnectionProviders.java new file mode 100644 index 000000000..4d7753392 --- /dev/null +++ b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiSwitchConnectionProviders.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.mdsal; + +import static java.util.Objects.requireNonNull; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.DataTreeChangeListener; +import org.opendaylight.mdsal.binding.api.DataTreeIdentifier; +import org.opendaylight.mdsal.binding.api.DataTreeModification; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl; +import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; +import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.osgi.framework.FrameworkUtil; +import org.osgi.service.component.ComponentFactory; +import org.osgi.service.component.ComponentInstance; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A component exposing {@link SwitchConnectionProvider} into OSGi service registry based on MD-SAL's configuration + * data store contents of {@link SwitchConnectionConfig}. + */ +@Component(service = { }) +public final class OSGiSwitchConnectionProviders implements DataTreeChangeListener { + private static final Logger LOG = LoggerFactory.getLogger(OSGiSwitchConnectionProviders.class); + + private final Map> instances = new HashMap<>(); + private final ComponentFactory providerFactory; + private final Registration reg; + + @Activate + public OSGiSwitchConnectionProviders(@Reference final DataBroker dataBroker, + @Reference(target = "(component.factory=" + SwitchConnectionProviderImpl.FACTORY_NAME + ")") + final ComponentFactory providerFactory) { + this.providerFactory = requireNonNull(providerFactory); + reg = dataBroker.registerTreeChangeListener(DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, + InstanceIdentifier.create(SwitchConnectionConfig.class)), this); + LOG.info("MD-SAL configuration-based SwitchConnectionProviders started"); + } + + @Deactivate + synchronized void deactivate() { + LOG.info("MD-SAL configuration-based SwitchConnectionProviders stopping"); + reg.close(); + instances.forEach((key, instance) -> instance.dispose()); + instances.clear(); + LOG.info("MD-SAL configuration-based SwitchConnectionProviders stopped"); + } + + @Override + public synchronized void onDataTreeChanged(final List> changes) { + final var apply = new HashMap(); + + for (var change : changes) { + final var root = change.getRootNode(); + switch (root.modificationType()) { + case DELETE -> apply.put(root.dataBefore().getInstanceName(), null); + case SUBTREE_MODIFIED, WRITE -> { + final var after = root.dataAfter(); + apply.put(after.getInstanceName(), after); + } + default -> LOG.warn("Ignoring unhandled root {}", root); + } + } + + LOG.debug("Applying {} changes", apply.size()); + apply.entrySet().stream() + .sorted(Comparator.comparing(Entry::getKey)) + .forEach(entry -> { + final var type = entry.getKey(); + final var prev = instances.remove(type); + if (prev != null) { + LOG.info("Stopping instance of type '{}'", type); + prev.dispose(); + } + + final var config = entry.getValue(); + if (config != null) { + LOG.info("Starting instance of type '{}'", type); + instances.put(type, providerFactory.newInstance(FrameworkUtil.asDictionary(props(type, config)))); + } + }); + } + + @Override + public void onInitialData() { + LOG.debug("No configuration is present"); + } + + private static Map props(final String type, final @Nullable SwitchConnectionConfig config) { + return config != null ? Map.of("type", type, SwitchConnectionProviderImpl.PROP_CONFIG, config) + : Map.of("type", type); + } +} diff --git a/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml b/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml deleted file mode 100644 index 0b8dffac6..000000000 --- a/openflowjava/openflowjava-blueprint-config/src/main/resources/OSGI-INF/blueprint/openflowjava.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - -- 2.43.0 From 25b2307426919a5cdf13223b02899925bf5c6045 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 20 May 2024 23:22:25 +0200 Subject: [PATCH 07/30] Hide PingPongDataBroker The ability to create merging transaction chains has long been integrated into DataBroker. Eliminate the intermediate interface capturing the DataBroker trait and turn it into an implementation detail of OpenFlowPluginProviderImpl. Change-Id: I470f85eead331b82ac3511e4669e86cbc3a34b85 Signed-off-by: Robert Varga (cherry picked from commit 847e5716480a28efb07d6e2e6a0a9f65d1123712) --- .../impl/ForwardingPingPongDataBroker.java | 40 ------------------- .../impl/OpenFlowPluginProviderImpl.java | 4 +- .../impl/PingPongDataBroker.java | 23 ++++++++++- .../blueprint/openflowplugin-impl.xml | 9 +---- 4 files changed, 25 insertions(+), 51 deletions(-) delete mode 100644 openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/ForwardingPingPongDataBroker.java diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/ForwardingPingPongDataBroker.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/ForwardingPingPongDataBroker.java deleted file mode 100644 index e6e30a0bc..000000000 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/ForwardingPingPongDataBroker.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowplugin.impl; - -import static java.util.Objects.requireNonNull; - -import org.eclipse.jdt.annotation.NonNull; -import org.opendaylight.mdsal.binding.api.DataBroker; -import org.opendaylight.mdsal.binding.api.TransactionChain; -import org.opendaylight.mdsal.binding.spi.ForwardingDataBroker; - -/** - * Delegating {@link PingPongDataBroker} implementation. - * This is useful for simple strongly typed dependency injection. - * - * @author Michael Vorburger.ch - */ -// FIXME: this should not be necessary -public class ForwardingPingPongDataBroker extends ForwardingDataBroker implements PingPongDataBroker { - private final @NonNull DataBroker delegate; - - public ForwardingPingPongDataBroker(final DataBroker delegate) { - this.delegate = requireNonNull(delegate); - } - - @Override - protected DataBroker delegate() { - return delegate; - } - - @Override - public TransactionChain createTransactionChain() { - return delegate().createMergingTransactionChain(); - } -} diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index 93ce99e6b..7f3fdd663 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -136,7 +136,7 @@ public class OpenFlowPluginProviderImpl implements @Inject public OpenFlowPluginProviderImpl(final ConfigurationService configurationService, final List switchConnectionProviders, - final PingPongDataBroker pingPongDataBroker, + final DataBroker dataBroker, final RpcProviderService rpcProviderRegistry, final NotificationPublishService notificationPublishService, final ClusterSingletonServiceProvider singletonServiceProvider, @@ -145,7 +145,7 @@ public class OpenFlowPluginProviderImpl implements final DiagStatusProvider diagStatusProvider, final SystemReadyMonitor systemReadyMonitor) { this.switchConnectionProviders = switchConnectionProviders; - dataBroker = pingPongDataBroker; + this.dataBroker = new PingPongDataBroker(dataBroker); this.rpcProviderRegistry = rpcProviderRegistry; this.notificationPublishService = notificationPublishService; singletonServicesProvider = singletonServiceProvider; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/PingPongDataBroker.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/PingPongDataBroker.java index 757a077d4..c09d30845 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/PingPongDataBroker.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/PingPongDataBroker.java @@ -7,13 +7,32 @@ */ package org.opendaylight.openflowplugin.impl; +import static java.util.Objects.requireNonNull; + +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.TransactionChain; +import org.opendaylight.mdsal.binding.spi.ForwardingDataBroker; /** - * An odl:type="pingpong" {@link DataBroker}. + * A {@link DataBroker} implementation which always creates merging transaction chains. * * @author Michael Vorburger.ch */ -public interface PingPongDataBroker extends DataBroker { +final class PingPongDataBroker extends ForwardingDataBroker { + private final @NonNull DataBroker delegate; + + PingPongDataBroker(final DataBroker delegate) { + this.delegate = requireNonNull(delegate); + } + + @Override + protected DataBroker delegate() { + return delegate; + } + @Override + public TransactionChain createTransactionChain() { + return delegate.createMergingTransactionChain(); + } } diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml index 0371850e2..ca06337d6 100644 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml +++ b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml @@ -15,7 +15,7 @@ - + @@ -52,13 +52,8 @@ - - - - - -- 2.43.0 From 266179414301025e23687449cd44c07c8a968372 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 21 May 2024 16:31:42 +0200 Subject: [PATCH 08/30] Fix MastershipChangeServiceManagerImpl services We should not be exposing AutoCloseable into OSGi SR. Fix that by explicitly listing MastershipChangeServiceManager as the sole service. Change-Id: Ib268828146aa3566d7fe96449551f1a5f221f03f Signed-off-by: Robert Varga (cherry picked from commit 2882e7c1bed136cdf8d379d4ece4d0ddf2373d36) --- .../impl/mastership/MastershipChangeServiceManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java index 06ecc97a3..a24036ce8 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java @@ -35,7 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Singleton -@Component(immediate = true) +@Component(immediate = true, service = MastershipChangeServiceManager.class) public final class MastershipChangeServiceManagerImpl implements MastershipChangeServiceManager, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(MastershipChangeServiceManagerImpl.class); -- 2.43.0 From d790db9ffe8f747103edefc00eab8028fa794642 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 21 May 2024 19:13:51 +0200 Subject: [PATCH 09/30] Use OSGi DS for MessageIntelligenceAgencyImpl Rather than using static field in OpenFlowPluginProviderImpl, make MessageIntelligenceAgencyImpl a proper singleton component and inject it where neeeded. JIRA: OPNFLWPLUG-1130 Change-Id: I1265c558fdbd4093283b356e2b469a0ed6723e68 Signed-off-by: Robert Varga (cherry picked from commit 6570baacbe3c2faee09b89d3939f6bb1441e35bb) --- .../impl/OpenFlowPluginProviderImpl.java | 53 +-------- .../impl/karaf/ClearStatsCommandProvider.java | 6 +- .../impl/karaf/ShowStatsCommandProvider.java | 6 +- .../MessageIntelligenceAgencyImpl.java | 108 +++++++++++------- .../MessageIntelligenceAgencyMXBean.java | 3 +- .../blueprint/openflowplugin-impl.xml | 3 + .../impl/OpenFlowPluginProviderImplTest.java | 16 +-- .../karaf/ClearStatsCommandProviderTest.java | 34 +++--- .../karaf/ShowStatsCommandProviderTest.java | 30 +++-- 9 files changed, 119 insertions(+), 140 deletions(-) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index 7f3fdd663..bc59a9910 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -15,7 +15,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import io.netty.util.HashedWheelTimer; import io.netty.util.Timer; -import java.lang.management.ManagementFactory; import java.util.Collection; import java.util.List; import java.util.Map; @@ -30,13 +29,6 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; import javax.inject.Singleton; -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanRegistrationException; -import javax.management.MBeanServer; -import javax.management.MalformedObjectNameException; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; import org.opendaylight.infrautils.diagstatus.ServiceState; import org.opendaylight.infrautils.ready.SystemReadyListener; import org.opendaylight.infrautils.ready.SystemReadyMonitor; @@ -72,8 +64,6 @@ import org.opendaylight.openflowplugin.impl.protocol.serialization.SerializerInj import org.opendaylight.openflowplugin.impl.role.RoleManagerImpl; import org.opendaylight.openflowplugin.impl.rpc.RpcManagerImpl; import org.opendaylight.openflowplugin.impl.statistics.StatisticsManagerImpl; -import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyImpl; -import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyMXBean; import org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor; import org.opendaylight.openflowplugin.impl.util.TranslatorLibraryUtil; import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterManagerImpl; @@ -98,12 +88,8 @@ public class OpenFlowPluginProviderImpl implements private static final long TICK_DURATION = 10; private static final String POOL_NAME = "ofppool"; - private static final MessageIntelligenceAgency MESSAGE_INTELLIGENCE_AGENCY = new MessageIntelligenceAgencyImpl(); - private static final String MESSAGE_INTELLIGENCE_AGENCY_MX_BEAN_NAME = String - .format("%s:type=%s", - MessageIntelligenceAgencyMXBean.class.getPackage().getName(), - MessageIntelligenceAgencyMXBean.class.getSimpleName()); - + // TODO: Split this out into a separate component, which requires proper timer cancellation from all users. But is + // that worth the complications? private final HashedWheelTimer hashedWheelTimer = new HashedWheelTimer(TICK_DURATION, TimeUnit.MILLISECONDS, TICKS_PER_WHEEL); private final NotificationPublishService notificationPublishService; @@ -124,15 +110,12 @@ public class OpenFlowPluginProviderImpl implements private ConnectionManager connectionManager; private ExecutorService executorService; private ContextChainHolderImpl contextChainHolder; + private final MessageIntelligenceAgency messageIntelligenceAgency; private final DiagStatusProvider diagStatusProvider; private final SystemReadyMonitor systemReadyMonitor; private final SettableFuture fullyStarted = SettableFuture.create(); private static final String OPENFLOW_SERVICE_NAME = "OPENFLOW"; - public static MessageIntelligenceAgency getMessageIntelligenceAgency() { - return MESSAGE_INTELLIGENCE_AGENCY; - } - @Inject public OpenFlowPluginProviderImpl(final ConfigurationService configurationService, final List switchConnectionProviders, @@ -142,6 +125,7 @@ public class OpenFlowPluginProviderImpl implements final ClusterSingletonServiceProvider singletonServiceProvider, final EntityOwnershipService entityOwnershipService, final MastershipChangeServiceManager mastershipChangeServiceManager, + final MessageIntelligenceAgency messageIntelligenceAgency, final DiagStatusProvider diagStatusProvider, final SystemReadyMonitor systemReadyMonitor) { this.switchConnectionProviders = switchConnectionProviders; @@ -155,6 +139,7 @@ public class OpenFlowPluginProviderImpl implements deviceInitializerProvider = DeviceInitializerProviderFactory.createDefaultProvider(); config = new OpenFlowProviderConfigImpl(configurationService); this.mastershipChangeServiceManager = mastershipChangeServiceManager; + this.messageIntelligenceAgency = messageIntelligenceAgency; this.diagStatusProvider = diagStatusProvider; this.systemReadyMonitor = systemReadyMonitor; } @@ -227,8 +212,6 @@ public class OpenFlowPluginProviderImpl implements @Override @PostConstruct public void initialize() { - registerMXBean(MESSAGE_INTELLIGENCE_AGENCY, MESSAGE_INTELLIGENCE_AGENCY_MX_BEAN_NAME); - // TODO: copied from OpenFlowPluginProvider (Helium) misusesing the old way of distributing extension converters // TODO: rewrite later! OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterManager); @@ -245,7 +228,7 @@ public class OpenFlowPluginProviderImpl implements deviceManager = new DeviceManagerImpl( config, dataBroker, - getMessageIntelligenceAgency(), + messageIntelligenceAgency, notificationPublishService, hashedWheelTimer, convertorManager, @@ -325,7 +308,6 @@ public class OpenFlowPluginProviderImpl implements gracefulShutdown(roleManager); gracefulShutdown(executorService); gracefulShutdown(hashedWheelTimer); - unregisterMXBean(MESSAGE_INTELLIGENCE_AGENCY_MX_BEAN_NAME); diagStatusProvider.reportStatus(ServiceState.UNREGISTERED); try { if (connectionManager != null) { @@ -368,28 +350,5 @@ public class OpenFlowPluginProviderImpl implements } } - private static void registerMXBean(final Object bean, final String beanName) { - final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - - try { - mbs.registerMBean(bean, new ObjectName(beanName)); - } catch (MalformedObjectNameException - | NotCompliantMBeanException - | MBeanRegistrationException - | InstanceAlreadyExistsException e) { - LOG.warn("Error registering MBean {}", beanName, e); - } - } - - private static void unregisterMXBean(final String beanName) { - final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - try { - mbs.unregisterMBean(new ObjectName(beanName)); - } catch (InstanceNotFoundException - | MBeanRegistrationException - | MalformedObjectNameException e) { - LOG.warn("Error unregistering MBean {}", beanName, e); - } - } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java index 5dcc22613..86aa56274 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java @@ -9,18 +9,18 @@ package org.opendaylight.openflowplugin.impl.karaf; import java.io.PrintStream; +import org.apache.karaf.shell.api.action.lifecycle.Reference; import org.apache.karaf.shell.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; -import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl; @Command(scope = "ofp", name = "clearStats", description = "Clear openflow statistics.") public class ClearStatsCommandProvider extends OsgiCommandSupport { + @Reference + MessageIntelligenceAgency messageIntelligenceAgency; @Override protected Object doExecute() { - final MessageIntelligenceAgency messageIntelligenceAgency = - OpenFlowPluginProviderImpl.getMessageIntelligenceAgency(); messageIntelligenceAgency.resetStatistics(); PrintStream out = session.getConsole(); out.print("Openflow plugin statistics cleaned.\n"); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java index 3d8307e6c..4042b4cea 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java @@ -10,19 +10,19 @@ package org.opendaylight.openflowplugin.impl.karaf; import java.io.PrintStream; import java.util.List; +import org.apache.karaf.shell.api.action.lifecycle.Reference; import org.apache.karaf.shell.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; -import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl; @Command(scope = "ofp", name = "showStats", description = "Show openflow statistics.") public class ShowStatsCommandProvider extends OsgiCommandSupport { + @Reference + MessageIntelligenceAgency messageIntelligenceAgency; @Override protected Object doExecute() { PrintStream out = session.getConsole(); - final MessageIntelligenceAgency messageIntelligenceAgency = - OpenFlowPluginProviderImpl.getMessageIntelligenceAgency(); final List statistics = messageIntelligenceAgency.provideIntelligence(); final StringBuilder result = new StringBuilder(); for (String line : statistics) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java index 866882251..732240f3d 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java @@ -9,14 +9,25 @@ package org.opendaylight.openflowplugin.impl.statistics.ofpspecific; import static java.util.Objects.requireNonNull; +import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicLongFieldUpdater; +import javax.annotation.PreDestroy; +import javax.inject.Inject; +import javax.inject.Singleton; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanRegistrationException; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,9 +36,23 @@ import org.slf4j.LoggerFactory; * {@link org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency}. * Class counts message of {@link StatisticsGroup} type and provides info as debug log. */ -public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, MessageIntelligenceAgencyMXBean { +@Singleton +@Component(immediate = true, service = MessageIntelligenceAgency.class) +public final class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(MessageIntelligenceAgencyImpl.class); + private static final ObjectName MXBEAN_OBJECT_NAME; + + static { + try { + MXBEAN_OBJECT_NAME = new ObjectName("%s:type=%s".formatted( + MessageIntelligenceAgencyMXBean.class.getPackage().getName(), + MessageIntelligenceAgencyMXBean.class.getSimpleName())); + } catch (MalformedObjectNameException e) { + throw new ExceptionInInitializerError(e); + } + } + private static final class MessageCounters { private static final AtomicLongFieldUpdater UPDATER = AtomicLongFieldUpdater.newUpdater(MessageCounters.class, "current"); @@ -50,8 +75,38 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, } } - private ConcurrentMap, MessageCounters>> inputStats = - new ConcurrentHashMap<>(); + private final Map, MessageCounters>> inputStats = new ConcurrentHashMap<>(); + + private boolean runUnreg; + + @Inject + @Activate + public MessageIntelligenceAgencyImpl() { + try { + ManagementFactory.getPlatformMBeanServer() + .registerMBean((MessageIntelligenceAgencyMXBean) this::provideIntelligence, MXBEAN_OBJECT_NAME); + runUnreg = true; + LOG.info("Registered MBean {}", MXBEAN_OBJECT_NAME); + } catch (NotCompliantMBeanException | MBeanRegistrationException | InstanceAlreadyExistsException e) { + LOG.warn("Error registering MBean {}", MXBEAN_OBJECT_NAME, e); + runUnreg = false; + } + } + + @PreDestroy + @Deactivate + @Override + public void close() { + if (runUnreg) { + runUnreg = false; + try { + ManagementFactory.getPlatformMBeanServer().unregisterMBean(MXBEAN_OBJECT_NAME); + LOG.info("Unregistered MBean {}", MXBEAN_OBJECT_NAME); + } catch (InstanceNotFoundException | MBeanRegistrationException e) { + LOG.warn("Error unregistering MBean {}", MXBEAN_OBJECT_NAME, e); + } + } + } @Override public void spyMessage(final Class message, final StatisticsGroup statGroup) { @@ -66,41 +121,16 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, * @return corresponding counter */ private MessageCounters getCounters(final Class message, final StatisticsGroup statGroup) { - ConcurrentMap, MessageCounters> groupData = getOrCreateGroupData(statGroup); - MessageCounters counters = getOrCreateCountersPair(message, groupData); - return counters; - } - - private static MessageCounters getOrCreateCountersPair(final Class msgType, - final ConcurrentMap, MessageCounters> groupData) { - final MessageCounters lookup = groupData.get(msgType); - if (lookup != null) { - return lookup; - } - - final MessageCounters newCounters = new MessageCounters(); - final MessageCounters check = groupData.putIfAbsent(msgType, newCounters); - return check == null ? newCounters : check; - - } - - private ConcurrentMap, MessageCounters> getOrCreateGroupData(final StatisticsGroup statGroup) { - final ConcurrentMap, MessageCounters> lookup = inputStats.get(statGroup); - if (lookup != null) { - return lookup; - } - - final ConcurrentMap, MessageCounters> newmap = new ConcurrentHashMap<>(); - final ConcurrentMap, MessageCounters> check = inputStats.putIfAbsent(statGroup, newmap); - - return check == null ? newmap : check; + return inputStats + .computeIfAbsent(statGroup, key -> new ConcurrentHashMap<>()) + .computeIfAbsent(message, key -> new MessageCounters()); } @Override public void run() { // log current counters and cleans it if (LOG.isDebugEnabled()) { - for (String counterItem : provideIntelligence()) { + for (var counterItem : provideIntelligence()) { LOG.debug("Counter: {}", counterItem); } } @@ -108,12 +138,12 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, @Override public List provideIntelligence() { - List dump = new ArrayList<>(); + final var dump = new ArrayList(); - for (StatisticsGroup statGroup : StatisticsGroup.values()) { - Map, MessageCounters> groupData = inputStats.get(statGroup); + for (var statGroup : StatisticsGroup.values()) { + final var groupData = inputStats.get(statGroup); if (groupData != null) { - for (Entry, MessageCounters> statEntry : groupData.entrySet()) { + for (var statEntry : groupData.entrySet()) { long amountPerInterval = statEntry.getValue().accumulate(); long cumulativeAmount = statEntry.getValue().getCumulative(); dump.add(String.format("%s: MSG[%s] -> +%d | %d", @@ -130,6 +160,6 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, @Override public void resetStatistics() { - inputStats = new ConcurrentHashMap<>(); + inputStats.clear(); } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyMXBean.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyMXBean.java index bf8602739..6ffd0da38 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyMXBean.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyMXBean.java @@ -5,14 +5,15 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.statistics.ofpspecific; import java.util.List; +import javax.management.MXBean; /** * Created by Martin Bobak <mbobak@cisco.com> on 11.5.2015. */ +@MXBean public interface MessageIntelligenceAgencyMXBean { List provideIntelligence(); diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml index ca06337d6..c4bf38f24 100644 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml +++ b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml @@ -21,6 +21,7 @@ + @@ -74,4 +75,6 @@ interface="org.opendaylight.infrautils.ready.SystemReadyMonitor"/> + diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index 3be51d33c..cba8d9b03 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -31,48 +31,39 @@ import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionPro import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty; import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService; import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager; +import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.common.Uint32; @RunWith(MockitoJUnitRunner.class) public class OpenFlowPluginProviderImplTest { - @Mock PingPongDataBroker dataBroker; - @Mock RpcProviderService rpcProviderRegistry; - @Mock NotificationPublishService notificationPublishService; - @Mock DiagStatusProvider ofPluginDiagstatusProvider; - @Mock SystemReadyMonitor systemReadyMonitor; - @Mock WriteTransaction writeTransaction; - @Mock EntityOwnershipService entityOwnershipService; - @Mock Registration entityOwnershipListenerRegistration; - @Mock SwitchConnectionProvider switchConnectionProvider; - @Mock ClusterSingletonServiceProvider clusterSingletonServiceProvider; - @Mock ConfigurationService configurationService; - @Mock MastershipChangeServiceManager mastershipChangeServiceManager; + @Mock + MessageIntelligenceAgency messageIntelligenceAgency; private static final Uint16 THREAD_POOL_MIN_THREADS = Uint16.ONE; private static final Uint16 THREAD_POOL_MAX_THREADS = Uint16.valueOf(32000); @@ -114,6 +105,7 @@ public class OpenFlowPluginProviderImplTest { clusterSingletonServiceProvider, entityOwnershipService, mastershipChangeServiceManager, + messageIntelligenceAgency, ofPluginDiagstatusProvider, systemReadyMonitor); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java index f6bd07f75..3d2443629 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java @@ -5,42 +5,41 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import java.util.function.Function; import org.junit.After; -import org.junit.Assert; import org.junit.Test; -import org.mockito.Mockito; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; -import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl; +import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyImpl; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; /** * Test for {@link ClearStatsCommandProvider}. */ public class ClearStatsCommandProviderTest extends AbstractKarafTest { - - private ClearStatsCommandProvider clearStatsCommandProvider; private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); - private MessageIntelligenceAgency mi5; + + private final MessageIntelligenceAgency mi5 = new MessageIntelligenceAgencyImpl(); + private final ClearStatsCommandProvider clearStatsCommandProvider = new ClearStatsCommandProvider(); @Override public void doSetUp() { - clearStatsCommandProvider = new ClearStatsCommandProvider(); - mi5 = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency(); - mi5.resetStatistics(); - Mockito.when(cmdSession.getConsole()).thenReturn(console); + clearStatsCommandProvider.messageIntelligenceAgency = mi5; + when(cmdSession.getConsole()).thenReturn(console); } @After public void tearDown() { - Mockito.verify(console).print(anyString()); + verify(console).print(anyString()); mi5.resetStatistics(); } @@ -49,10 +48,10 @@ public class ClearStatsCommandProviderTest extends AbstractKarafTest { */ @Test public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); clearStatsCommandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); } /** @@ -60,12 +59,11 @@ public class ClearStatsCommandProviderTest extends AbstractKarafTest { */ @Test public void testDoExecute_dirty() throws Exception { - mi5 = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency(); - Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); mi5.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH); - Assert.assertFalse(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertFalse(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); clearStatsCommandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); } } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java index f9bb9763b..c7b517c05 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java @@ -8,40 +8,38 @@ package org.opendaylight.openflowplugin.impl.karaf; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.matches; +import static org.mockito.Mockito.verify; import java.util.function.Function; import org.junit.After; -import org.junit.Assert; import org.junit.Test; -import org.mockito.Mockito; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; -import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl; +import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyImpl; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; /** * Test for {@link ShowStatsCommandProvider}. */ public class ShowStatsCommandProviderTest extends AbstractKarafTest { - - private ShowStatsCommandProvider showStatsCommandProvider; - private MessageIntelligenceAgency messageIntelligenceAgency; + private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl(); + private final ShowStatsCommandProvider showStatsCommandProvider = new ShowStatsCommandProvider(); private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); @Override public void doSetUp() { - showStatsCommandProvider = new ShowStatsCommandProvider(); - messageIntelligenceAgency = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency(); - messageIntelligenceAgency.resetStatistics(); + showStatsCommandProvider.messageIntelligenceAgency = messageIntelligenceAgency; } @After public void tearDown() { // Pattern.DOTALL is set inline via "(?s)" at the beginning - Mockito.verify(console).print(matches("(?s).+")); + verify(console).print(matches("(?s).+")); messageIntelligenceAgency.resetStatistics(); } @@ -50,9 +48,9 @@ public class ShowStatsCommandProviderTest extends AbstractKarafTest { */ @Test public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); showStatsCommandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); } /** @@ -60,14 +58,12 @@ public class ShowStatsCommandProviderTest extends AbstractKarafTest { */ @Test public void testDoExecute_dirty() throws Exception { - Assert.assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); messageIntelligenceAgency.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH); - Assert.assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), - CHECK_NO_ACTIVITY_FUNCTION)); + assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); showStatsCommandProvider.execute(cmdSession); - Assert.assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), - CHECK_NO_ACTIVITY_FUNCTION)); + assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); } } -- 2.43.0 From e56621c6e607c2450796a72c99acb3f86e915fe3 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 21 May 2024 19:54:12 +0200 Subject: [PATCH 10/30] Refactor ConfigurationServiceFactoryOsgiImpl Turn this class into an OSGi DS component, renaming it to OSGiConfigurationServiceFactory -- which is a more fitting name. JIRA: OPNFLWPLUG-1131 Change-Id: I3fd3a352591bc6833a529184e4207592fb810c8f Signed-off-by: Robert Varga (cherry picked from commit 397c5f9199a2d94bd4e57d3c433f225af62307be) --- .../ConfigurationServiceFactoryImpl.java | 3 +- ...a => OSGiConfigurationServiceFactory.java} | 45 +++++++++---------- .../blueprint/openflowplugin-impl.xml | 12 ++--- 3 files changed, 25 insertions(+), 35 deletions(-) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/{ConfigurationServiceFactoryOsgiImpl.java => OSGiConfigurationServiceFactory.java} (56%) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryImpl.java index 336814874..8acf277e3 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryImpl.java @@ -27,8 +27,7 @@ public class ConfigurationServiceFactoryImpl implements ConfigurationServiceFact private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceFactoryImpl.class); @Override - public ConfigurationService newInstance( - final OpenflowProviderConfig providerConfig) { + public ConfigurationService newInstance(final OpenflowProviderConfig providerConfig) { return new ConfigurationServiceImpl(providerConfig); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryOsgiImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/OSGiConfigurationServiceFactory.java similarity index 56% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryOsgiImpl.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/OSGiConfigurationServiceFactory.java index 7f09eaba2..a4ddc6ce2 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryOsgiImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/OSGiConfigurationServiceFactory.java @@ -7,47 +7,51 @@ */ package org.opendaylight.openflowplugin.impl.configuration; +import static java.util.Objects.requireNonNull; + +import com.google.common.collect.Maps; import java.io.IOException; -import java.util.Dictionary; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService; +import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationServiceFactory; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.cm.Configuration; import org.osgi.service.cm.ConfigurationAdmin; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -// NOT @Singleton @Service - we do not want this OSGi specific implementation to be auto-discovered in a standalone env -public class ConfigurationServiceFactoryOsgiImpl extends ConfigurationServiceFactoryImpl { - private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceFactoryOsgiImpl.class); +@Component(service = ConfigurationServiceFactory.class) +public final class OSGiConfigurationServiceFactory extends ConfigurationServiceFactoryImpl { + private static final Logger LOG = LoggerFactory.getLogger(OSGiConfigurationServiceFactory.class); private final BundleContext bundleContext; - public ConfigurationServiceFactoryOsgiImpl(final BundleContext bundleContext) { - this.bundleContext = bundleContext; + @Activate + public OSGiConfigurationServiceFactory(final BundleContext bundleContext) { + this.bundleContext = requireNonNull(bundleContext); } @Override public ConfigurationService newInstance(final OpenflowProviderConfig providerConfig) { - ConfigurationService cs = super.newInstance(providerConfig); + var cs = super.newInstance(providerConfig); update(cs); return cs; } private void update(final ConfigurationService configurationService) { LOG.info("Loading configuration from '{}' configuration file", OFConstants.CONFIG_FILE_ID); - final ServiceReference serviceReference = - bundleContext.getServiceReference(ConfigurationAdmin.class); + final var serviceReference = bundleContext.getServiceReference(ConfigurationAdmin.class); if (serviceReference == null) { + LOG.debug("No Configuration Admin Service available"); return; } - final ConfigurationAdmin configurationAdmin = bundleContext.getService(serviceReference); + final var configurationAdmin = bundleContext.getService(serviceReference); if (configurationAdmin == null) { + LOG.debug("Failed to get Configuration Admin Service from {}", serviceReference); return; } @@ -60,18 +64,9 @@ public class ConfigurationServiceFactoryOsgiImpl extends ConfigurationServiceFac return; } - final Dictionary properties = configuration.getProperties(); + final var properties = configuration.getProperties(); if (properties != null) { - final Enumeration keys = properties.keys(); - final Map mapProperties = new HashMap<>(properties.size()); - - while (keys.hasMoreElements()) { - final String key = keys.nextElement(); - final String value = properties.get(key).toString(); - mapProperties.put(key, value); - } - - configurationService.update(mapProperties); + configurationService.update(Maps.transformValues(FrameworkUtil.asMap(properties), Object::toString)); } } finally { bundleContext.ungetService(serviceReference); diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml index c4bf38f24..3e5078e05 100644 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml +++ b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml @@ -33,6 +33,8 @@ + - - - - - @@ -77,4 +71,6 @@ interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/> + -- 2.43.0 From 1d3367406e678d82c5048b36b81484b17ba0826b Mon Sep 17 00:00:00 2001 From: Ruslan Kashapov Date: Tue, 12 Mar 2024 17:29:03 +0200 Subject: [PATCH 11/30] Eliminate blueprint for openflowplugins-impl karaf commands Karaf commands are refactored to use Karaf-4 new-style definitions. We do not use karaf-services-maven-plugin, as we justs need the Karaf-Commands directive and not all the complexity it brings to the table. While we are touching tests, convert them to JUnit5. JIRA: OPNFLWPLUG-1127 Change-Id: Ie9092226457c40f6d0fcd22c39657875b70e8975 Signed-off-by: Ruslan Kashapov Signed-off-by: Robert Varga (cherry picked from commit 6d7be341aa04f534b1cb0180336931aed6028cab) --- openflowplugin-impl/pom.xml | 82 +++++++++---------- .../impl/karaf/ClearStatsCommandProvider.java | 18 ++-- .../karaf/ResetEventTimesComandProvider.java | 19 +++-- .../ResetSessionStatsComandProvider.java | 19 +++-- .../karaf/ShowEventTimesComandProvider.java | 27 +++--- .../ShowSessionStatsCommandProvider.java | 27 +++--- .../impl/karaf/ShowStatsCommandProvider.java | 26 +++--- .../resources/OSGI-INF/blueprint/commands.xml | 31 ------- .../impl/karaf/AbstractKarafTest.java | 52 +++++++----- .../karaf/ClearStatsCommandProviderTest.java | 54 ++++++------ .../ResetEventTimesComandProviderTest.java | 50 +++++------ .../ResetSessionStatsComandProviderTest.java | 48 +++++------ .../ShowEventTimesComandProviderTest.java | 54 ++++++------ .../ShowSessionStatsCommandProviderTest.java | 55 ++++++------- .../karaf/ShowStatsCommandProviderTest.java | 51 ++++++------ 15 files changed, 275 insertions(+), 338 deletions(-) delete mode 100644 openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/commands.xml diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index 8cb244cb1..9e40b2275 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -13,12 +13,32 @@ - org.osgi - org.osgi.framework + com.github.spotbugs + spotbugs-annotations + true - org.osgi - org.osgi.service.cm + com.google.guava + guava + + + com.guicedee.services + javax.inject + true + + + jakarta.annotation + jakarta.annotation-api + true + + + org.apache.commons + commons-lang3 + + + org.apache.karaf.shell + org.apache.karaf.shell.core + provided org.opendaylight.openflowplugin @@ -32,6 +52,10 @@ org.opendaylight.openflowplugin openflowplugin-extension-api + + org.opendaylight.openflowplugin + openflowplugin-common + org.opendaylight.openflowplugin.model model-flow-base @@ -73,54 +97,25 @@ openflow-protocol-spi - org.apache.karaf.shell - org.apache.karaf.shell.console - provided - - - com.google.guava - guava - - - org.apache.commons - commons-lang3 + ${project.groupId}.openflowjava + openflowjava-util - jakarta.annotation - jakarta.annotation-api - true + ${project.groupId}.openflowjava + openflow-protocol-impl - com.github.spotbugs - spotbugs-annotations - true + org.osgi + org.osgi.framework - com.guicedee.services - javax.inject - true + org.osgi + org.osgi.service.cm org.osgi org.osgi.service.component.annotations - - org.slf4j - slf4j-simple - test - - - ${project.groupId}.openflowjava - openflowjava-util - - - ${project.groupId}.openflowjava - openflow-protocol-impl - - - org.opendaylight.openflowplugin - openflowplugin-common - @@ -129,6 +124,11 @@ org.apache.felix maven-bundle-plugin true + + + org.opendaylight.openflowplugin.impl.karaf + + diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java index 86aa56274..b88a5e63a 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java @@ -5,25 +5,27 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.lifecycle.Reference; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; @Command(scope = "ofp", name = "clearStats", description = "Clear openflow statistics.") -public class ClearStatsCommandProvider extends OsgiCommandSupport { +@Service +public class ClearStatsCommandProvider implements Action { + @Reference + Session session; @Reference MessageIntelligenceAgency messageIntelligenceAgency; @Override - protected Object doExecute() { + public Object execute() { messageIntelligenceAgency.resetStatistics(); - PrintStream out = session.getConsole(); - out.print("Openflow plugin statistics cleaned.\n"); + session.getConsole().println("Openflow plugin statistics cleaned."); return null; } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java index 7cd5adb3e..429858c38 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java @@ -5,25 +5,28 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** * Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015. */ @Command(scope = "ofp", name = "reset-time-counters", description = "Resets events time counters.") -public class ResetEventTimesComandProvider extends OsgiCommandSupport { +@Service +public class ResetEventTimesComandProvider implements Action { + @Reference + Session session; @Override - protected Object doExecute() { - PrintStream out = session.getConsole(); + public Object execute() { EventsTimeCounter.resetAllCounters(); - out.print("Events time counters reset.\n"); + session.getConsole().println("Events time counters reset."); return null; } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java index db383c6af..f1da8c6d1 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java @@ -5,25 +5,28 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** * Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015. */ @Command(scope = "ofp", name = "reset-session-stats", description = "Resets session statistics counters.") -public class ResetSessionStatsComandProvider extends OsgiCommandSupport { +@Service +public class ResetSessionStatsComandProvider implements Action { + @Reference + Session session; @Override - protected Object doExecute() { - PrintStream out = session.getConsole(); + public Object execute() { SessionStatistics.resetAllCounters(); - out.print("Session statistics counters reset.\n"); + session.getConsole().println("Session statistics counters reset."); return null; } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java index 137485780..99b7a0d4b 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java @@ -5,31 +5,28 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; -import java.util.List; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** * Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015. */ @Command(scope = "ofp", name = "show-time-counters", description = "Shows time counts for events.") -public class ShowEventTimesComandProvider extends OsgiCommandSupport { +@Service +public class ShowEventTimesComandProvider implements Action { + @Reference + Session session; @Override - protected Object doExecute() { - PrintStream out = session.getConsole(); - final List statistics = EventsTimeCounter.provideTimes(); - final StringBuilder result = new StringBuilder(); - for (String line : statistics) { - result.append(line); - result.append("\n"); - } - out.print(result.toString()); + public Object execute() { + final var console = session.getConsole(); + EventsTimeCounter.provideTimes().forEach(console::println); return null; } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java index 0187ec61d..e97dcc2cf 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java @@ -5,13 +5,13 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; -import java.util.List; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** @@ -19,18 +19,15 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatis */ @Command(scope = "ofp", name = "show-session-stats", description = "Show session statistics.") -public class ShowSessionStatsCommandProvider extends OsgiCommandSupport { +@Service +public class ShowSessionStatsCommandProvider implements Action { + @Reference + Session session; @Override - protected Object doExecute() { - PrintStream out = session.getConsole(); - final List statistics = SessionStatistics.provideStatistics(); - final StringBuilder result = new StringBuilder(); - for (String line : statistics) { - result.append(line); - result.append("\n"); - } - out.print(result.toString()); + public Object execute() { + final var console = session.getConsole(); + SessionStatistics.provideStatistics().forEach(console::println); return null; } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java index 4042b4cea..37bb9f4be 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java @@ -5,31 +5,27 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import java.io.PrintStream; -import java.util.List; +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.lifecycle.Reference; -import org.apache.karaf.shell.commands.Command; -import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.api.console.Session; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; @Command(scope = "ofp", name = "showStats", description = "Show openflow statistics.") -public class ShowStatsCommandProvider extends OsgiCommandSupport { +@Service +public class ShowStatsCommandProvider implements Action { + @Reference + Session session; @Reference MessageIntelligenceAgency messageIntelligenceAgency; @Override - protected Object doExecute() { - PrintStream out = session.getConsole(); - final List statistics = messageIntelligenceAgency.provideIntelligence(); - final StringBuilder result = new StringBuilder(); - for (String line : statistics) { - result.append(line); - result.append("\n"); - } - out.print(result.toString()); + public Object execute() { + final var console = session.getConsole(); + messageIntelligenceAgency.provideIntelligence().forEach(console::println); return null; } } diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/commands.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/commands.xml deleted file mode 100644 index 0b8e99a55..000000000 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/commands.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java index d47c0e1a3..04a5c2262 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java @@ -5,42 +5,56 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.doReturn; + import java.io.PrintStream; import java.util.List; import java.util.function.Function; -import org.apache.felix.service.command.CommandSession; -import org.junit.Before; -import org.junit.runner.RunWith; +import org.apache.karaf.shell.api.console.Session; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; /** * Created by mirehak on 7/29/15. */ -@RunWith(MockitoJUnitRunner.class) -public abstract class AbstractKarafTest { +@ExtendWith(MockitoExtension.class) +abstract class AbstractKarafTest { @Mock - protected CommandSession cmdSession; + protected Session session; @Mock protected PrintStream console; - @Before - public void setUp() { - Mockito.when(cmdSession.getConsole()).thenReturn(console); - doSetUp(); + @BeforeEach + void beforeEach() { + doReturn(console).when(session).getConsole(); + doBeforeEach(); + } + + protected abstract void doBeforeEach(); + + protected static void assertNoActivity(final List allStatLines, + final Function checkFunction) { + assertTrue(checkNoActivity(allStatLines, checkFunction)); } - public abstract void doSetUp(); + protected static void assertHasActivity(final List allStatLines, + final Function checkFunction) { + assertFalse(checkNoActivity(allStatLines, checkFunction)); + } - public static boolean checkNoActivity(List allStatLines, Function checkFunction) { - boolean noActivity = true; - for (String statLine : allStatLines) { - noActivity &= checkFunction.apply(statLine); + private static boolean checkNoActivity(final List allStatLines, + final Function checkFunction) { + for (var statLine : allStatLines) { + if (!checkFunction.apply(statLine)) { + return false; + } } - return noActivity; + return true; } } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java index 3d2443629..c797fd2ec 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java @@ -7,15 +7,12 @@ */ package org.opendaylight.openflowplugin.impl.karaf; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import java.util.function.Function; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyImpl; @@ -24,46 +21,41 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 /** * Test for {@link ClearStatsCommandProvider}. */ -public class ClearStatsCommandProviderTest extends AbstractKarafTest { +class ClearStatsCommandProviderTest extends AbstractKarafTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); - private final MessageIntelligenceAgency mi5 = new MessageIntelligenceAgencyImpl(); - private final ClearStatsCommandProvider clearStatsCommandProvider = new ClearStatsCommandProvider(); + private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl(); - @Override - public void doSetUp() { - clearStatsCommandProvider.messageIntelligenceAgency = mi5; - when(cmdSession.getConsole()).thenReturn(console); - } + @InjectMocks + private ClearStatsCommandProvider clearStatsCommand; - @After - public void tearDown() { - verify(console).print(anyString()); - mi5.resetStatistics(); + @Override + protected void doBeforeEach() { + clearStatsCommand.messageIntelligenceAgency = messageIntelligenceAgency; + messageIntelligenceAgency.resetStatistics(); + assertNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ClearStatsCommandProvider#doExecute()} when no stats were touched before. + * Test for {@link ClearStatsCommandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); - clearStatsCommandProvider.execute(cmdSession); - - assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + void clearNoActivity() { + clearStatsCommand.execute(); + verify(console).println(anyString()); + assertNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ClearStatsCommandProvider#doExecute()} when stats were touched before. + * Test for {@link ClearStatsCommandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { - assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); - mi5.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH); - assertFalse(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); - - clearStatsCommandProvider.execute(cmdSession); - assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + void clearHavingActivity() { + messageIntelligenceAgency.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH); + assertHasActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); + clearStatsCommand.execute(); + verify(console).println(anyString()); + assertNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); } } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java index 02315e812..048873ae5 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java @@ -5,62 +5,54 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verify; import java.util.function.Function; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** * Test for {@link ResetEventTimesComandProvider}. */ -public class ResetEventTimesComandProviderTest extends AbstractKarafTest { - - private ResetEventTimesComandProvider resetEventTimesComandProvider; +class ResetEventTimesComandProviderTest extends AbstractKarafTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; - @Override - public void doSetUp() { - resetEventTimesComandProvider = new ResetEventTimesComandProvider(); - EventsTimeCounter.resetAllCounters(); - } + @InjectMocks + private ResetEventTimesComandProvider resetEventTimesCommand; - @After - public void tearDown() { - Mockito.verify(console).print(anyString()); + @Override + protected void doBeforeEach() { EventsTimeCounter.resetAllCounters(); + assertNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ResetEventTimesComandProvider#doExecute()} when no stats were touched before. + * Test for {@link ResetEventTimesComandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - resetEventTimesComandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); + void resetNoActivity() { + resetEventTimesCommand.execute(); + verify(console).println(anyString()); + assertNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ResetEventTimesComandProvider#doExecute()} when stats were touched before. + * Test for {@link ResetEventTimesComandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { - final EventIdentifier dummyEvent = new EventIdentifier("junit", "junitDevice"); - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - + void resetHavingActivity() { + final var dummyEvent = new EventIdentifier("junit", "junitDevice"); EventsTimeCounter.markStart(dummyEvent); EventsTimeCounter.markEnd(dummyEvent); - Assert.assertFalse(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); + assertHasActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); - resetEventTimesComandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); + resetEventTimesCommand.execute(); + verify(console).println(anyString()); + assertNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); } } \ No newline at end of file diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java index 754988938..3565fc9cb 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java @@ -5,60 +5,52 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.verify; import java.util.function.Function; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** * Test for {@link ResetSessionStatsComandProvider}. */ -public class ResetSessionStatsComandProviderTest extends AbstractKarafTest { - - private ResetSessionStatsComandProvider resetSessionStatsComandProvider; +class ResetSessionStatsComandProviderTest extends AbstractKarafTest { + @InjectMocks + private ResetSessionStatsComandProvider resetSessionStatsCommand; private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; @Override - public void doSetUp() { - resetSessionStatsComandProvider = new ResetSessionStatsComandProvider(); - SessionStatistics.resetAllCounters(); - } - - @After - public void tearDown() { - Mockito.verify(console).print(anyString()); + protected void doBeforeEach() { SessionStatistics.resetAllCounters(); + assertNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ResetSessionStatsComandProvider#doExecute()} when no stats were touched before. + * Test for {@link ResetSessionStatsComandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - resetSessionStatsComandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); + void resetNoActivity() { + resetSessionStatsCommand.execute(); + verify(console, atLeastOnce()).println(anyString()); + assertNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ResetSessionStatsComandProvider#doExecute()} when stats were touched before. + * Test for {@link ResetSessionStatsComandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { + void resetHavingActivity() { final String dummySessionId = "junitSessionId"; - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - SessionStatistics.countEvent(dummySessionId, SessionStatistics.ConnectionStatus.CONNECTION_CREATED); - Assert.assertFalse(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); + assertHasActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); - resetSessionStatsComandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); + resetSessionStatsCommand.execute(); + verify(console, atLeastOnce()).println(anyString()); + assertNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } } \ No newline at end of file diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java index 69b0704d8..2cd8b0f7e 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -7,61 +7,53 @@ */ package org.opendaylight.openflowplugin.impl.karaf; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.contains; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; import java.util.function.Function; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** * Test for {@link ShowEventTimesComandProvider}. */ -public class ShowEventTimesComandProviderTest extends AbstractKarafTest { - - private ShowEventTimesComandProvider showEventTimesComandProvider; +class ShowEventTimesComandProviderTest extends AbstractKarafTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; - @Override + @InjectMocks + private ShowEventTimesComandProvider showEventTimesCommand; - public void doSetUp() { - showEventTimesComandProvider = new ShowEventTimesComandProvider(); - EventsTimeCounter.resetAllCounters(); - } - - @After - public void tearDown() { + @Override + protected void doBeforeEach() { EventsTimeCounter.resetAllCounters(); + assertNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when no stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - showEventTimesComandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - Mockito.verify(console).print(""); + void showNoActivity() { + showEventTimesCommand.execute(); + verify(console, never()).println(anyString()); + assertNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { - final EventIdentifier dummyEvent = new EventIdentifier("junit", "junitDevice"); - Assert.assertTrue(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - + void showHavingActivity() { + final var dummyEvent = new EventIdentifier("junit", "junitDevice"); EventsTimeCounter.markStart(dummyEvent); EventsTimeCounter.markEnd(dummyEvent); - Assert.assertFalse(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); + assertHasActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION); - showEventTimesComandProvider.execute(cmdSession); - Assert.assertFalse(checkNoActivity(EventsTimeCounter.provideTimes(), CHECK_NO_ACTIVITY_FUNCTION)); - Mockito.verify(console).print(contains("junitDevice")); + showEventTimesCommand.execute(); + verify(console).println(contains("junitDevice")); } } \ No newline at end of file diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java index 557190127..72df5c1e5 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java @@ -5,62 +5,55 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.contains; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; import java.util.function.Function; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** * Test for {@link ShowSessionStatsCommandProvider}. */ -public class ShowSessionStatsCommandProviderTest extends AbstractKarafTest { - - private ShowSessionStatsCommandProvider showSessionStatsCommandProvider; +class ShowSessionStatsCommandProviderTest extends AbstractKarafTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; - @Override - - public void doSetUp() { - showSessionStatsCommandProvider = new ShowSessionStatsCommandProvider(); - SessionStatistics.resetAllCounters(); - } + @InjectMocks + private ShowSessionStatsCommandProvider showSessionStatsCommand; - @After - public void tearDown() { + @Override + protected void doBeforeEach() { SessionStatistics.resetAllCounters(); + assertNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when no stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - showSessionStatsCommandProvider.execute(cmdSession); - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - Mockito.verify(console).print(""); + void showNoActivity() { + showSessionStatsCommand.execute(); + verify(console, never()).println(anyString()); + assertNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { - final String dummySessionId = "junitSessionId"; - Assert.assertTrue(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - + void showHavingActivity() { + final var dummySessionId = "junitSessionId"; SessionStatistics.countEvent(dummySessionId, SessionStatistics.ConnectionStatus.CONNECTION_CREATED); - Assert.assertFalse(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); + assertHasActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); - showSessionStatsCommandProvider.execute(cmdSession); - Assert.assertFalse(checkNoActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION)); - Mockito.verify(console).print(contains(dummySessionId)); + showSessionStatsCommand.execute(); + verify(console, atLeastOnce()).println(contains(dummySessionId)); + assertHasActivity(SessionStatistics.provideStatistics(), CHECK_NO_ACTIVITY_FUNCTION); } } \ No newline at end of file diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java index c7b517c05..69a07f9ed 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java @@ -5,17 +5,16 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.karaf; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.matches; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import java.util.function.Function; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntelligenceAgencyImpl; @@ -24,46 +23,42 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 /** * Test for {@link ShowStatsCommandProvider}. */ -public class ShowStatsCommandProviderTest extends AbstractKarafTest { +class ShowStatsCommandProviderTest extends AbstractKarafTest { private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl(); - private final ShowStatsCommandProvider showStatsCommandProvider = new ShowStatsCommandProvider(); + + @InjectMocks + private ShowStatsCommandProvider showStatsCommand; private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); @Override - public void doSetUp() { - showStatsCommandProvider.messageIntelligenceAgency = messageIntelligenceAgency; - } - - @After - public void tearDown() { - // Pattern.DOTALL is set inline via "(?s)" at the beginning - verify(console).print(matches("(?s).+")); + protected void doBeforeEach() { + showStatsCommand.messageIntelligenceAgency = messageIntelligenceAgency; messageIntelligenceAgency.resetStatistics(); + assertNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when no stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. */ @Test - public void testDoExecute_clean() throws Exception { - assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); - showStatsCommandProvider.execute(cmdSession); - assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + void showNoActivity() { + showStatsCommand.execute(); + verify(console, never()).println(); + assertNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION); } /** - * Test for {@link ShowEventTimesComandProvider#doExecute()} when stats were touched before. + * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. */ @Test - public void testDoExecute_dirty() throws Exception { - assertTrue(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); - + void showHavingActivity() { messageIntelligenceAgency.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH); - assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + assertHasActivity(messageIntelligenceAgency.provideIntelligence(),CHECK_NO_ACTIVITY_FUNCTION); - showStatsCommandProvider.execute(cmdSession); - assertFalse(checkNoActivity(messageIntelligenceAgency.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION)); + showStatsCommand.execute(); + verify(console, atLeastOnce()).println(anyString()); + assertHasActivity(messageIntelligenceAgency.provideIntelligence(),CHECK_NO_ACTIVITY_FUNCTION); } } -- 2.43.0 From 1baa73aa7ffd8b8c82c01b9ee88f47497cc062af Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 22 May 2024 13:35:47 +0200 Subject: [PATCH 12/30] Clean up command naming Drop the 'Provider' suffix and fix typos in 'Command'. JIRA: OPNFLWPLUG-1127 Change-Id: I06e3d80920f832c7a03d360908c116e2a18c7794 Signed-off-by: Ruslan Kashapov Signed-off-by: Robert Varga (cherry picked from commit 4496c75dec71cde8cce8381e5bb666ff06d52dbc) --- ...tatsCommandProvider.java => ClearStatsCommand.java} | 2 +- ...ComandProvider.java => ResetEventTimesCommand.java} | 2 +- ...mandProvider.java => ResetSessionStatsCommand.java} | 2 +- ...sComandProvider.java => ShowEventTimesCommand.java} | 2 +- ...mmandProvider.java => ShowSessionStatsCommand.java} | 2 +- ...StatsCommandProvider.java => ShowStatsCommand.java} | 2 +- ...AbstractKarafTest.java => AbstractCommandTest.java} | 2 +- ...andProviderTest.java => ClearStatsCommandTest.java} | 10 +++++----- ...oviderTest.java => ResetEventTimesCommandTest.java} | 10 +++++----- ...iderTest.java => ResetSessionStatsCommandTest.java} | 10 +++++----- ...roviderTest.java => ShowEventTimesCommandTest.java} | 10 +++++----- ...viderTest.java => ShowSessionStatsCommandTest.java} | 10 +++++----- ...andProviderTest.java => ShowStatsCommandrTest.java} | 10 +++++----- 13 files changed, 37 insertions(+), 37 deletions(-) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ClearStatsCommandProvider.java => ClearStatsCommand.java} (95%) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ResetEventTimesComandProvider.java => ResetEventTimesCommand.java} (94%) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ResetSessionStatsComandProvider.java => ResetSessionStatsCommand.java} (94%) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ShowEventTimesComandProvider.java => ShowEventTimesCommand.java} (94%) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ShowSessionStatsCommandProvider.java => ShowSessionStatsCommand.java} (94%) rename openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/{ShowStatsCommandProvider.java => ShowStatsCommand.java} (95%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{AbstractKarafTest.java => AbstractCommandTest.java} (98%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ClearStatsCommandProviderTest.java => ClearStatsCommandTest.java} (86%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ResetEventTimesComandProviderTest.java => ResetEventTimesCommandTest.java} (82%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ResetSessionStatsComandProviderTest.java => ResetSessionStatsCommandTest.java} (82%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ShowEventTimesComandProviderTest.java => ShowEventTimesCommandTest.java} (82%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ShowSessionStatsCommandProviderTest.java => ShowSessionStatsCommandTest.java} (83%) rename openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/{ShowStatsCommandProviderTest.java => ShowStatsCommandrTest.java} (86%) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommand.java similarity index 95% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommand.java index b88a5e63a..e9e698f12 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommand.java @@ -16,7 +16,7 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Messa @Command(scope = "ofp", name = "clearStats", description = "Clear openflow statistics.") @Service -public class ClearStatsCommandProvider implements Action { +public class ClearStatsCommand implements Action { @Reference Session session; @Reference diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommand.java similarity index 94% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommand.java index 429858c38..b387147de 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommand.java @@ -19,7 +19,7 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCou */ @Command(scope = "ofp", name = "reset-time-counters", description = "Resets events time counters.") @Service -public class ResetEventTimesComandProvider implements Action { +public class ResetEventTimesCommand implements Action { @Reference Session session; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommand.java similarity index 94% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommand.java index f1da8c6d1..e8167c5ad 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommand.java @@ -19,7 +19,7 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatis */ @Command(scope = "ofp", name = "reset-session-stats", description = "Resets session statistics counters.") @Service -public class ResetSessionStatsComandProvider implements Action { +public class ResetSessionStatsCommand implements Action { @Reference Session session; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommand.java similarity index 94% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommand.java index 99b7a0d4b..22bbea3b0 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommand.java @@ -19,7 +19,7 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCou */ @Command(scope = "ofp", name = "show-time-counters", description = "Shows time counts for events.") @Service -public class ShowEventTimesComandProvider implements Action { +public class ShowEventTimesCommand implements Action { @Reference Session session; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommand.java similarity index 94% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommand.java index e97dcc2cf..94b968d62 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommand.java @@ -20,7 +20,7 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatis @Command(scope = "ofp", name = "show-session-stats", description = "Show session statistics.") @Service -public class ShowSessionStatsCommandProvider implements Action { +public class ShowSessionStatsCommand implements Action { @Reference Session session; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommand.java similarity index 95% rename from openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java rename to openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommand.java index 37bb9f4be..31daa53bf 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommand.java @@ -16,7 +16,7 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Messa @Command(scope = "ofp", name = "showStats", description = "Show openflow statistics.") @Service -public class ShowStatsCommandProvider implements Action { +public class ShowStatsCommand implements Action { @Reference Session session; @Reference diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractCommandTest.java similarity index 98% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractCommandTest.java index 04a5c2262..124ab0d3d 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractKarafTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/AbstractCommandTest.java @@ -24,7 +24,7 @@ import org.mockito.junit.jupiter.MockitoExtension; * Created by mirehak on 7/29/15. */ @ExtendWith(MockitoExtension.class) -abstract class AbstractKarafTest { +abstract class AbstractCommandTest { @Mock protected Session session; @Mock diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandTest.java similarity index 86% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandTest.java index c797fd2ec..c232e2101 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandTest.java @@ -19,16 +19,16 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntell import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; /** - * Test for {@link ClearStatsCommandProvider}. + * Test for {@link ClearStatsCommand}. */ -class ClearStatsCommandProviderTest extends AbstractKarafTest { +class ClearStatsCommandTest extends AbstractCommandTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl(); @InjectMocks - private ClearStatsCommandProvider clearStatsCommand; + private ClearStatsCommand clearStatsCommand; @Override protected void doBeforeEach() { @@ -38,7 +38,7 @@ class ClearStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ClearStatsCommandProvider#execute()} when no stats were touched before. + * Test for {@link ClearStatsCommand#execute()} when no stats were touched before. */ @Test void clearNoActivity() { @@ -48,7 +48,7 @@ class ClearStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ClearStatsCommandProvider#execute()} when stats were touched before. + * Test for {@link ClearStatsCommand#execute()} when stats were touched before. */ @Test void clearHavingActivity() { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommandTest.java similarity index 82% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommandTest.java index 048873ae5..4003ad137 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetEventTimesCommandTest.java @@ -17,13 +17,13 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Event import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** - * Test for {@link ResetEventTimesComandProvider}. + * Test for {@link ResetEventTimesCommand}. */ -class ResetEventTimesComandProviderTest extends AbstractKarafTest { +class ResetEventTimesCommandTest extends AbstractCommandTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; @InjectMocks - private ResetEventTimesComandProvider resetEventTimesCommand; + private ResetEventTimesCommand resetEventTimesCommand; @Override protected void doBeforeEach() { @@ -32,7 +32,7 @@ class ResetEventTimesComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ResetEventTimesComandProvider#execute()} when no stats were touched before. + * Test for {@link ResetEventTimesCommand#execute()} when no stats were touched before. */ @Test void resetNoActivity() { @@ -42,7 +42,7 @@ class ResetEventTimesComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ResetEventTimesComandProvider#execute()} when stats were touched before. + * Test for {@link ResetEventTimesCommand#execute()} when stats were touched before. */ @Test void resetHavingActivity() { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommandTest.java similarity index 82% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommandTest.java index 3565fc9cb..ce7c88eba 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ResetSessionStatsCommandTest.java @@ -17,11 +17,11 @@ import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** - * Test for {@link ResetSessionStatsComandProvider}. + * Test for {@link ResetSessionStatsCommand}. */ -class ResetSessionStatsComandProviderTest extends AbstractKarafTest { +class ResetSessionStatsCommandTest extends AbstractCommandTest { @InjectMocks - private ResetSessionStatsComandProvider resetSessionStatsCommand; + private ResetSessionStatsCommand resetSessionStatsCommand; private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; @Override @@ -31,7 +31,7 @@ class ResetSessionStatsComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ResetSessionStatsComandProvider#execute()} when no stats were touched before. + * Test for {@link ResetSessionStatsCommand#execute()} when no stats were touched before. */ @Test void resetNoActivity() { @@ -41,7 +41,7 @@ class ResetSessionStatsComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ResetSessionStatsComandProvider#execute()} when stats were touched before. + * Test for {@link ResetSessionStatsCommand#execute()} when stats were touched before. */ @Test void resetHavingActivity() { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommandTest.java similarity index 82% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommandTest.java index 2cd8b0f7e..38a38c9c2 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesComandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowEventTimesCommandTest.java @@ -19,13 +19,13 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Event import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter; /** - * Test for {@link ShowEventTimesComandProvider}. + * Test for {@link ShowEventTimesCommand}. */ -class ShowEventTimesComandProviderTest extends AbstractKarafTest { +class ShowEventTimesCommandTest extends AbstractCommandTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; @InjectMocks - private ShowEventTimesComandProvider showEventTimesCommand; + private ShowEventTimesCommand showEventTimesCommand; @Override protected void doBeforeEach() { @@ -34,7 +34,7 @@ class ShowEventTimesComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when no stats were touched before. */ @Test void showNoActivity() { @@ -44,7 +44,7 @@ class ShowEventTimesComandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when stats were touched before. */ @Test void showHavingActivity() { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandTest.java similarity index 83% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandTest.java index 72df5c1e5..1e24c0033 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandTest.java @@ -19,13 +19,13 @@ import org.mockito.InjectMocks; import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics; /** - * Test for {@link ShowSessionStatsCommandProvider}. + * Test for {@link ShowSessionStatsCommand}. */ -class ShowSessionStatsCommandProviderTest extends AbstractKarafTest { +class ShowSessionStatsCommandTest extends AbstractCommandTest { private static final Function CHECK_NO_ACTIVITY_FUNCTION = String::isEmpty; @InjectMocks - private ShowSessionStatsCommandProvider showSessionStatsCommand; + private ShowSessionStatsCommand showSessionStatsCommand; @Override protected void doBeforeEach() { @@ -34,7 +34,7 @@ class ShowSessionStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when no stats were touched before. */ @Test void showNoActivity() { @@ -44,7 +44,7 @@ class ShowSessionStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when stats were touched before. */ @Test void showHavingActivity() { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandrTest.java similarity index 86% rename from openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java rename to openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandrTest.java index 69a07f9ed..bc1a3fbf0 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandProviderTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ShowStatsCommandrTest.java @@ -21,13 +21,13 @@ import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.MessageIntell import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; /** - * Test for {@link ShowStatsCommandProvider}. + * Test for {@link ShowStatsCommand}. */ -class ShowStatsCommandProviderTest extends AbstractKarafTest { +class ShowStatsCommandrTest extends AbstractCommandTest { private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl(); @InjectMocks - private ShowStatsCommandProvider showStatsCommand; + private ShowStatsCommand showStatsCommand; private static final Function CHECK_NO_ACTIVITY_FUNCTION = input -> input.endsWith(": no activity detected"); @@ -40,7 +40,7 @@ class ShowStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when no stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when no stats were touched before. */ @Test void showNoActivity() { @@ -50,7 +50,7 @@ class ShowStatsCommandProviderTest extends AbstractKarafTest { } /** - * Test for {@link ShowEventTimesComandProvider#execute()} when stats were touched before. + * Test for {@link ShowEventTimesCommand#execute()} when stats were touched before. */ @Test void showHavingActivity() { -- 2.43.0 From 41e93b484243a86f71c5fe81245d17210495d3d8 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 21 May 2024 15:40:53 +0200 Subject: [PATCH 13/30] Wire OpenFlowPluginProviderImpl via OSGi DS OpenFlowPluginProviderImpl has interactions with injected SwitchConnectionProviders which get interacted with during shutdown. This is problematic if Blueprint fails to notice it is shutting down and there is no point in listening for dependencies showing up in the proxy interfaces. While the SwitchConnectionProvider lifecycle needs a deep look, take advantage of the fact that OPNFLWPLUG-1129 laid the SCR ground work and move OpenFlowPluginProviderImpl to SCR as well. This takes Blueprint out of the picture, with SCR guaranteeing we are looking at a live SwitchConnectionProvider when shutting down. Unfortunately we still have one more service in Blueprint, hence we need to manually specify Provides manifest header. That part will be addressed in a follow-up patch. JIRA: OPNFLWPLUG-1132 Change-Id: I5329c3209342f52caf7b4403f5c0bcff65c9f669 Signed-off-by: Robert Varga (cherry picked from commit 271bb499582603561140828ae2b044dba2f12a2a) --- .../api/openflow/OpenFlowPluginProvider.java | 22 -- openflowplugin-impl/pom.xml | 19 +- .../impl/OpenFlowPluginProviderImpl.java | 220 +++++++++--------- .../blueprint/openflowplugin-impl.xml | 60 +---- .../impl/OpenFlowPluginProviderImplTest.java | 26 +-- 5 files changed, 131 insertions(+), 216 deletions(-) delete mode 100644 openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java deleted file mode 100644 index 94519348f..000000000 --- a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2015, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowplugin.api.openflow; - -import org.opendaylight.mdsal.binding.api.BindingService; - -/** - * Plugin services provider. - */ -public interface OpenFlowPluginProvider extends AutoCloseable, BindingService { - - /** - * Method initializes all DeviceManager, RpcManager and related contexts. - */ - void initialize(); - -} diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index 9e40b2275..00483bcd7 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -124,10 +124,21 @@ org.apache.felix maven-bundle-plugin true - - - org.opendaylight.openflowplugin.impl.karaf - + + + org.opendaylight.openflowplugin.impl.karaf + + + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.FlowGroupCacheManager";uses:="org.opendaylight.openflowplugin.api.openflow", + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories,org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider";uses:="org.opendaylight.openflowplugin.api.openflow,org.opendaylight.openflowplugin.extension.api", + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationServiceFactory";uses:="org.opendaylight.openflowplugin.api.openflow.configuration", + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager";uses:="org.opendaylight.openflowplugin.api.openflow.mastership", + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency";uses:="org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific", + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.impl.DiagStatusProvider";uses:="org.opendaylight.openflowplugin.impl", + + osgi.service;objectClass:List<String>="org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService";uses:="org.opendaylight.openflowplugin.api.openflow.configuration" + + diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index bc59a9910..95246cc62 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -7,6 +7,8 @@ */ package org.opendaylight.openflowplugin.impl; +import static java.util.Objects.requireNonNull; + import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; @@ -15,7 +17,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import io.netty.util.HashedWheelTimer; import io.netty.util.Timer; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -25,7 +26,6 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; -import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; import javax.inject.Singleton; @@ -40,7 +40,6 @@ import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories; import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistory; -import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider; import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService; import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionManager; import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager; @@ -49,7 +48,6 @@ import org.opendaylight.openflowplugin.api.openflow.role.RoleManager; import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager; import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency; -import org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper; import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator; import org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider; import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterManager; @@ -72,16 +70,23 @@ import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorM import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicyOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Singleton -public class OpenFlowPluginProviderImpl implements - OpenFlowPluginProvider, - OpenFlowPluginExtensionRegistratorProvider, - FlowGroupInfoHistories, - SystemReadyListener { - +@Component(immediate = true, service = { + OpenFlowPluginExtensionRegistratorProvider.class, + FlowGroupInfoHistories.class +}) +public final class OpenFlowPluginProviderImpl + implements OpenFlowPluginExtensionRegistratorProvider, FlowGroupInfoHistories, SystemReadyListener, + AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderImpl.class); private static final int TICKS_PER_WHEEL = 500; // 0.5 sec. @@ -92,56 +97,106 @@ public class OpenFlowPluginProviderImpl implements // that worth the complications? private final HashedWheelTimer hashedWheelTimer = new HashedWheelTimer(TICK_DURATION, TimeUnit.MILLISECONDS, TICKS_PER_WHEEL); - private final NotificationPublishService notificationPublishService; private final ExtensionConverterManager extensionConverterManager; - private final DataBroker dataBroker; - private final Collection switchConnectionProviders; + private final List switchConnectionProviders; private final DeviceInitializerProvider deviceInitializerProvider; private final ConvertorManager convertorManager; - private final RpcProviderService rpcProviderRegistry; - private final ClusterSingletonServiceProvider singletonServicesProvider; private final OpenflowProviderConfig config; - private final EntityOwnershipService entityOwnershipService; - private final MastershipChangeServiceManager mastershipChangeServiceManager; - private DeviceManager deviceManager; - private RpcManager rpcManager; - private StatisticsManager statisticsManager; - private RoleManager roleManager; - private ConnectionManager connectionManager; - private ExecutorService executorService; - private ContextChainHolderImpl contextChainHolder; - private final MessageIntelligenceAgency messageIntelligenceAgency; + private final DeviceManager deviceManager; + private final RpcManager rpcManager; + private final StatisticsManager statisticsManager; + private final RoleManager roleManager; + private final ExecutorService executorService; + private final ContextChainHolderImpl contextChainHolder; private final DiagStatusProvider diagStatusProvider; - private final SystemReadyMonitor systemReadyMonitor; private final SettableFuture fullyStarted = SettableFuture.create(); - private static final String OPENFLOW_SERVICE_NAME = "OPENFLOW"; + + private ConnectionManager connectionManager; @Inject - public OpenFlowPluginProviderImpl(final ConfigurationService configurationService, - final List switchConnectionProviders, - final DataBroker dataBroker, - final RpcProviderService rpcProviderRegistry, - final NotificationPublishService notificationPublishService, - final ClusterSingletonServiceProvider singletonServiceProvider, - final EntityOwnershipService entityOwnershipService, - final MastershipChangeServiceManager mastershipChangeServiceManager, - final MessageIntelligenceAgency messageIntelligenceAgency, - final DiagStatusProvider diagStatusProvider, - final SystemReadyMonitor systemReadyMonitor) { - this.switchConnectionProviders = switchConnectionProviders; - this.dataBroker = new PingPongDataBroker(dataBroker); - this.rpcProviderRegistry = rpcProviderRegistry; - this.notificationPublishService = notificationPublishService; - singletonServicesProvider = singletonServiceProvider; - this.entityOwnershipService = entityOwnershipService; + @Activate + public OpenFlowPluginProviderImpl(@Reference final ConfigurationService configurationService, + @Reference(cardinality = ReferenceCardinality.AT_LEAST_ONE, policyOption = ReferencePolicyOption.GREEDY) + final List switchConnectionProviders, + @Reference final DataBroker dataBroker, @Reference final RpcProviderService rpcProviderRegistry, + @Reference final NotificationPublishService notificationPublishService, + @Reference final ClusterSingletonServiceProvider singletonServiceProvider, + @Reference final EntityOwnershipService entityOwnershipService, + @Reference final MastershipChangeServiceManager mastershipChangeServiceManager, + @Reference final MessageIntelligenceAgency messageIntelligenceAgency, + @Reference final DiagStatusProvider diagStatusProvider, + @Reference final SystemReadyMonitor systemReadyMonitor) { + config = new OpenFlowProviderConfigImpl(configurationService); + this.switchConnectionProviders = List.copyOf(switchConnectionProviders); + final var ppdb = new PingPongDataBroker(dataBroker); + this.diagStatusProvider = requireNonNull(diagStatusProvider); + convertorManager = ConvertorManagerFactory.createDefaultManager(); extensionConverterManager = new ExtensionConverterManagerImpl(); deviceInitializerProvider = DeviceInitializerProviderFactory.createDefaultProvider(); - config = new OpenFlowProviderConfigImpl(configurationService); - this.mastershipChangeServiceManager = mastershipChangeServiceManager; - this.messageIntelligenceAgency = messageIntelligenceAgency; - this.diagStatusProvider = diagStatusProvider; - this.systemReadyMonitor = systemReadyMonitor; + + // TODO: copied from OpenFlowPluginProvider (Helium) misusesing the old way of distributing extension converters + // TODO: rewrite later! + OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterManager); + + // Creates a thread pool that creates new threads as needed, but will reuse previously + // constructed threads when they are available. + // Threads that have not been used for x seconds are terminated and removed from the cache. + executorService = new ThreadPoolLoggingExecutor( + config.getThreadPoolMinThreads().toJava(), + config.getThreadPoolMaxThreads().getValue().toJava(), + config.getThreadPoolTimeout().toJava(), + TimeUnit.SECONDS, new SynchronousQueue<>(), POOL_NAME); + + final var devMgr = new DeviceManagerImpl( + config, + ppdb, + messageIntelligenceAgency, + notificationPublishService, + hashedWheelTimer, + convertorManager, + deviceInitializerProvider, + executorService); + deviceManager = devMgr; + + TranslatorLibraryUtil.injectBasicTranslatorLibrary(deviceManager, convertorManager); + devMgr.setExtensionConverterProvider(extensionConverterManager); + + rpcManager = new RpcManagerImpl( + config, + rpcProviderRegistry, + extensionConverterManager, + convertorManager, + notificationPublishService); + + statisticsManager = new StatisticsManagerImpl( + config, + rpcProviderRegistry, + convertorManager, + executorService); + + roleManager = new RoleManagerImpl(hashedWheelTimer, config, executorService); + + contextChainHolder = new ContextChainHolderImpl( + executorService, + singletonServiceProvider, + entityOwnershipService, + mastershipChangeServiceManager, + config); + + contextChainHolder.addManager(deviceManager); + contextChainHolder.addManager(statisticsManager); + contextChainHolder.addManager(rpcManager); + contextChainHolder.addManager(roleManager); + + connectionManager = new ConnectionManagerImpl(config, executorService, ppdb, notificationPublishService); + connectionManager.setDeviceConnectedHandler(contextChainHolder); + connectionManager.setDeviceDisconnectedHandler(contextChainHolder); + + deviceManager.setContextChainHolder(contextChainHolder); + deviceManager.initialize(); + systemReadyMonitor.registerListener(this); + LOG.info("registered onSystemBootReady() listener for OpenFlowPluginProvider"); } @Override @@ -209,72 +264,6 @@ public class OpenFlowPluginProviderImpl implements return listListenableFuture; } - @Override - @PostConstruct - public void initialize() { - // TODO: copied from OpenFlowPluginProvider (Helium) misusesing the old way of distributing extension converters - // TODO: rewrite later! - OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterManager); - - // Creates a thread pool that creates new threads as needed, but will reuse previously - // constructed threads when they are available. - // Threads that have not been used for x seconds are terminated and removed from the cache. - executorService = new ThreadPoolLoggingExecutor( - config.getThreadPoolMinThreads().toJava(), - config.getThreadPoolMaxThreads().getValue().toJava(), - config.getThreadPoolTimeout().toJava(), - TimeUnit.SECONDS, new SynchronousQueue<>(), POOL_NAME); - - deviceManager = new DeviceManagerImpl( - config, - dataBroker, - messageIntelligenceAgency, - notificationPublishService, - hashedWheelTimer, - convertorManager, - deviceInitializerProvider, - executorService); - - TranslatorLibraryUtil.injectBasicTranslatorLibrary(deviceManager, convertorManager); - ((ExtensionConverterProviderKeeper) deviceManager).setExtensionConverterProvider(extensionConverterManager); - - rpcManager = new RpcManagerImpl( - config, - rpcProviderRegistry, - extensionConverterManager, - convertorManager, - notificationPublishService); - - statisticsManager = new StatisticsManagerImpl( - config, - rpcProviderRegistry, - convertorManager, - executorService); - - roleManager = new RoleManagerImpl(hashedWheelTimer, config, executorService); - - contextChainHolder = new ContextChainHolderImpl( - executorService, - singletonServicesProvider, - entityOwnershipService, - mastershipChangeServiceManager, - config); - - contextChainHolder.addManager(deviceManager); - contextChainHolder.addManager(statisticsManager); - contextChainHolder.addManager(rpcManager); - contextChainHolder.addManager(roleManager); - - connectionManager = new ConnectionManagerImpl(config, executorService, dataBroker, notificationPublishService); - connectionManager.setDeviceConnectedHandler(contextChainHolder); - connectionManager.setDeviceDisconnectedHandler(contextChainHolder); - - deviceManager.setContextChainHolder(contextChainHolder); - deviceManager.initialize(); - systemReadyMonitor.registerListener(this); - LOG.info("registered onSystemBootReady() listener for OpenFlowPluginProvider"); - } - @Override public ExtensionConverterRegistrator getExtensionConverterRegistrator() { return extensionConverterManager; @@ -292,6 +281,7 @@ public class OpenFlowPluginProviderImpl implements @Override @PreDestroy + @Deactivate @SuppressWarnings("checkstyle:IllegalCatch") public void close() { try { diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml index 3e5078e05..c89df82dd 100644 --- a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml +++ b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml @@ -3,38 +3,11 @@ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true"> - - - - - - - - - - - - - - - - - - - - - - org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider - org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider - org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories - - - + + - - - - - - - - - - - - - diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index cba8d9b03..2c421e6ff 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -96,24 +96,14 @@ public class OpenFlowPluginProviderImplTest { @Test public void testInitializeAndClose() { - final OpenFlowPluginProviderImpl provider = new OpenFlowPluginProviderImpl( - configurationService, - List.of(switchConnectionProvider), - dataBroker, - rpcProviderRegistry, - notificationPublishService, - clusterSingletonServiceProvider, - entityOwnershipService, - mastershipChangeServiceManager, - messageIntelligenceAgency, - ofPluginDiagstatusProvider, - systemReadyMonitor); - - provider.initialize(); - // Calling the onSystemBootReady() callback - provider.onSystemBootReady(); - verify(switchConnectionProvider).startup(); - provider.close(); + try (var provider = new OpenFlowPluginProviderImpl(configurationService, List.of(switchConnectionProvider), + dataBroker, rpcProviderRegistry, notificationPublishService, clusterSingletonServiceProvider, + entityOwnershipService, mastershipChangeServiceManager, messageIntelligenceAgency, + ofPluginDiagstatusProvider, systemReadyMonitor)) { + // Calling the onSystemBootReady() callback + provider.onSystemBootReady(); + verify(switchConnectionProvider).startup(); + } verify(switchConnectionProvider).shutdown(); } } -- 2.43.0 From b9595ff8c27a724a8e0a61af2c23079144b0cef3 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 20 May 2024 10:53:05 +0200 Subject: [PATCH 14/30] Bump upstreams Adopt: - odlparent-13.1.2 - infrautils-6.0.8 - yangtools-13.0.5 - mdsal-13.0.3 - controller-9.0.3 - aaa-0.19.4 - netconf-7.0.5 Change-Id: I4a5ce2439d2510ec2e99d3edf95373aa68e5ae68 Signed-off-by: Robert Varga --- applications/arbitratorreconciliation/pom.xml | 2 +- applications/pom.xml | 2 +- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- .../odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 4 ++-- .../odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 6 +++--- features-aggregator/odl-openflowplugin-southbound/pom.xml | 6 +++--- features-aggregator/pom.xml | 2 +- libraries/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 8 ++++---- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- parent/pom.xml | 6 +++--- samples/pom.xml | 2 +- 37 files changed, 47 insertions(+), 47 deletions(-) diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 12c4cc287..0772b9914 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/applications/pom.xml b/applications/pom.xml index c4e07d51a..08f0de916 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 6c3a5991b..d819c71aa 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 4d4abe7a1..87319036c 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 13.0.11 + 13.1.2 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 01608b79a..53398e39d 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.11 + 13.1.2 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index ce722910a..9924abf5b 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index 6df8f8947..ae3c74674 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index aeb054506..f78e38aef 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 7cb503f41..322ad79ad 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 4.0.0 diff --git a/extension/pom.xml b/extension/pom.xml index 8d444339d..07b7208c8 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index a766b8125..e66e2f5c6 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 45c37248f..2be8024d0 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index c9a303b26..a6dfca724 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 06cf3d3d4..03d2a503e 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index 4fc580839..df5115d9a 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index 00a13122f..a2f8fca8d 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index c443d8805..ff3e7a296 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 93e4696a8..681e3308c 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index a94550bbb..8c693863d 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index 627816b1d..16b7ea946 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 3661439c1..73fe4e68d 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 24fec380f..d8c7e914d 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 312861eb5..59fcaa929 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 2ca3f1fe8..8c3b04b44 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 270410cda..73b229898 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 7.0.4 + 7.0.5 import pom diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index c6c499865..e5c2d87dc 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index f682d4256..d99a09952 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index dee0ad4c6..d15a7610c 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 @@ -21,7 +21,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.1 + 13.0.3 import pom @@ -30,7 +30,7 @@ org.opendaylight.controller controller-artifacts - 9.0.2 + 9.0.3 import pom diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index f0978c6a3..cf378a37f 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 @@ -29,14 +29,14 @@ org.opendaylight.controller controller-artifacts - 9.0.2 + 9.0.3 import pom org.opendaylight.infrautils infrautils-artifacts - 6.0.6 + 6.0.8 import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 5481e88b5..a1109001f 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/libraries/pom.xml b/libraries/pom.xml index 2fd30015e..6b7b69be0 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/model/pom.xml b/model/pom.xml index 2aaddbc22..c2c3bb3df 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index 66a3333a1..22a9d581a 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.11 + 13.1.2 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 36e700d34..3abc7324c 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.11 + 13.1.2 @@ -33,7 +33,7 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.6 + 6.0.8 import pom @@ -42,7 +42,7 @@ org.opendaylight.yangtools yangtools-artifacts - 13.0.2 + 13.0.5 import pom @@ -51,7 +51,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.1 + 13.0.3 import pom diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index ae4667326..7411beaa0 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 diff --git a/parent/pom.xml b/parent/pom.xml index d98516d79..961880cdc 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.mdsal binding-parent - 13.0.1 + 13.0.3 @@ -41,14 +41,14 @@ org.opendaylight.controller controller-artifacts - 9.0.2 + 9.0.3 pom import org.opendaylight.infrautils infrautils-artifacts - 6.0.6 + 6.0.8 pom import diff --git a/samples/pom.xml b/samples/pom.xml index 291b272d9..ad4256b0d 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.11 + 13.1.2 -- 2.43.0 From 5a64f2402b8af587dec4c692c57b44563368b463 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 23 May 2024 13:57:03 +0200 Subject: [PATCH 15/30] Change getIsOnlineFuture() return type Provising a Boolean is superfluous -- we are just reporting success/failure. Clean this up by using Void as the return type. Change-Id: I7e292941a59f255d27df25828f6848bfc6b8059e Signed-off-by: Robert Varga --- .../protocol/impl/core/OnlineProvider.java | 4 +- .../core/SwitchConnectionProviderImpl.java | 2 +- .../impl/core/TcpConnectionInitializer.java | 9 ++-- .../protocol/impl/core/TcpHandler.java | 11 ++-- .../protocol/impl/core/UdpHandler.java | 11 ++-- .../protocol/impl/core/TcpHandlerTest.java | 16 +++--- .../SwitchConnectionProviderImpl02Test.java | 21 ++++---- .../SwitchConnectionProviderImplTest.java | 15 +++--- .../impl/core/connection/UdpHandlerTest.java | 53 +++++++------------ .../connection/SwitchConnectionProvider.java | 4 +- .../impl/OpenFlowPluginProviderImpl.java | 4 +- .../impl/OpenFlowPluginProviderImplTest.java | 2 +- 12 files changed, 64 insertions(+), 88 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java index c167dfb7f..370ea160a 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java @@ -5,8 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - - package org.opendaylight.openflowjava.protocol.impl.core; import com.google.common.util.concurrent.ListenableFuture; @@ -18,5 +16,5 @@ import com.google.common.util.concurrent.ListenableFuture; */ public interface OnlineProvider { - ListenableFuture getIsOnlineFuture(); + ListenableFuture getIsOnlineFuture(); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index cf7a88069..677d0525b 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -156,7 +156,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C @Override @SuppressWarnings("checkstyle:IllegalCatch") - public ListenableFuture startup() { + public ListenableFuture startup() { LOG.debug("Startup summoned"); try { serverFacade = createAndConfigureServer(); diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java index 9e8d1fa9b..eeebdc63a 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java @@ -25,12 +25,11 @@ import org.slf4j.LoggerFactory; * @author martin.uhlir */ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitializer { - private static final Logger LOG = LoggerFactory.getLogger(TcpConnectionInitializer.class); + private final SettableFuture hasRun = SettableFuture.create(); private final EventLoopGroup workerGroup; private final boolean isEpollEnabled; - private final SettableFuture hasRun = SettableFuture.create(); private TcpChannelInitializer channelInitializer; private Bootstrap bootstrap; @@ -53,18 +52,18 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial } else { bootstrap.group(workerGroup).channel(NioSocketChannel.class).handler(channelInitializer); } - hasRun.set(true); + hasRun.set(null); } @Override public ListenableFuture shutdown() { - final SettableFuture result = SettableFuture.create(); + final var result = SettableFuture.create(); workerGroup.shutdownGracefully(); return result; } @Override - public ListenableFuture getIsOnlineFuture() { + public ListenableFuture getIsOnlineFuture() { return hasRun; } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java index 25789dcc1..7a449f158 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java @@ -48,13 +48,14 @@ public class TcpHandler implements ServerFacade { private static final Logger LOG = LoggerFactory.getLogger(TcpHandler.class); - private int port; - private String address; + private final SettableFuture isOnlineFuture = SettableFuture.create(); private final InetAddress startupAddress; private final Runnable readyRunnable; + + private int port; + private String address; private EventLoopGroup workerGroup; private EventLoopGroup bossGroup; - private final SettableFuture isOnlineFuture = SettableFuture.create(); private TcpChannelInitializer channelInitializer; @@ -136,7 +137,7 @@ public class TcpHandler implements ServerFacade { LOG.debug("address from tcphandler: {}", address); LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port); readyRunnable.run(); - isOnlineFuture.set(true); + isOnlineFuture.set(null); // This waits until this channel is closed, and rethrows the cause of the failure if this future failed. f.channel().closeFuture().sync(); @@ -174,7 +175,7 @@ public class TcpHandler implements ServerFacade { } @Override - public ListenableFuture getIsOnlineFuture() { + public ListenableFuture getIsOnlineFuture() { return isOnlineFuture; } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java index f4ad4b2e4..f3439bd8d 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java @@ -31,15 +31,14 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ public final class UdpHandler implements ServerFacade { - private static final Logger LOG = LoggerFactory.getLogger(UdpHandler.class); - private int port; - private EventLoopGroup group; + private final SettableFuture isOnlineFuture = SettableFuture.create(); private final InetAddress startupAddress; private final Runnable readyRunnable; - private final SettableFuture isOnlineFuture = SettableFuture.create(); + private int port; + private EventLoopGroup group; private UdpChannelInitializer channelInitializer; private Class datagramChannelClass; @@ -96,7 +95,7 @@ public final class UdpHandler implements ServerFacade { LOG.debug("Address from udpHandler: {}", address); LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port); readyRunnable.run(); - isOnlineFuture.set(true); + isOnlineFuture.set(null); // This waits until this channel is closed, and rethrows the cause of the failure if this future failed. f.channel().closeFuture().sync(); @@ -120,7 +119,7 @@ public final class UdpHandler implements ServerFacade { } @Override - public ListenableFuture getIsOnlineFuture() { + public ListenableFuture getIsOnlineFuture() { return isOnlineFuture; } diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java index a767bfa8c..700b376f2 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java @@ -146,14 +146,12 @@ public class TcpHandlerTest { int serverPort = 28001; Socket firstBinder = new Socket(); - try { + try (firstBinder) { firstBinder.bind(new InetSocketAddress(serverAddress, serverPort)); tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); tcpHandler.setChannelInitializer(mockChannelInitializer); tcpHandler.initiateEventLoopGroups(null, false); tcpHandler.run(); - } finally { - firstBinder.close(); } } @@ -165,7 +163,7 @@ public class TcpHandlerTest { int serverPort = 28001; Socket firstBinder = new Socket(); - try { + try (firstBinder) { firstBinder.bind(new InetSocketAddress(serverAddress, serverPort)); tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); @@ -176,8 +174,6 @@ public class TcpHandlerTest { fail("Expected BindException or Errors.NativeIoException"); } catch (BindException | Errors.NativeIoException e) { // expected - } finally { - firstBinder.close(); } } @@ -192,8 +188,8 @@ public class TcpHandlerTest { assertEquals("shutdown failed", true, shutdownRet.get()); } - private Boolean startupServer(boolean isEpollEnabled) throws InterruptedException { - ListenableFuture online = tcpHandler.getIsOnlineFuture(); + private Boolean startupServer(final boolean isEpollEnabled) throws InterruptedException { + final var online = tcpHandler.getIsOnlineFuture(); /** * Test EPoll based native transport if isEpollEnabled is true. * Else use Nio based transport. @@ -204,10 +200,10 @@ public class TcpHandlerTest { while (online.isDone() != true && retry++ < 20) { Thread.sleep(100); } - return online.isDone() ; + return online.isDone(); } - private static Boolean clientConnection(int port) throws IOException { + private static Boolean clientConnection(final int port) throws IOException { // Connect, and disconnect Socket socket = new Socket(InetAddress.getLoopbackAddress(), port); Boolean result = socket.isConnected(); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java index 035efd39a..a2b0daa16 100755 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java @@ -7,7 +7,9 @@ */ package org.opendaylight.openflowjava.protocol.impl.core.connection; -import com.google.common.util.concurrent.ListenableFuture; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + import java.net.InetAddress; import java.net.UnknownHostException; import java.util.List; @@ -36,7 +38,6 @@ import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey; import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey; import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey; import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; -import org.opendaylight.openflowjava.protocol.impl.core.ServerFacade; import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType; @@ -115,9 +116,9 @@ public class SwitchConnectionProviderImpl02Test { @Test public void testServerFacade() throws UnknownHostException { startUp(TransportProtocol.TCP); - final ListenableFuture future = provider.startup(); - final ServerFacade serverFacade = provider.getServerFacade(); - Assert.assertNotNull("Wrong -- getServerFacade return null",serverFacade); + final var future = provider.startup(); + final var serverFacade = provider.getServerFacade(); + assertNotNull("Wrong -- getServerFacade return null", serverFacade); } /** @@ -135,12 +136,10 @@ public class SwitchConnectionProviderImpl02Test { @Test public void testUnregisterWrongKeys() throws UnknownHostException { startUp(TransportProtocol.TCP); - final ExperimenterInstructionSerializerKey testSerKey - = new ExperimenterInstructionSerializerKey(EncodeConstants.OF_VERSION_1_0, 42L); - Assert.assertFalse("Wrong -- unregisterSerializer",provider.unregisterSerializer(testSerKey)); - final ExperimenterInstructionDeserializerKey tesDeserKey - = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 24L); - Assert.assertFalse("Wrong -- unregisterDeserializer",provider.unregisterDeserializer(tesDeserKey)); + final var testSerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF_VERSION_1_0, 42L); + assertFalse("Wrong -- unregisterSerializer",provider.unregisterSerializer(testSerKey)); + final var tesDeserKey = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 24L); + assertFalse("Wrong -- unregisterDeserializer",provider.unregisterDeserializer(tesDeserKey)); } /** diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java index 972970603..f5fbe8bf3 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java @@ -16,7 +16,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import com.google.common.util.concurrent.ListenableFuture; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.List; @@ -94,7 +93,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testStartup1() throws UnknownHostException { startUp(null); - final ListenableFuture future = provider.startup(); + final var future = provider.startup(); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -109,7 +108,7 @@ public class SwitchConnectionProviderImplTest { public void testStartup2() throws UnknownHostException { startUp(null); provider.setSwitchConnectionHandler(handler); - final ListenableFuture future = provider.startup(); + final var future = provider.startup(); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -123,7 +122,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testStartup3() throws UnknownHostException { startUp(TransportProtocol.TCP); - final ListenableFuture future = provider.startup(); + final var future = provider.startup(); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -139,7 +138,7 @@ public class SwitchConnectionProviderImplTest { startUp(TransportProtocol.TCP); provider.setSwitchConnectionHandler(handler); - assertTrue("Failed to start", provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); + provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -150,7 +149,7 @@ public class SwitchConnectionProviderImplTest { startUp(TransportProtocol.TLS); provider.setSwitchConnectionHandler(handler); - assertTrue("Failed to start", provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); + provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -161,7 +160,7 @@ public class SwitchConnectionProviderImplTest { startUp(TransportProtocol.UDP); provider.setSwitchConnectionHandler(handler); - assertTrue("Failed to start", provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); + provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -172,7 +171,7 @@ public class SwitchConnectionProviderImplTest { startUp(TransportProtocol.TCP); provider.setSwitchConnectionHandler(handler); - assertTrue("Failed to start", provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); + provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); assertTrue("Failed to stop", provider.shutdown().get(5 * WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); } } diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java index 871e2adf6..cb2e53fb8 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java @@ -7,12 +7,14 @@ */ package org.opendaylight.openflowjava.protocol.impl.core.connection; -import com.google.common.util.concurrent.ListenableFuture; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.net.InetAddress; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -43,13 +45,9 @@ public class UdpHandlerTest { public void testWithEmptyAddress() throws Exception { udpHandler = new UdpHandler(null, 0, () -> { }); udpHandler.setChannelInitializer(udpChannelInitializerMock); - Assert.assertTrue("Wrong - start server", startupServer(false)); - try { - Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500, TimeUnit.MILLISECONDS)); - } catch (TimeoutException e) { - Assert.fail("Wrong - getIsOnlineFuture timed out"); - } - Assert.assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); + assertTrue("Wrong - start server", startupServer(false)); + udpHandler.getIsOnlineFuture().get(1500, TimeUnit.MILLISECONDS); + assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); shutdownServer(); } @@ -60,13 +58,9 @@ public class UdpHandlerTest { public void testWithEmptyAddressOnEpoll() throws Exception { udpHandler = new UdpHandler(null, 0, () -> { }); udpHandler.setChannelInitializer(udpChannelInitializerMock); - Assert.assertTrue("Wrong - start server", startupServer(true)); - try { - Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS)); - } catch (TimeoutException e) { - Assert.fail("Wrong - getIsOnlineFuture timed out"); - } - Assert.assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); + assertTrue("Wrong - start server", startupServer(true)); + udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); + assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); shutdownServer(); } @@ -78,13 +72,9 @@ public class UdpHandlerTest { int port = 9874; udpHandler = new UdpHandler(InetAddress.getLocalHost(), port, () -> { }); udpHandler.setChannelInitializer(udpChannelInitializerMock); - Assert.assertTrue("Wrong - start server", startupServer(false)); - try { - Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS)); - } catch (TimeoutException e) { - Assert.fail("Wrong - getIsOnlineFuture timed out"); - } - Assert.assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); + assertTrue("Wrong - start server", startupServer(false)); + udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); + assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); shutdownServer(); } @@ -96,19 +86,15 @@ public class UdpHandlerTest { int port = 9874; udpHandler = new UdpHandler(InetAddress.getLocalHost(), port, () -> { }); udpHandler.setChannelInitializer(udpChannelInitializerMock); - Assert.assertTrue("Wrong - start server", startupServer(true)); - try { - Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS)); - } catch (TimeoutException e) { - Assert.fail("Wrong - getIsOnlineFuture timed out"); - } - Assert.assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); + assertTrue("Wrong - start server", startupServer(true)); + udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); + assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); shutdownServer(); } private Boolean startupServer(final boolean isEpollEnabled) throws InterruptedException, ExecutionException { - ListenableFuture online = udpHandler.getIsOnlineFuture(); + final var online = udpHandler.getIsOnlineFuture(); /** * Test EPoll based native transport if isEpollEnabled is true. * Else use Nio based transport. @@ -126,8 +112,7 @@ public class UdpHandlerTest { } private void shutdownServer() throws InterruptedException, ExecutionException, TimeoutException { - ListenableFuture shutdownRet = udpHandler.shutdown() ; - final Boolean shutdownSucceeded = shutdownRet.get(10, TimeUnit.SECONDS); - Assert.assertTrue("Wrong - shutdown failed", shutdownSucceeded); + final var shutdownRet = udpHandler.shutdown() ; + assertTrue("Wrong - shutdown failed", shutdownRet.get(10, TimeUnit.SECONDS)); } } diff --git a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java index f63e21c9e..cab8051c1 100644 --- a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java +++ b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java @@ -33,9 +33,9 @@ public interface SwitchConnectionProvider extends AutoCloseable, * Start listening to switches, but please don't forget to do * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first. * - * @return future, triggered to true, when listening channel is up and running + * @return future completing when the channel has been resolved */ - ListenableFuture startup(); + ListenableFuture startup(); /** * Stop listening to switches. diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index 95246cc62..b841e72c8 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -215,9 +215,9 @@ public final class OpenFlowPluginProviderImpl // Set handler of incoming connections and start switch connection provider switchConnectionProvider.setSwitchConnectionHandler(connectionManager); return switchConnectionProvider.startup(); - }).collect(Collectors.toSet())), new FutureCallback>() { + }).collect(Collectors.toSet())), new FutureCallback>() { @Override - public void onSuccess(final List result) { + public void onSuccess(final List result) { LOG.info("All switchConnectionProviders are up and running ({}).", result.size()); diagStatusProvider.reportStatus(ServiceState.OPERATIONAL); fullyStarted.set(null); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index 2c421e6ff..948082283 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -77,7 +77,7 @@ public class OpenFlowPluginProviderImplTest { when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); when(entityOwnershipService.registerListener(any(), any())).thenReturn(entityOwnershipListenerRegistration); - when(switchConnectionProvider.startup()).thenReturn(Futures.immediateFuture(true)); + when(switchConnectionProvider.startup()).thenReturn(Futures.immediateFuture(null)); when(switchConnectionProvider.shutdown()).thenReturn(Futures.immediateFuture(true)); when(configurationService.getProperty(eq(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString()), any())).thenReturn(USE_SINGLE_LAYER_SERIALIZATION); -- 2.43.0 From dbd582fcbf4015ed7132aca6a42a7143b38d9ac0 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 23 May 2024 11:55:09 +0200 Subject: [PATCH 16/30] Remove ServerFacade.setThreadConfig() This method is not used anywhere, remove it. Change-Id: Icf4f5202bd17b9b467857e2c3eab8080d9fb46f6 Signed-off-by: Robert Varga (cherry picked from commit 71c18a121b5f7c6aed1ffa7596490d926f5ca71c) --- .../protocol/impl/core/ServerFacade.java | 10 +--- .../core/SwitchConnectionProviderImpl.java | 56 ++++++++++--------- .../impl/core/TcpConnectionInitializer.java | 7 --- .../protocol/impl/core/TcpHandler.java | 6 -- .../protocol/impl/core/UdpHandler.java | 6 -- 5 files changed, 30 insertions(+), 55 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java index 67bb0a3d3..6a0fa1ab6 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java @@ -7,19 +7,11 @@ */ package org.opendaylight.openflowjava.protocol.impl.core; -import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; - /** * Server facade interface. * * @author mirehak */ public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable { - /** - * Sets thread configuration. - * - * @param threadConfig desired thread configuration - */ - @Deprecated(since = "0.17.2", forRemoval = true) - void setThreadConfig(ThreadConfiguration threadConfig); + } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index 677d0525b..abd3af6eb 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -7,14 +7,11 @@ */ package org.opendaylight.openflowjava.protocol.impl.core; -import static com.google.common.base.Preconditions.checkState; - import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.Epoll; import java.util.Map; import org.eclipse.jdt.annotation.Nullable; @@ -184,9 +181,15 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C private ServerFacade createAndConfigureServer() { LOG.debug("Configuring .."); - checkState(connConfig != null, "Connection not configured"); + if (connConfig == null) { + throw new IllegalStateException("Connection not configured"); + } + final var transportProtocol = (TransportProtocol) connConfig.getTransferProtocol(); + if (transportProtocol == null) { + throw new IllegalStateException("No transport protocol received in " + connConfig); + } - final ChannelInitializerFactory factory = new ChannelInitializerFactory(); + final var factory = new ChannelInitializerFactory(); factory.setSwitchConnectionHandler(switchConnectionHandler); factory.setSwitchIdleTimeout(connConfig.getSwitchIdleTimeout()); factory.setTlsConfig(connConfig.getTlsConfiguration()); @@ -194,32 +197,31 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C factory.setDeserializationFactory(deserializationFactory); factory.setUseBarrier(connConfig.useBarrier()); factory.setChannelOutboundQueueSize(connConfig.getChannelOutboundQueueSize()); - final TransportProtocol transportProtocol = (TransportProtocol) connConfig.getTransferProtocol(); // Check if Epoll native transport is available. // TODO : Add option to disable Epoll. boolean isEpollEnabled = Epoll.isAvailable(); - final ServerFacade server; - if (TransportProtocol.TCP.equals(transportProtocol) || TransportProtocol.TLS.equals(transportProtocol)) { - server = new TcpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); - final TcpChannelInitializer channelInitializer = factory.createPublishingChannelInitializer(); - ((TcpHandler) server).setChannelInitializer(channelInitializer); - ((TcpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); - final EventLoopGroup workerGroupFromTcpHandler = ((TcpHandler) server).getWorkerGroup(); - connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, isEpollEnabled); - connectionInitializer.setChannelInitializer(channelInitializer); - connectionInitializer.run(); - } else if (TransportProtocol.UDP.equals(transportProtocol)) { - server = new UdpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); - ((UdpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); - ((UdpHandler) server).setChannelInitializer(factory.createUdpChannelInitializer()); - } else { - throw new IllegalStateException("Unknown transport protocol received: " + transportProtocol); - } - server.setThreadConfig(connConfig.getThreadConfiguration()); - return server; + return switch (transportProtocol) { + case TCP, TLS -> { + final var tcpHandler = new TcpHandler(connConfig.getAddress(), connConfig.getPort(), + () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); + final var channelInitializer = factory.createPublishingChannelInitializer(); + tcpHandler.setChannelInitializer(channelInitializer); + tcpHandler.initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); + final var workerGroupFromTcpHandler = tcpHandler.getWorkerGroup(); + connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, isEpollEnabled); + connectionInitializer.setChannelInitializer(channelInitializer); + connectionInitializer.run(); + yield tcpHandler; + } + case UDP -> { + final var udpHandler = new UdpHandler(connConfig.getAddress(), connConfig.getPort(), + () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); + udpHandler.initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); + udpHandler.setChannelInitializer(factory.createUdpChannelInitializer()); + yield udpHandler; + } + }; } public ServerFacade getServerFacade() { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java index eeebdc63a..354954088 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java @@ -15,7 +15,6 @@ import io.netty.bootstrap.Bootstrap; import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.EpollSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; -import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,12 +66,6 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial return hasRun; } - @Override - @Deprecated(since = "0.17.2", forRemoval = true) - public void setThreadConfig(final ThreadConfiguration threadConfig) { - // IGNORE - } - @Override public void initiateConnection(final String host, final int port) { try { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java index 7a449f158..ca797a4d1 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java @@ -191,12 +191,6 @@ public class TcpHandler implements ServerFacade { this.channelInitializer = channelInitializer; } - @Override - @Deprecated(since = "0.17.2", forRemoval = true) - public void setThreadConfig(final ThreadConfiguration threadConfig) { - // No-op - } - /** * Initiate event loop groups. * diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java index f3439bd8d..1c59efd7c 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java @@ -131,12 +131,6 @@ public final class UdpHandler implements ServerFacade { this.channelInitializer = channelInitializer; } - @Override - @Deprecated(since = "0.17.2", forRemoval = true) - public void setThreadConfig(final ThreadConfiguration threadConfig) { - // No-op - } - /** * Initiate event loop groups. * -- 2.43.0 From acb41d869c8f1e253e18b9a973cb79e4ef6228ec Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 23 May 2024 16:54:25 +0200 Subject: [PATCH 17/30] Refactor TcpConnectionInitializer TcpConnectionInitializer is *not* a ServerFacade, disconnect it from that interface and eliminate all dead code. While we are at it, make sure to define ServerFacade.run() to make it easy to see the actual implementations. Change-Id: Ied7fc8ccacadf8a27f995ebc9553b88a281f6553 Signed-off-by: Robert Varga --- .../protocol/impl/core/ServerFacade.java | 3 +- .../core/SwitchConnectionProviderImpl.java | 5 +- .../impl/core/TcpConnectionInitializer.java | 52 +++---------------- 3 files changed, 12 insertions(+), 48 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java index 6a0fa1ab6..57333a375 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java @@ -13,5 +13,6 @@ package org.opendaylight.openflowjava.protocol.impl.core; * @author mirehak */ public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable { - + @Override + void run(); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index abd3af6eb..6c12edf99 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -209,9 +209,8 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C tcpHandler.setChannelInitializer(channelInitializer); tcpHandler.initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); final var workerGroupFromTcpHandler = tcpHandler.getWorkerGroup(); - connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, isEpollEnabled); - connectionInitializer.setChannelInitializer(channelInitializer); - connectionInitializer.run(); + connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, channelInitializer, + isEpollEnabled); yield tcpHandler; } case UDP -> { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java index 354954088..727230237 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java @@ -9,8 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.core; import static java.util.Objects.requireNonNull; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; import io.netty.bootstrap.Bootstrap; import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.EpollSocketChannel; @@ -23,47 +21,17 @@ import org.slf4j.LoggerFactory; * * @author martin.uhlir */ -public class TcpConnectionInitializer implements ServerFacade, ConnectionInitializer { +final class TcpConnectionInitializer implements ConnectionInitializer { private static final Logger LOG = LoggerFactory.getLogger(TcpConnectionInitializer.class); - private final SettableFuture hasRun = SettableFuture.create(); - private final EventLoopGroup workerGroup; - private final boolean isEpollEnabled; + private final Bootstrap bootstrap; - private TcpChannelInitializer channelInitializer; - private Bootstrap bootstrap; - - /** - * Constructor. - * - * @param workerGroup - shared worker group - */ - public TcpConnectionInitializer(final EventLoopGroup workerGroup, final boolean isEpollEnabled) { - this.workerGroup = requireNonNull(workerGroup, "WorkerGroup can't be null"); - this.isEpollEnabled = isEpollEnabled; - } - - @Override - public void run() { - bootstrap = new Bootstrap(); - if (isEpollEnabled) { - bootstrap.group(workerGroup).channel(EpollSocketChannel.class).handler(channelInitializer); - } else { - bootstrap.group(workerGroup).channel(NioSocketChannel.class).handler(channelInitializer); - } - hasRun.set(null); - } - - @Override - public ListenableFuture shutdown() { - final var result = SettableFuture.create(); - workerGroup.shutdownGracefully(); - return result; - } - - @Override - public ListenableFuture getIsOnlineFuture() { - return hasRun; + TcpConnectionInitializer(final EventLoopGroup workerGroup, final TcpChannelInitializer channelInitializer, + final boolean isEpollEnabled) { + bootstrap = new Bootstrap() + .group(requireNonNull(workerGroup, "WorkerGroup cannot be null")) + .handler(channelInitializer) + .channel(isEpollEnabled ? EpollSocketChannel.class : NioSocketChannel.class); } @Override @@ -74,8 +42,4 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial LOG.error("Unable to initiate connection", e); } } - - public void setChannelInitializer(final TcpChannelInitializer channelInitializer) { - this.channelInitializer = channelInitializer; - } } -- 2.43.0 From b753a6614a2036e78f76d7c17fde521a58f887da Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 23 May 2024 18:02:32 +0200 Subject: [PATCH 18/30] Refactor SwitchConnectionProvider a bit This interface specifies AutoCloseable, which is an implementation leak from the days of Config Subsystem. Eliminate this specification and make sure the close() method performs deactivation. This is the step in the direction of having well-defined lifecycle, where the users cannot interfere with what the provider is doing. Change-Id: I1ccbb6987f21b3871d80a9da694211e3c3d19204 Signed-off-by: Robert Varga --- .../core/SwitchConnectionProviderImpl.java | 41 ++++------ .../SwitchConnectionProviderImpl02Test.java | 81 +++++++++---------- .../SwitchConnectionProviderImplTest.java | 29 +++---- .../it/integration/IntegrationTest.java | 3 +- .../connection/SwitchConnectionProvider.java | 17 +--- .../impl/OpenFlowPluginProviderImpl.java | 3 +- .../impl/OpenFlowPluginProviderImplTest.java | 4 +- 7 files changed, 74 insertions(+), 104 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index 6c12edf99..a55a638a4 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -71,7 +71,7 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ @Component(service = SwitchConnectionProvider.class, factory = SwitchConnectionProviderImpl.FACTORY_NAME) -public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, ConnectionInitializer { +public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, ConnectionInitializer, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(SwitchConnectionProviderImpl.class); private static final String THREAD_NAME_PREFIX = "OFP-SwitchConnectionProvider-Udp/TcpHandler"; @@ -82,8 +82,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C "org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl"; public static final String PROP_CONFIG = ".config"; - private SwitchConnectionHandler switchConnectionHandler; - private ServerFacade serverFacade; private final ConnectionConfiguration connConfig; private final SerializationFactory serializationFactory; private final SerializerRegistry serializerRegistry; @@ -94,6 +92,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C private final String threadName; private TcpConnectionInitializer connectionInitializer; + private ServerFacade serverFacade; // FIXME: clean this up when no longer needed private final ServiceRegistration diagReg; @@ -123,8 +122,10 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C this(diagStatus, new ConnectionConfigurationImpl((SwitchConnectionConfig) props.get(PROP_CONFIG))); } + @Override @Deactivate - void deactivate() { + public void close() { + shutdown(); diagReg.close(); } @@ -133,12 +134,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C return config == null ? "-null-config" : "_" + config.getPort(); } - @Override - public void setSwitchConnectionHandler(final SwitchConnectionHandler switchConnectionHandler) { - LOG.debug("setSwitchConnectionHandler"); - this.switchConnectionHandler = switchConnectionHandler; - } - @Override public ListenableFuture shutdown() { LOG.debug("Shutdown summoned"); @@ -153,13 +148,17 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C @Override @SuppressWarnings("checkstyle:IllegalCatch") - public ListenableFuture startup() { + public ListenableFuture startup(final SwitchConnectionHandler connectionHandler) { LOG.debug("Startup summoned"); + if (connConfig == null) { + return Futures.immediateFailedFuture(new IllegalStateException("Connection not configured")); + } + if (connectionHandler == null) { + return Futures.immediateFailedFuture(new IllegalStateException("SwitchConnectionHandler is not set")); + } + try { - serverFacade = createAndConfigureServer(); - if (switchConnectionHandler == null) { - throw new IllegalStateException("SwitchConnectionHandler is not set"); - } + serverFacade = createAndConfigureServer(connectionHandler); Futures.addCallback(listeningExecutorService.submit(serverFacade), new FutureCallback() { @Override public void onFailure(final Throwable throwable) { @@ -178,19 +177,16 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C } } - private ServerFacade createAndConfigureServer() { + private ServerFacade createAndConfigureServer(final SwitchConnectionHandler connectionHandler) { LOG.debug("Configuring .."); - if (connConfig == null) { - throw new IllegalStateException("Connection not configured"); - } final var transportProtocol = (TransportProtocol) connConfig.getTransferProtocol(); if (transportProtocol == null) { throw new IllegalStateException("No transport protocol received in " + connConfig); } final var factory = new ChannelInitializerFactory(); - factory.setSwitchConnectionHandler(switchConnectionHandler); + factory.setSwitchConnectionHandler(connectionHandler); factory.setSwitchIdleTimeout(connConfig.getSwitchIdleTimeout()); factory.setTlsConfig(connConfig.getTlsConfiguration()); factory.setSerializationFactory(serializationFactory); @@ -227,11 +223,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C return serverFacade; } - @Override - public void close() { - shutdown(); - } - @Override public boolean unregisterSerializer(final ExperimenterSerializerKey key) { return serializerRegistry.unregisterSerializer((MessageTypeKey) key); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java index a2b0daa16..7c5328812 100755 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java @@ -9,11 +9,10 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.List; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -86,7 +85,7 @@ public class SwitchConnectionProviderImpl02Test { * * @param protocol communication protocol */ - public void startUp(final TransportProtocol protocol) throws UnknownHostException { + public void startUp(final TransportProtocol protocol) throws Exception { config = null; if (protocol != null) { createConfig(protocol); @@ -94,7 +93,7 @@ public class SwitchConnectionProviderImpl02Test { provider = new SwitchConnectionProviderImpl(diagStatusService, config); } - private void createConfig(final TransportProtocol protocol) throws UnknownHostException { + private void createConfig(final TransportProtocol protocol) throws Exception { InetAddress startupAddress = InetAddress.getLocalHost(); tlsConfiguration = null; @@ -114,9 +113,9 @@ public class SwitchConnectionProviderImpl02Test { * Test getServerFacade. */ @Test - public void testServerFacade() throws UnknownHostException { + public void testServerFacade() throws Exception { startUp(TransportProtocol.TCP); - final var future = provider.startup(); + final var future = provider.startup(handler); final var serverFacade = provider.getServerFacade(); assertNotNull("Wrong -- getServerFacade return null", serverFacade); } @@ -125,7 +124,7 @@ public class SwitchConnectionProviderImpl02Test { * Test shutdown on unconfigured provider. */ @Test(expected = IllegalStateException.class) - public void testShutdownUnconfigured() throws UnknownHostException { + public void testShutdownUnconfigured() throws Exception { startUp(TransportProtocol.TCP); provider.shutdown(); } @@ -134,7 +133,7 @@ public class SwitchConnectionProviderImpl02Test { * Test unregister by wrong key. */ @Test - public void testUnregisterWrongKeys() throws UnknownHostException { + public void testUnregisterWrongKeys() throws Exception { startUp(TransportProtocol.TCP); final var testSerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF_VERSION_1_0, 42L); assertFalse("Wrong -- unregisterSerializer",provider.unregisterSerializer(testSerKey)); @@ -146,124 +145,124 @@ public class SwitchConnectionProviderImpl02Test { * Test register and unregister method. */ @Test - public void testUnregisterExistingKeys() throws UnknownHostException { + public void testUnregisterExistingKeys() throws Exception { startUp(TransportProtocol.TCP); // -- registerActionSerializer final ExperimenterActionSerializerKey key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), TestSubType.VALUE); provider.registerActionSerializer(key1, serializer); - Assert.assertTrue("Wrong -- unregister ActionSerializer", provider.unregisterSerializer(key1)); - Assert.assertFalse("Wrong -- unregister ActionSerializer by not existing key", + assertTrue("Wrong -- unregister ActionSerializer", provider.unregisterSerializer(key1)); + assertFalse("Wrong -- unregister ActionSerializer by not existing key", provider.unregisterSerializer(key1)); // -- registerActionDeserializer final ExperimenterActionDeserializerKey key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); provider.registerActionDeserializer(key2, deserializer); - Assert.assertTrue("Wrong -- unregister ActionDeserializer", provider.unregisterDeserializer(key2)); - Assert.assertFalse("Wrong -- unregister ActionDeserializer by not existing key", + assertTrue("Wrong -- unregister ActionDeserializer", provider.unregisterDeserializer(key2)); + assertFalse("Wrong -- unregister ActionDeserializer by not existing key", provider.unregisterDeserializer(key2)); // -- registerInstructionSerializer final ExperimenterInstructionSerializerKey key3 = new ExperimenterInstructionSerializerKey(EncodeConstants.OF_VERSION_1_0, 42L); provider.registerInstructionSerializer(key3, serializer); - Assert.assertTrue("Wrong -- unregister InstructionSerializer", provider.unregisterSerializer(key3)); - Assert.assertFalse("Wrong -- unregister InstructionSerializer by not existing key", + assertTrue("Wrong -- unregister InstructionSerializer", provider.unregisterSerializer(key3)); + assertFalse("Wrong -- unregister InstructionSerializer by not existing key", provider.unregisterSerializer(key3)); // -- registerInstructionDeserializer final ExperimenterInstructionDeserializerKey key4 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); provider.registerInstructionDeserializer(key4, deserializer); - Assert.assertTrue("Wrong -- unregister InstructionDeserializer", provider.unregisterDeserializer(key4)); - Assert.assertFalse("Wrong -- unregister InstructionDeserializer by not existing key", + assertTrue("Wrong -- unregister InstructionDeserializer", provider.unregisterDeserializer(key4)); + assertFalse("Wrong -- unregister InstructionDeserializer by not existing key", provider.unregisterDeserializer(key4)); // -- registerMatchEntryDeserializer final MatchEntryDeserializerKey key5 = new MatchEntryDeserializerKey(EncodeConstants.OF_VERSION_1_0, 0x8000, 42); provider.registerMatchEntryDeserializer(key5, deserializer); - Assert.assertTrue("Wrong -- unregister MatchEntryDeserializer", provider.unregisterDeserializer(key5)); - Assert.assertFalse("Wrong -- unregister MatchEntryDeserializer by not existing key", + assertTrue("Wrong -- unregister MatchEntryDeserializer", provider.unregisterDeserializer(key5)); + assertFalse("Wrong -- unregister MatchEntryDeserializer by not existing key", provider.unregisterDeserializer(key5)); // -- registerErrorDeserializer final ExperimenterIdDeserializerKey key6 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), ErrorMessage.class); provider.registerErrorDeserializer(key6, deserializerError); - Assert.assertTrue("Wrong -- unregister ErrorDeserializer", provider.unregisterDeserializer(key6)); - Assert.assertFalse("Wrong -- unregister ErrorDeserializer by not existing key", + assertTrue("Wrong -- unregister ErrorDeserializer", provider.unregisterDeserializer(key6)); + assertFalse("Wrong -- unregister ErrorDeserializer by not existing key", provider.unregisterDeserializer(key6)); // -- registerExperimenterMessageDeserializer final ExperimenterIdDeserializerKey key7 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), ExperimenterMessage.class); provider.registerExperimenterMessageDeserializer(key7, deserializerExpMsg); - Assert.assertTrue("Wrong -- unregister ExperimenterMessageDeserializer", provider.unregisterDeserializer(key7)); - Assert.assertFalse("Wrong -- unregister ExperimenterMessageDeserializer by not existing key", + assertTrue("Wrong -- unregister ExperimenterMessageDeserializer", provider.unregisterDeserializer(key7)); + assertFalse("Wrong -- unregister ExperimenterMessageDeserializer by not existing key", provider.unregisterDeserializer(key7)); // -- registerMultipartReplyMessageDeserializer final ExperimenterIdDeserializerKey key8 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), MultipartReplyMessage.class); provider.registerMultipartReplyMessageDeserializer(key8, deserializerMultipartRplMsg); - Assert.assertTrue("Wrong -- unregister MultipartReplyMessageDeserializer", + assertTrue("Wrong -- unregister MultipartReplyMessageDeserializer", provider.unregisterDeserializer(key8)); - Assert.assertFalse("Wrong -- unregister MultipartReplyMessageDeserializer by not existing key", + assertFalse("Wrong -- unregister MultipartReplyMessageDeserializer by not existing key", provider.unregisterDeserializer(key8)); // -- registerMultipartReplyTFDeserializer final ExperimenterIdDeserializerKey key9 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), MultipartReplyMessage.class); provider.registerMultipartReplyTFDeserializer(key9, deserializer); - Assert.assertTrue("Wrong -- unregister MultipartReplyTFDeserializer", provider.unregisterDeserializer(key9)); - Assert.assertFalse("Wrong -- unregister MultipartReplyTFDeserializer by non existing key", + assertTrue("Wrong -- unregister MultipartReplyTFDeserializer", provider.unregisterDeserializer(key9)); + assertFalse("Wrong -- unregister MultipartReplyTFDeserializer by non existing key", provider.unregisterDeserializer(key9)); // -- registerQueuePropertyDeserializer final ExperimenterIdDeserializerKey key10 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), QueueProperty.class); provider.registerQueuePropertyDeserializer(key10, deserializerQueueProperty); - Assert.assertTrue("Wrong -- unregister QueuePropertyDeserializer", provider.unregisterDeserializer(key10)); - Assert.assertFalse("Wrong -- unregister QueuePropertyDeserializer by not existing key", + assertTrue("Wrong -- unregister QueuePropertyDeserializer", provider.unregisterDeserializer(key10)); + assertFalse("Wrong -- unregister QueuePropertyDeserializer by not existing key", provider.unregisterDeserializer(key10)); // -- registerMeterBandDeserializer final ExperimenterIdDeserializerKey key11 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), MeterBandExperimenterCase.class); provider.registerMeterBandDeserializer(key11, deserializerMeterBandExpCase); - Assert.assertTrue("Wrong -- unregister MeterBandDeserializer", provider.unregisterDeserializer(key11)); - Assert.assertFalse("Wrong -- unregister MeterBandDeserializer by not existing key", + assertTrue("Wrong -- unregister MeterBandDeserializer", provider.unregisterDeserializer(key11)); + assertFalse("Wrong -- unregister MeterBandDeserializer by not existing key", provider.unregisterDeserializer(key11)); // -- registerExperimenterMessageSerializer ExperimenterIdSerializerKey key12 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), ExperimenterDataOfChoice.class); provider.registerExperimenterMessageSerializer(key12, serializerExperimenterInput); - Assert.assertTrue("Wrong -- unregister ExperimenterMessageSerializer", provider.unregisterSerializer(key12)); - Assert.assertFalse("Wrong -- unregister ExperimenterMessageSerializer by not existing key", + assertTrue("Wrong -- unregister ExperimenterMessageSerializer", provider.unregisterSerializer(key12)); + assertFalse("Wrong -- unregister ExperimenterMessageSerializer by not existing key", provider.unregisterSerializer(key12)); //registerMultipartRequestSerializer ExperimenterIdSerializerKey key13 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), ExperimenterDataOfChoice.class); provider.registerMultipartRequestSerializer(key13, serializerMultipartRequestExpCase); - Assert.assertTrue("Wrong -- unregister MultipartRequestSerializer", provider.unregisterSerializer(key13)); - Assert.assertFalse("Wrong -- unregister MultipartRequestSerializer by not existing key", + assertTrue("Wrong -- unregister MultipartRequestSerializer", provider.unregisterSerializer(key13)); + assertFalse("Wrong -- unregister MultipartRequestSerializer by not existing key", provider.unregisterSerializer(key13)); // -- registerMultipartRequestTFSerializer final ExperimenterIdSerializerKey key14 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), TableFeatureProperties.class); provider.registerMultipartRequestTFSerializer(key14, serializer); - Assert.assertTrue("Wrong -- unregister MultipartRequestTFSerializer", provider.unregisterSerializer(key14)); - Assert.assertFalse("Wrong -- unregister MultipartRequestTFSerializer by not existing key", + assertTrue("Wrong -- unregister MultipartRequestTFSerializer", provider.unregisterSerializer(key14)); + assertFalse("Wrong -- unregister MultipartRequestTFSerializer by not existing key", provider.unregisterSerializer(key14)); // -- registerMeterBandSerializer final ExperimenterIdMeterSubTypeSerializerKey key15 = new ExperimenterIdMeterSubTypeSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), MeterBandExperimenterCase.class,null); provider.registerMeterBandSerializer(key15, serializerMeterBandExpCase); - Assert.assertTrue("Wrong -- unregister MeterBandSerializer", provider.unregisterSerializer(key15)); - Assert.assertFalse("Wrong -- unregister MeterBandSerializer by not existing key", + assertTrue("Wrong -- unregister MeterBandSerializer", provider.unregisterSerializer(key15)); + assertFalse("Wrong -- unregister MeterBandSerializer by not existing key", provider.unregisterSerializer(key15)); // -- registerMatchEntrySerializer final MatchEntrySerializerKey key16 = new MatchEntrySerializerKey<>(EncodeConstants.OF_VERSION_1_3, OpenflowBasicClass.VALUE, InPort.VALUE); provider.registerMatchEntrySerializer(key16, serializer); - Assert.assertTrue("Wrong -- unregister MatchEntrySerializer", provider.unregisterSerializer(key16)); - Assert.assertFalse("Wrong -- unregister MatchEntrySerializer by not existing key", + assertTrue("Wrong -- unregister MatchEntrySerializer", provider.unregisterSerializer(key16)); + assertFalse("Wrong -- unregister MatchEntrySerializer by not existing key", provider.unregisterSerializer(key15)); // -- registerSerializer final MessageTypeKey key17 = new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3, TestSubType.class); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java index f5fbe8bf3..5987de64d 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java @@ -91,9 +91,9 @@ public class SwitchConnectionProviderImplTest { * Tests provider startup - without configuration and {@link SwitchConnectionHandler}. */ @Test - public void testStartup1() throws UnknownHostException { + public void testStartup1() throws Exception { startUp(null); - final var future = provider.startup(); + final var future = provider.startup(null); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -105,10 +105,9 @@ public class SwitchConnectionProviderImplTest { * Tests provider startup - without configuration. */ @Test - public void testStartup2() throws UnknownHostException { + public void testStartup2() throws Exception { startUp(null); - provider.setSwitchConnectionHandler(handler); - final var future = provider.startup(); + final var future = provider.startup(handler); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -120,9 +119,9 @@ public class SwitchConnectionProviderImplTest { * Tests provider startup - without {@link SwitchConnectionHandler}. */ @Test - public void testStartup3() throws UnknownHostException { + public void testStartup3() throws Exception { startUp(TransportProtocol.TCP); - final var future = provider.startup(); + final var future = provider.startup(null); final var cause = assertThrows(ExecutionException.class, () -> future.get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) .getCause(); @@ -136,9 +135,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testStartup4() throws Exception { startUp(TransportProtocol.TCP); - provider.setSwitchConnectionHandler(handler); - - provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); + provider.startup(handler).get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -147,9 +144,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testStartup5() throws Exception { startUp(TransportProtocol.TLS); - provider.setSwitchConnectionHandler(handler); - - provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); + provider.startup(handler).get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -158,9 +153,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testStartup6() throws Exception { startUp(TransportProtocol.UDP); - provider.setSwitchConnectionHandler(handler); - - provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); + provider.startup(handler).get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } /** @@ -169,9 +162,7 @@ public class SwitchConnectionProviderImplTest { @Test public void testShutdown() throws Exception { startUp(TransportProtocol.TCP); - provider.setSwitchConnectionHandler(handler); - - provider.startup().get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); + provider.startup(handler).get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); assertTrue("Failed to stop", provider.shutdown().get(5 * WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); } } diff --git a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java index fc78e954d..a5dea9588 100644 --- a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java +++ b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java @@ -108,8 +108,7 @@ public class IntegrationTest { doReturn(mock(ServiceRegistration.class)).when(diagStatusService).register(any()); switchConnectionProvider = new SwitchConnectionProviderImpl(diagStatusService, connConfig); - switchConnectionProvider.setSwitchConnectionHandler(mockPlugin); - switchConnectionProvider.startup().get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); + switchConnectionProvider.startup(mockPlugin).get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); if (protocol.equals(TransportProtocol.TCP) || protocol.equals(TransportProtocol.TLS)) { final TcpHandler tcpHandler = (TcpHandler) switchConnectionProvider.getServerFacade(); port = tcpHandler.getPort(); diff --git a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java index cab8051c1..481fc56dd 100644 --- a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java +++ b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java @@ -19,9 +19,7 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtens * @author mirehak * @author michal.polkorab */ -public interface SwitchConnectionProvider extends AutoCloseable, - SerializerExtensionProvider, DeserializerExtensionProvider { - +public interface SwitchConnectionProvider extends SerializerExtensionProvider, DeserializerExtensionProvider { /** * Returns the connection configuration. * @@ -30,12 +28,12 @@ public interface SwitchConnectionProvider extends AutoCloseable, ConnectionConfiguration getConfiguration(); /** - * Start listening to switches, but please don't forget to do - * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first. + * Start listening to switches using specified {@link SwitchConnectionHandler}. * + * @param connectionHandler instance being informed when new switch connects * @return future completing when the channel has been resolved */ - ListenableFuture startup(); + ListenableFuture startup(SwitchConnectionHandler connectionHandler); /** * Stop listening to switches. @@ -43,11 +41,4 @@ public interface SwitchConnectionProvider extends AutoCloseable, * @return future, triggered to true, when all listening channels are down */ ListenableFuture shutdown(); - - /** - * Sets the SwitchConnectionHandler. - * - * @param switchConHandler instance being informed when new switch connects - */ - void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index b841e72c8..708a5bb20 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -213,8 +213,7 @@ public final class OpenFlowPluginProviderImpl } // Set handler of incoming connections and start switch connection provider - switchConnectionProvider.setSwitchConnectionHandler(connectionManager); - return switchConnectionProvider.startup(); + return switchConnectionProvider.startup(connectionManager); }).collect(Collectors.toSet())), new FutureCallback>() { @Override public void onSuccess(final List result) { diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index 948082283..6c7bae185 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -77,7 +77,7 @@ public class OpenFlowPluginProviderImplTest { when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); when(entityOwnershipService.registerListener(any(), any())).thenReturn(entityOwnershipListenerRegistration); - when(switchConnectionProvider.startup()).thenReturn(Futures.immediateFuture(null)); + when(switchConnectionProvider.startup(any())).thenReturn(Futures.immediateFuture(null)); when(switchConnectionProvider.shutdown()).thenReturn(Futures.immediateFuture(true)); when(configurationService.getProperty(eq(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString()), any())).thenReturn(USE_SINGLE_LAYER_SERIALIZATION); @@ -102,7 +102,7 @@ public class OpenFlowPluginProviderImplTest { ofPluginDiagstatusProvider, systemReadyMonitor)) { // Calling the onSystemBootReady() callback provider.onSystemBootReady(); - verify(switchConnectionProvider).startup(); + verify(switchConnectionProvider).startup(any()); } verify(switchConnectionProvider).shutdown(); } -- 2.43.0 From 945b2dd05df3c725941fe4c4677f6b2972249256 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 23 May 2024 18:25:59 +0200 Subject: [PATCH 19/30] Refactor ShutdownProvider.shutdown() Returning a Boolean is confusing with regard to error reporting: - users are really ignoring the value and rely on exception cause - that is not what the code does, as it is confused about mapping, running set(true/false) followed by an optional setException() Change the future type to Void, making it the value does not hold anything and rely on setException() to deliver the failure cause. Change-Id: Id6d97580b8d908caf37338f3578045598d2555f1 Signed-off-by: Robert Varga --- .../protocol/impl/core/ShutdownProvider.java | 5 +--- .../core/SwitchConnectionProviderImpl.java | 4 +-- .../protocol/impl/core/TcpHandler.java | 12 ++++---- .../protocol/impl/core/UdpHandler.java | 12 ++++---- .../protocol/impl/core/TcpHandlerTest.java | 29 ++++++++++--------- .../SwitchConnectionProviderImplTest.java | 4 +-- .../impl/core/connection/UdpHandlerTest.java | 3 +- .../connection/SwitchConnectionProvider.java | 4 +-- .../impl/OpenFlowPluginProviderImpl.java | 28 +++++++++--------- .../impl/OpenFlowPluginProviderImplTest.java | 4 +-- 10 files changed, 54 insertions(+), 51 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java index b6d6f73fd..34717e289 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java @@ -5,13 +5,10 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - - package org.opendaylight.openflowjava.protocol.impl.core; import com.google.common.util.concurrent.ListenableFuture; - /** * Shutdown provider interface. * @@ -19,5 +16,5 @@ import com.google.common.util.concurrent.ListenableFuture; */ public interface ShutdownProvider { - ListenableFuture shutdown(); + ListenableFuture shutdown(); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index a55a638a4..d483830f4 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -135,13 +135,13 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C } @Override - public ListenableFuture shutdown() { + public ListenableFuture shutdown() { LOG.debug("Shutdown summoned"); if (serverFacade == null) { LOG.warn("Can not shutdown - not configured or started"); throw new IllegalStateException("SwitchConnectionProvider is not started or not configured."); } - ListenableFuture serverFacadeShutdownFuture = serverFacade.shutdown(); + final var serverFacadeShutdownFuture = serverFacade.shutdown(); Executors.shutdownAndAwaitTermination(listeningExecutorService); return serverFacadeShutdownFuture; } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java index ca797a4d1..97fe5abb1 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java @@ -152,14 +152,16 @@ public class TcpHandler implements ServerFacade { * Shuts down {@link TcpHandler}}. */ @Override - public ListenableFuture shutdown() { - final SettableFuture result = SettableFuture.create(); + public ListenableFuture shutdown() { + final var result = SettableFuture.create(); workerGroup.shutdownGracefully(); // boss will shutdown as soon, as worker is down bossGroup.shutdownGracefully().addListener(downResult -> { - result.set(downResult.isSuccess()); - if (downResult.cause() != null) { - result.setException(downResult.cause()); + final var cause = downResult.cause(); + if (cause != null) { + result.setException(cause); + } else { + result.set(null); } }); return result; diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java index 1c59efd7c..472db5fc5 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java @@ -107,12 +107,14 @@ public final class UdpHandler implements ServerFacade { } @Override - public ListenableFuture shutdown() { - final SettableFuture result = SettableFuture.create(); + public ListenableFuture shutdown() { + final var result = SettableFuture.create(); group.shutdownGracefully().addListener(downResult -> { - result.set(downResult.isSuccess()); - if (downResult.cause() != null) { - result.setException(downResult.cause()); + final var cause = downResult.cause(); + if (cause != null) { + result.setException(cause); + } else { + result.set(null); } }); return result; diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java index 700b376f2..9d3f1cee6 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java @@ -5,13 +5,12 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowjava.protocol.impl.core; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; -import com.google.common.util.concurrent.ListenableFuture; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.unix.Errors; import java.io.IOException; @@ -35,15 +34,20 @@ import org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFa */ @RunWith(MockitoJUnitRunner.class) public class TcpHandlerTest { + private final InetAddress serverAddress = InetAddress.getLoopbackAddress(); - private final InetAddress serverAddress = InetAddress.getLoopbackAddress() ; - @Mock ChannelHandlerContext mockChHndlrCtx ; - @Mock TcpChannelInitializer mockChannelInitializer; - @Mock SwitchConnectionHandler mockSwitchConnHndler ; - @Mock SerializationFactory mockSerializationFactory ; - @Mock DeserializationFactory mockDeserializationFactory ; + @Mock + ChannelHandlerContext mockChHndlrCtx; + @Mock + TcpChannelInitializer mockChannelInitializer; + @Mock + SwitchConnectionHandler mockSwitchConnHndler; + @Mock + SerializationFactory mockSerializationFactory; + @Mock + DeserializationFactory mockDeserializationFactory; - TcpHandler tcpHandler ; + TcpHandler tcpHandler; /** * Test run with null address set. @@ -181,11 +185,8 @@ public class TcpHandlerTest { * Trigger the server shutdown and wait 2 seconds for completion. */ private void shutdownServer() throws InterruptedException, ExecutionException { - ListenableFuture shutdownRet = tcpHandler.shutdown() ; - while (shutdownRet.isDone() != true) { - Thread.sleep(100) ; - } - assertEquals("shutdown failed", true, shutdownRet.get()); + final var shutdownRet = tcpHandler.shutdown() ; + assertNull(shutdownRet.get()); } private Boolean startupServer(final boolean isEpollEnabled) throws InterruptedException { diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java index 5987de64d..970d99d63 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java @@ -10,8 +10,8 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -163,6 +163,6 @@ public class SwitchConnectionProviderImplTest { public void testShutdown() throws Exception { startUp(TransportProtocol.TCP); provider.startup(handler).get(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); - assertTrue("Failed to stop", provider.shutdown().get(5 * WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); + assertNull("Failed to stop", provider.shutdown().get(5 * WAIT_TIMEOUT, TimeUnit.MILLISECONDS)); } } diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java index cb2e53fb8..dbcd31079 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java @@ -9,6 +9,7 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.net.InetAddress; @@ -113,6 +114,6 @@ public class UdpHandlerTest { private void shutdownServer() throws InterruptedException, ExecutionException, TimeoutException { final var shutdownRet = udpHandler.shutdown() ; - assertTrue("Wrong - shutdown failed", shutdownRet.get(10, TimeUnit.SECONDS)); + assertNull("Wrong - shutdown failed", shutdownRet.get(10, TimeUnit.SECONDS)); } } diff --git a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java index 481fc56dd..b68200d1c 100644 --- a/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java +++ b/openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java @@ -38,7 +38,7 @@ public interface SwitchConnectionProvider extends SerializerExtensionProvider, D /** * Stop listening to switches. * - * @return future, triggered to true, when all listening channels are down + * @return future completing when all channels are down */ - ListenableFuture shutdown(); + ListenableFuture shutdown(); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index 708a5bb20..56d903e8d 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -236,21 +236,21 @@ public final class OpenFlowPluginProviderImpl return fullyStarted; } - private ListenableFuture> shutdownSwitchConnections() { - final ListenableFuture> listListenableFuture = - Futures.allAsList(switchConnectionProviders.stream().map(switchConnectionProvider -> { - // Revert deserializers to their original state - if (config.getUseSingleLayerSerialization()) { - DeserializerInjector.revertDeserializers(switchConnectionProvider); - } - - // Shutdown switch connection provider - return switchConnectionProvider.shutdown(); - }).collect(Collectors.toSet())); - - Futures.addCallback(listListenableFuture, new FutureCallback>() { + private ListenableFuture> shutdownSwitchConnections() { + final var listListenableFuture = Futures.allAsList(switchConnectionProviders.stream() + .map(switchConnectionProvider -> { + // Revert deserializers to their original state + if (config.getUseSingleLayerSerialization()) { + DeserializerInjector.revertDeserializers(switchConnectionProvider); + } + + // Shutdown switch connection provider + return switchConnectionProvider.shutdown(); + }).collect(Collectors.toList())); + + Futures.addCallback(listListenableFuture, new FutureCallback<>() { @Override - public void onSuccess(final List result) { + public void onSuccess(final List result) { LOG.info("All switchConnectionProviders were successfully shut down ({}).", result.size()); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index 6c7bae185..012d39aa8 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -77,8 +77,8 @@ public class OpenFlowPluginProviderImplTest { when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); when(entityOwnershipService.registerListener(any(), any())).thenReturn(entityOwnershipListenerRegistration); - when(switchConnectionProvider.startup(any())).thenReturn(Futures.immediateFuture(null)); - when(switchConnectionProvider.shutdown()).thenReturn(Futures.immediateFuture(true)); + when(switchConnectionProvider.startup(any())).thenReturn(Futures.immediateVoidFuture()); + when(switchConnectionProvider.shutdown()).thenReturn(Futures.immediateVoidFuture()); when(configurationService.getProperty(eq(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString()), any())).thenReturn(USE_SINGLE_LAYER_SERIALIZATION); when(configurationService.getProperty(eq(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString()), any())) -- 2.43.0 From ce1a49362ddb70df372798f0ed5c1fbfc39d83a4 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 24 May 2024 00:44:24 +0200 Subject: [PATCH 20/30] Refactor ServerFacade ServerFacade and its two implementations have intrinsic state in their associated groups. The API and interactions are rather involved, including a threadpool holding a thread, which is waiting for channel shutdown. This completely refactors things: - ServerFacade is an abstract class with a well-separated public and private APIs - {Tcp,Udp}ServerFacade are replacements for {Tcp,Udp}Handler, which manage the lifecycle - instantiation is completely asynchronous, so that we know at all times what we need to clean up and what is fine Change-Id: I82952b5c3e54a9b9067f6d28bc6e9072373b146b Signed-off-by: Robert Varga --- .../protocol/impl/core/OnlineProvider.java | 20 -- .../protocol/impl/core/ServerFacade.java | 61 ++++- .../protocol/impl/core/ShutdownProvider.java | 20 -- .../core/SwitchConnectionProviderImpl.java | 150 ++++++----- .../impl/core/TcpConnectionInitializer.java | 45 ---- .../protocol/impl/core/TcpHandler.java | 255 ------------------ .../protocol/impl/core/TcpServerFacade.java | 188 +++++++++++++ .../protocol/impl/core/UdpHandler.java | 185 ------------- .../protocol/impl/core/UdpServerFacade.java | 81 ++++++ .../protocol/impl/core/TcpHandlerTest.java | 214 --------------- .../impl/core/TcpServerFacadeTest.java | 139 ++++++++++ .../impl/core/UdpServerFacadeTest.java | 75 ++++++ .../SwitchConnectionProviderImpl02Test.java | 116 ++++---- .../impl/core/connection/UdpHandlerTest.java | 119 -------- .../it/integration/IntegrationTest.java | 12 +- 15 files changed, 693 insertions(+), 987 deletions(-) delete mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java delete mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java delete mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java delete mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java create mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacade.java delete mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java create mode 100644 openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacade.java delete mode 100644 openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java create mode 100644 openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacadeTest.java create mode 100644 openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacadeTest.java delete mode 100644 openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java deleted file mode 100644 index 370ea160a..000000000 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.core; - -import com.google.common.util.concurrent.ListenableFuture; - -/** - * OnlineProvider. - * - * @author mirehak - */ -public interface OnlineProvider { - - ListenableFuture getIsOnlineFuture(); -} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java index 57333a375..c864f0a50 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * Copyright (c) 2013 Pantheon Technologies, s.r.o. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech, s.r.o. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -7,12 +8,60 @@ */ package org.opendaylight.openflowjava.protocol.impl.core; +import static java.util.Objects.requireNonNull; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.SettableFuture; +import io.netty.channel.EventLoopGroup; +import java.net.InetSocketAddress; +import org.checkerframework.checker.lock.qual.GuardedBy; +import org.eclipse.jdt.annotation.NonNull; + /** * Server facade interface. - * - * @author mirehak */ -public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable { - @Override - void run(); +public abstract class ServerFacade { + private final @NonNull SettableFuture shutdownFuture = SettableFuture.create(); + private final @NonNull InetSocketAddress localAddress; + + @GuardedBy("this") + private EventLoopGroup group; + + ServerFacade(final EventLoopGroup group, final InetSocketAddress localAddress) { + this.localAddress = requireNonNull(localAddress); + this.group = requireNonNull(group); + + // Hook onto group shutting down -- that's when we know shutdownFuture is completed + group.terminationFuture().addListener(downResult -> { + final var cause = downResult.cause(); + if (cause != null) { + shutdownFuture.setException(cause); + } else { + shutdownFuture.set(null); + } + }); + } + + /** + * Returns the local address. + * + * @return the local address + */ + public final @NonNull InetSocketAddress localAddress() { + return localAddress; + } + + /** + * Shuts down this facade. If this facade was already shut down, this method does nothing. + * + * @return a future completing when the facade has been shut down + */ + synchronized @NonNull ListenableFuture shutdown() { + final var local = group; + if (local != null) { + group = null; + local.shutdownGracefully(); + } + return shutdownFuture; + } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java deleted file mode 100644 index 34717e289..000000000 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.core; - -import com.google.common.util.concurrent.ListenableFuture; - -/** - * Shutdown provider interface. - * - * @author mirehak - */ -public interface ShutdownProvider { - - ListenableFuture shutdown(); -} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index d483830f4..ead6e06e4 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -7,19 +7,20 @@ */ package org.opendaylight.openflowjava.protocol.impl.core; +import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import io.netty.channel.epoll.Epoll; import java.util.Map; +import java.util.concurrent.ExecutionException; +import org.checkerframework.checker.lock.qual.GuardedBy; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.infrautils.diagstatus.DiagStatusService; import org.opendaylight.infrautils.diagstatus.ServiceDescriptor; import org.opendaylight.infrautils.diagstatus.ServiceRegistration; import org.opendaylight.infrautils.diagstatus.ServiceState; -import org.opendaylight.infrautils.utils.concurrent.Executors; import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler; import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry; @@ -73,8 +74,6 @@ import org.slf4j.LoggerFactory; @Component(service = SwitchConnectionProvider.class, factory = SwitchConnectionProviderImpl.FACTORY_NAME) public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, ConnectionInitializer, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(SwitchConnectionProviderImpl.class); - - private static final String THREAD_NAME_PREFIX = "OFP-SwitchConnectionProvider-Udp/TcpHandler"; private static final String OPENFLOW_JAVA_SERVICE_NAME_PREFIX = "OPENFLOW_SERVER"; // OSGi DS Component Factory name @@ -87,14 +86,12 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C private final SerializerRegistry serializerRegistry; private final DeserializerRegistry deserializerRegistry; private final DeserializationFactory deserializationFactory; - private final ListeningExecutorService listeningExecutorService; private final String diagStatusIdentifier; - private final String threadName; - private TcpConnectionInitializer connectionInitializer; - private ServerFacade serverFacade; - // FIXME: clean this up when no longer needed - private final ServiceRegistration diagReg; + @GuardedBy("this") + private ListenableFuture serverFacade; + @GuardedBy("this") + private ServiceRegistration diagReg; public SwitchConnectionProviderImpl(final DiagStatusService diagStatus, final @Nullable ConnectionConfiguration connConfig) { @@ -103,8 +100,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C diagStatusIdentifier = OPENFLOW_JAVA_SERVICE_NAME_PREFIX + connectionSuffix; diagReg = diagStatus.register(diagStatusIdentifier); - threadName = THREAD_NAME_PREFIX + connectionSuffix; - listeningExecutorService = Executors.newListeningSingleThreadExecutor(threadName, LOG); serializerRegistry = new SerializerRegistryImpl(); if (connConfig != null) { serializerRegistry.setGroupAddModConfig(connConfig.isGroupAddModEnabled()); @@ -124,9 +119,17 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C @Override @Deactivate - public void close() { - shutdown(); - diagReg.close(); + public synchronized void close() throws InterruptedException, ExecutionException { + final var local = diagReg; + if (local != null) { + diagReg = null; + final var future = serverFacade; + if (future != null) { + shutdownFacade(future).addListener(local::close, MoreExecutors.directExecutor()); + } else { + local.close(); + } + } } // ID based, on configuration, used for diagstatus serviceIdentifier (ServiceDescriptor moduleServiceName) @@ -137,52 +140,76 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C @Override public ListenableFuture shutdown() { LOG.debug("Shutdown summoned"); - if (serverFacade == null) { - LOG.warn("Can not shutdown - not configured or started"); + final ListenableFuture local; + synchronized (this) { + if (diagReg == null) { + return Futures.immediateVoidFuture(); + } + local = serverFacade; + } + if (local == null) { throw new IllegalStateException("SwitchConnectionProvider is not started or not configured."); } - final var serverFacadeShutdownFuture = serverFacade.shutdown(); - Executors.shutdownAndAwaitTermination(listeningExecutorService); - return serverFacadeShutdownFuture; + return shutdownFacade(local); + } + + private ListenableFuture shutdownFacade(final ListenableFuture future) { + return Futures.transformAsync(future, facade -> { + final var shutdownFuture = facade.shutdown(); + shutdownFuture.addListener(() -> removeFacade(future), MoreExecutors.directExecutor()); + return shutdownFuture; + }, MoreExecutors.directExecutor()); + } + + private synchronized void removeFacade(final ListenableFuture expected) { + if (expected == serverFacade) { + serverFacade = null; + diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.ERROR, "Terminated")); + } } @Override @SuppressWarnings("checkstyle:IllegalCatch") - public ListenableFuture startup(final SwitchConnectionHandler connectionHandler) { + public synchronized ListenableFuture startup(final SwitchConnectionHandler connectionHandler) { LOG.debug("Startup summoned"); + if (connConfig == null) { return Futures.immediateFailedFuture(new IllegalStateException("Connection not configured")); } if (connectionHandler == null) { return Futures.immediateFailedFuture(new IllegalStateException("SwitchConnectionHandler is not set")); } - - try { - serverFacade = createAndConfigureServer(connectionHandler); - Futures.addCallback(listeningExecutorService.submit(serverFacade), new FutureCallback() { - @Override - public void onFailure(final Throwable throwable) { - diagReg.report(new ServiceDescriptor(diagStatusIdentifier, throwable)); - } - - @Override - public void onSuccess(final Object result) { - diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.ERROR, - threadName + " terminated")); - } - }, MoreExecutors.directExecutor()); - return serverFacade.getIsOnlineFuture(); - } catch (RuntimeException e) { - return Futures.immediateFailedFuture(e); + if (serverFacade != null) { + return Futures.immediateFailedFuture(new IllegalStateException("Provider already started")); } + + final var future = createAndConfigureServer(connectionHandler); + serverFacade = future; + Futures.addCallback(future, new FutureCallback() { + @Override + public void onSuccess(final ServerFacade result) { + diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL)); + LOG.info("Started {} connection on {}", connConfig.getTransferProtocol(), result.localAddress()); + } + + @Override + public void onFailure(final Throwable cause) { + LOG.error("Failed to start {} connection on {}:{}", connConfig.getTransferProtocol(), + connConfig.getAddress(), connConfig.getPort(), cause); + diagReg.report(new ServiceDescriptor(diagStatusIdentifier, cause)); + } + }, MoreExecutors.directExecutor()); + + return Futures.transform(future, facade -> null, MoreExecutors.directExecutor()); } - private ServerFacade createAndConfigureServer(final SwitchConnectionHandler connectionHandler) { + private ListenableFuture createAndConfigureServer( + final SwitchConnectionHandler connectionHandler) { LOG.debug("Configuring .."); - final var transportProtocol = (TransportProtocol) connConfig.getTransferProtocol(); if (transportProtocol == null) { - throw new IllegalStateException("No transport protocol received in " + connConfig); + return Futures.immediateFailedFuture( + new IllegalStateException("No transport protocol received in " + connConfig)); } final var factory = new ChannelInitializerFactory(); @@ -198,29 +225,23 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C boolean isEpollEnabled = Epoll.isAvailable(); return switch (transportProtocol) { - case TCP, TLS -> { - final var tcpHandler = new TcpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); - final var channelInitializer = factory.createPublishingChannelInitializer(); - tcpHandler.setChannelInitializer(channelInitializer); - tcpHandler.initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); - final var workerGroupFromTcpHandler = tcpHandler.getWorkerGroup(); - connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, channelInitializer, - isEpollEnabled); - yield tcpHandler; - } - case UDP -> { - final var udpHandler = new UdpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); - udpHandler.initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); - udpHandler.setChannelInitializer(factory.createUdpChannelInitializer()); - yield udpHandler; - } + case TCP, TLS -> TcpServerFacade.start(connConfig, isEpollEnabled, + factory.createPublishingChannelInitializer()); + case UDP -> UdpServerFacade.start(connConfig, isEpollEnabled, factory.createUdpChannelInitializer()); }; } + @VisibleForTesting public ServerFacade getServerFacade() { - return serverFacade; + final ListenableFuture future; + synchronized (this) { + future = serverFacade; + } + try { + return future.get(); + } catch (InterruptedException | ExecutionException e) { + throw new IllegalStateException("Failed to acquire facade", e); + } } @Override @@ -347,7 +368,12 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C @Override public void initiateConnection(final String host, final int port) { - connectionInitializer.initiateConnection(host, port); + final var facade = getServerFacade(); + if (facade instanceof ConnectionInitializer initializer) { + initializer.initiateConnection(host, port); + } else { + throw new UnsupportedOperationException(facade + " does not support connections"); + } } @Override diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java deleted file mode 100644 index 727230237..000000000 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2015 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.core; - -import static java.util.Objects.requireNonNull; - -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.epoll.EpollSocketChannel; -import io.netty.channel.socket.nio.NioSocketChannel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Initializes (TCP) connection to device. - * - * @author martin.uhlir - */ -final class TcpConnectionInitializer implements ConnectionInitializer { - private static final Logger LOG = LoggerFactory.getLogger(TcpConnectionInitializer.class); - - private final Bootstrap bootstrap; - - TcpConnectionInitializer(final EventLoopGroup workerGroup, final TcpChannelInitializer channelInitializer, - final boolean isEpollEnabled) { - bootstrap = new Bootstrap() - .group(requireNonNull(workerGroup, "WorkerGroup cannot be null")) - .handler(channelInitializer) - .channel(isEpollEnabled ? EpollSocketChannel.class : NioSocketChannel.class); - } - - @Override - public void initiateConnection(final String host, final int port) { - try { - bootstrap.connect(host, port).sync(); - } catch (InterruptedException e) { - LOG.error("Unable to initiate connection", e); - } - } -} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java deleted file mode 100644 index 97fe5abb1..000000000 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.openflowjava.protocol.impl.core; - -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.buffer.PooledByteBufAllocator; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.WriteBufferWaterMark; -import io.netty.channel.epoll.EpollEventLoopGroup; -import io.netty.channel.epoll.EpollServerSocketChannel; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.ServerSocketChannel; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.handler.logging.LogLevel; -import io.netty.handler.logging.LoggingHandler; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Class implementing server over TCP / TLS for handling incoming connections. - * - * @author michal.polkorab - */ -public class TcpHandler implements ServerFacade { - /* - * High/low write watermarks - */ - private static final int DEFAULT_WRITE_HIGH_WATERMARK = 64 * 1024; - private static final int DEFAULT_WRITE_LOW_WATERMARK = 32 * 1024; - /* - * Write spin count. This tells netty to immediately retry a non-blocking - * write this many times before moving on to selecting. - */ - private static final int DEFAULT_WRITE_SPIN_COUNT = 16; - - private static final Logger LOG = LoggerFactory.getLogger(TcpHandler.class); - - private final SettableFuture isOnlineFuture = SettableFuture.create(); - private final InetAddress startupAddress; - private final Runnable readyRunnable; - - private int port; - private String address; - private EventLoopGroup workerGroup; - private EventLoopGroup bossGroup; - - private TcpChannelInitializer channelInitializer; - - private Class socketChannelClass; - - /** - * Constructor of TCPHandler that listens on selected port. - * - * @param port listening port of TCPHandler server - */ - public TcpHandler(final int port, final Runnable readyRunnable) { - this(null, port, readyRunnable); - } - - /** - * Constructor of TCPHandler that listens on selected address and port. - * @param address listening address of TCPHandler server - * @param port listening port of TCPHandler server - */ - public TcpHandler(final InetAddress address, final int port, final Runnable readyRunnable) { - this.port = port; - startupAddress = address; - this.readyRunnable = readyRunnable; - } - - /** - * Starts server on selected port. - */ - @Override - @SuppressWarnings("checkstyle:IllegalCatch") - public void run() { - /* - * We generally do not perform IO-unrelated tasks, so we want to have - * all outstanding tasks completed before the executing thread goes - * back into select. - * - * Any other setting means netty will measure the time it spent selecting - * and spend roughly proportional time executing tasks. - */ - //workerGroup.setIoRatio(100); - - final ChannelFuture f; - try { - ServerBootstrap bootstrap = new ServerBootstrap(); - bootstrap.group(bossGroup, workerGroup) - .channel(socketChannelClass) - .handler(new LoggingHandler(LogLevel.DEBUG)) - .childHandler(channelInitializer) - .option(ChannelOption.SO_BACKLOG, 128) - .option(ChannelOption.SO_REUSEADDR, true) - .childOption(ChannelOption.SO_KEEPALIVE, true) - .childOption(ChannelOption.TCP_NODELAY , true) - .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) - .childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, - new WriteBufferWaterMark(DEFAULT_WRITE_LOW_WATERMARK, DEFAULT_WRITE_HIGH_WATERMARK)) - .childOption(ChannelOption.WRITE_SPIN_COUNT, DEFAULT_WRITE_SPIN_COUNT); - - if (startupAddress != null) { - f = bootstrap.bind(startupAddress.getHostAddress(), port).sync(); - } else { - f = bootstrap.bind(port).sync(); - } - } catch (InterruptedException e) { - LOG.error("Interrupted while binding port {}", port, e); - return; - } catch (Throwable throwable) { - // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them - LOG.error("Error while binding address {} and port {}", startupAddress, port, throwable); - throw throwable; - } - - try { - InetSocketAddress isa = (InetSocketAddress) f.channel().localAddress(); - address = isa.getHostString(); - - // Update port, as it may have been specified as 0 - port = isa.getPort(); - - LOG.debug("address from tcphandler: {}", address); - LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port); - readyRunnable.run(); - isOnlineFuture.set(null); - - // This waits until this channel is closed, and rethrows the cause of the failure if this future failed. - f.channel().closeFuture().sync(); - } catch (InterruptedException e) { - LOG.error("Interrupted while waiting for port {} shutdown", port, e); - } finally { - shutdown(); - } - } - - /** - * Shuts down {@link TcpHandler}}. - */ - @Override - public ListenableFuture shutdown() { - final var result = SettableFuture.create(); - workerGroup.shutdownGracefully(); - // boss will shutdown as soon, as worker is down - bossGroup.shutdownGracefully().addListener(downResult -> { - final var cause = downResult.cause(); - if (cause != null) { - result.setException(cause); - } else { - result.set(null); - } - }); - return result; - } - - /** - * Returns the number of connected clients / channels. - * - * @return number of connected clients / channels - */ - public int getNumberOfConnections() { - return channelInitializer.size(); - } - - @Override - public ListenableFuture getIsOnlineFuture() { - return isOnlineFuture; - } - - public int getPort() { - return port; - } - - public String getAddress() { - return address; - } - - public void setChannelInitializer(final TcpChannelInitializer channelInitializer) { - this.channelInitializer = channelInitializer; - } - - /** - * Initiate event loop groups. - * - * @param threadConfiguration number of threads to be created, if not specified in threadConfig - */ - public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) { - if (isEpollEnabled) { - initiateEpollEventLoopGroups(threadConfiguration); - } else { - initiateNioEventLoopGroups(threadConfiguration); - } - } - - /** - * Initiate Nio event loop groups. - * - * @param threadConfiguration number of threads to be created, if not specified in threadConfig - */ - public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) { - socketChannelClass = NioServerSocketChannel.class; - if (threadConfiguration != null) { - bossGroup = new NioEventLoopGroup(threadConfiguration.getBossThreadCount()); - workerGroup = new NioEventLoopGroup(threadConfiguration.getWorkerThreadCount()); - } else { - bossGroup = new NioEventLoopGroup(); - workerGroup = new NioEventLoopGroup(); - } - ((NioEventLoopGroup)workerGroup).setIoRatio(100); - } - - /** - * Initiate Epoll event loop groups with Nio as fall back. - * - * @param threadConfiguration the ThreadConfiguration - */ - @SuppressWarnings("checkstyle:IllegalCatch") - protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) { - try { - socketChannelClass = EpollServerSocketChannel.class; - if (threadConfiguration != null) { - bossGroup = new EpollEventLoopGroup(threadConfiguration.getBossThreadCount()); - workerGroup = new EpollEventLoopGroup(threadConfiguration.getWorkerThreadCount()); - } else { - bossGroup = new EpollEventLoopGroup(); - workerGroup = new EpollEventLoopGroup(); - } - ((EpollEventLoopGroup)workerGroup).setIoRatio(100); - return; - } catch (RuntimeException ex) { - LOG.debug("Epoll initiation failed"); - } - - //Fallback mechanism - initiateNioEventLoopGroups(threadConfiguration); - } - - public EventLoopGroup getWorkerGroup() { - return workerGroup; - } -} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacade.java new file mode 100644 index 000000000..75ff69013 --- /dev/null +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacade.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2013 Pantheon Technologies, s.r.o. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech, s.r.o. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.core; + +import static java.util.Objects.requireNonNull; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.SettableFuture; +import io.netty.bootstrap.Bootstrap; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.buffer.PooledByteBufAllocator; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.WriteBufferWaterMark; +import io.netty.channel.epoll.Epoll; +import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.epoll.EpollServerSocketChannel; +import io.netty.channel.epoll.EpollSocketChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.logging.LogLevel; +import io.netty.handler.logging.LoggingHandler; +import java.net.InetSocketAddress; +import org.checkerframework.checker.lock.qual.GuardedBy; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Class implementing server over TCP / TLS for handling incoming connections. + * + * @author michal.polkorab + */ +final class TcpServerFacade extends ServerFacade implements ConnectionInitializer { + private static final Logger LOG = LoggerFactory.getLogger(TcpServerFacade.class); + + /* + * High/low write watermarks + */ + private static final int DEFAULT_WRITE_HIGH_WATERMARK = 64 * 1024; + private static final int DEFAULT_WRITE_LOW_WATERMARK = 32 * 1024; + /* + * Write spin count. This tells Netty to immediately retry a non-blocking write this many times before moving on to + * selecting. + */ + private static final int DEFAULT_WRITE_SPIN_COUNT = 16; + + private final TcpChannelInitializer channelInitializer; + private final Bootstrap bootstrap; + + @GuardedBy("this") + private EventLoopGroup childGroup; + + private TcpServerFacade(final EventLoopGroup parentGroup, final EventLoopGroup childGroup, + final Bootstrap bootstrap, final TcpChannelInitializer channelInitializer, + final InetSocketAddress localAddress) { + super(parentGroup, localAddress); + this.childGroup = requireNonNull(childGroup); + this.bootstrap = requireNonNull(bootstrap); + this.channelInitializer = requireNonNull(channelInitializer); + + // Log-and-hook to prevent surprise timing + LOG.info("Switch listener started and ready to accept incoming TCP/TLS connections on {}", localAddress); + } + + static ListenableFuture start(final ConnectionConfiguration connConfig, final boolean epollEnabled, + final TcpChannelInitializer channelInitializer) { + // Server bootstrap configuration + final var serverBootstrap = new ServerBootstrap() + .handler(new LoggingHandler(LogLevel.DEBUG)) + .childHandler(channelInitializer) + .option(ChannelOption.SO_BACKLOG, 128) + .option(ChannelOption.SO_REUSEADDR, true) + .childOption(ChannelOption.SO_KEEPALIVE, true) + .childOption(ChannelOption.TCP_NODELAY , true) + .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) + .childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, + new WriteBufferWaterMark(DEFAULT_WRITE_LOW_WATERMARK, DEFAULT_WRITE_HIGH_WATERMARK)) + .childOption(ChannelOption.WRITE_SPIN_COUNT, DEFAULT_WRITE_SPIN_COUNT); + + // Client bootstrap configuration + final var bootstrap = new Bootstrap().handler(channelInitializer); + + /* + * Initialize groups. + * + * We generally do not perform IO-unrelated tasks, so we want to have all outstanding tasks completed before + * the executing thread goes back into select. + * + * Any other setting means Netty will measure the time it spent selecting and spend roughly proportional time + * executing tasks. + */ + final var threadConfig = connConfig.getThreadConfiguration(); + final var childIoRatio = 100; + + // Captured by bindFuture callback below + final EventLoopGroup parentGroup; + final EventLoopGroup childGroup; + if (Epoll.isAvailable() && epollEnabled) { + // Epoll + serverBootstrap.channel(EpollServerSocketChannel.class); + bootstrap.channel(EpollSocketChannel.class); + + parentGroup = new EpollEventLoopGroup(threadConfig == null ? 0 : threadConfig.getBossThreadCount()); + final var tmp = new EpollEventLoopGroup(threadConfig == null ? 0 : threadConfig.getWorkerThreadCount()); + tmp.setIoRatio(childIoRatio); + childGroup = tmp; + } else { + // NIO + serverBootstrap.channel(NioServerSocketChannel.class); + bootstrap.channel(NioSocketChannel.class); + + parentGroup = threadConfig == null ? new NioEventLoopGroup() + : new NioEventLoopGroup(threadConfig.getBossThreadCount()); + + final var tmp = threadConfig == null ? new NioEventLoopGroup() + : new NioEventLoopGroup(threadConfig.getWorkerThreadCount()); + tmp.setIoRatio(childIoRatio); + childGroup = tmp; + } + serverBootstrap.group(parentGroup, childGroup); + bootstrap.group(childGroup); + + // Attempt to bind the address + final var address = connConfig.getAddress(); + final var port = connConfig.getPort(); + final var bindFuture = address != null ? serverBootstrap.bind(address.getHostAddress(), port) + : serverBootstrap.bind(port); + + // Clean up or hand off to caller + final var retFuture = SettableFuture.create(); + bindFuture.addListener((ChannelFutureListener) future -> { + final var cause = future.cause(); + if (cause != null) { + childGroup.shutdownGracefully(); + parentGroup.shutdownGracefully(); + retFuture.setException(cause); + return; + } + + final var channel = future.channel(); + final var handler = new TcpServerFacade(parentGroup, childGroup, bootstrap, channelInitializer, + (InetSocketAddress) channel.localAddress()); + // Hook onto the channel's termination to initiate group shutdown + channel.closeFuture().addListener(closeFuture -> handler.shutdown()); + retFuture.set(handler); + }); + return retFuture; + } + + /** + * Returns the number of connected clients / channels. + * + * @return number of connected clients / channels + */ + public int getNumberOfConnections() { + return channelInitializer.size(); + } + + @Override + public void initiateConnection(final String host, final int port) { + try { + bootstrap.connect(host, port).sync(); + } catch (InterruptedException e) { + LOG.error("Unable to initiate connection", e); + } + } + + @Override + synchronized @NonNull ListenableFuture shutdown() { + final var local = childGroup; + if (local != null) { + LOG.info("Cleaning up TCP/TLS connection resources on {}", localAddress()); + childGroup = null; + local.shutdownGracefully(); + } + return super.shutdown(); + } +} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java deleted file mode 100644 index 472db5fc5..000000000 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.openflowjava.protocol.impl.core; - -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.epoll.EpollDatagramChannel; -import io.netty.channel.epoll.EpollEventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.DatagramChannel; -import io.netty.channel.socket.nio.NioDatagramChannel; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Class implementing server over UDP for handling incoming connections. - * - * @author michal.polkorab - */ -public final class UdpHandler implements ServerFacade { - private static final Logger LOG = LoggerFactory.getLogger(UdpHandler.class); - - private final SettableFuture isOnlineFuture = SettableFuture.create(); - private final InetAddress startupAddress; - private final Runnable readyRunnable; - - private int port; - private EventLoopGroup group; - private UdpChannelInitializer channelInitializer; - private Class datagramChannelClass; - - /** - * Constructor of UdpHandler that listens on selected port. - * - * @param port listening port of UdpHandler server - */ - public UdpHandler(final int port, final Runnable readyRunnable) { - this(null, port, readyRunnable); - } - - /** - * Constructor of UdpHandler that listens on selected address and port. - * @param address listening address of UdpHandler server - * @param port listening port of UdpHandler server - */ - public UdpHandler(final InetAddress address, final int port, final Runnable readyRunnable) { - this.port = port; - startupAddress = address; - this.readyRunnable = readyRunnable; - } - - @Override - @SuppressWarnings("checkstyle:IllegalCatch") - public void run() { - final ChannelFuture f; - try { - Bootstrap bootstrap = new Bootstrap(); - bootstrap.group(group).channel(datagramChannelClass).option(ChannelOption.SO_BROADCAST, false) - .handler(channelInitializer); - - if (startupAddress != null) { - f = bootstrap.bind(startupAddress.getHostAddress(), port).sync(); - } else { - f = bootstrap.bind(port).sync(); - } - } catch (InterruptedException e) { - LOG.error("Interrupted while binding port {}", port, e); - return; - } catch (Throwable throwable) { - // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them - LOG.error("Error while binding address {} and port {}", startupAddress, port, throwable); - throw throwable; - } - - try { - InetSocketAddress isa = (InetSocketAddress) f.channel().localAddress(); - String address = isa.getHostString(); - - // Update port, as it may have been specified as 0 - port = isa.getPort(); - - LOG.debug("Address from udpHandler: {}", address); - LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port); - readyRunnable.run(); - isOnlineFuture.set(null); - - // This waits until this channel is closed, and rethrows the cause of the failure if this future failed. - f.channel().closeFuture().sync(); - } catch (InterruptedException e) { - LOG.error("Interrupted while waiting for port {} shutdown", port, e); - } finally { - shutdown(); - } - } - - @Override - public ListenableFuture shutdown() { - final var result = SettableFuture.create(); - group.shutdownGracefully().addListener(downResult -> { - final var cause = downResult.cause(); - if (cause != null) { - result.setException(cause); - } else { - result.set(null); - } - }); - return result; - } - - @Override - public ListenableFuture getIsOnlineFuture() { - return isOnlineFuture; - } - - public int getPort() { - return port; - } - - public void setChannelInitializer(final UdpChannelInitializer channelInitializer) { - this.channelInitializer = channelInitializer; - } - - /** - * Initiate event loop groups. - * - * @param threadConfiguration number of threads to be created, if not specified in threadConfig - */ - public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) { - if (isEpollEnabled) { - initiateEpollEventLoopGroups(threadConfiguration); - } else { - initiateNioEventLoopGroups(threadConfiguration); - } - } - - /** - * Initiate Nio event loop groups. - * - * @param threadConfiguration number of threads to be created, if not specified in threadConfig - */ - public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) { - datagramChannelClass = NioDatagramChannel.class; - if (threadConfiguration != null) { - group = new NioEventLoopGroup(threadConfiguration.getWorkerThreadCount()); - } else { - group = new NioEventLoopGroup(); - } - } - - /** - * Initiate Epoll event loop groups with Nio as fall back. - * - * @param threadConfiguration the ThreadConfiguration - */ - @SuppressWarnings("checkstyle:IllegalCatch") - protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) { - try { - datagramChannelClass = EpollDatagramChannel.class; - if (threadConfiguration != null) { - group = new EpollEventLoopGroup(threadConfiguration.getWorkerThreadCount()); - } else { - group = new EpollEventLoopGroup(); - } - return; - } catch (RuntimeException ex) { - LOG.debug("Epoll initiation failed"); - } - - //Fallback mechanism - initiateNioEventLoopGroups(threadConfiguration); - } -} diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacade.java new file mode 100644 index 000000000..a15a6178e --- /dev/null +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacade.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014 Pantheon Technologies, s.r.o. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech, s.r.o. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.core; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.SettableFuture; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.epoll.Epoll; +import io.netty.channel.epoll.EpollDatagramChannel; +import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioDatagramChannel; +import java.net.InetSocketAddress; +import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Class implementing server over UDP for handling incoming connections. + * + * @author michal.polkorab + */ +final class UdpServerFacade extends ServerFacade { + private static final Logger LOG = LoggerFactory.getLogger(UdpServerFacade.class); + + private UdpServerFacade(final EventLoopGroup group, final InetSocketAddress localAddress) { + super(group, localAddress); + + LOG.debug("Address from udpHandler: {}", localAddress); + LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", + localAddress.getPort()); + } + + static ListenableFuture start(final ConnectionConfiguration connConfig, final boolean epollEnabled, + final UdpChannelInitializer channelInitializer) { + // Client bootstrap configuration + final var bootstrap = new Bootstrap().handler(channelInitializer).option(ChannelOption.SO_BROADCAST, false); + final var threadConfig = connConfig.getThreadConfiguration(); + final var threadCount = threadConfig == null ? 0 : threadConfig.getWorkerThreadCount(); + + // Captured by bindFuture callback below + final EventLoopGroup group; + if (Epoll.isAvailable() && epollEnabled) { + // Epoll + bootstrap.channel(EpollDatagramChannel.class); + group = new EpollEventLoopGroup(threadCount); + } else { + // NIO + bootstrap.channel(NioDatagramChannel.class); + group = new NioEventLoopGroup(threadCount); + } + bootstrap.group(group); + + // Attempt to bind the address + final var address = connConfig.getAddress(); + final var port = connConfig.getPort(); + final var bindFuture = address != null ? bootstrap.bind(address.getHostAddress(), port) : bootstrap.bind(port); + + // Clean up or hand off to caller + final var retFuture = SettableFuture.create(); + bindFuture.addListener((ChannelFutureListener) future -> { + final var cause = future.cause(); + if (cause != null) { + group.shutdownGracefully(); + retFuture.setException(cause); + } else { + retFuture.set(new UdpServerFacade(group, (InetSocketAddress) future.channel().localAddress())); + } + }); + return retFuture; + } +} diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java deleted file mode 100644 index 9d3f1cee6..000000000 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.core; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; - -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.unix.Errors; -import java.io.IOException; -import java.net.BindException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.util.concurrent.ExecutionException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler; -import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory; -import org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory; - -/** - * Unit tests for TcpHandler. - * - * @author jameshall - */ -@RunWith(MockitoJUnitRunner.class) -public class TcpHandlerTest { - private final InetAddress serverAddress = InetAddress.getLoopbackAddress(); - - @Mock - ChannelHandlerContext mockChHndlrCtx; - @Mock - TcpChannelInitializer mockChannelInitializer; - @Mock - SwitchConnectionHandler mockSwitchConnHndler; - @Mock - SerializationFactory mockSerializationFactory; - @Mock - DeserializationFactory mockDeserializationFactory; - - TcpHandler tcpHandler; - - /** - * Test run with null address set. - */ - @Test - public void testRunWithNullAddress() throws IOException, InterruptedException, ExecutionException { - tcpHandler = new TcpHandler(null, 0, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - assertEquals("failed to start server", true, startupServer(false)) ; - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())) ; - shutdownServer(); - } - - /** - * Test run with null address set on Epoll native transport. - */ - @Test - public void testRunWithNullAddressOnEpoll() throws IOException, InterruptedException, ExecutionException { - tcpHandler = new TcpHandler(null, 0, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - //Use Epoll native transport - assertEquals("failed to start server", true, startupServer(true)) ; - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())) ; - shutdownServer(); - } - - /** - * Test run with address set. - */ - @Test - public void testRunWithAddress() throws IOException, InterruptedException, ExecutionException { - tcpHandler = new TcpHandler(serverAddress, 0, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - assertEquals("failed to start server", true, startupServer(false)) ; - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())) ; - shutdownServer(); - } - - /** - * Test run with address set on Epoll native transport. - */ - @Test - public void testRunWithAddressOnEpoll() throws IOException, InterruptedException, ExecutionException { - tcpHandler = new TcpHandler(serverAddress, 0, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - //Use Epoll native transport - assertEquals("failed to start server", true, startupServer(true)); - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())); - shutdownServer(); - } - - /** - * Test run with encryption. - */ - @Test - public void testRunWithEncryption() throws InterruptedException, IOException, ExecutionException { - int serverPort = 28001; - tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - assertEquals("failed to start server", true, startupServer(false)); - assertEquals("wrong connection count", 0, tcpHandler.getNumberOfConnections()); - assertEquals("wrong port", serverPort, tcpHandler.getPort()); - assertEquals("wrong address", serverAddress.getHostAddress(), tcpHandler.getAddress()); - - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())); - - shutdownServer(); - } - - /** - * Test run with encryption on Epoll native transport. - */ - @Test - public void testRunWithEncryptionOnEpoll() throws InterruptedException, IOException, ExecutionException { - int serverPort = 28001; - tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - - //Use Epoll native transport - assertEquals("failed to start server", true, startupServer(true)); - assertEquals("wrong connection count", 0, tcpHandler.getNumberOfConnections()); - assertEquals("wrong port", serverPort, tcpHandler.getPort()); - assertEquals("wrong address", serverAddress.getHostAddress(), tcpHandler.getAddress()); - - assertEquals("failed to connect client", true, clientConnection(tcpHandler.getPort())); - - shutdownServer(); - } - - /** - * Test run on already used port. - */ - @Test(expected = BindException.class) - public void testSocketAlreadyInUse() throws IOException { - int serverPort = 28001; - Socket firstBinder = new Socket(); - - try (firstBinder) { - firstBinder.bind(new InetSocketAddress(serverAddress, serverPort)); - tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - tcpHandler.initiateEventLoopGroups(null, false); - tcpHandler.run(); - } - } - - /** - * Test run on already used port. - */ - @Test - public void testSocketAlreadyInUseOnEpoll() throws IOException { - int serverPort = 28001; - Socket firstBinder = new Socket(); - - try (firstBinder) { - firstBinder.bind(new InetSocketAddress(serverAddress, serverPort)); - - tcpHandler = new TcpHandler(serverAddress, serverPort, () -> { }); - tcpHandler.setChannelInitializer(mockChannelInitializer); - //Use Epoll native transport - tcpHandler.initiateEventLoopGroups(null, true); - tcpHandler.run(); - fail("Expected BindException or Errors.NativeIoException"); - } catch (BindException | Errors.NativeIoException e) { - // expected - } - } - - /** - * Trigger the server shutdown and wait 2 seconds for completion. - */ - private void shutdownServer() throws InterruptedException, ExecutionException { - final var shutdownRet = tcpHandler.shutdown() ; - assertNull(shutdownRet.get()); - } - - private Boolean startupServer(final boolean isEpollEnabled) throws InterruptedException { - final var online = tcpHandler.getIsOnlineFuture(); - /** - * Test EPoll based native transport if isEpollEnabled is true. - * Else use Nio based transport. - */ - tcpHandler.initiateEventLoopGroups(null, isEpollEnabled); - new Thread(tcpHandler).start(); - int retry = 0; - while (online.isDone() != true && retry++ < 20) { - Thread.sleep(100); - } - return online.isDone(); - } - - private static Boolean clientConnection(final int port) throws IOException { - // Connect, and disconnect - Socket socket = new Socket(InetAddress.getLoopbackAddress(), port); - Boolean result = socket.isConnected(); - socket.close() ; - return result ; - } -} diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacadeTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacadeTest.java new file mode 100644 index 000000000..23dade46b --- /dev/null +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacadeTest.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech, s.r.o. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.core; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.doReturn; + +import io.netty.channel.ChannelHandlerContext; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; +import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler; +import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory; +import org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory; + +@ExtendWith(MockitoExtension.class) +class TcpServerFacadeTest { + private final InetAddress serverAddress = InetAddress.getLoopbackAddress(); + + @Mock + private ConnectionConfiguration connConfig; + @Mock + private ChannelHandlerContext mockChHndlrCtx; + @Mock + private TcpChannelInitializer mockChannelInitializer; + @Mock + private SwitchConnectionHandler mockSwitchConnHndler; + @Mock + private SerializationFactory mockSerializationFactory; + @Mock + private DeserializationFactory mockDeserializationFactory; + + private TcpServerFacade tcpHandler; + + @AfterEach + void afterEach() throws Exception { + if (tcpHandler != null) { + tcpHandler.shutdown().get(10, TimeUnit.SECONDS); + } + } + + /** + * Test run with null address set. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + void testRunWithNullAddress(final boolean epollEnabled) { + tcpHandler = assertFacade(null, 0, epollEnabled); + assertTrue(clientConnection(tcpHandler.localAddress().getPort())) ; + } + + /** + * Test run with address set. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + void testRunWithAddress(final boolean epollEnabled) { + tcpHandler = assertFacade(serverAddress, 0, epollEnabled); + assertTrue(clientConnection(tcpHandler.localAddress().getPort())) ; + } + + /** + * Test run with encryption. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void testRunWithEncryption(final boolean epollEnabled) { + final int serverPort = 28001; + tcpHandler = assertFacade(serverAddress, serverPort, epollEnabled); + assertEquals(0, tcpHandler.getNumberOfConnections()); + assertEquals(serverPort, tcpHandler.localAddress().getPort()); + assertEquals(serverAddress.getHostAddress(), tcpHandler.localAddress().getHostString()); + + assertTrue(clientConnection(serverPort)); + } + + /** + * Test run on already used port. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + void testSocketAlreadyInUse(final boolean epollEnabled) throws Exception { + final int serverPort = 28001; + + try (var firstBinder = new Socket()) { + firstBinder.bind(new InetSocketAddress(serverAddress, serverPort)); + + doReturn(serverAddress).when(connConfig).getAddress(); + doReturn(serverPort).when(connConfig).getPort(); + + final var future = TcpServerFacade.start(connConfig, epollEnabled, mockChannelInitializer); + final var cause = assertThrows(ExecutionException.class, () -> future.get(1500, TimeUnit.MILLISECONDS)) + .getCause(); + assertThat(cause.getMessage(), containsString("Address already in use")); + } + } + + private TcpServerFacade assertFacade(final InetAddress address, final int port, final boolean epollEnabled) { + doReturn(address).when(connConfig).getAddress(); + doReturn(port).when(connConfig).getPort(); + + final var future = TcpServerFacade.start(connConfig, epollEnabled, mockChannelInitializer); + try { + return future.get(1500, TimeUnit.MILLISECONDS); + } catch (InterruptedException | ExecutionException | TimeoutException e) { + throw new AssertionError(e); + } + } + + private static boolean clientConnection(final int port) { + // Connect, and disconnect + try (var socket = new Socket(InetAddress.getLoopbackAddress(), port)) { + return socket.isConnected(); + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacadeTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacadeTest.java new file mode 100644 index 000000000..625431339 --- /dev/null +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacadeTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014 Pantheon Technologies, s.r.o. and others. All rights reserved. + * Copyright (c) 2024 PANTHEON.tech, s.r.o. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.core; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.mockito.Mockito.doReturn; + +import java.net.InetAddress; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration; + +@ExtendWith(MockitoExtension.class) +class UdpServerFacadeTest { + @Mock + private ConnectionConfiguration connConfig; + @Mock + private UdpChannelInitializer udpChannelInitializerMock; + private UdpServerFacade udpHandler; + + @AfterEach + void afterEach() throws Exception { + if (udpHandler != null) { + udpHandler.shutdown().get(10, TimeUnit.SECONDS); + } + } + + /** + * Test to create UdpHandler with empty address and zero port. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + void testWithEmptyAddress(final boolean epollEnabled) { + udpHandler = assertFacade(null, 0, epollEnabled); + assertNotEquals(0, udpHandler.localAddress().getPort()); + } + + + /** + * Test to create UdpHandler with fill address and given port. + */ + @ParameterizedTest + @ValueSource(booleans = { false, true }) + void testWithAddressAndPort(final boolean epollEnabled) throws Exception { + final int port = 9874; + udpHandler = assertFacade(InetAddress.getLocalHost(), port, epollEnabled); + assertEquals(port, udpHandler.localAddress().getPort()); + } + + private UdpServerFacade assertFacade(final InetAddress address, final int port, final boolean epollEnabled) { + doReturn(address).when(connConfig).getAddress(); + doReturn(port).when(connConfig).getPort(); + + final var future = UdpServerFacade.start(connConfig, epollEnabled, udpChannelInitializerMock); + try { + return future.get(1500, TimeUnit.MILLISECONDS); + } catch (InterruptedException | ExecutionException | TimeoutException e) { + throw new AssertionError(e); + } + } +} diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java index 7c5328812..894ab2547 100755 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java @@ -9,7 +9,10 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doReturn; import java.net.InetAddress; import java.util.List; @@ -18,6 +21,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.infrautils.diagstatus.DiagStatusService; +import org.opendaylight.infrautils.diagstatus.ServiceRegistration; import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfigurationImpl; @@ -62,21 +66,38 @@ import org.opendaylight.yangtools.yang.common.Uint32; */ @RunWith(MockitoJUnitRunner.class) public class SwitchConnectionProviderImpl02Test { - @Mock DiagStatusService diagStatusService; - @Mock SwitchConnectionHandler handler; - @Mock OFGeneralSerializer serializer; - @Mock OFGeneralDeserializer deserializer; - @Mock OFDeserializer deserializerError; - @Mock OFDeserializer deserializerExpMsg; - @Mock OFDeserializer deserializerMultipartRplMsg; - @Mock OFDeserializer deserializerQueueProperty; - @Mock OFDeserializer deserializerMeterBandExpCase; - @Mock OFSerializer serializerExperimenterInput; - @Mock OFSerializer serializerMultipartRequestExpCase; - @Mock OFSerializer serializerMeterBandExpCase; - @Mock ConnectionConfigurationImpl config; private static final int CHANNEL_OUTBOUND_QUEUE_SIZE = 1024; private static final int SWITCH_IDLE_TIMEOUT = 2000; + + @Mock + DiagStatusService diagStatusService; + @Mock + ServiceRegistration diagReg; + @Mock + SwitchConnectionHandler handler; + @Mock + OFGeneralSerializer serializer; + @Mock + OFGeneralDeserializer deserializer; + @Mock + OFDeserializer deserializerError; + @Mock + OFDeserializer deserializerExpMsg; + @Mock + OFDeserializer deserializerMultipartRplMsg; + @Mock + OFDeserializer deserializerQueueProperty; + @Mock + OFDeserializer deserializerMeterBandExpCase; + @Mock + OFSerializer serializerExperimenterInput; + @Mock + OFSerializer serializerMultipartRequestExpCase; + @Mock + OFSerializer serializerMeterBandExpCase; + @Mock + ConnectionConfigurationImpl config; + private TlsConfiguration tlsConfiguration; private SwitchConnectionProviderImpl provider; @@ -90,6 +111,7 @@ public class SwitchConnectionProviderImpl02Test { if (protocol != null) { createConfig(protocol); } + doReturn(diagReg).when(diagStatusService).register(any()); provider = new SwitchConnectionProviderImpl(diagStatusService, config); } @@ -108,7 +130,6 @@ public class SwitchConnectionProviderImpl02Test { config.setTransferProtocol(protocol); } - /** * Test getServerFacade. */ @@ -123,10 +144,10 @@ public class SwitchConnectionProviderImpl02Test { /** * Test shutdown on unconfigured provider. */ - @Test(expected = IllegalStateException.class) + @Test public void testShutdownUnconfigured() throws Exception { startUp(TransportProtocol.TCP); - provider.shutdown(); + assertThrows(IllegalStateException.class, provider::shutdown); } /** @@ -148,15 +169,14 @@ public class SwitchConnectionProviderImpl02Test { public void testUnregisterExistingKeys() throws Exception { startUp(TransportProtocol.TCP); // -- registerActionSerializer - final ExperimenterActionSerializerKey key1 = - new ExperimenterActionSerializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), TestSubType.VALUE); + final var key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + TestSubType.VALUE); provider.registerActionSerializer(key1, serializer); assertTrue("Wrong -- unregister ActionSerializer", provider.unregisterSerializer(key1)); assertFalse("Wrong -- unregister ActionSerializer by not existing key", provider.unregisterSerializer(key1)); // -- registerActionDeserializer - final ExperimenterActionDeserializerKey key2 - = new ExperimenterActionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); + final var key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); provider.registerActionDeserializer(key2, deserializer); assertTrue("Wrong -- unregister ActionDeserializer", provider.unregisterDeserializer(key2)); assertFalse("Wrong -- unregister ActionDeserializer by not existing key", @@ -169,35 +189,33 @@ public class SwitchConnectionProviderImpl02Test { assertFalse("Wrong -- unregister InstructionSerializer by not existing key", provider.unregisterSerializer(key3)); // -- registerInstructionDeserializer - final ExperimenterInstructionDeserializerKey key4 = - new ExperimenterInstructionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); + final var key4 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF_VERSION_1_0, 42L); provider.registerInstructionDeserializer(key4, deserializer); assertTrue("Wrong -- unregister InstructionDeserializer", provider.unregisterDeserializer(key4)); assertFalse("Wrong -- unregister InstructionDeserializer by not existing key", provider.unregisterDeserializer(key4)); // -- registerMatchEntryDeserializer - final MatchEntryDeserializerKey key5 = - new MatchEntryDeserializerKey(EncodeConstants.OF_VERSION_1_0, 0x8000, 42); + final var key5 = new MatchEntryDeserializerKey(EncodeConstants.OF_VERSION_1_0, 0x8000, 42); provider.registerMatchEntryDeserializer(key5, deserializer); assertTrue("Wrong -- unregister MatchEntryDeserializer", provider.unregisterDeserializer(key5)); assertFalse("Wrong -- unregister MatchEntryDeserializer by not existing key", provider.unregisterDeserializer(key5)); // -- registerErrorDeserializer - final ExperimenterIdDeserializerKey key6 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, - Uint32.valueOf(42), ErrorMessage.class); + final var key6 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + ErrorMessage.class); provider.registerErrorDeserializer(key6, deserializerError); assertTrue("Wrong -- unregister ErrorDeserializer", provider.unregisterDeserializer(key6)); assertFalse("Wrong -- unregister ErrorDeserializer by not existing key", provider.unregisterDeserializer(key6)); // -- registerExperimenterMessageDeserializer - final ExperimenterIdDeserializerKey key7 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, - Uint32.valueOf(42), ExperimenterMessage.class); + final var key7 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + ExperimenterMessage.class); provider.registerExperimenterMessageDeserializer(key7, deserializerExpMsg); assertTrue("Wrong -- unregister ExperimenterMessageDeserializer", provider.unregisterDeserializer(key7)); assertFalse("Wrong -- unregister ExperimenterMessageDeserializer by not existing key", provider.unregisterDeserializer(key7)); // -- registerMultipartReplyMessageDeserializer - final ExperimenterIdDeserializerKey key8 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, + final var key8 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), MultipartReplyMessage.class); provider.registerMultipartReplyMessageDeserializer(key8, deserializerMultipartRplMsg); assertTrue("Wrong -- unregister MultipartReplyMessageDeserializer", @@ -205,70 +223,66 @@ public class SwitchConnectionProviderImpl02Test { assertFalse("Wrong -- unregister MultipartReplyMessageDeserializer by not existing key", provider.unregisterDeserializer(key8)); // -- registerMultipartReplyTFDeserializer - final ExperimenterIdDeserializerKey key9 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, - Uint32.valueOf(42), MultipartReplyMessage.class); + final var key9 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + MultipartReplyMessage.class); provider.registerMultipartReplyTFDeserializer(key9, deserializer); assertTrue("Wrong -- unregister MultipartReplyTFDeserializer", provider.unregisterDeserializer(key9)); assertFalse("Wrong -- unregister MultipartReplyTFDeserializer by non existing key", provider.unregisterDeserializer(key9)); // -- registerQueuePropertyDeserializer - final ExperimenterIdDeserializerKey key10 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, - Uint32.valueOf(42), QueueProperty.class); + final var key10 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + QueueProperty.class); provider.registerQueuePropertyDeserializer(key10, deserializerQueueProperty); assertTrue("Wrong -- unregister QueuePropertyDeserializer", provider.unregisterDeserializer(key10)); assertFalse("Wrong -- unregister QueuePropertyDeserializer by not existing key", provider.unregisterDeserializer(key10)); // -- registerMeterBandDeserializer - final ExperimenterIdDeserializerKey key11 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, - Uint32.valueOf(42), MeterBandExperimenterCase.class); + final var key11 = new ExperimenterIdDeserializerKey(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + MeterBandExperimenterCase.class); provider.registerMeterBandDeserializer(key11, deserializerMeterBandExpCase); assertTrue("Wrong -- unregister MeterBandDeserializer", provider.unregisterDeserializer(key11)); assertFalse("Wrong -- unregister MeterBandDeserializer by not existing key", provider.unregisterDeserializer(key11)); // -- registerExperimenterMessageSerializer - ExperimenterIdSerializerKey key12 = - new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), - ExperimenterDataOfChoice.class); + final var key12 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + ExperimenterDataOfChoice.class); provider.registerExperimenterMessageSerializer(key12, serializerExperimenterInput); assertTrue("Wrong -- unregister ExperimenterMessageSerializer", provider.unregisterSerializer(key12)); assertFalse("Wrong -- unregister ExperimenterMessageSerializer by not existing key", provider.unregisterSerializer(key12)); //registerMultipartRequestSerializer - ExperimenterIdSerializerKey key13 = - new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), - ExperimenterDataOfChoice.class); + final var key13 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + ExperimenterDataOfChoice.class); provider.registerMultipartRequestSerializer(key13, serializerMultipartRequestExpCase); assertTrue("Wrong -- unregister MultipartRequestSerializer", provider.unregisterSerializer(key13)); assertFalse("Wrong -- unregister MultipartRequestSerializer by not existing key", provider.unregisterSerializer(key13)); // -- registerMultipartRequestTFSerializer - final ExperimenterIdSerializerKey key14 = - new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), - TableFeatureProperties.class); + final var key14 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), + TableFeatureProperties.class); provider.registerMultipartRequestTFSerializer(key14, serializer); assertTrue("Wrong -- unregister MultipartRequestTFSerializer", provider.unregisterSerializer(key14)); assertFalse("Wrong -- unregister MultipartRequestTFSerializer by not existing key", provider.unregisterSerializer(key14)); // -- registerMeterBandSerializer - final ExperimenterIdMeterSubTypeSerializerKey key15 = - new ExperimenterIdMeterSubTypeSerializerKey<>(EncodeConstants.OF_VERSION_1_0, Uint32.valueOf(42), - MeterBandExperimenterCase.class,null); + final var key15 = new ExperimenterIdMeterSubTypeSerializerKey<>(EncodeConstants.OF_VERSION_1_0, + Uint32.valueOf(42), MeterBandExperimenterCase.class,null); provider.registerMeterBandSerializer(key15, serializerMeterBandExpCase); assertTrue("Wrong -- unregister MeterBandSerializer", provider.unregisterSerializer(key15)); assertFalse("Wrong -- unregister MeterBandSerializer by not existing key", provider.unregisterSerializer(key15)); // -- registerMatchEntrySerializer - final MatchEntrySerializerKey key16 = - new MatchEntrySerializerKey<>(EncodeConstants.OF_VERSION_1_3, OpenflowBasicClass.VALUE, InPort.VALUE); + final var key16 = new MatchEntrySerializerKey<>(EncodeConstants.OF_VERSION_1_3, OpenflowBasicClass.VALUE, + InPort.VALUE); provider.registerMatchEntrySerializer(key16, serializer); assertTrue("Wrong -- unregister MatchEntrySerializer", provider.unregisterSerializer(key16)); assertFalse("Wrong -- unregister MatchEntrySerializer by not existing key", provider.unregisterSerializer(key15)); // -- registerSerializer - final MessageTypeKey key17 = new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3, TestSubType.class); + final var key17 = new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3, TestSubType.class); provider.registerSerializer(key17, serializer); // -- registerDeserializer - final MessageCodeKey key18 = new MessageCodeKey(EncodeConstants.OF_VERSION_1_3, 42, TestSubType.class); + final var key18 = new MessageCodeKey(EncodeConstants.OF_VERSION_1_3, 42, TestSubType.class); provider.registerDeserializer(key18, deserializer); } diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java deleted file mode 100644 index dbcd31079..000000000 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.core.connection; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.net.InetAddress; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.opendaylight.openflowjava.protocol.impl.core.UdpChannelInitializer; -import org.opendaylight.openflowjava.protocol.impl.core.UdpHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Unit tests for UdpHandler. - * - * @author madamjak - */ -@RunWith(MockitoJUnitRunner.class) -public class UdpHandlerTest { - - private static final Logger LOG = LoggerFactory.getLogger(UdpHandlerTest.class); - - @Mock - private UdpChannelInitializer udpChannelInitializerMock; - private UdpHandler udpHandler; - - /** - * Test to create UdpHandler with empty address and zero port. - */ - @Test - public void testWithEmptyAddress() throws Exception { - udpHandler = new UdpHandler(null, 0, () -> { }); - udpHandler.setChannelInitializer(udpChannelInitializerMock); - assertTrue("Wrong - start server", startupServer(false)); - udpHandler.getIsOnlineFuture().get(1500, TimeUnit.MILLISECONDS); - assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); - shutdownServer(); - } - - /** - * Test to create UdpHandler with empty address and zero port on Epoll native transport. - */ - @Test - public void testWithEmptyAddressOnEpoll() throws Exception { - udpHandler = new UdpHandler(null, 0, () -> { }); - udpHandler.setChannelInitializer(udpChannelInitializerMock); - assertTrue("Wrong - start server", startupServer(true)); - udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); - assertFalse("Wrong - port has been set to zero", udpHandler.getPort() == 0); - shutdownServer(); - } - - /** - * Test to create UdpHandler with fill address and given port. - */ - @Test - public void testWithAddressAndPort() throws Exception { - int port = 9874; - udpHandler = new UdpHandler(InetAddress.getLocalHost(), port, () -> { }); - udpHandler.setChannelInitializer(udpChannelInitializerMock); - assertTrue("Wrong - start server", startupServer(false)); - udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); - assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); - shutdownServer(); - } - - /** - * Test to create UdpHandler with fill address and given port on Epoll native transport. - */ - @Test - public void testWithAddressAndPortOnEpoll() throws Exception { - int port = 9874; - udpHandler = new UdpHandler(InetAddress.getLocalHost(), port, () -> { }); - udpHandler.setChannelInitializer(udpChannelInitializerMock); - assertTrue("Wrong - start server", startupServer(true)); - udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS); - assertEquals("Wrong - bad port number has been set", port, udpHandler.getPort()); - shutdownServer(); - } - - private Boolean startupServer(final boolean isEpollEnabled) - throws InterruptedException, ExecutionException { - final var online = udpHandler.getIsOnlineFuture(); - /** - * Test EPoll based native transport if isEpollEnabled is true. - * Else use Nio based transport. - */ - udpHandler.initiateEventLoopGroups(null, isEpollEnabled); - new Thread(udpHandler).start(); - - try { - online.get(10, TimeUnit.SECONDS); - } catch (TimeoutException e) { - LOG.warn("Timeout while waiting for UDP handler to start", e); - } - - return online.isDone(); - } - - private void shutdownServer() throws InterruptedException, ExecutionException, TimeoutException { - final var shutdownRet = udpHandler.shutdown() ; - assertNull("Wrong - shutdown failed", shutdownRet.get(10, TimeUnit.SECONDS)); - } -} diff --git a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java index a5dea9588..75bf309f5 100644 --- a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java +++ b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java @@ -41,8 +41,6 @@ import org.opendaylight.openflowjava.protocol.impl.clients.SleepEvent; import org.opendaylight.openflowjava.protocol.impl.clients.UdpSimpleClient; import org.opendaylight.openflowjava.protocol.impl.clients.WaitForMessageEvent; import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl; -import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler; -import org.opendaylight.openflowjava.protocol.impl.core.UdpHandler; import org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionConfigurationImpl; import org.opendaylight.openflowjava.util.ByteBufUtils; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType; @@ -109,17 +107,11 @@ public class IntegrationTest { switchConnectionProvider = new SwitchConnectionProviderImpl(diagStatusService, connConfig); switchConnectionProvider.startup(mockPlugin).get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); - if (protocol.equals(TransportProtocol.TCP) || protocol.equals(TransportProtocol.TLS)) { - final TcpHandler tcpHandler = (TcpHandler) switchConnectionProvider.getServerFacade(); - port = tcpHandler.getPort(); - } else { - final UdpHandler udpHandler = (UdpHandler) switchConnectionProvider.getServerFacade(); - port = udpHandler.getPort(); - } + port = switchConnectionProvider.getServerFacade().localAddress().getPort(); } @After - public void tearDown() { + public void tearDown() throws Exception { switchConnectionProvider.close(); LOGGER.debug("\n ending test -------------------------------"); } -- 2.43.0 From 7ba9597bd81572e09d3594798dc2a606b5f82c11 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 24 May 2024 02:09:21 +0200 Subject: [PATCH 21/30] Fixup openflow-protocol-impl dependencies We have a number of missing/extra dependencies. Fix all of that up. Change-Id: I1be3bf061e98e305cdfea5179d84147f4f94b07f Signed-off-by: Robert Varga --- openflowjava/openflow-protocol-impl/pom.xml | 91 ++++++++++++++------- openflowplugin-impl/pom.xml | 36 ++++---- 2 files changed, 82 insertions(+), 45 deletions(-) diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index 6213984e3..d5dcfbfe8 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -47,39 +47,42 @@ - ${project.groupId} - openflow-protocol-api + com.github.spotbugs + spotbugs-annotations + true - ${project.groupId} - openflow-protocol-spi + com.google.guava + guava - ${project.groupId} - openflowjava-util + com.guicedee.services + javax.inject + true io.netty - netty-handler + netty-buffer - - org.kohsuke.metainf-services - metainf-services + io.netty + netty-codec - com.github.spotbugs - spotbugs-annotations - true + io.netty + netty-common - com.guicedee.services - javax.inject - true + io.netty + netty-handler - org.osgi - org.osgi.service.component.annotations + io.netty + netty-transport + + + io.netty + netty-transport-classes-epoll jakarta.annotation @@ -87,32 +90,62 @@ provided true - - org.slf4j - slf4j-simple - test + org.checkerframework + checker-qual + true - - org.opendaylight.infrautils - infrautils-util + org.eclipse.jdt + org.eclipse.jdt.annotation - com.google.guava - guava + org.kohsuke.metainf-services + metainf-services org.opendaylight.infrautils diagstatus-api + + org.opendaylight.mdsal + yang-binding + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-inet-types + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-yang-types + + + org.opendaylight.openflowplugin.openflowjava + openflow-protocol-api + + + org.opendaylight.openflowplugin.openflowjava + openflow-protocol-spi + + + org.opendaylight.openflowplugin.openflowjava + openflowjava-util + + + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-common + org.opendaylight.yangtools yang-common-netty - io.netty - netty-transport-classes-epoll + org.osgi + org.osgi.service.component.annotations diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index 00483bcd7..9be45c7a7 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -40,6 +40,22 @@ org.apache.karaf.shell.core provided + + org.opendaylight.infrautils + diagstatus-api + + + org.opendaylight.infrautils + infrautils-util + + + org.opendaylight.mdsal + mdsal-binding-api + + + org.opendaylight.mdsal + mdsal-binding-spi + org.opendaylight.openflowplugin openflowplugin-api @@ -77,31 +93,19 @@ yang-common-netty - org.opendaylight.mdsal - mdsal-binding-api - - - org.opendaylight.mdsal - mdsal-binding-spi - - - ${project.groupId}.openflowjava + org.opendaylight.openflowplugin.openflowjava openflow-protocol-api - org.opendaylight.infrautils - diagstatus-api - - - ${project.groupId}.openflowjava + org.opendaylight.openflowplugin.openflowjava openflow-protocol-spi - ${project.groupId}.openflowjava + org.opendaylight.openflowplugin.openflowjava openflowjava-util - ${project.groupId}.openflowjava + org.opendaylight.openflowplugin.openflowjava openflow-protocol-impl -- 2.43.0 From e6b8c99c6dba6a1729052bd8029dbc548529d5e1 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 24 May 2024 04:51:06 +0200 Subject: [PATCH 22/30] Rework OpenFlowPluginProviderImpl connection provider tracking We are living in a dynamic world, make sure we can accept providers coming and going without restarting. Change-Id: I997c112f6f383631c51c1fbcfcaeae1514721c96 Signed-off-by: Robert Varga --- .../impl/OpenFlowPluginProviderImpl.java | 116 +++++++++++------- .../impl/OpenFlowPluginProviderImplTest.java | 10 +- 2 files changed, 80 insertions(+), 46 deletions(-) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index 56d903e8d..9e81231ce 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -9,19 +9,17 @@ package org.opendaylight.openflowplugin.impl; import static java.util.Objects.requireNonNull; -import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; -import com.google.common.util.concurrent.SettableFuture; import io.netty.util.HashedWheelTimer; import io.netty.util.Timer; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -75,6 +73,7 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; import org.osgi.service.component.annotations.ReferencePolicyOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -98,7 +97,6 @@ public final class OpenFlowPluginProviderImpl private final HashedWheelTimer hashedWheelTimer = new HashedWheelTimer(TICK_DURATION, TimeUnit.MILLISECONDS, TICKS_PER_WHEEL); private final ExtensionConverterManager extensionConverterManager; - private final List switchConnectionProviders; private final DeviceInitializerProvider deviceInitializerProvider; private final ConvertorManager convertorManager; private final OpenflowProviderConfig config; @@ -109,15 +107,16 @@ public final class OpenFlowPluginProviderImpl private final ExecutorService executorService; private final ContextChainHolderImpl contextChainHolder; private final DiagStatusProvider diagStatusProvider; - private final SettableFuture fullyStarted = SettableFuture.create(); + private final List connectionProviders = new ArrayList<>(); + + private List startedProviders; private ConnectionManager connectionManager; + private int startingProviders; @Inject @Activate public OpenFlowPluginProviderImpl(@Reference final ConfigurationService configurationService, - @Reference(cardinality = ReferenceCardinality.AT_LEAST_ONE, policyOption = ReferencePolicyOption.GREEDY) - final List switchConnectionProviders, @Reference final DataBroker dataBroker, @Reference final RpcProviderService rpcProviderRegistry, @Reference final NotificationPublishService notificationPublishService, @Reference final ClusterSingletonServiceProvider singletonServiceProvider, @@ -127,7 +126,6 @@ public final class OpenFlowPluginProviderImpl @Reference final DiagStatusProvider diagStatusProvider, @Reference final SystemReadyMonitor systemReadyMonitor) { config = new OpenFlowProviderConfigImpl(configurationService); - this.switchConnectionProviders = List.copyOf(switchConnectionProviders); final var ppdb = new PingPongDataBroker(dataBroker); this.diagStatusProvider = requireNonNull(diagStatusProvider); @@ -196,48 +194,83 @@ public final class OpenFlowPluginProviderImpl deviceManager.setContextChainHolder(contextChainHolder); deviceManager.initialize(); systemReadyMonitor.registerListener(this); - LOG.info("registered onSystemBootReady() listener for OpenFlowPluginProvider"); + LOG.info("OpenFlowPluginProvider started, waiting for onSystemBootReady()"); } - @Override - public void onSystemBootReady() { - LOG.info("onSystemBootReady() received, starting the switch connections"); - Futures.addCallback(Futures.allAsList(switchConnectionProviders.stream().map(switchConnectionProvider -> { - // Inject OpenFlowPlugin custom serializers and deserializers into OpenFlowJava - if (config.getUseSingleLayerSerialization()) { - SerializerInjector.injectSerializers(switchConnectionProvider, - switchConnectionProvider.getConfiguration().isGroupAddModEnabled()); - DeserializerInjector.injectDeserializers(switchConnectionProvider); - } else { - DeserializerInjector.revertDeserializers(switchConnectionProvider); - } + @Reference(cardinality = ReferenceCardinality.AT_LEAST_ONE, + policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + public synchronized void bindConnectionProvider(final SwitchConnectionProvider switchConnectionProvider) { + connectionProviders.add(switchConnectionProvider); + LOG.info("Added connection provider {}", switchConnectionProvider); + + if (startedProviders != null) { + LOG.info("Starting latecomer connection provider {}", switchConnectionProvider); + startingProviders += 1; + startProvider(switchConnectionProvider); + } + } + + public synchronized void unbindConnectionProvider(final SwitchConnectionProvider switchConnectionProvider) { + connectionProviders.remove(switchConnectionProvider); + if (startedProviders != null && startedProviders.remove(switchConnectionProvider)) { + switchConnectionProvider.shutdown(); + } + LOG.info("Removed connection provider {}", switchConnectionProvider); + } + + private ListenableFuture startProvider(final SwitchConnectionProvider provider) { + // Inject OpenFlowPlugin custom serializers and deserializers into OpenFlowJava + if (config.getUseSingleLayerSerialization()) { + SerializerInjector.injectSerializers(provider, provider.getConfiguration().isGroupAddModEnabled()); + DeserializerInjector.injectDeserializers(provider); + } else { + DeserializerInjector.revertDeserializers(provider); + } - // Set handler of incoming connections and start switch connection provider - return switchConnectionProvider.startup(connectionManager); - }).collect(Collectors.toSet())), new FutureCallback>() { + // Set handler of incoming connections and start switch connection provider + final var future = provider.startup(connectionManager); + startedProviders.add(provider); + Futures.addCallback(future, new FutureCallback<>() { @Override - public void onSuccess(final List result) { - LOG.info("All switchConnectionProviders are up and running ({}).", result.size()); - diagStatusProvider.reportStatus(ServiceState.OPERATIONAL); - fullyStarted.set(null); + public void onSuccess(final Void result) { + LOG.info("Connection provider {} started", provider); + connectionStarted(); } @Override - public void onFailure(final Throwable throwable) { - LOG.warn("Some switchConnectionProviders failed to start.", throwable); - diagStatusProvider.reportStatus(ServiceState.ERROR, throwable); - fullyStarted.setException(throwable); + public void onFailure(final Throwable cause) { + LOG.warn("Connection provider {} failed to start", provider, cause); + connectionFailed(cause); } }, MoreExecutors.directExecutor()); + return future; + } + + @Override + public synchronized void onSystemBootReady() { + LOG.info("onSystemBootReady() received, starting the switch connections"); + + final var size = connectionProviders.size(); + startedProviders = new ArrayList<>(size); + startingProviders = size; + connectionProviders.forEach(this::startProvider); + } + + private synchronized void connectionFailed(final Throwable cause) { + // Decrement below zero, so we do not arrive to zero + startingProviders = -1; + diagStatusProvider.reportStatus(ServiceState.ERROR, cause); } - @VisibleForTesting - public Future getFullyStarted() { - return fullyStarted; + private synchronized void connectionStarted() { + if (--startingProviders == 0 && startedProviders.equals(connectionProviders)) { + LOG.info("All switchConnectionProviders are up and running ({}).", startedProviders.size()); + diagStatusProvider.reportStatus(ServiceState.OPERATIONAL); + } } private ListenableFuture> shutdownSwitchConnections() { - final var listListenableFuture = Futures.allAsList(switchConnectionProviders.stream() + final var future = Futures.allAsList(startedProviders.stream() .map(switchConnectionProvider -> { // Revert deserializers to their original state if (config.getUseSingleLayerSerialization()) { @@ -247,8 +280,9 @@ public final class OpenFlowPluginProviderImpl // Shutdown switch connection provider return switchConnectionProvider.shutdown(); }).collect(Collectors.toList())); + startedProviders.clear(); - Futures.addCallback(listListenableFuture, new FutureCallback<>() { + Futures.addCallback(future, new FutureCallback<>() { @Override public void onSuccess(final List result) { LOG.info("All switchConnectionProviders were successfully shut down ({}).", result.size()); @@ -260,7 +294,7 @@ public final class OpenFlowPluginProviderImpl } }, MoreExecutors.directExecutor()); - return listListenableFuture; + return future; } @Override @@ -282,7 +316,8 @@ public final class OpenFlowPluginProviderImpl @PreDestroy @Deactivate @SuppressWarnings("checkstyle:IllegalCatch") - public void close() { + public synchronized void close() { + LOG.info("OpenFlowPluginProvider stopping"); try { shutdownSwitchConnections().get(10, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { @@ -306,6 +341,7 @@ public final class OpenFlowPluginProviderImpl } catch (Exception e) { LOG.error("Failed to close ConnectionManager", e); } + LOG.info("OpenFlowPluginProvider stopped"); } @SuppressWarnings("checkstyle:IllegalCatch") @@ -338,6 +374,4 @@ public final class OpenFlowPluginProviderImpl } } } - - } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java index 012d39aa8..3ae0dc325 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java @@ -14,7 +14,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.common.util.concurrent.Futures; -import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -96,10 +95,11 @@ public class OpenFlowPluginProviderImplTest { @Test public void testInitializeAndClose() { - try (var provider = new OpenFlowPluginProviderImpl(configurationService, List.of(switchConnectionProvider), - dataBroker, rpcProviderRegistry, notificationPublishService, clusterSingletonServiceProvider, - entityOwnershipService, mastershipChangeServiceManager, messageIntelligenceAgency, - ofPluginDiagstatusProvider, systemReadyMonitor)) { + try (var provider = new OpenFlowPluginProviderImpl(configurationService, dataBroker, rpcProviderRegistry, + notificationPublishService, clusterSingletonServiceProvider, entityOwnershipService, + mastershipChangeServiceManager, messageIntelligenceAgency, ofPluginDiagstatusProvider, + systemReadyMonitor)) { + provider.bindConnectionProvider(switchConnectionProvider); // Calling the onSystemBootReady() callback provider.onSystemBootReady(); verify(switchConnectionProvider).startup(any()); -- 2.43.0 From 65959364e29fab495dd1fb694483721d9c9aabbe Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 6 Jun 2024 17:48:52 +0200 Subject: [PATCH 23/30] Bump upstreams Adopt: - odlparent-13.1.3 - infrautils-6.0.9 - yangtools-13.0.6 - mdsal-13.0.4 - controller-9.0.4 - aaa-0.19.5 - netconf-7.0.6 Change-Id: I895b6fad732c308a211a4a72f049a17d3eeacf05 Signed-off-by: Robert Varga --- applications/arbitratorreconciliation/pom.xml | 2 +- applications/pom.xml | 2 +- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- .../odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 4 ++-- .../odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 6 +++--- features-aggregator/odl-openflowplugin-southbound/pom.xml | 6 +++--- features-aggregator/pom.xml | 2 +- libraries/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 8 ++++---- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- parent/pom.xml | 6 +++--- samples/pom.xml | 2 +- 37 files changed, 47 insertions(+), 47 deletions(-) diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 0772b9914..a9a9d461e 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/applications/pom.xml b/applications/pom.xml index 08f0de916..389db95f1 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/artifacts/pom.xml b/artifacts/pom.xml index d819c71aa..1c1b419e1 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 87319036c..5629cbb02 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 13.1.2 + 13.1.3 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 53398e39d..75b4e83c9 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.2 + 13.1.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 9924abf5b..838bc6470 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index ae3c74674..f5af93517 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index f78e38aef..ccf34b67b 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 322ad79ad..2f1ebda54 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 4.0.0 diff --git a/extension/pom.xml b/extension/pom.xml index 07b7208c8..3700cdb40 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index e66e2f5c6..16e626217 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 2be8024d0..82146652a 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index a6dfca724..76499b9ca 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 03d2a503e..4a533c819 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index df5115d9a..c228fd686 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index a2f8fca8d..2877a7dc0 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index ff3e7a296..f0a282eaf 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 681e3308c..d619c67b2 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 8c693863d..1239e5d8a 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index 16b7ea946..3b86fd80e 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 73fe4e68d..15cf55dc1 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index d8c7e914d..25d78aa73 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 59fcaa929..5413d5b8f 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 8c3b04b44..bec350c02 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 73b229898..e709bfd1a 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 7.0.5 + 7.0.6 import pom diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index e5c2d87dc..f8b6a4162 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index d99a09952..e6e668b2f 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index d15a7610c..9457332c4 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 @@ -21,7 +21,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.3 + 13.0.4 import pom @@ -30,7 +30,7 @@ org.opendaylight.controller controller-artifacts - 9.0.3 + 9.0.4 import pom diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index cf378a37f..9d59b8fe4 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 @@ -29,14 +29,14 @@ org.opendaylight.controller controller-artifacts - 9.0.3 + 9.0.4 import pom org.opendaylight.infrautils infrautils-artifacts - 6.0.8 + 6.0.9 import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index a1109001f..0bec3ede7 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/libraries/pom.xml b/libraries/pom.xml index 6b7b69be0..0d98a4a5f 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/model/pom.xml b/model/pom.xml index c2c3bb3df..5d149e335 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index 22a9d581a..4232292bd 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.2 + 13.1.3 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 3abc7324c..b355b33c3 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.2 + 13.1.3 @@ -33,7 +33,7 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.8 + 6.0.9 import pom @@ -42,7 +42,7 @@ org.opendaylight.yangtools yangtools-artifacts - 13.0.5 + 13.0.6 import pom @@ -51,7 +51,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.3 + 13.0.4 import pom diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index 7411beaa0..b36bfebae 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 diff --git a/parent/pom.xml b/parent/pom.xml index 961880cdc..da7d5f799 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.mdsal binding-parent - 13.0.3 + 13.0.4 @@ -41,14 +41,14 @@ org.opendaylight.controller controller-artifacts - 9.0.3 + 9.0.4 pom import org.opendaylight.infrautils infrautils-artifacts - 6.0.8 + 6.0.9 pom import diff --git a/samples/pom.xml b/samples/pom.xml index ad4256b0d..b3abfc9e6 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.2 + 13.1.3 -- 2.43.0 From 5417744502652a59ca28f04b600fde1092c77029 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 13 Jun 2024 19:14:25 +0200 Subject: [PATCH 24/30] Bump netconf to 7.0.7 Pick up a critical fix from upstream. Change-Id: I73187c514a585e8a22e5d22ee66a2df106dc4874 Signed-off-by: Robert Varga --- .../odl-openflowplugin-flow-services-rest/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index e709bfd1a..2f1000ac6 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 7.0.6 + 7.0.7 import pom -- 2.43.0 From 59fd0b715a6fe90769c985fe484813ac7514b0a2 Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Fri, 28 Jun 2024 00:33:45 +0000 Subject: [PATCH 25/30] Bump versions by x.y.(z+1) Change-Id: I95babd64fe74618674b61938b374550ed41ea35b Signed-off-by: jenkins-releng --- applications/arbitratorreconciliation/api/pom.xml | 2 +- applications/arbitratorreconciliation/impl/pom.xml | 2 +- applications/arbitratorreconciliation/pom.xml | 2 +- applications/bulk-o-matic/pom.xml | 2 +- applications/device-ownership-service/pom.xml | 2 +- applications/forwardingrules-manager/pom.xml | 2 +- applications/forwardingrules-sync/pom.xml | 2 +- applications/lldp-speaker/pom.xml | 2 +- applications/of-switch-config-pusher/pom.xml | 2 +- applications/pom.xml | 2 +- applications/reconciliation-framework/pom.xml | 2 +- applications/southbound-cli/pom.xml | 2 +- applications/table-miss-enforcer/pom.xml | 2 +- applications/topology-lldp-discovery/pom.xml | 2 +- applications/topology-manager/pom.xml | 4 ++-- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 4 ++-- drop-test-karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/openflowjava-extension-eric/pom.xml | 2 +- extension/openflowjava-extension-nicira-api/pom.xml | 2 +- extension/openflowjava-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-api/pom.xml | 2 +- extension/openflowplugin-extension-eric/pom.xml | 2 +- extension/openflowplugin-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-onf/pom.xml | 2 +- extension/pom.xml | 2 +- extension/test-extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../odl-openflowplugin-app-arbitratorreconciliation/pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-manager/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../odl-openflowplugin-app-reconciliation-framework/pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../odl-openflowplugin-app-topology-lldp-discovery/pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- features-aggregator/odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 2 +- features-aggregator/odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 2 +- features-aggregator/odl-openflowplugin-southbound/pom.xml | 4 ++-- features-aggregator/pom.xml | 2 +- libraries/liblldp/pom.xml | 2 +- libraries/pom.xml | 2 +- model/model-flow-base/pom.xml | 2 +- model/model-flow-service/pom.xml | 2 +- model/model-flow-statistics/pom.xml | 2 +- model/model-inventory/pom.xml | 2 +- model/model-topology/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 2 +- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- openflowjava/openflow-protocol-api/pom.xml | 4 ++-- openflowjava/openflow-protocol-impl/pom.xml | 2 +- openflowjava/openflow-protocol-it/pom.xml | 2 +- openflowjava/openflow-protocol-spi/pom.xml | 2 +- openflowjava/openflowjava-blueprint-config/pom.xml | 2 +- openflowjava/openflowjava-util/pom.xml | 2 +- openflowjava/pom.xml | 2 +- openflowplugin-api/pom.xml | 2 +- openflowplugin-blueprint-config/pom.xml | 2 +- openflowplugin-common/pom.xml | 2 +- openflowplugin-impl/pom.xml | 2 +- openflowplugin-it/pom.xml | 2 +- openflowplugin/pom.xml | 2 +- parent/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/learning-switch/pom.xml | 2 +- samples/pom.xml | 2 +- samples/sample-bundles/pom.xml | 2 +- samples/sample-consumer/pom.xml | 2 +- samples/simple-client/pom.xml | 2 +- test-common/pom.xml | 2 +- test-provider/pom.xml | 2 +- 85 files changed, 91 insertions(+), 91 deletions(-) diff --git a/applications/arbitratorreconciliation/api/pom.xml b/applications/arbitratorreconciliation/api/pom.xml index d6be58698..e0dea7ddc 100644 --- a/applications/arbitratorreconciliation/api/pom.xml +++ b/applications/arbitratorreconciliation/api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../../parent diff --git a/applications/arbitratorreconciliation/impl/pom.xml b/applications/arbitratorreconciliation/impl/pom.xml index 02a8ed4e9..e22310986 100644 --- a/applications/arbitratorreconciliation/impl/pom.xml +++ b/applications/arbitratorreconciliation/impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../../parent diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index a9a9d461e..3be686de9 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.applications arbitratorreconciliation-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom ODL :: openflowplugin :: ${project.artifactId} diff --git a/applications/bulk-o-matic/pom.xml b/applications/bulk-o-matic/pom.xml index b8d368ab0..53abea9e0 100644 --- a/applications/bulk-o-matic/pom.xml +++ b/applications/bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/device-ownership-service/pom.xml b/applications/device-ownership-service/pom.xml index ff3fe5a35..58377c4b5 100644 --- a/applications/device-ownership-service/pom.xml +++ b/applications/device-ownership-service/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/forwardingrules-manager/pom.xml b/applications/forwardingrules-manager/pom.xml index ef8f17c05..cd3c9463b 100644 --- a/applications/forwardingrules-manager/pom.xml +++ b/applications/forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/forwardingrules-sync/pom.xml b/applications/forwardingrules-sync/pom.xml index 5d8df288d..57db00011 100644 --- a/applications/forwardingrules-sync/pom.xml +++ b/applications/forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/lldp-speaker/pom.xml b/applications/lldp-speaker/pom.xml index a00bebc14..3a22fc9d6 100644 --- a/applications/lldp-speaker/pom.xml +++ b/applications/lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/of-switch-config-pusher/pom.xml b/applications/of-switch-config-pusher/pom.xml index 47c96c911..517f446ac 100644 --- a/applications/of-switch-config-pusher/pom.xml +++ b/applications/of-switch-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/pom.xml b/applications/pom.xml index 389db95f1..95a601585 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin applications-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/applications/reconciliation-framework/pom.xml b/applications/reconciliation-framework/pom.xml index e8c38955c..07904682c 100644 --- a/applications/reconciliation-framework/pom.xml +++ b/applications/reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/southbound-cli/pom.xml b/applications/southbound-cli/pom.xml index 483a10161..88bcd19b0 100644 --- a/applications/southbound-cli/pom.xml +++ b/applications/southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/table-miss-enforcer/pom.xml b/applications/table-miss-enforcer/pom.xml index b6d1b68ec..054a073da 100644 --- a/applications/table-miss-enforcer/pom.xml +++ b/applications/table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/applications/topology-lldp-discovery/pom.xml b/applications/topology-lldp-discovery/pom.xml index a97175f5d..252ae96de 100644 --- a/applications/topology-lldp-discovery/pom.xml +++ b/applications/topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent org.opendaylight.openflowplugin.applications diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index c7b68fc52..c7121ce49 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent org.opendaylight.openflowplugin.applications topology-manager - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT bundle diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 1c1b419e1..b9f3492fc 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -19,7 +19,7 @@ org.opendaylight.openflowplugin openflowplugin-artifacts - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 5629cbb02..f268d52f0 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -8,11 +8,11 @@ org.opendaylight.openflowplugin openflowplugin-karaf - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT diff --git a/drop-test-karaf/pom.xml b/drop-test-karaf/pom.xml index 3133dbc65..16732b0d3 100644 --- a/drop-test-karaf/pom.xml +++ b/drop-test-karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 75b4e83c9..f05926d7a 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin-extension feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 838bc6470..0e0f6612c 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-eric-extensions feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Eric Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index f5af93517..4690d18b9 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nxm-extensions feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Nicira Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index ccf34b67b..76683735b 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-onf-extensions feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: ONF Extensions diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 2f1ebda54..80e3e31cf 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-extension-aggregator pom - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT features-openflowplugin-extension diff --git a/extension/openflowjava-extension-eric/pom.xml b/extension/openflowjava-extension-eric/pom.xml index 89a299719..6fac9d7c0 100644 --- a/extension/openflowjava-extension-eric/pom.xml +++ b/extension/openflowjava-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent openflowjava-extension-eric diff --git a/extension/openflowjava-extension-nicira-api/pom.xml b/extension/openflowjava-extension-nicira-api/pom.xml index 295929905..6ca3c64aa 100644 --- a/extension/openflowjava-extension-nicira-api/pom.xml +++ b/extension/openflowjava-extension-nicira-api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent openflowjava-extension-nicira-api diff --git a/extension/openflowjava-extension-nicira/pom.xml b/extension/openflowjava-extension-nicira/pom.xml index 654b84176..07fd73960 100644 --- a/extension/openflowjava-extension-nicira/pom.xml +++ b/extension/openflowjava-extension-nicira/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent openflowjava-extension-nicira diff --git a/extension/openflowplugin-extension-api/pom.xml b/extension/openflowplugin-extension-api/pom.xml index b21ec3cf6..06180687d 100644 --- a/extension/openflowplugin-extension-api/pom.xml +++ b/extension/openflowplugin-extension-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-eric/pom.xml b/extension/openflowplugin-extension-eric/pom.xml index f4715668f..f6cef1066 100644 --- a/extension/openflowplugin-extension-eric/pom.xml +++ b/extension/openflowplugin-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-nicira/pom.xml b/extension/openflowplugin-extension-nicira/pom.xml index 93a924f2e..84fb7b2ea 100644 --- a/extension/openflowplugin-extension-nicira/pom.xml +++ b/extension/openflowplugin-extension-nicira/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/extension/openflowplugin-extension-onf/pom.xml b/extension/openflowplugin-extension-onf/pom.xml index f7226fe0b..3c2ace98d 100644 --- a/extension/openflowplugin-extension-onf/pom.xml +++ b/extension/openflowplugin-extension-onf/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/extension/pom.xml b/extension/pom.xml index 3700cdb40..ce27ee92a 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-extension-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/extension/test-extension/pom.xml b/extension/test-extension/pom.xml index 414343aa6..b2673c3b7 100644 --- a/extension/test-extension/pom.xml +++ b/extension/test-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index 16e626217..a16ab73ea 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 82146652a..911afb05b 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-arbitratorreconciliation feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Arbitrator Reconciliation diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 76499b9ca..98c8a05c7 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-bulk-o-matic feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - bulk flow operations support diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 4a533c819..d32b95d2d 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-config-pusher feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - default config-pusher diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index c228fd686..b9dc17647 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-manager feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - FRM diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index 2877a7dc0..cae894ba2 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-sync feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - FRS diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index f0a282eaf..7d5d19079 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-lldp-speaker feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - LLDP Speaker diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index d619c67b2..6c81eb5a7 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-reconciliation-framework feature -0.18.1-SNAPSHOT +0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Reconciliation Framework diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 1239e5d8a..edbd9b343 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-southbound-cli feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Southbound CLI diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index 3b86fd80e..b10ab82e2 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-table-miss-enforcer feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - table-miss-enforcer diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 15cf55dc1..ec72c218f 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-lldp-discovery feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Topology LLDP Discovery diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 25d78aa73..0f7d024c4 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-manager feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - Topology Manager diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 5413d5b8f..c1ff5d6d3 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Application - topology diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index bec350c02..07c1dddd7 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-drop-test feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Drop Test diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 2f1000ac6..6c63f917f 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services-rest feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Flow Services :: REST diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index f8b6a4162..fc919d303 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Flow Services diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index e6e668b2f..662da8514 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-libraries feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Libraries diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index 9457332c4..c12288622 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nsf-model feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: OpenflowPlugin :: NSF :: Model diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index 9d59b8fe4..be833b612 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-southbound feature - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT OpenDaylight :: Openflow Plugin :: Li southbound API implementation @@ -43,7 +43,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.1-SNAPSHOT + 0.13.2-SNAPSHOT import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 0bec3ede7..5d590d47d 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-aggregator pom - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT features-openflowplugin diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index bb958b33b..7702d9340 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/libraries/pom.xml b/libraries/pom.xml index 0d98a4a5f..6860edd30 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin libraries-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/model/model-flow-base/pom.xml b/model/model-flow-base/pom.xml index d39659b8c..e8a39e211 100644 --- a/model/model-flow-base/pom.xml +++ b/model/model-flow-base/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/model/model-flow-service/pom.xml b/model/model-flow-service/pom.xml index 5e0c16393..20ade1d54 100644 --- a/model/model-flow-service/pom.xml +++ b/model/model-flow-service/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/model/model-flow-statistics/pom.xml b/model/model-flow-statistics/pom.xml index f72d7fa1c..2cb549c59 100644 --- a/model/model-flow-statistics/pom.xml +++ b/model/model-flow-statistics/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/model/model-inventory/pom.xml b/model/model-inventory/pom.xml index 33ae156fc..770d590c3 100644 --- a/model/model-inventory/pom.xml +++ b/model/model-inventory/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/model/model-topology/pom.xml b/model/model-topology/pom.xml index fdeec6b14..9b1eea8ff 100644 --- a/model/model-topology/pom.xml +++ b/model/model-topology/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/model/pom.xml b/model/pom.xml index 5d149e335..10ff7594a 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.openflowplugin.model model-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index 4232292bd..6a730708f 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava features-openflowjava - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT feature diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index b355b33c3..b57edd92f 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.openflowjava odl-openflowjava-protocol - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT feature diff --git a/openflowjava/openflow-protocol-api/pom.xml b/openflowjava/openflow-protocol-api/pom.xml index be56b0389..fdae0c19a 100644 --- a/openflowjava/openflow-protocol-api/pom.xml +++ b/openflowjava/openflow-protocol-api/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent org.opendaylight.openflowplugin.openflowjava openflow-protocol-api - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT bundle diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index d5dcfbfe8..372e58fa7 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../ openflow-protocol-impl diff --git a/openflowjava/openflow-protocol-it/pom.xml b/openflowjava/openflow-protocol-it/pom.xml index eb8a58a68..7d1d87100 100644 --- a/openflowjava/openflow-protocol-it/pom.xml +++ b/openflowjava/openflow-protocol-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../ openflow-protocol-it diff --git a/openflowjava/openflow-protocol-spi/pom.xml b/openflowjava/openflow-protocol-spi/pom.xml index 8080301f5..f222aafe4 100644 --- a/openflowjava/openflow-protocol-spi/pom.xml +++ b/openflowjava/openflow-protocol-spi/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../ openflow-protocol-spi diff --git a/openflowjava/openflowjava-blueprint-config/pom.xml b/openflowjava/openflowjava-blueprint-config/pom.xml index 04e99bc42..c0b0381c4 100644 --- a/openflowjava/openflowjava-blueprint-config/pom.xml +++ b/openflowjava/openflowjava-blueprint-config/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../ openflowjava-blueprint-config diff --git a/openflowjava/openflowjava-util/pom.xml b/openflowjava/openflowjava-util/pom.xml index 8913d8d96..b579a7855 100644 --- a/openflowjava/openflowjava-util/pom.xml +++ b/openflowjava/openflowjava-util/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../ bundle diff --git a/openflowjava/pom.xml b/openflowjava/pom.xml index b9ccf3b4d..7d8ce206c 100644 --- a/openflowjava/pom.xml +++ b/openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin-api/pom.xml b/openflowplugin-api/pom.xml index 0bc683bd1..7ded49d61 100644 --- a/openflowplugin-api/pom.xml +++ b/openflowplugin-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin-blueprint-config/pom.xml b/openflowplugin-blueprint-config/pom.xml index b95833451..245ca1221 100644 --- a/openflowplugin-blueprint-config/pom.xml +++ b/openflowplugin-blueprint-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index d5b968da6..1f5f4d26a 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index 9be45c7a7..a97f93925 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin-it/pom.xml b/openflowplugin-it/pom.xml index 35c048d44..0006acb31 100644 --- a/openflowplugin-it/pom.xml +++ b/openflowplugin-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index 436c3369a..9dfca6264 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent diff --git a/parent/pom.xml b/parent/pom.xml index da7d5f799..f946c1a50 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -19,7 +19,7 @@ 4.0.0 org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom @@ -55,7 +55,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.1-SNAPSHOT + 0.13.2-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index e9d49400f..10dc1c5d5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT parent openflowplugin-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT openflowplugin pom diff --git a/samples/learning-switch/pom.xml b/samples/learning-switch/pom.xml index 7f960c2dc..74b5ae8e5 100644 --- a/samples/learning-switch/pom.xml +++ b/samples/learning-switch/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/samples/pom.xml b/samples/pom.xml index b3abfc9e6..c0a043837 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-samples-aggregator - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT pom diff --git a/samples/sample-bundles/pom.xml b/samples/sample-bundles/pom.xml index 23f9b9660..2de036cc7 100644 --- a/samples/sample-bundles/pom.xml +++ b/samples/sample-bundles/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/samples/sample-consumer/pom.xml b/samples/sample-consumer/pom.xml index d6e39af66..10bbb1ccf 100644 --- a/samples/sample-consumer/pom.xml +++ b/samples/sample-consumer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/samples/simple-client/pom.xml b/samples/simple-client/pom.xml index 38cc82e7f..a9b7c6154 100644 --- a/samples/simple-client/pom.xml +++ b/samples/simple-client/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../../parent diff --git a/test-common/pom.xml b/test-common/pom.xml index 4cc3ef943..ce0fa9158 100644 --- a/test-common/pom.xml +++ b/test-common/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent test-common diff --git a/test-provider/pom.xml b/test-provider/pom.xml index 39ce98f6a..8874d9b8b 100644 --- a/test-provider/pom.xml +++ b/test-provider/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.1-SNAPSHOT + 0.18.2-SNAPSHOT ../parent test-provider -- 2.43.0 From 888e37df63366748bf9f991ee9ce1a0ed447579f Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 2 Sep 2024 20:28:40 +0200 Subject: [PATCH 26/30] Bump upstreams Adopt: - odlparent-13.1.4 - infrautils-6.0.10 - yangtools-13.0.7 - mdsal-13.0.6 - controller-9.0.5 - aaa-0.19.6 - netconf-7.0.8 Change-Id: I5b6b9bd8f4b93be6bf25dacd11379f3137a02206 Signed-off-by: Robert Varga --- applications/arbitratorreconciliation/pom.xml | 2 +- applications/pom.xml | 2 +- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- .../odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 4 ++-- .../odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 6 +++--- features-aggregator/odl-openflowplugin-southbound/pom.xml | 6 +++--- features-aggregator/pom.xml | 2 +- libraries/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 8 ++++---- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- parent/pom.xml | 6 +++--- samples/pom.xml | 2 +- 37 files changed, 47 insertions(+), 47 deletions(-) diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 3be686de9..94851ae44 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/applications/pom.xml b/applications/pom.xml index 95a601585..05eec0297 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/artifacts/pom.xml b/artifacts/pom.xml index b9f3492fc..ef508fd1f 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index f268d52f0..719a49688 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 13.1.3 + 13.1.4 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index f05926d7a..fcc2d5bce 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.3 + 13.1.4 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 0e0f6612c..be7085b1c 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index 4690d18b9..c0380444e 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index 76683735b..87a0d27e5 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 80e3e31cf..0823c1f37 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 4.0.0 diff --git a/extension/pom.xml b/extension/pom.xml index ce27ee92a..a99101a18 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index a16ab73ea..9983f53cb 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 911afb05b..ff5ce23df 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 98c8a05c7..ce091dbb6 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index d32b95d2d..ca924de4f 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index b9dc17647..34da35657 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index cae894ba2..daacc1317 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index 7d5d19079..85cf8ed7a 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 6c81eb5a7..2744d4ab0 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index edbd9b343..7b168c178 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index b10ab82e2..c3fab0874 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index ec72c218f..a2168e710 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 0f7d024c4..50b76d898 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index c1ff5d6d3..2857d692d 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 07c1dddd7..86b1917b0 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 6c63f917f..eb295b9a7 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 7.0.7 + 7.0.8 import pom diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index fc919d303..7db5139d2 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index 662da8514..fd863d1bd 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index c12288622..0b006ab85 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 @@ -21,7 +21,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.4 + 13.0.6 import pom @@ -30,7 +30,7 @@ org.opendaylight.controller controller-artifacts - 9.0.4 + 9.0.5 import pom diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index be833b612..c7f3dbd58 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 @@ -29,14 +29,14 @@ org.opendaylight.controller controller-artifacts - 9.0.4 + 9.0.5 import pom org.opendaylight.infrautils infrautils-artifacts - 6.0.9 + 6.0.10 import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 5d590d47d..099fd7148 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/libraries/pom.xml b/libraries/pom.xml index 6860edd30..3c953e9cb 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/model/pom.xml b/model/pom.xml index 10ff7594a..bc336d527 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index 6a730708f..4c90bcb42 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.1.3 + 13.1.4 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index b57edd92f..045633111 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 13.1.3 + 13.1.4 @@ -33,7 +33,7 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.9 + 6.0.10 import pom @@ -42,7 +42,7 @@ org.opendaylight.yangtools yangtools-artifacts - 13.0.6 + 13.0.7 import pom @@ -51,7 +51,7 @@ org.opendaylight.mdsal mdsal-artifacts - 13.0.4 + 13.0.6 import pom diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index 95e1669b0..ba12fb38c 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 diff --git a/parent/pom.xml b/parent/pom.xml index f946c1a50..e32f2172d 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.mdsal binding-parent - 13.0.4 + 13.0.6 @@ -41,14 +41,14 @@ org.opendaylight.controller controller-artifacts - 9.0.4 + 9.0.5 pom import org.opendaylight.infrautils infrautils-artifacts - 6.0.9 + 6.0.10 pom import diff --git a/samples/pom.xml b/samples/pom.xml index c0a043837..1eeb73b41 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.1.3 + 13.1.4 -- 2.43.0 From c5c8c1c915bd5a91c76b7b4ac18e381095e88ec5 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 3 Sep 2024 15:16:32 +0200 Subject: [PATCH 27/30] Bump netconf to 7.0.9 Pick up regression fixes from upstream. Change-Id: I84e53bb1bfd92ec143e35772e32cac5aefe29aa8 Signed-off-by: Robert Varga --- .../odl-openflowplugin-flow-services-rest/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index eb295b9a7..06fd71af5 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 7.0.8 + 7.0.9 import pom -- 2.43.0 From e20cdfd2f5a64fd5083ac6d1521386409a332e33 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 23 Sep 2024 19:36:05 +0200 Subject: [PATCH 28/30] Use configuration from XML files Rather than deploying fixed configuration, parse it from XML files, as documented. JIRA: OPNFLWPLUG-1133 Change-Id: Ib3e9df26639e33be6414c7458d9664a5eb823237 Signed-off-by: Robert Varga --- .../openflowjava-blueprint-config/pom.xml | 30 +++++- ...iFactorySwitchConnectionConfiguration.java | 102 ++++++++++-------- 2 files changed, 84 insertions(+), 48 deletions(-) diff --git a/openflowjava/openflowjava-blueprint-config/pom.xml b/openflowjava/openflowjava-blueprint-config/pom.xml index c0b0381c4..7662d2b7f 100644 --- a/openflowjava/openflowjava-blueprint-config/pom.xml +++ b/openflowjava/openflowjava-blueprint-config/pom.xml @@ -43,11 +43,11 @@ org.opendaylight.mdsal - yang-binding + mdsal-dom-api - org.opendaylight.openflowplugin.openflowjava - openflow-protocol-api + org.opendaylight.mdsal + yang-binding org.opendaylight.openflowplugin.openflowjava @@ -61,10 +61,34 @@ org.opendaylight.yangtools concepts + + org.opendaylight.yangtools + util + org.opendaylight.yangtools yang-common + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-data-codec-xml + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-model-api + + + org.opendaylight.yangtools + yang-model-util + org.osgi org.osgi.framework diff --git a/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java index e56736509..f755ea9ef 100644 --- a/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java +++ b/openflowjava/openflowjava-blueprint-config/src/main/java/org/opendaylight/openflowjava/mdsal/OSGiFactorySwitchConnectionConfiguration.java @@ -10,18 +10,22 @@ package org.opendaylight.openflowjava.mdsal; import com.google.common.base.Stopwatch; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.MoreExecutors; -import java.util.List; -import org.opendaylight.mdsal.binding.api.DataBroker; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import javax.xml.stream.XMLStreamException; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfigBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506._switch.connection.config.TlsBuilder; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.util.xml.UntrustedXML; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.MapNode; +import org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream; +import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; +import org.opendaylight.yangtools.yang.data.impl.schema.NormalizationResultHolder; +import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -34,73 +38,81 @@ import org.slf4j.LoggerFactory; @Component(service = { }) public final class OSGiFactorySwitchConnectionConfiguration { private static final Logger LOG = LoggerFactory.getLogger(OSGiFactorySwitchConnectionConfiguration.class); + private static final Path INITIAL_CONFIG_DIR = Path.of("etc", "opendaylight", "datastore", "initial", "config"); @Activate - public OSGiFactorySwitchConnectionConfiguration(@Reference final DataBroker dataBroker) { - // Common for both cases - final var builder = new SwitchConnectionConfigBuilder() - .setTransportProtocol(TransportProtocol.TCP) - .setGroupAddModEnabled(Boolean.FALSE) - .setChannelOutboundQueueSize(Uint16.valueOf(1024)) - .setTls(new TlsBuilder() - .setKeystore("configuration/ssl/ctl.jks") - .setKeystoreType(KeystoreType.JKS) - .setKeystorePathType(PathType.PATH) - .setKeystorePassword("opendaylight") - .setTruststore("configuration/ssl/truststore.jks") - .setTruststoreType(KeystoreType.JKS) - .setTruststorePathType(PathType.PATH) - .setTruststorePassword("opendaylight") - .setCertificatePassword("opendaylight") - .setCipherSuites(List.of()) - .build()); + public OSGiFactorySwitchConnectionConfiguration(@Reference final DOMDataBroker dataBroker, + @Reference final DOMSchemaService schemaService) { + final var inference = Inference.ofDataTreePath(schemaService.getGlobalContext(), SwitchConnectionConfig.QNAME); // Create OF switch connection provider on port 6653 (default) - writeIfNotPresent(dataBroker, builder - .setInstanceName("openflow-switch-connection-provider-default-impl") - .setPort(Uint16.valueOf(6653)) - .build()); + writeIfNotPresent(dataBroker, inference, "default-openflow-connection-config.xml"); // Create OF switch connection provider on port 6633 (legacy) - writeIfNotPresent(dataBroker, builder - .setInstanceName("openflow-switch-connection-provider-legacy-impl") - .setPort(Uint16.valueOf(6633)) - .build()); + writeIfNotPresent(dataBroker, inference, "legacy-openflow-connection-config.xml"); } - private static void writeIfNotPresent(final DataBroker dataBroker, final SwitchConnectionConfig config) { - final var instanceName = config.getInstanceName(); - LOG.info("Checking presence of configuration for {}", instanceName); + private static void writeIfNotPresent(final DOMDataBroker dataBroker, final Inference inference, + final String fileName) { + final var path = INITIAL_CONFIG_DIR.resolve(fileName); + final var resultHolder = new NormalizationResultHolder(); + final var writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder); + try (var xmlParser = XmlParserStream.create(writer, inference)) { + xmlParser.parse(UntrustedXML.createXMLStreamReader(Files.newInputStream(path))); + } catch (IOException | XMLStreamException e) { + LOG.warn("Cannot parse {}, skipping configuration deployment", path, e); + return; + } + + final var result = resultHolder.getResult().data(); + if (!(result instanceof MapNode map)) { + LOG.warn("Skipping configuration deployment of non-MapNode {}", result.prettyTree()); + return; + } + final var size = map.size(); + if (size != 1) { + LOG.warn("Skipping configuration deployment of multi-entry {}", map.prettyTree()); + return; + } + final var entry = map.body().iterator().next(); + final var name = entry.name(); + if (!SwitchConnectionConfig.QNAME.equals(name.getNodeType())) { + LOG.warn("Skipping configuration deployemtn of unrecognized {}", entry.prettyTree()); + return; + } + + LOG.info("Checking presence of configuration for {}", name); final var sw = Stopwatch.createStarted(); - final var iid = InstanceIdentifier.builder(SwitchConnectionConfig.class, config.key()).build(); + final var iid = YangInstanceIdentifier.builder().node(SwitchConnectionConfig.QNAME).node(name).build(); + final var tx = dataBroker.newReadWriteTransaction(); tx.exists(LogicalDatastoreType.CONFIGURATION, iid).addCallback(new FutureCallback() { @Override public void onSuccess(final Boolean result) { - LOG.debug("Presence of configuration for {} ascertained in {}", instanceName, sw); + LOG.debug("Presence of configuration for {} ascertained in {}", name, sw); if (result) { - LOG.info("Configuration for {} already present", instanceName); + LOG.info("Configuration for {} already present", name); tx.cancel(); return; } - tx.put(LogicalDatastoreType.CONFIGURATION, iid, config); + tx.put(LogicalDatastoreType.CONFIGURATION, iid, entry); tx.commit().addCallback(new FutureCallback() { @Override public void onSuccess(final CommitInfo result) { - LOG.info("Configuration for {} set to factory-default", instanceName); + LOG.info("Configuration for {} populated", name); } @Override public void onFailure(final Throwable cause) { - LOG.warn("Failed to set configuration for {} set to factory-default", instanceName, cause); + LOG.warn("Failed to populated configuration for {}", name, cause); } }, MoreExecutors.directExecutor()); } @Override public void onFailure(final Throwable cause) { - LOG.warn("Failed to ascertain presence of configuration for {} after {}", instanceName, sw, cause); + LOG.warn("Failed to ascertain presence of configuration for {} after {}", name, sw, cause); tx.cancel(); } }, MoreExecutors.directExecutor()); -- 2.43.0 From 4019fd5c344fa2a7e7b934673b62e7310905e9a7 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 23 Sep 2024 21:07:56 +0200 Subject: [PATCH 29/30] Move OFP configuration files We are packaging the deployer artifact in odl-openflowplugin-southbound, hence we should package configuration files there as well. This fixes the dependencies of odl-openflowjava-protocol so as not to reference MD-SAL's APIs. JIRA: OPNFLWPLUG-1133 Change-Id: I8e26134c3d584e3c9962ce2885d14edb8e505c01 Signed-off-by: Robert Varga --- .../odl-openflowplugin-southbound/pom.xml | 12 ++++++++++++ .../src/main/feature/feature.xml | 2 ++ .../odl-openflowjava-protocol/pom.xml | 13 ------------- .../src/main/feature/feature.xml | 2 -- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index c7f3dbd58..42c066a09 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -128,6 +128,18 @@ cfg config + + ${project.groupId}.openflowjava + openflowjava-blueprint-config + xml + config + + + ${project.groupId}.openflowjava + openflowjava-blueprint-config + xml + legacyConfig + diff --git a/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml b/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml index 25fde0585..6fb8e953a 100644 --- a/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml +++ b/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml @@ -2,6 +2,8 @@ mvn:org.opendaylight.openflowplugin/openflowplugin-blueprint-config/${project.version}/cfg/config + mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/config + mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/legacyConfig odl-mdsal-broker odl-infrautils-diagstatus diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 045633111..3093094bb 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -95,19 +95,6 @@ ${project.groupId} openflowjava-util - - - ${project.groupId} - openflowjava-blueprint-config - xml - config - - - ${project.groupId} - openflowjava-blueprint-config - xml - legacyConfig - diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml index fdd305b81..1ca52c31b 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml @@ -2,8 +2,6 @@ - mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/config - mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/legacyConfig odl-yangtools-netty odl-mdsal-model-rfc6991 odl-infrautils-diagstatus -- 2.43.0 From 077081dff6ad97e1d4dadaed142e14ea10b6054d Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Mon, 23 Sep 2024 19:11:59 +0000 Subject: [PATCH 30/30] Release Validate --- applications/arbitratorreconciliation/api/pom.xml | 2 +- applications/arbitratorreconciliation/impl/pom.xml | 2 +- applications/arbitratorreconciliation/pom.xml | 2 +- applications/bulk-o-matic/pom.xml | 2 +- applications/device-ownership-service/pom.xml | 2 +- applications/forwardingrules-manager/pom.xml | 2 +- applications/forwardingrules-sync/pom.xml | 2 +- applications/lldp-speaker/pom.xml | 2 +- applications/of-switch-config-pusher/pom.xml | 2 +- applications/pom.xml | 2 +- applications/reconciliation-framework/pom.xml | 2 +- applications/southbound-cli/pom.xml | 2 +- applications/table-miss-enforcer/pom.xml | 2 +- applications/topology-lldp-discovery/pom.xml | 2 +- applications/topology-manager/pom.xml | 4 ++-- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 4 ++-- drop-test-karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-eric-extensions/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- extension/features-extension-aggregator/pom.xml | 2 +- extension/openflowjava-extension-eric/pom.xml | 2 +- extension/openflowjava-extension-nicira-api/pom.xml | 2 +- extension/openflowjava-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-api/pom.xml | 2 +- extension/openflowplugin-extension-eric/pom.xml | 2 +- extension/openflowplugin-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-onf/pom.xml | 2 +- extension/pom.xml | 2 +- extension/test-extension/pom.xml | 2 +- features-aggregator/features-openflowplugin/pom.xml | 2 +- .../odl-openflowplugin-app-arbitratorreconciliation/pom.xml | 2 +- .../odl-openflowplugin-app-bulk-o-matic/pom.xml | 2 +- .../odl-openflowplugin-app-config-pusher/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-manager/pom.xml | 2 +- .../odl-openflowplugin-app-forwardingrules-sync/pom.xml | 2 +- .../odl-openflowplugin-app-lldp-speaker/pom.xml | 2 +- .../odl-openflowplugin-app-reconciliation-framework/pom.xml | 2 +- .../odl-openflowplugin-app-southbound-cli/pom.xml | 2 +- .../odl-openflowplugin-app-table-miss-enforcer/pom.xml | 2 +- .../odl-openflowplugin-app-topology-lldp-discovery/pom.xml | 2 +- .../odl-openflowplugin-app-topology-manager/pom.xml | 2 +- features-aggregator/odl-openflowplugin-app-topology/pom.xml | 2 +- features-aggregator/odl-openflowplugin-drop-test/pom.xml | 2 +- .../odl-openflowplugin-flow-services-rest/pom.xml | 2 +- features-aggregator/odl-openflowplugin-flow-services/pom.xml | 2 +- features-aggregator/odl-openflowplugin-libraries/pom.xml | 2 +- features-aggregator/odl-openflowplugin-nsf-model/pom.xml | 2 +- features-aggregator/odl-openflowplugin-southbound/pom.xml | 4 ++-- features-aggregator/pom.xml | 2 +- libraries/liblldp/pom.xml | 2 +- libraries/pom.xml | 2 +- model/model-flow-base/pom.xml | 2 +- model/model-flow-service/pom.xml | 2 +- model/model-flow-statistics/pom.xml | 2 +- model/model-inventory/pom.xml | 2 +- model/model-topology/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 2 +- openflowjava/features-openflowjava-aggregator/pom.xml | 2 +- openflowjava/openflow-protocol-api/pom.xml | 4 ++-- openflowjava/openflow-protocol-impl/pom.xml | 2 +- openflowjava/openflow-protocol-it/pom.xml | 2 +- openflowjava/openflow-protocol-spi/pom.xml | 2 +- openflowjava/openflowjava-blueprint-config/pom.xml | 2 +- openflowjava/openflowjava-util/pom.xml | 2 +- openflowjava/pom.xml | 2 +- openflowplugin-api/pom.xml | 2 +- openflowplugin-blueprint-config/pom.xml | 2 +- openflowplugin-common/pom.xml | 2 +- openflowplugin-impl/pom.xml | 2 +- openflowplugin-it/pom.xml | 2 +- openflowplugin/pom.xml | 2 +- parent/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/learning-switch/pom.xml | 2 +- samples/pom.xml | 2 +- samples/sample-bundles/pom.xml | 2 +- samples/sample-consumer/pom.xml | 2 +- samples/simple-client/pom.xml | 2 +- test-common/pom.xml | 2 +- test-provider/pom.xml | 2 +- 85 files changed, 91 insertions(+), 91 deletions(-) diff --git a/applications/arbitratorreconciliation/api/pom.xml b/applications/arbitratorreconciliation/api/pom.xml index e0dea7ddc..e418045bd 100644 --- a/applications/arbitratorreconciliation/api/pom.xml +++ b/applications/arbitratorreconciliation/api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../../parent diff --git a/applications/arbitratorreconciliation/impl/pom.xml b/applications/arbitratorreconciliation/impl/pom.xml index e22310986..1afeae9bb 100644 --- a/applications/arbitratorreconciliation/impl/pom.xml +++ b/applications/arbitratorreconciliation/impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../../parent diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 94851ae44..5630b9dfc 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.applications arbitratorreconciliation-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom ODL :: openflowplugin :: ${project.artifactId} diff --git a/applications/bulk-o-matic/pom.xml b/applications/bulk-o-matic/pom.xml index 53abea9e0..28f367412 100644 --- a/applications/bulk-o-matic/pom.xml +++ b/applications/bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/device-ownership-service/pom.xml b/applications/device-ownership-service/pom.xml index 58377c4b5..d6339182e 100644 --- a/applications/device-ownership-service/pom.xml +++ b/applications/device-ownership-service/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/forwardingrules-manager/pom.xml b/applications/forwardingrules-manager/pom.xml index cd3c9463b..25e36a138 100644 --- a/applications/forwardingrules-manager/pom.xml +++ b/applications/forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/forwardingrules-sync/pom.xml b/applications/forwardingrules-sync/pom.xml index 57db00011..12024daeb 100644 --- a/applications/forwardingrules-sync/pom.xml +++ b/applications/forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/lldp-speaker/pom.xml b/applications/lldp-speaker/pom.xml index 3a22fc9d6..b4493cdb5 100644 --- a/applications/lldp-speaker/pom.xml +++ b/applications/lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/of-switch-config-pusher/pom.xml b/applications/of-switch-config-pusher/pom.xml index 517f446ac..2d64d8fb2 100644 --- a/applications/of-switch-config-pusher/pom.xml +++ b/applications/of-switch-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/pom.xml b/applications/pom.xml index 05eec0297..f5705a12e 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin applications-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/applications/reconciliation-framework/pom.xml b/applications/reconciliation-framework/pom.xml index 07904682c..8f303a8fd 100644 --- a/applications/reconciliation-framework/pom.xml +++ b/applications/reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/southbound-cli/pom.xml b/applications/southbound-cli/pom.xml index 88bcd19b0..502d5efd7 100644 --- a/applications/southbound-cli/pom.xml +++ b/applications/southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/table-miss-enforcer/pom.xml b/applications/table-miss-enforcer/pom.xml index 054a073da..c95fb25f5 100644 --- a/applications/table-miss-enforcer/pom.xml +++ b/applications/table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/applications/topology-lldp-discovery/pom.xml b/applications/topology-lldp-discovery/pom.xml index 252ae96de..715597c08 100644 --- a/applications/topology-lldp-discovery/pom.xml +++ b/applications/topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent org.opendaylight.openflowplugin.applications diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index c7121ce49..afc1a319e 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent org.opendaylight.openflowplugin.applications topology-manager - 0.18.2-SNAPSHOT + 0.18.2 bundle diff --git a/artifacts/pom.xml b/artifacts/pom.xml index ef508fd1f..8da2c73ad 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -19,7 +19,7 @@ org.opendaylight.openflowplugin openflowplugin-artifacts - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 719a49688..a6d9e08c0 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -8,11 +8,11 @@ org.opendaylight.openflowplugin openflowplugin-karaf - 0.18.2-SNAPSHOT + 0.18.2 pom - 0.18.2-SNAPSHOT + 0.18.2 diff --git a/drop-test-karaf/pom.xml b/drop-test-karaf/pom.xml index 16732b0d3..97dd265e7 100644 --- a/drop-test-karaf/pom.xml +++ b/drop-test-karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index fcc2d5bce..0ba490f6b 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin-extension feature - 0.18.2-SNAPSHOT + 0.18.2 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index be7085b1c..d3999a54f 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-eric-extensions feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Eric Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index c0380444e..3b1d8dd1a 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nxm-extensions feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Nicira Extensions diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index 87a0d27e5..86baccce3 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-onf-extensions feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: ONF Extensions diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 0823c1f37..933dd6204 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-extension-aggregator pom - 0.18.2-SNAPSHOT + 0.18.2 features-openflowplugin-extension diff --git a/extension/openflowjava-extension-eric/pom.xml b/extension/openflowjava-extension-eric/pom.xml index 6fac9d7c0..4c4180bfa 100644 --- a/extension/openflowjava-extension-eric/pom.xml +++ b/extension/openflowjava-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent openflowjava-extension-eric diff --git a/extension/openflowjava-extension-nicira-api/pom.xml b/extension/openflowjava-extension-nicira-api/pom.xml index 6ca3c64aa..ad428945e 100644 --- a/extension/openflowjava-extension-nicira-api/pom.xml +++ b/extension/openflowjava-extension-nicira-api/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent openflowjava-extension-nicira-api diff --git a/extension/openflowjava-extension-nicira/pom.xml b/extension/openflowjava-extension-nicira/pom.xml index 07fd73960..fc25008e7 100644 --- a/extension/openflowjava-extension-nicira/pom.xml +++ b/extension/openflowjava-extension-nicira/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent openflowjava-extension-nicira diff --git a/extension/openflowplugin-extension-api/pom.xml b/extension/openflowplugin-extension-api/pom.xml index 06180687d..f3bad658e 100644 --- a/extension/openflowplugin-extension-api/pom.xml +++ b/extension/openflowplugin-extension-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/extension/openflowplugin-extension-eric/pom.xml b/extension/openflowplugin-extension-eric/pom.xml index f6cef1066..b571b1253 100644 --- a/extension/openflowplugin-extension-eric/pom.xml +++ b/extension/openflowplugin-extension-eric/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/extension/openflowplugin-extension-nicira/pom.xml b/extension/openflowplugin-extension-nicira/pom.xml index 84fb7b2ea..f26974f51 100644 --- a/extension/openflowplugin-extension-nicira/pom.xml +++ b/extension/openflowplugin-extension-nicira/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/extension/openflowplugin-extension-onf/pom.xml b/extension/openflowplugin-extension-onf/pom.xml index 3c2ace98d..e7469fd90 100644 --- a/extension/openflowplugin-extension-onf/pom.xml +++ b/extension/openflowplugin-extension-onf/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/extension/pom.xml b/extension/pom.xml index a99101a18..db6ac391b 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-extension-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/extension/test-extension/pom.xml b/extension/test-extension/pom.xml index b2673c3b7..32ba5e696 100644 --- a/extension/test-extension/pom.xml +++ b/extension/test-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index 9983f53cb..1c41c0c61 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-openflowplugin feature - 0.18.2-SNAPSHOT + 0.18.2 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index ff5ce23df..e63094c1f 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-arbitratorreconciliation feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - Arbitrator Reconciliation diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index ce091dbb6..213498a0f 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-bulk-o-matic feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - bulk flow operations support diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index ca924de4f..9771a16e4 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-config-pusher feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - default config-pusher diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index 34da35657..036bbb8fc 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-manager feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - FRM diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index daacc1317..dea0a5718 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-forwardingrules-sync feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - FRS diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index 85cf8ed7a..1f04d0b41 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-lldp-speaker feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - LLDP Speaker diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 2744d4ab0..7266e6bfb 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-reconciliation-framework feature -0.18.2-SNAPSHOT +0.18.2 OpenDaylight :: Openflow Plugin :: Application - Reconciliation Framework diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 7b168c178..ca02f5c18 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-southbound-cli feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - Southbound CLI diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index c3fab0874..7287e55cd 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-table-miss-enforcer feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - table-miss-enforcer diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index a2168e710..fba2484a1 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-lldp-discovery feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - Topology LLDP Discovery diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 50b76d898..42602d8fb 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology-manager feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - Topology Manager diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 2857d692d..a13aef6fb 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-app-topology feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Application - topology diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 86b1917b0..965670797 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-drop-test feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Drop Test diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 06fd71af5..bb64282dc 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services-rest feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Flow Services :: REST diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index 7db5139d2..6333b35cb 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-flow-services feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Flow Services diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index fd863d1bd..7171e5435 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-libraries feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Libraries diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index 0b006ab85..2e7e385cc 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-nsf-model feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: OpenflowPlugin :: NSF :: Model diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index 42c066a09..22c97bda7 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin odl-openflowplugin-southbound feature - 0.18.2-SNAPSHOT + 0.18.2 OpenDaylight :: Openflow Plugin :: Li southbound API implementation @@ -43,7 +43,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.2-SNAPSHOT + 0.13.2 import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 099fd7148..7621a9fb1 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin features-aggregator pom - 0.18.2-SNAPSHOT + 0.18.2 features-openflowplugin diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index 7702d9340..66c466356 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/libraries/pom.xml b/libraries/pom.xml index 3c953e9cb..f9423a9a7 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin libraries-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/model/model-flow-base/pom.xml b/model/model-flow-base/pom.xml index e8a39e211..2af66826a 100644 --- a/model/model-flow-base/pom.xml +++ b/model/model-flow-base/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/model/model-flow-service/pom.xml b/model/model-flow-service/pom.xml index 20ade1d54..f47dc1b23 100644 --- a/model/model-flow-service/pom.xml +++ b/model/model-flow-service/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/model/model-flow-statistics/pom.xml b/model/model-flow-statistics/pom.xml index 2cb549c59..2d4b73c06 100644 --- a/model/model-flow-statistics/pom.xml +++ b/model/model-flow-statistics/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/model/model-inventory/pom.xml b/model/model-inventory/pom.xml index 770d590c3..aa756c2ed 100644 --- a/model/model-inventory/pom.xml +++ b/model/model-inventory/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/model/model-topology/pom.xml b/model/model-topology/pom.xml index 9b1eea8ff..149022fdf 100644 --- a/model/model-topology/pom.xml +++ b/model/model-topology/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/model/pom.xml b/model/pom.xml index bc336d527..c13a7f50e 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.openflowplugin.model model-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index 4c90bcb42..cb9c6d67a 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava features-openflowjava - 0.18.2-SNAPSHOT + 0.18.2 feature diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 3093094bb..ed7201aa2 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin.openflowjava odl-openflowjava-protocol - 0.18.2-SNAPSHOT + 0.18.2 feature diff --git a/openflowjava/openflow-protocol-api/pom.xml b/openflowjava/openflow-protocol-api/pom.xml index fdae0c19a..1a70165fb 100644 --- a/openflowjava/openflow-protocol-api/pom.xml +++ b/openflowjava/openflow-protocol-api/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent org.opendaylight.openflowplugin.openflowjava openflow-protocol-api - 0.18.2-SNAPSHOT + 0.18.2 bundle diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index 372e58fa7..0bdd3fc01 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.2-SNAPSHOT + 0.18.2 ../ openflow-protocol-impl diff --git a/openflowjava/openflow-protocol-it/pom.xml b/openflowjava/openflow-protocol-it/pom.xml index 7d1d87100..d258af077 100644 --- a/openflowjava/openflow-protocol-it/pom.xml +++ b/openflowjava/openflow-protocol-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.2-SNAPSHOT + 0.18.2 ../ openflow-protocol-it diff --git a/openflowjava/openflow-protocol-spi/pom.xml b/openflowjava/openflow-protocol-spi/pom.xml index f222aafe4..d3f93b77d 100644 --- a/openflowjava/openflow-protocol-spi/pom.xml +++ b/openflowjava/openflow-protocol-spi/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.2-SNAPSHOT + 0.18.2 ../ openflow-protocol-spi diff --git a/openflowjava/openflowjava-blueprint-config/pom.xml b/openflowjava/openflowjava-blueprint-config/pom.xml index 7662d2b7f..3aee1dcc2 100644 --- a/openflowjava/openflowjava-blueprint-config/pom.xml +++ b/openflowjava/openflowjava-blueprint-config/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.2-SNAPSHOT + 0.18.2 ../ openflowjava-blueprint-config diff --git a/openflowjava/openflowjava-util/pom.xml b/openflowjava/openflowjava-util/pom.xml index b579a7855..716647704 100644 --- a/openflowjava/openflowjava-util/pom.xml +++ b/openflowjava/openflowjava-util/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin.openflowjava openflowjava-parent - 0.18.2-SNAPSHOT + 0.18.2 ../ bundle diff --git a/openflowjava/pom.xml b/openflowjava/pom.xml index 7d8ce206c..30e586f53 100644 --- a/openflowjava/pom.xml +++ b/openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin-api/pom.xml b/openflowplugin-api/pom.xml index 7ded49d61..448ee6922 100644 --- a/openflowplugin-api/pom.xml +++ b/openflowplugin-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin-blueprint-config/pom.xml b/openflowplugin-blueprint-config/pom.xml index 245ca1221..7c4ecff8b 100644 --- a/openflowplugin-blueprint-config/pom.xml +++ b/openflowplugin-blueprint-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index 1f5f4d26a..8d5f20693 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index a97f93925..243e56703 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin-it/pom.xml b/openflowplugin-it/pom.xml index 0006acb31..35c1b5fd3 100644 --- a/openflowplugin-it/pom.xml +++ b/openflowplugin-it/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index 9dfca6264..25d885395 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent diff --git a/parent/pom.xml b/parent/pom.xml index e32f2172d..2a4568dac 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -19,7 +19,7 @@ 4.0.0 org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 pom @@ -55,7 +55,7 @@ org.opendaylight.serviceutils serviceutils-artifacts - 0.13.2-SNAPSHOT + 0.13.2 pom import diff --git a/pom.xml b/pom.xml index 10dc1c5d5..2555a00c4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 parent openflowplugin-aggregator - 0.18.2-SNAPSHOT + 0.18.2 openflowplugin pom diff --git a/samples/learning-switch/pom.xml b/samples/learning-switch/pom.xml index 74b5ae8e5..9455b9d26 100644 --- a/samples/learning-switch/pom.xml +++ b/samples/learning-switch/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/samples/pom.xml b/samples/pom.xml index 1eeb73b41..95b0214dd 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-samples-aggregator - 0.18.2-SNAPSHOT + 0.18.2 pom diff --git a/samples/sample-bundles/pom.xml b/samples/sample-bundles/pom.xml index 2de036cc7..ab434ec55 100644 --- a/samples/sample-bundles/pom.xml +++ b/samples/sample-bundles/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/samples/sample-consumer/pom.xml b/samples/sample-consumer/pom.xml index 10bbb1ccf..e9365fe58 100644 --- a/samples/sample-consumer/pom.xml +++ b/samples/sample-consumer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/samples/simple-client/pom.xml b/samples/simple-client/pom.xml index a9b7c6154..4bb91d044 100644 --- a/samples/simple-client/pom.xml +++ b/samples/simple-client/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../../parent diff --git a/test-common/pom.xml b/test-common/pom.xml index ce0fa9158..5faccdfb5 100644 --- a/test-common/pom.xml +++ b/test-common/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent test-common diff --git a/test-provider/pom.xml b/test-provider/pom.xml index 8874d9b8b..1bbaba792 100644 --- a/test-provider/pom.xml +++ b/test-provider/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.openflowplugin openflowplugin-parent - 0.18.2-SNAPSHOT + 0.18.2 ../parent test-provider -- 2.43.0