From: Tony Tkacik
Date: Mon, 27 Oct 2014 10:22:29 +0000 (+0000)
Subject: Merge "BUG 1839 - HTTP delete of non existing data"
X-Git-Tag: release/lithium~970
X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=531621aac4cff9d39cbd8668a53bdeba8a0e6d81;hp=4c22825994c2519fb1c9d63f0050ebf35c4f8439
Merge "BUG 1839 - HTTP delete of non existing data"
---
diff --git a/features/adsal-compatibility/pom.xml b/features/adsal-compatibility/pom.xml
index 44b9b0900c..7b8af64445 100644
--- a/features/adsal-compatibility/pom.xml
+++ b/features/adsal-compatibility/pom.xml
@@ -10,14 +10,14 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightfeatures-adsal-compatibilityjarfeatures.xml
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOT
diff --git a/features/adsal/src/main/resources/features.xml b/features/adsal/src/main/resources/features.xml
index e12ca8e5e9..a665657ba7 100644
--- a/features/adsal/src/main/resources/features.xml
+++ b/features/adsal/src/main/resources/features.xml
@@ -35,7 +35,6 @@
odl-adsal-coremvn:org.opendaylight.controller/clustering.services/${clustering.services.version}mvn:org.opendaylight.controller/clustering.services-implementation/${clustering.services_implementation.version}
- mvn:org.opendaylight.controller/clustering.stub/${clustering.stub.version}odl-adsal-core
diff --git a/features/akka/pom.xml b/features/akka/pom.xml
index f1f3017c20..f804505c64 100644
--- a/features/akka/pom.xml
+++ b/features/akka/pom.xml
@@ -10,7 +10,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightfeatures-akka
@@ -20,11 +20,11 @@
features.xml
- 1.0.0-SNAPSHOT
- 1.4.2-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 1.5.0-SNAPSHOT3.0.1
- 0.6.2-SNAPSHOT
- 1.4.2-SNAPSHOT
+ 0.7.0-SNAPSHOT
+ 1.5.0-SNAPSHOT2.16
@@ -42,21 +42,21 @@
org.opendaylight.yangtoolsfeatures-yangtools
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOTfeaturesxmlorg.opendaylight.controllerfeatures-mdsal
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTfeaturesxmlorg.opendaylight.openflowpluginfeatures-openflowplugin
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOTfeaturesxml
diff --git a/features/akka/src/main/resources/features.xml b/features/akka/src/main/resources/features.xml
index 182ff766e6..8a3b4a2e25 100644
--- a/features/akka/src/main/resources/features.xml
+++ b/features/akka/src/main/resources/features.xml
@@ -18,9 +18,9 @@
Necessary TODO: Add repo entries for the repositories of features you refer to
in this feature file but do not define here.
Examples:
- mvn:org.opendaylight.yangtools/features-yangtools/0.6.2-SNAPSHOT/xml/features
- mvn:org.opendaylight.controller/features-mdsal/1.1-SNAPSHOT/xml/features
- mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.0.3-SNAPSHOT/xml/features
+ mvn:org.opendaylight.yangtools/features-yangtools/0.7.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.controller/features-mdsal/1.2.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.1.0-SNAPSHOT/xml/features
-->
org.opendaylight.controlleropendaylight-karaf-empty
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOTzip
diff --git a/features/base/src/main/resources/features.xml b/features/base/src/main/resources/features.xml
index e4c455ccca..d7d8e0ddac 100644
--- a/features/base/src/main/resources/features.xml
+++ b/features/base/src/main/resources/features.xml
@@ -16,8 +16,8 @@
odl-base-jacksonodl-base-spring-security
-
- mvn:org.opendaylight.controller/dummy-console/1.1.0-SNAPSHOT
+
+ mvn:org.opendaylight.controller/dummy-console/1.2.0-SNAPSHOTmvn:org.osgi/org.osgi.compendium/${osgi.compendium.version}
@@ -36,7 +36,7 @@
wrap:mvn:io.netty/netty-common/${netty.version}wrap:mvn:io.netty/netty-handler/${netty.version}wrap:mvn:io.netty/netty-codec-http/${netty.version}
- mvn:org.opendaylight.controller.thirdparty/ganymed/1.1-SNAPSHOT
+ mvn:org.opendaylight.controller.thirdparty/ganymed/1.2.0-SNAPSHOTodl-base-gemini-web
@@ -80,6 +80,7 @@
mvn:eclipselink/javax.persistence/2.0.4.v201112161009mvn:eclipselink/javax.resource/1.5.0.v200906010428
+ mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/2.5.0mvn:org.eclipse.persistence/org.eclipse.persistence.moxy/2.5.0mvn:org.eclipse.persistence/org.eclipse.persistence.core/2.5.0
diff --git a/features/config-netty/pom.xml b/features/config-netty/pom.xml
index bf036979cf..0057fc05c7 100644
--- a/features/config-netty/pom.xml
+++ b/features/config-netty/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../../opendaylight/config/features-config-netty
diff --git a/features/config-persister/pom.xml b/features/config-persister/pom.xml
index 3346c754d6..f3b42ca143 100644
--- a/features/config-persister/pom.xml
+++ b/features/config-persister/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../../opendaylight/config/features-config-persister
diff --git a/features/config/pom.xml b/features/config/pom.xml
index 20feceb360..461427c7ce 100644
--- a/features/config/pom.xml
+++ b/features/config/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../../opendaylight/config/features-config
@@ -20,7 +20,7 @@
org.opendaylight.controlleropendaylight-karaf-empty
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOTzip
diff --git a/features/controller/pom.xml b/features/controller/pom.xml
index ddaf773151..5dd2bd4a2a 100644
--- a/features/controller/pom.xml
+++ b/features/controller/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightcontroller-features
diff --git a/features/extras/pom.xml b/features/extras/pom.xml
index 4563190b9f..e4356e6b49 100644
--- a/features/extras/pom.xml
+++ b/features/extras/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightextras-features
diff --git a/features/flow/pom.xml b/features/flow/pom.xml
index ac189737d9..ab30b0b61f 100644
--- a/features/flow/pom.xml
+++ b/features/flow/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT../../opendaylight/md-salfeatures-flow
diff --git a/features/mdsal/pom.xml b/features/mdsal/pom.xml
index 960dfb37a1..036d18fb85 100644
--- a/features/mdsal/pom.xml
+++ b/features/mdsal/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT../../opendaylight/md-salfeatures-mdsal
@@ -13,6 +13,7 @@
features.xml
+ 20131018
@@ -67,6 +68,11 @@
org.opendaylight.controllersal-dom-xsql
+
+
+ org.opendaylight.controller
+ sal-karaf-xsql
+ org.opendaylight.controllersal-dom-xsql-config
@@ -259,6 +265,20 @@
xmlconfig
+
+ org.opendaylight.controller.samples
+ clustering-it-config
+ ${mdsal.version}
+ xml
+ testmoduleshardconf
+
+
+ org.opendaylight.controller.samples
+ clustering-it-config
+ ${mdsal.version}
+ xml
+ testmoduleconf
+ org.opendaylight.controllersal-rest-docgen
@@ -299,7 +319,7 @@
org.opendaylight.yangtoolsfeatures-test
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOT
diff --git a/features/mdsal/src/main/resources/features.xml b/features/mdsal/src/main/resources/features.xml
index da246b63e3..fb524081e7 100644
--- a/features/mdsal/src/main/resources/features.xml
+++ b/features/mdsal/src/main/resources/features.xml
@@ -11,13 +11,13 @@
odl-mdsal-brokerodl-mdsal-clustering
- odl-restconfodl-mdsal-xsqlodl-toasterodl-yangtools-commonodl-yangtools-binding
+ odl-yangtools-modelsodl-mdsal-commonodl-config-startupodl-config-netty
@@ -32,24 +32,6 @@
mvn:org.opendaylight.controller/sal-inmemory-datastore/${project.version}mvn:org.opendaylight.controller/md-sal-config/${mdsal.version}/xml/config
-
- odl-mdsal-broker
- war
- mvn:org.opendaylight.controller/sal-rest-connector/${project.version}
- mvn:com.google.code.gson/gson/${gson.version}
- mvn:org.opendaylight.yangtools/yang-data-codec-gson/${yangtools.version}
- mvn:com.sun.jersey/jersey-core/${jersey.version}
- mvn:com.sun.jersey/jersey-server/${jersey.version}
- mvn:com.sun.jersey/jersey-servlet/${jersey.version}
- mvn:io.netty/netty-buffer/${netty.version}
- mvn:io.netty/netty-codec/${netty.version}
- mvn:io.netty/netty-codec-http/${netty.version}
- mvn:io.netty/netty-common/${netty.version}
- mvn:io.netty/netty-handler/${netty.version}
- mvn:io.netty/netty-transport/${netty.version}
- mvn:org.opendaylight.controller/sal-remote/${project.version}
- mvn:org.opendaylight.controller/sal-rest-connector-config/${mdsal.version}/xml/config
- odl-yangtools-commonodl-yangtools-binding
@@ -62,23 +44,9 @@
odl-mdsal-brokermvn:org.opendaylight.controller/sal-dom-xsql/${project.version}
+ mvn:org.opendaylight.controller/sal-karaf-xsql/${project.version}mvn:org.opendaylight.controller/sal-dom-xsql-config/${project.version}/xml/config
-
- odl-restconf
- mvn:org.opendaylight.controller/sal-rest-docgen/${project.version}
- mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson.version}
- mvn:com.fasterxml.jackson.core/jackson-core/${jackson.version}
- mvn:com.fasterxml.jackson.core/jackson-databind/${jackson.version}
- mvn:com.fasterxml.jackson.datatype/jackson-datatype-json-org/${jackson.version}
- mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/${jackson.version}
- mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${jackson.version}
- mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${jackson.version}
- mvn:com.sun.jersey/jersey-core/${jersey.version}
- mvn:com.sun.jersey/jersey-server/${jersey.version}
- mvn:com.sun.jersey/jersey-servlet/${jersey.version}
- wrap:mvn:org.json/json/${org.json.version}
- odl-mdsal-brokerodl-akka-system
@@ -108,15 +76,4 @@
mvn:org.opendaylight.controller/sal-clustering-config/${project.version}/xml/moduleshardconfmvn:org.opendaylight.controller/sal-clustering-config/${project.version}/xml/moduleconf
-
-
- odl-mdsal-clustering
- odl-restconf
- odl-yangtools-models
- mvn:org.opendaylight.controller.samples/clustering-it-model/${project.version}
- mvn:org.opendaylight.controller.samples/clustering-it-provider/${project.version}
- mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/config
- mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/testmoduleshardconf
- mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/testmoduleconf
-
diff --git a/features/netconf-connector/pom.xml b/features/netconf-connector/pom.xml
index 8b19d200a3..b44fa11657 100644
--- a/features/netconf-connector/pom.xml
+++ b/features/netconf-connector/pom.xml
@@ -10,7 +10,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT../../opendaylight/md-salfeatures-netconf-connectorjar
@@ -42,21 +42,21 @@
org.opendaylight.yangtoolsfeatures-yangtools
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOTfeaturesxmlorg.opendaylight.controllerfeatures-mdsal
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTfeaturesxmlorg.opendaylight.openflowpluginfeatures-openflowplugin
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOTfeaturesxml
@@ -162,12 +162,13 @@
Optional TODO: Remove TODO comments.
-->
-
- org.opendaylight.yangtools
- features-test
- ${yangtools.version}
- test
-
+
+
+
+
+
+
+
org.opendaylight.controller
diff --git a/features/netconf-connector/src/main/resources/features.xml b/features/netconf-connector/src/main/resources/features.xml
index 3e576e47f1..6ae308eb0c 100644
--- a/features/netconf-connector/src/main/resources/features.xml
+++ b/features/netconf-connector/src/main/resources/features.xml
@@ -18,9 +18,9 @@
Necessary TODO: Add repo entries for the repositories of features you refer to
in this feature file but do not define here.
Examples:
- mvn:org.opendaylight.yangtools/features-yangtools/0.6.2-SNAPSHOT/xml/features
- mvn:org.opendaylight.controller/features-mdsal/1.1-SNAPSHOT/xml/features
- mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.0.3-SNAPSHOT/xml/features
+ mvn:org.opendaylight.yangtools/features-yangtools/0.7.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.controller/features-mdsal/1.2.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.1.0-SNAPSHOT/xml/features
-->
mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/featuresmvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features
@@ -54,7 +54,7 @@
* Basic MD-SAL Provider
- odl-mdsal-broker
+ odl-mdsal-brokerodl-controller-modelmvn:org.opendaylight.controller/controller-provider/${project.version}
... whatever other bundles you need
@@ -62,15 +62,15 @@
* Basic MD-SAL Model feature
- odl-yangtools-binding
- odl-yangtools-models
+ odl-yangtools-binding
+ odl-yangtools-modelsmvn:org.opendaylight.controller/controller-model/${project.version}
... whatever other bundles you need
* Config Subsystem example - the config file is your config subsystem configuration
- odl-mdsal-broker
+ odl-mdsal-brokermvn:org.opendaylight.controller/controller-provider/${project.version}mvn:org.opendaylight.controller/controller-config/${project.version}/xml/config
... whatever other bundles you need
@@ -78,7 +78,7 @@
* Basic MD-SAL Provider that uses openflowplugin-flow-services (which brings along odl-mdsal-broker)
- odl-openflowplugin-flow-services
+ odl-openflowplugin-flow-servicesmvn:org.opendaylight.controller/controller-provider/${project.version}
... whatever other bundles you need
diff --git a/features/netconf/pom.xml b/features/netconf/pom.xml
index 1061f4a37d..a944bb4dec 100644
--- a/features/netconf/pom.xml
+++ b/features/netconf/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllernetconf-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../../opendaylight/netconffeatures-netconf
diff --git a/features/netconf/src/main/resources/features.xml b/features/netconf/src/main/resources/features.xml
index 743dae663e..444f20865b 100644
--- a/features/netconf/src/main/resources/features.xml
+++ b/features/netconf/src/main/resources/features.xml
@@ -11,8 +11,6 @@
odl-netconf-mapping-apiodl-netconf-utilodl-netconf-impl
- odl-netconf-tcp
- odl-netconf-sshodl-config-netconf-connectorodl-netconf-netty-utilodl-netconf-client
diff --git a/features/nsf/pom.xml b/features/nsf/pom.xml
index e677d491bc..00dc219b39 100644
--- a/features/nsf/pom.xml
+++ b/features/nsf/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightfeatures-nsf
@@ -25,7 +25,7 @@
org.opendaylight.controlleropendaylight-karaf-empty
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOTzip
diff --git a/features/pom.xml b/features/pom.xml
index 9f10b5908b..5270e3f5cd 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../opendaylight/commons/opendaylightfeatures-controller
@@ -28,5 +28,6 @@
adsal-compatibilityakkanetconf-connector
+ restconf
\ No newline at end of file
diff --git a/features/protocol-framework/pom.xml b/features/protocol-framework/pom.xml
index dcd24d6216..d5387b43c3 100644
--- a/features/protocol-framework/pom.xml
+++ b/features/protocol-framework/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../opendaylight/commons/opendaylightfeatures-protocol-framework
diff --git a/features/restconf/pom.xml b/features/restconf/pom.xml
new file mode 100644
index 0000000000..632b4cd592
--- /dev/null
+++ b/features/restconf/pom.xml
@@ -0,0 +1,346 @@
+
+
+ 4.0.0
+
+ org.opendaylight.controller
+ sal-parent
+ 1.2.0-SNAPSHOT
+ ../../opendaylight/md-sal
+
+
+ features-restconf
+ org.opendaylight.controller
+
+ jar
+
+ features.xml
+
+
+
+
+
+
+
+
+ org.opendaylight.yangtools
+ features-yangtools
+ ${yangtools.version}
+ features
+ xml
+
+
+ org.opendaylight.controller
+ features-mdsal
+ ${mdsal.version}
+ features
+ xml
+
+
+ org.opendaylight.aaa
+ features-aaa
+ ${aaa.version}
+ features
+ xml
+
+
+
+ org.opendaylight.controller
+ sal-remote
+
+
+
+ org.opendaylight.controller
+ sal-rest-connector
+
+
+
+ com.google.code.gson
+ gson
+
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey
+ jersey-servlet
+
+
+ io.netty
+ netty-buffer
+
+
+ io.netty
+ netty-codec
+
+
+ io.netty
+ netty-codec-http
+
+
+ io.netty
+ netty-common
+
+
+ io.netty
+ netty-handler
+
+
+ io.netty
+ netty-transport
+
+
+
+ org.opendaylight.controller
+ sal-rest-connector-config
+ ${mdsal.version}
+ xml
+ config
+
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-json-org
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-base
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+
+
+ org.json
+ json
+
+
+
+ org.opendaylight.yangtools
+ yang-data-codec-gson
+
+
+
+ org.opendaylight.controller.samples
+ clustering-it-model
+ ${mdsal.version}
+
+
+ org.opendaylight.controller.samples
+ clustering-it-provider
+ ${mdsal.version}
+
+
+ org.opendaylight.controller.samples
+ clustering-it-config
+ ${mdsal.version}
+ xml
+ config
+
+
+ org.opendaylight.controller.samples
+ clustering-it-config
+ ${mdsal.version}
+ xml
+ testmoduleshardconf
+
+
+ org.opendaylight.controller.samples
+ clustering-it-config
+ ${mdsal.version}
+ xml
+ testmoduleconf
+
+
+ org.opendaylight.controller
+ sal-rest-docgen
+
+
+
+
+
+ org.opendaylight.yangtools
+ features-test
+ ${yangtools.version}
+ test
+
+
+
+ org.opendaylight.controller
+ opendaylight-karaf-empty
+ ${commons.opendaylight.version}
+ zip
+
+
+
+
+
+
+
+ src/main/resources
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+
+
+ filter
+ generate-resources
+
+ resources
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ attach-artifacts
+ package
+
+ attach-artifact
+
+
+
+
+ ${project.build.directory}/classes/${features.file}
+ xml
+ features
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${surefire.version}
+
+
+ org.opendaylight.controller
+ opendaylight-karaf-empty
+ ${commons.opendaylight.version}
+
+
+ org.opendaylight.yangtools:features-test
+
+
+
+
+
+
+ scm:git:ssh://git.opendaylight.org:29418/controller.git
+ scm:git:ssh://git.opendaylight.org:29418/controller.git
+ HEAD
+ https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary
+
+
diff --git a/features/restconf/src/main/resources/features.xml b/features/restconf/src/main/resources/features.xml
new file mode 100644
index 0000000000..ab42330eac
--- /dev/null
+++ b/features/restconf/src/main/resources/features.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+ mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features
+ mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features
+ mvn:org.opendaylight.aaa/features-aaa/${aaa.version}/xml/features
+
+
+ odl-restconf
+ odl-mdsal-apidocs
+ odl-clustering-test-app
+
+
+
+
+ odl-aaa-authn
+ odl-restconf-noauth
+
+
+ odl-mdsal-broker
+ war
+
+ mvn:org.opendaylight.controller/sal-remote/${project.version}
+ mvn:org.opendaylight.controller/sal-rest-connector/${project.version}
+ mvn:com.google.code.gson/gson/${gson.version}
+ mvn:org.opendaylight.yangtools/yang-data-codec-gson/${yangtools.version}
+ mvn:com.sun.jersey/jersey-core/${jersey.version}
+ mvn:com.sun.jersey/jersey-server/${jersey.version}
+ mvn:com.sun.jersey/jersey-servlet/${jersey.version}
+ mvn:io.netty/netty-buffer/${netty.version}
+ mvn:io.netty/netty-codec/${netty.version}
+ mvn:io.netty/netty-codec-http/${netty.version}
+ mvn:io.netty/netty-common/${netty.version}
+ mvn:io.netty/netty-handler/${netty.version}
+ mvn:io.netty/netty-transport/${netty.version}
+ mvn:org.opendaylight.controller/sal-rest-connector-config/${mdsal.version}/xml/config
+
+
+ odl-restconf
+ mvn:org.opendaylight.controller/sal-rest-docgen/${project.version}
+ mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson.version}
+ mvn:com.fasterxml.jackson.core/jackson-core/${jackson.version}
+ mvn:com.fasterxml.jackson.core/jackson-databind/${jackson.version}
+ mvn:com.fasterxml.jackson.datatype/jackson-datatype-json-org/${jackson.version}
+ mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/${jackson.version}
+ mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${jackson.version}
+ mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${jackson.version}
+ mvn:com.sun.jersey/jersey-core/${jersey.version}
+ mvn:com.sun.jersey/jersey-server/${jersey.version}
+ mvn:com.sun.jersey/jersey-servlet/${jersey.version}
+ wrap:mvn:org.json/json/${org.json.version}
+
+
+
+ odl-mdsal-clustering
+ odl-restconf
+ odl-yangtools-models
+ mvn:org.opendaylight.controller.samples/clustering-it-model/${project.version}
+ mvn:org.opendaylight.controller.samples/clustering-it-provider/${project.version}
+ mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/config
+ mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/testmoduleshardconf
+ mvn:org.opendaylight.controller.samples/clustering-it-config/${project.version}/xml/testmoduleconf
+
+
+
+ odl-restconf
+ odl-toaster
+
+
+
+ odl-mdsal-apidocs
+ odl-mdsal-xsql
+ odl-toaster-rest
+
+
+
+
diff --git a/itests/base-features-it/pom.xml b/itests/base-features-it/pom.xml
index 8f73779009..d05e9a515b 100644
--- a/itests/base-features-it/pom.xml
+++ b/itests/base-features-it/pom.xml
@@ -3,7 +3,7 @@
org.opendaylight.controlleritests-controller
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../pom.xmlbase-features-it
diff --git a/itests/pom.xml b/itests/pom.xml
index 19836a2ad6..c722149145 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../opendaylight/commons/opendaylightitests-controller
diff --git a/opendaylight/appauth/pom.xml b/opendaylight/appauth/pom.xml
index e74e3cb915..8a035510bf 100644
--- a/opendaylight/appauth/pom.xml
+++ b/opendaylight/appauth/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../commons/opendaylightappauth
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/archetypes/odl-model-project/pom.xml b/opendaylight/archetypes/odl-model-project/pom.xml
index d2896027fb..4945eb2a66 100644
--- a/opendaylight/archetypes/odl-model-project/pom.xml
+++ b/opendaylight/archetypes/odl-model-project/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controller.archetypesodl-model-project
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmaven-archetype
diff --git a/opendaylight/archetypes/odl-model-project/src/main/resources/archetype-resources/pom.xml b/opendaylight/archetypes/odl-model-project/src/main/resources/archetype-resources/pom.xml
index 016c30d787..6b41485e7b 100644
--- a/opendaylight/archetypes/odl-model-project/src/main/resources/archetype-resources/pom.xml
+++ b/opendaylight/archetypes/odl-model-project/src/main/resources/archetype-resources/pom.xml
@@ -11,8 +11,8 @@
http://nexus.opendaylight.org/contentopendaylight.releaseopendaylight.release
- 0.6.2-SNAPSHOT
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOT
+ 0.7.0-SNAPSHOT2.3.7
diff --git a/opendaylight/archetypes/opendaylight-configfile-archetype/pom.xml b/opendaylight/archetypes/opendaylight-configfile-archetype/pom.xml
index 38c86164e9..45ec9ac717 100644
--- a/opendaylight/archetypes/opendaylight-configfile-archetype/pom.xml
+++ b/opendaylight/archetypes/opendaylight-configfile-archetype/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controlleropendaylight-configfile-archetype
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmaven-archetype
@@ -38,15 +38,15 @@
opendaylight-release
- http://nexus.opendaylight.org/content/repositories/opendaylight.release/
+ ${nexusproxy}/repositories/opendaylight.release/opendaylight-snapshot
- http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/
+ ${nexusproxy}/repositories/opendaylight.snapshot/website
- dav:http://nexus.opendaylight.org/content/sites/site/sal-parent
+ dav:${nexusproxy}/sites/site/sal-parent
diff --git a/opendaylight/archetypes/opendaylight-karaf-distro-archetype/pom.xml b/opendaylight/archetypes/opendaylight-karaf-distro-archetype/pom.xml
index 8883c64295..ff2384fb27 100644
--- a/opendaylight/archetypes/opendaylight-karaf-distro-archetype/pom.xml
+++ b/opendaylight/archetypes/opendaylight-karaf-distro-archetype/pom.xml
@@ -1,10 +1,14 @@
4.0.0
-
+
+ org.opendaylight.controller.archetypes
+ archetypes-parent
+ 0.2.0-SNAPSHOT
+ org.opendaylight.controlleropendaylight-karaf-distro-archetype
- 1.0.0-SNAPSHOT
+ 1.1.0-SNAPSHOTmaven-archetypedistribution-karaf-archetype
diff --git a/opendaylight/archetypes/opendaylight-karaf-distro-archetype/src/main/resources/archetype-resources/pom.xml b/opendaylight/archetypes/opendaylight-karaf-distro-archetype/src/main/resources/archetype-resources/pom.xml
index fdc60625c8..c2e399b370 100644
--- a/opendaylight/archetypes/opendaylight-karaf-distro-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/opendaylight/archetypes/opendaylight-karaf-distro-archetype/src/main/resources/archetype-resources/pom.xml
@@ -19,8 +19,8 @@
- 1.0.0-SNAPSHOT
- 1.4.2-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 1.5.0-SNAPSHOT3.0.1
@@ -81,7 +81,7 @@
org.opendaylight.openflowpluginfeatures-openflowplugin
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOTfeaturesxmlruntime
diff --git a/opendaylight/archetypes/opendaylight-karaf-features/pom.xml b/opendaylight/archetypes/opendaylight-karaf-features/pom.xml
index 4973a69537..12861604e8 100644
--- a/opendaylight/archetypes/opendaylight-karaf-features/pom.xml
+++ b/opendaylight/archetypes/opendaylight-karaf-features/pom.xml
@@ -2,9 +2,14 @@
4.0.0
+
+ org.opendaylight.controller.archetypes
+ archetypes-parent
+ 0.2.0-SNAPSHOT
+ org.opendaylight.controlleropendaylight-karaf-features-archetype
- 1.0.0-SNAPSHOT
+ 1.1.0-SNAPSHOTmaven-archetypeopendaylight-karaf-features-archetype
diff --git a/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/pom.xml b/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/pom.xml
index e135e6b656..df35831a90 100644
--- a/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/pom.xml
+++ b/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/pom.xml
@@ -24,11 +24,11 @@
features.xml
- 1.0.0-SNAPSHOT
- 1.4.2-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 1.5.0-SNAPSHOT3.0.1
- 0.6.2-SNAPSHOT
- 1.4.2-SNAPSHOT
+ 0.7.0-SNAPSHOT
+ 1.5.0-SNAPSHOT2.16
@@ -46,21 +46,21 @@
org.opendaylight.yangtoolsfeatures-yangtools
- 0.6.2-SNAPSHOT
+ 0.7.0-SNAPSHOTfeaturesxmlorg.opendaylight.controllerfeatures-mdsal
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTfeaturesxmlorg.opendaylight.openflowpluginfeatures-openflowplugin
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOTfeaturesxml
diff --git a/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/src/main/resources/features.xml b/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/src/main/resources/features.xml
index 4a59657431..54bbfe45fc 100644
--- a/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/src/main/resources/features.xml
+++ b/opendaylight/archetypes/opendaylight-karaf-features/src/main/resources/archetype-resources/src/main/resources/features.xml
@@ -21,9 +21,9 @@
Necessary TODO: Add repo entries for the repositories of features you refer to
in this feature file but do not define here.
Examples:
- mvn:org.opendaylight.yangtools/features-yangtools/0.6.2-SNAPSHOT/xml/features
- mvn:org.opendaylight.controller/features-mdsal/1.1-SNAPSHOT/xml/features
- mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.0.3-SNAPSHOT/xml/features
+ mvn:org.opendaylight.yangtools/features-yangtools/0.7.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.controller/features-mdsal/1.2.0-SNAPSHOT/xml/features
+ mvn:org.opendaylight.openflowplugin/features-openflowplugin/0.1.0-SNAPSHOT/xml/features
-->
diff --git a/opendaylight/arphandler/pom.xml b/opendaylight/arphandler/pom.xml
index 064d04c25c..ffd528beb0 100644
--- a/opendaylight/arphandler/pom.xml
+++ b/opendaylight/arphandler/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../commons/opendaylightarphandler
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/clustering/integrationtest/pom.xml b/opendaylight/clustering/integrationtest/pom.xml
index 62c182c3b9..fecf4f8034 100644
--- a/opendaylight/clustering/integrationtest/pom.xml
+++ b/opendaylight/clustering/integrationtest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT../../commons/integrationtestclustering.services.integrationtest
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT../implementation/target/jacoco-it.exec
diff --git a/opendaylight/clustering/services/pom.xml b/opendaylight/clustering/services/pom.xml
index 3ff6bac21f..8c66e70cbe 100644
--- a/opendaylight/clustering/services/pom.xml
+++ b/opendaylight/clustering/services/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightclustering.services
- 0.5.1-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/clustering/services_implementation/pom.xml b/opendaylight/clustering/services_implementation/pom.xml
index 8d3f53b6c4..f11f7a14c0 100644
--- a/opendaylight/clustering/services_implementation/pom.xml
+++ b/opendaylight/clustering/services_implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightclustering.services-implementation
- 0.4.3-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/clustering/stub/pom.xml b/opendaylight/clustering/stub/pom.xml
index 6a0b3082fb..211dcc29d0 100644
--- a/opendaylight/clustering/stub/pom.xml
+++ b/opendaylight/clustering/stub/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightclustering.stub
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/clustering/test/pom.xml b/opendaylight/clustering/test/pom.xml
index 9021c9419e..93294f2290 100644
--- a/opendaylight/clustering/test/pom.xml
+++ b/opendaylight/clustering/test/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightclustering.test
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/commons/checkstyle/pom.xml b/opendaylight/commons/checkstyle/pom.xml
index 55567af437..fee517f08b 100644
--- a/opendaylight/commons/checkstyle/pom.xml
+++ b/opendaylight/commons/checkstyle/pom.xml
@@ -2,7 +2,7 @@
4.0.0org.opendaylight.controllercheckstyle
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOTscm:git:ssh://git.opendaylight.org:29418/controller.gitscm:git:ssh://git.opendaylight.org:29418/controller.git
diff --git a/opendaylight/commons/concepts/pom.xml b/opendaylight/commons/concepts/pom.xml
index 01dd61a1cb..fa97e5fcac 100644
--- a/opendaylight/commons/concepts/pom.xml
+++ b/opendaylight/commons/concepts/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightconcepts
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
@@ -43,7 +43,7 @@
org.opendaylight.controllercheckstyle
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOT
diff --git a/opendaylight/commons/filter-valve/pom.xml b/opendaylight/commons/filter-valve/pom.xml
index 7b5be02514..012b4a2529 100644
--- a/opendaylight/commons/filter-valve/pom.xml
+++ b/opendaylight/commons/filter-valve/pom.xml
@@ -11,7 +11,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../opendaylightfilter-valve
diff --git a/opendaylight/commons/httpclient/pom.xml b/opendaylight/commons/httpclient/pom.xml
index 07d3cdda96..39364cbcba 100644
--- a/opendaylight/commons/httpclient/pom.xml
+++ b/opendaylight/commons/httpclient/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcommons.httpclient
- 0.1.2-SNAPSHOT
+ 0.2.0-SNAPSHOTbundle
@@ -71,7 +71,7 @@
org.opendaylight.controllercheckstyle
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOT
diff --git a/opendaylight/commons/integrationtest/pom.xml b/opendaylight/commons/integrationtest/pom.xml
index 315611f647..ad4e166cbd 100644
--- a/opendaylight/commons/integrationtest/pom.xml
+++ b/opendaylight/commons/integrationtest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcommons.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTpom
@@ -89,7 +89,7 @@
org.opendaylight.controllercheckstyle
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOT
diff --git a/opendaylight/commons/liblldp/pom.xml b/opendaylight/commons/liblldp/pom.xml
index 1551041edb..148a4f3792 100644
--- a/opendaylight/commons/liblldp/pom.xml
+++ b/opendaylight/commons/liblldp/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../opendaylightliblldp
- 0.8.1-SNAPSHOT
+ 0.9.0-SNAPSHOTbundle
diff --git a/opendaylight/commons/logback_settings/pom.xml b/opendaylight/commons/logback_settings/pom.xml
index 11a7ffbd0e..f98b7a3a7a 100644
--- a/opendaylight/commons/logback_settings/pom.xml
+++ b/opendaylight/commons/logback_settings/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.parent
- 1.0.2-SNAPSHOT
+ 1.1.0-SNAPSHOT../parentcommons.logback_settings
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOTscm:git:ssh://git.opendaylight.org:29418/controller.gitscm:git:ssh://git.opendaylight.org:29418/controller.git
diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml
index 4240db939a..23542dd62b 100644
--- a/opendaylight/commons/opendaylight/pom.xml
+++ b/opendaylight/commons/opendaylight/pom.xml
@@ -4,13 +4,13 @@
org.opendaylight.odlparentodlparent
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOTorg.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOTpom3.0
@@ -20,24 +20,24 @@
2.3.41.0.0
- 0.4.2-SNAPSHOT
- 0.0.1-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.1.0-SNAPSHOT1.1.0
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT4.11.502.4.0
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT2.12
- 0.5.1-SNAPSHOT
- 0.4.3-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT3.0.1
@@ -51,23 +51,23 @@
7.0.53.v2014060607207.0.53.v201406070630
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOT1.2.2
- 0.1.2-SNAPSHOT
+ 0.2.0-SNAPSHOT2.43.1
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOT3.0.1
- 0.1.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 1.4.2-SNAPSHOT
- 1.0.2-SNAPSHOT
+ 0.2.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 1.5.0-SNAPSHOT
+ 1.1.0-SNAPSHOT2.3.2
- 0.1.2-SNAPSHOT
- 0.5.2-SNAPSHOT
+ 0.2.0-SNAPSHOT
+ 0.6.0-SNAPSHOT1.4
- 0.2.5-SNAPSHOT
- 0.1.0-SNAPSHOT
+ 0.3.0-SNAPSHOT
+ 0.2.0-SNAPSHOTetc/opendaylight/karaf05-clustering.xml00-netty.xml
@@ -77,16 +77,16 @@
03-toaster-sample.xml10-rest-connector.xml99-netconf-connector.xml
- 0.4.3-SNAPSHOT
- 0.4.3-SNAPSHOT
- 0.1.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.0.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 1.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.2.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 1.2.0-SNAPSHOT2.5.03.8.0.I20120518-2145
@@ -98,78 +98,78 @@
0000.0002.0038.01.6.0
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT2.4.0
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.6.0-SNAPSHOT
- 1.1-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.5.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 1.0.0-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.0.2-SNAPSHOT
- 2010.09.24.4-SNAPSHOT
- 2013.10.19.1-SNAPSHOT
- 2013.10.21.2-SNAPSHOT
- 2010.09.24.4-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.7.0-SNAPSHOT
+ 1.2.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.1.0-SNAPSHOT
+ 2010.09.24.7-SNAPSHOT
+ 2013.10.19.7-SNAPSHOT
+ 2013.10.21.7-SNAPSHOT
+ 2010.09.24.7-SNAPSHOT2.0-beta-2src/main/yang-gen-config
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOT1.1.42.0.11.1.12.0
- 1.0.0-SNAPSHOT
+ 1.1.0-SNAPSHOT3.0.03.0.10.71.81.0.01.0.9
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT3.0.51.9.4
- 1.1-SNAPSHOT
- 0.2.5-SNAPSHOT
- 0.0.3-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 1.2.0-SNAPSHOT
+ 0.3.0-SNAPSHOT
+ 0.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOThttp://nexus.opendaylight.org/content
- 0.4.2-SNAPSHOT
- 1.4.2-SNAPSHOT
- 1.4.2-SNAPSHOT
- 2013.08.27.4-SNAPSHOT
- 0.0.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 1.5.0-SNAPSHOT
+ 1.5.0-SNAPSHOT
+ 2013.08.27.7-SNAPSHOT
+ 0.1.0-SNAPSHOT4.0.01.1.61.1.61.0-alpha-22.5.0
- 0.5.0-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.1.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.0.3-SNAPSHOT
- 0.8.1-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.2.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.1.0-SNAPSHOT
+ 0.9.0-SNAPSHOTsrc/main/yang-gen-sal
- 0.5.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT2.104
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT1.2.4dav:http://nexus.opendaylight.org/content/sites/site${user.name}-private-view
@@ -187,52 +187,45 @@
3.1.4.RELEASE3.1.3.RELEASE3.1.3.RELEASE
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.5.1-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.6.0-SNAPSHOT
+ 0.5.0-SNAPSHOT2.15
- 0.7.1-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.8.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT-Xmx1024m -XX:MaxPermSize=256m
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 1.0.0-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT1.2.01.2.2a
- 0.4.2-SNAPSHOT
- 0.0.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.1.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
+ 0.5.0-SNAPSHOTsrc/main/xtend-gen
- 2013.09.07.4-SNAPSHOT
- 1.0.0-SNAPSHOT
- 0.6.2-SNAPSHOT
+ 2013.09.07.7-SNAPSHOT
+ 1.1.0-SNAPSHOT
+ 0.7.0-SNAPSHOT0.12.00.9.7
+
- ${project.groupId}
- ietf-netconf-monitoring
- ${netconf.version}
-
-
- ${project.groupId}
- ietf-netconf-monitoring-extension
- ${netconf.version}
-
-
- ${project.groupId}
- netconf-netty-util
+ org.opendaylight.controller
+ netconf-artifacts${netconf.version}
+ pom
+ importorg.apache.sshd
@@ -863,11 +856,6 @@
config-manager${config.version}
-
- org.opendaylight.controller
- config-netconf-connector
- ${netconf.version}
- org.opendaylight.controllerconfig-persister-api
@@ -894,11 +882,6 @@
config-persister-feature-adapter${config.version}
-
- org.opendaylight.controller
- config-persister-impl
- ${netconf.version}
- org.opendaylight.controller
@@ -1035,12 +1018,12 @@
org.opendaylight.controllerhttpservice-bridge
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOTorg.opendaylight.controllerjolokia-bridge
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOT
@@ -1070,94 +1053,6 @@
${dummy-console.version}
-
-
- org.opendaylight.controller
- netconf-api
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-client
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-client
- ${netconf.version}
- test-jar
-
-
-
-
- org.opendaylight.controller
- netconf-config-dispatcher
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-impl
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-impl
- ${netconf.version}
- test-jar
-
-
- org.opendaylight.controller
- netconf-mapping-api
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-monitoring
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-netty-util
- ${netconf.version}
- test-jar
-
-
- org.opendaylight.controller
- netconf-auth
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-usermanager
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-ssh
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-ssh
- ${netconf.version}
- test-jar
-
-
- org.opendaylight.controller
- netconf-tcp
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-util
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-util
- ${netconf.version}
- test-jar
- org.opendaylight.controllernetty-config-api
@@ -1298,6 +1193,11 @@
sal-dom-xsql${mdsal.version}
+
+ org.opendaylight.controller
+ sal-karaf-xsql
+ ${mdsal.version}
+ org.opendaylight.controllersal-dom-xsql-config
@@ -1345,16 +1245,6 @@
md-sal-config${mdsal.version}
-
- org.opendaylight.controller
- netconf-config
- ${netconf.version}
-
-
- org.opendaylight.controller
- netconf-connector-config
- ${netconf.version}
- org.opendaylight.controllersal-rest-docgen
@@ -1691,6 +1581,7 @@
ganymed${ganymed.version}
+
org.opendaylight.controller.thirdparty
@@ -1707,174 +1598,16 @@
org.openflow.openflowj1.0.2
-
- org.opendaylight.yangtools
- binding-generator-impl
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- binding-data-codec
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- binding-generator-spi
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- binding-generator-util
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- binding-type-provider
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- concepts
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- object-cache-api
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- object-cache-guava
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- restconf-client-api
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- restconf-client-impl
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- util
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-data-composite-node
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-data-codec-gson
- ${yangtools.version}
-
-
-
- org.opendaylight.yangtools
- yang-binding
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-common
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-data-api
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-data-impl
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-data-util
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-maven-plugin-spi
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-model-api
- ${yangtools.version}
-
+
org.opendaylight.yangtools
- yang-model-util
+ yangtools-artifacts${yangtools.version}
+ pom
+ import
-
- org.opendaylight.yangtools
- yang-parser-api
- ${yangtools.version}
-
-
- org.opendaylight.yangtools
- yang-parser-impl
- ${yangtools.version}
-
-
-
- org.opendaylight.yangtools.model
- ietf-inet-types
- ${ietf-inet-types.version}
-
-
- org.opendaylight.yangtools.model
- ietf-restconf
- ${ietf-restconf.version}
-
-
- org.opendaylight.yangtools.model
- ietf-topology
- ${ietf-topology.version}
-
-
- org.opendaylight.yangtools.model
- ietf-topology-l3-unicast-igp
- ${ietf-topology.version}
-
-
- org.opendaylight.yangtools.model
- ietf-yang-types
- ${ietf-yang-types.version}
-
-
- org.opendaylight.yangtools.model
- ietf-yang-types-20130715
- 2013.07.15.1-SNAPSHOT
-
-
- org.opendaylight.yangtools.model
- opendaylight-l2-types
- ${opendaylight-l2-types.version}
-
-
- org.opendaylight.yangtools.model
- yang-ext
- ${yang-ext.version}
-
-
- org.opendaylight.yangtools.thirdparty
- antlr4-runtime-osgi-nohead
- 4.0
-
-
- org.opendaylight.yangtools.thirdparty
- xtend-lib-osgi
- ${xtend.version}
-
+
org.openexinagasena
@@ -1929,7 +1662,7 @@
org.opendaylight.controllercommons.logback_settings
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOTtest
@@ -1945,12 +1678,6 @@
${mdsal.version}test
-
- org.opendaylight.yangtools
- mockito-configuration
- ${yangtools.version}
- test
- org.opendaylight.controllerfeatures-config
@@ -1967,14 +1694,6 @@
xmlruntime
-
- org.opendaylight.controller
- features-netconf
- ${netconf.version}
- features
- xml
- runtime
- org.opendaylight.controllerfeatures-config-persister
@@ -2023,6 +1742,14 @@
xmlruntime
+
+ org.opendaylight.controller
+ features-netconf-connector
+ ${mdsal.version}
+ features
+ xml
+ runtime
+ org.openjdk.jmh
@@ -2152,7 +1879,7 @@
org.opendaylight.controllercommons.logback_settings
- 0.0.2-SNAPSHOT
+ 0.1.0-SNAPSHOT
@@ -2403,7 +2130,7 @@
org.opendaylight.controllercheckstyle
- 0.0.3-SNAPSHOT
+ 0.1.0-SNAPSHOT
@@ -2581,6 +2308,10 @@
+
true
@@ -2634,16 +2365,24 @@
http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/
+
+
opendaylight-release
- http://nexus.opendaylight.org/content/repositories/opendaylight.release/
+ ${nexusproxy}/repositories/opendaylight.release/opendaylight-snapshot
- http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/
+ ${nexusproxy}/repositories/opendaylight.snapshot/
diff --git a/opendaylight/commons/parent/pom.xml b/opendaylight/commons/parent/pom.xml
index 67d1cb419b..cbd6efaef8 100644
--- a/opendaylight/commons/parent/pom.xml
+++ b/opendaylight/commons/parent/pom.xml
@@ -3,7 +3,7 @@
4.0.0org.opendaylight.controllercommons.parent
- 1.0.2-SNAPSHOT
+ 1.1.0-SNAPSHOTpom3.0
diff --git a/opendaylight/commons/protocol-framework/pom.xml b/opendaylight/commons/protocol-framework/pom.xml
index 774bc7c23f..00f7b3179b 100644
--- a/opendaylight/commons/protocol-framework/pom.xml
+++ b/opendaylight/commons/protocol-framework/pom.xml
@@ -6,12 +6,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightprotocol-framework
- 0.5.0-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle${project.artifactId}Common protocol framework
diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java
index cbe9235245..2ecd267b9f 100644
--- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java
+++ b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java
@@ -46,7 +46,7 @@ public abstract class AbstractSessionNegotiator, L extends SessionList
return;
}
- // Check if initial connection was fully finished. If the session was dropped during negotiation, reconnect will not happen.
- // Session can be dropped during negotiation on purpose by the client side and would make no sense to initiate reconnect
if (promise.isInitialConnectFinished() == false) {
- return;
+ LOG.debug("Connection to {} was dropped during negotiation, reattempting", promise.address);
}
LOG.debug("Reconnecting after connection to {} was dropped", promise.address);
diff --git a/opendaylight/commons/protocol-framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java b/opendaylight/commons/protocol-framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java
index 63026e384c..fc38888de3 100644
--- a/opendaylight/commons/protocol-framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java
+++ b/opendaylight/commons/protocol-framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java
@@ -250,52 +250,6 @@ public class ServerTest {
assertFalse(session.isSuccess());
}
- @Test
- public void testNegotiationFailedNoReconnect() throws Exception {
- final Promise p = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
-
- this.dispatcher = getServerDispatcher(p);
-
- this.server = this.dispatcher.createServer(this.serverAddress, new SessionListenerFactory() {
- @Override
- public SimpleSessionListener getSessionListener() {
- return new SimpleSessionListener();
- }
- });
-
- this.server.get();
-
- this.clientDispatcher = new SimpleDispatcher(new SessionNegotiatorFactory() {
- @Override
- public SessionNegotiator getSessionNegotiator(final SessionListenerFactory factory,
- final Channel channel, final Promise promise) {
-
- return new SimpleSessionNegotiator(promise, channel) {
- @Override
- protected void startNegotiation() throws Exception {
- negotiationFailed(new IllegalStateException("Negotiation failed"));
- }
- };
- }
- }, new DefaultPromise(GlobalEventExecutor.INSTANCE), eventLoopGroup);
-
- final ReconnectStrategyFactory reconnectStrategyFactory = mock(ReconnectStrategyFactory.class);
- final ReconnectStrategy reconnectStrategy = getMockedReconnectStrategy();
- doReturn(reconnectStrategy).when(reconnectStrategyFactory).createReconnectStrategy();
-
- this.clientDispatcher.createReconnectingClient(this.serverAddress,
- reconnectStrategyFactory, new SessionListenerFactory() {
- @Override
- public SimpleSessionListener getSessionListener() {
- return new SimpleSessionListener();
- }
- });
-
-
- // Only one strategy should be created for initial connect, no more = no reconnects
- verify(reconnectStrategyFactory, times(1)).createReconnectStrategy();
- }
-
private SimpleDispatcher getClientDispatcher() {
return new SimpleDispatcher(new SessionNegotiatorFactory() {
@Override
diff --git a/opendaylight/config/config-api/pom.xml b/opendaylight/config/config-api/pom.xml
index e145bd2db0..eff635c17e 100644
--- a/opendaylight/config/config-api/pom.xml
+++ b/opendaylight/config/config-api/pom.xml
@@ -5,7 +5,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOTconfig-api
diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java
index 5ad6e0da8d..48aa6ae646 100644
--- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java
+++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java
@@ -39,7 +39,7 @@ public final class IdentityAttributeRef {
@Override
public String toString() {
- final StringBuffer sb = new StringBuffer("IdentityAttributeRef{");
+ final StringBuilder sb = new StringBuilder("IdentityAttributeRef{");
sb.append("qNameOfIdentity='").append(qNameOfIdentity).append('\'');
sb.append('}');
return sb.toString();
diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
index abb9f1ae9b..c23a0cbf69 100644
--- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
+++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
@@ -29,6 +29,8 @@ import java.util.Set;
*/
@ThreadSafe
public class ObjectNameUtil {
+ private ObjectNameUtil() {
+ }
public static final String ON_DOMAIN = ConfigRegistryConstants.ON_DOMAIN;
public static final String MODULE_FACTORY_NAME_KEY = "moduleFactoryName";
@@ -270,7 +272,7 @@ public class ObjectNameUtil {
}
public static Map getAdditionalProperties(ObjectName on) {
- Hashtable keyPropertyList = on.getKeyPropertyList();
+ Map keyPropertyList = on.getKeyPropertyList();
Map result = new HashMap<>();
for (Entry entry : keyPropertyList.entrySet()) {
result.put(entry.getKey(), entry.getValue());
@@ -304,8 +306,8 @@ public class ObjectNameUtil {
public static ObjectName createModulePattern(String moduleName,
String instanceName) {
- moduleName = moduleName == null ? ON_WILDCARD : moduleName;
- instanceName = instanceName == null ? ON_WILDCARD : instanceName;
+ String finalModuleName = moduleName == null ? ON_WILDCARD : moduleName;
+ String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
// do not return object names containing transaction name
ObjectName namePattern = ObjectNameUtil
@@ -313,34 +315,34 @@ public class ObjectNameUtil {
+ ObjectNameUtil.TYPE_KEY + "="
+ ObjectNameUtil.TYPE_MODULE + ","
+ ObjectNameUtil.MODULE_FACTORY_NAME_KEY + "="
- + moduleName + "," + ""
- + ObjectNameUtil.INSTANCE_NAME_KEY + "=" + instanceName);
+ + finalModuleName + "," + ""
+ + ObjectNameUtil.INSTANCE_NAME_KEY + "=" + finalInstanceName);
return namePattern;
}
public static ObjectName createModulePattern(String ifcName,
String instanceName, String transactionName) {
- ifcName = ifcName == null ? ON_WILDCARD : ifcName;
- instanceName = instanceName == null ? ON_WILDCARD : instanceName;
- transactionName = transactionName == null ? ON_WILDCARD : transactionName;
+ String finalIfcName = ifcName == null ? ON_WILDCARD : ifcName;
+ String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
+ String finalTransactionName = transactionName == null ? ON_WILDCARD : transactionName;
return ObjectNameUtil.createON(ObjectNameUtil.ON_DOMAIN
+ ":type=Module," + ObjectNameUtil.MODULE_FACTORY_NAME_KEY
- + "=" + ifcName + "," + ObjectNameUtil.INSTANCE_NAME_KEY + "="
- + instanceName + "," + ObjectNameUtil.TRANSACTION_NAME_KEY
- + "=" + transactionName);
+ + "=" + finalIfcName + "," + ObjectNameUtil.INSTANCE_NAME_KEY + "="
+ + finalInstanceName + "," + ObjectNameUtil.TRANSACTION_NAME_KEY
+ + "=" + finalTransactionName);
}
public static ObjectName createRuntimeBeanPattern(String moduleName,
String instanceName) {
- moduleName = moduleName == null ? ON_WILDCARD : moduleName;
- instanceName = instanceName == null ? ON_WILDCARD : instanceName;
+ String finalModuleName = moduleName == null ? ON_WILDCARD : moduleName;
+ String finalInstanceName = instanceName == null ? ON_WILDCARD : instanceName;
return ObjectNameUtil.createON(ObjectNameUtil.ON_DOMAIN + ":"
+ ObjectNameUtil.TYPE_KEY + "="
+ ObjectNameUtil.TYPE_RUNTIME_BEAN + ","
- + ObjectNameUtil.MODULE_FACTORY_NAME_KEY + "=" + moduleName
- + "," + ObjectNameUtil.INSTANCE_NAME_KEY + "=" + instanceName
+ + ObjectNameUtil.MODULE_FACTORY_NAME_KEY + "=" + finalModuleName
+ + "," + ObjectNameUtil.INSTANCE_NAME_KEY + "=" + finalInstanceName
+ ",*");
}
diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/constants/ConfigRegistryConstants.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/constants/ConfigRegistryConstants.java
index 1d9563bf4e..bdb6f0e344 100644
--- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/constants/ConfigRegistryConstants.java
+++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/constants/ConfigRegistryConstants.java
@@ -12,6 +12,9 @@ import javax.management.ObjectName;
public class ConfigRegistryConstants {
+ private ConfigRegistryConstants() {
+ }
+
public static final String TYPE_CONFIG_REGISTRY = "ConfigRegistry";
public static final String ON_DOMAIN = "org.opendaylight.controller";
diff --git a/opendaylight/config/config-api/src/main/yang/config.yang b/opendaylight/config/config-api/src/main/yang/config.yang
index a0a4292adf..e46d327ece 100644
--- a/opendaylight/config/config-api/src/main/yang/config.yang
+++ b/opendaylight/config/config-api/src/main/yang/config.yang
@@ -122,7 +122,9 @@ module config {
the actual service-type which is actually required.";
mandatory true;
- type service-type-ref;
+ type leafref {
+ path "/config:services/config:service/config:type";
+ }
}
leaf name {
@@ -138,7 +140,7 @@ module config {
"Top level container encapsulating configuration of all modules.";
list module {
- key "name";
+ key "type name";
leaf name {
description "Unique module instance name";
type string;
diff --git a/opendaylight/config/config-manager/pom.xml b/opendaylight/config/config-manager/pom.xml
index c98a47660e..3ebffc65a2 100644
--- a/opendaylight/config/config-manager/pom.xml
+++ b/opendaylight/config/config-manager/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT..config-manager
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
index b7cdf94757..605223ae22 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
@@ -60,7 +60,7 @@ import java.util.Set;
*/
@ThreadSafe
public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBean {
- private static final Logger logger = LoggerFactory.getLogger(ConfigRegistryImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConfigRegistryImpl.class);
private final ModuleFactoriesResolver resolver;
private final MBeanServer configMBeanServer;
@@ -166,7 +166,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
for (ModuleInternalInfo moduleInternalInfo : currentConfig.getEntries()) {
String name = moduleInternalInfo.getModuleFactory().getImplementationName();
if (allCurrentFactories.containsKey(name) == false) {
- logger.trace("Factory {} not found in SR, using reference from previous commit", name);
+ LOGGER.trace("Factory {} not found in SR, using reference from previous commit", name);
allCurrentFactories.put(name,
Maps.immutableEntry(moduleInternalInfo.getModuleFactory(), moduleInternalInfo.getBundleContext()));
}
@@ -202,7 +202,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
throws ConflictingVersionException, ValidationException {
final String transactionName = ObjectNameUtil
.getTransactionName(transactionControllerON);
- logger.trace("About to commit {}. Current parentVersion: {}, versionCounter {}", transactionName, version, versionCounter);
+ LOGGER.trace("About to commit {}. Current parentVersion: {}, versionCounter {}", transactionName, version, versionCounter);
// find ConfigTransactionController
Map> transactions = transactionsHolder.getCurrentTransactions();
@@ -230,7 +230,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
} catch (Error | RuntimeException t) { // some libs throw Errors: e.g.
// javax.xml.ws.spi.FactoryFinder$ConfigurationError
isHealthy = false;
- logger.error("Configuration Transaction failed on 2PC, server is unhealthy", t);
+ LOGGER.error("Configuration Transaction failed on 2PC, server is unhealthy", t);
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
} else {
@@ -292,7 +292,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
int orderingIdx = 0;
for (ModuleIdentifier moduleIdentifier : orderedModuleIdentifiers) {
- logger.trace("Registering {}", moduleIdentifier);
+ LOGGER.trace("Registering {}", moduleIdentifier);
ModuleInternalTransactionalInfo entry = commitInfo.getCommitted()
.get(moduleIdentifier);
if (entry == null) {
@@ -427,7 +427,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
configTransactionControllerEntry.getValue().close();
configTransactionController.abortConfig();
} catch (RuntimeException e) {
- logger.warn("Ignoring exception while aborting {}",
+ LOGGER.warn("Ignoring exception while aborting {}",
configTransactionController, e);
}
}
@@ -524,14 +524,10 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
@Override
public Set lookupRuntimeBeans(String moduleName,
String instanceName) {
- if (moduleName == null) {
- moduleName = "*";
- }
- if (instanceName == null) {
- instanceName = "*";
- }
+ String finalModuleName = moduleName == null ? "*" : moduleName;
+ String finalInstanceName = instanceName == null ? "*" : instanceName;
ObjectName namePattern = ObjectNameUtil.createRuntimeBeanPattern(
- moduleName, instanceName);
+ finalModuleName, finalInstanceName);
return baseJMXRegistrator.queryNames(namePattern, null);
}
@@ -609,7 +605,7 @@ class ConfigHolder {
* Service Registry.
*/
public void addAll(Collection configInfos) {
- if (currentConfig.size() > 0) {
+ if (!currentConfig.isEmpty()) {
throw new IllegalStateException(
"Error - some config entries were not removed: "
+ currentConfig);
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
index 39eef8741b..a58f7a05c6 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
@@ -53,7 +53,7 @@ class ConfigTransactionControllerImpl implements
ConfigTransactionControllerInternal,
ConfigTransactionControllerImplMXBean,
Identifiable {
- private static final Logger logger = LoggerFactory.getLogger(ConfigTransactionControllerImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConfigTransactionControllerImpl.class);
private final ConfigTransactionLookupRegistry txLookupRegistry;
private final ObjectName controllerON;
@@ -226,7 +226,7 @@ class ConfigTransactionControllerImpl implements
boolean isDefaultBean, BundleContext bundleContext)
throws InstanceAlreadyExistsException {
- logger.debug("Adding module {} to transaction {}", moduleIdentifier, this);
+ LOGGER.debug("Adding module {} to transaction {}", moduleIdentifier, this);
if (moduleIdentifier.equals(module.getIdentifier()) == false) {
throw new IllegalStateException("Incorrect name reported by module. Expected "
+ moduleIdentifier + ", got " + module.getIdentifier());
@@ -271,15 +271,13 @@ class ConfigTransactionControllerImpl implements
}
private synchronized void destroyModule(ModuleIdentifier moduleIdentifier) {
- logger.debug("Destroying module {} in transaction {}", moduleIdentifier, this);
+ LOGGER.debug("Destroying module {} in transaction {}", moduleIdentifier, this);
transactionStatus.checkNotAborted();
ModuleInternalTransactionalInfo found = dependencyResolverManager.findModuleInternalTransactionalInfo(moduleIdentifier);
- if (blankTransaction == false) {
-
- if (found.isDefaultBean()) {
- logger.warn("Warning: removing default bean. This will be forbidden in next version of config-subsystem");
- }
+ if (blankTransaction == false &&
+ found.isDefaultBean()) {
+ LOGGER.warn("Warning: removing default bean. This will be forbidden in next version of config-subsystem");
}
// first remove refNames, it checks for objectname existence
@@ -287,7 +285,7 @@ class ConfigTransactionControllerImpl implements
writableSRRegistry.removeServiceReferences(
ObjectNameUtil.createTransactionModuleON(getTransactionName(), moduleIdentifier));
} catch (InstanceNotFoundException e) {
- logger.error("Possible code error: cannot find {} in {}", moduleIdentifier, writableSRRegistry);
+ LOGGER.error("Possible code error: cannot find {} in {}", moduleIdentifier, writableSRRegistry);
throw new IllegalStateException("Possible code error: cannot find " + moduleIdentifier, e);
}
@@ -313,15 +311,15 @@ class ConfigTransactionControllerImpl implements
}
configBeanModificationDisabled.set(true);
try {
- validate_noLocks();
+ validateNoLocks();
} finally {
configBeanModificationDisabled.set(false);
}
}
- private void validate_noLocks() throws ValidationException {
+ private void validateNoLocks() throws ValidationException {
transactionStatus.checkNotAborted();
- logger.trace("Validating transaction {}", getTransactionIdentifier());
+ LOGGER.trace("Validating transaction {}", getTransactionIdentifier());
// call validate()
List collectedExceptions = new ArrayList<>();
for (Entry entry : dependencyResolverManager
@@ -331,17 +329,17 @@ class ConfigTransactionControllerImpl implements
try {
module.validate();
} catch (Exception e) {
- logger.warn("Validation exception in {}", getTransactionName(),
+ LOGGER.warn("Validation exception in {}", getTransactionName(),
e);
collectedExceptions.add(ValidationException
.createForSingleException(name, e));
}
}
- if (collectedExceptions.size() > 0) {
+ if (!collectedExceptions.isEmpty()) {
throw ValidationException
.createFromCollectedValidationExceptions(collectedExceptions);
}
- logger.trace("Validated transaction {}", getTransactionIdentifier());
+ LOGGER.trace("Validated transaction {}", getTransactionIdentifier());
}
/**
@@ -358,9 +356,9 @@ class ConfigTransactionControllerImpl implements
transactionStatus.checkNotCommitStarted();
configBeanModificationDisabled.set(true);
try {
- validate_noLocks();
+ validateNoLocks();
} catch (ValidationException e) {
- logger.trace("Commit failed on validation");
+ LOGGER.trace("Commit failed on validation");
configBeanModificationDisabled.set(false); // recoverable error
throw e;
}
@@ -383,7 +381,7 @@ class ConfigTransactionControllerImpl implements
+ "to obtain a lock");
}
- logger.trace("Committing transaction {}", getTransactionIdentifier());
+ LOGGER.trace("Committing transaction {}", getTransactionIdentifier());
// call getInstance()
for (Entry entry : dependencyResolverManager
@@ -391,12 +389,12 @@ class ConfigTransactionControllerImpl implements
Module module = entry.getValue();
ModuleIdentifier name = entry.getKey();
try {
- logger.debug("About to commit {} in transaction {}",
+ LOGGER.debug("About to commit {} in transaction {}",
name, getTransactionIdentifier());
AutoCloseable instance = module.getInstance();
checkNotNull(instance, "Instance is null:{} in transaction {}", name, getTransactionIdentifier());
} catch (Exception e) {
- logger.error("Commit failed on {} in transaction {}", name,
+ LOGGER.error("Commit failed on {} in transaction {}", name,
getTransactionIdentifier(), e);
internalAbort();
throw new IllegalStateException(
@@ -407,7 +405,7 @@ class ConfigTransactionControllerImpl implements
// count dependency order
- logger.trace("Committed configuration {}", getTransactionIdentifier());
+ LOGGER.trace("Committed configuration {}", getTransactionIdentifier());
transactionStatus.setCommitted();
return dependencyResolverManager.getSortedModuleIdentifiers();
@@ -421,7 +419,7 @@ class ConfigTransactionControllerImpl implements
}
private void internalAbort() {
- logger.trace("Aborting {}", this);
+ LOGGER.trace("Aborting {}", this);
transactionStatus.setAborted();
close();
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
index d34a739703..b59b48e5a9 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
@@ -11,7 +11,7 @@ import java.util.LinkedList;
import java.util.concurrent.TimeUnit;
public class DeadlockMonitor implements AutoCloseable {
- private static final Logger logger = LoggerFactory.getLogger(DeadlockMonitorRunnable.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(DeadlockMonitorRunnable.class);
private static final long WARN_AFTER_MILLIS = 5000;
@@ -43,7 +43,7 @@ public class DeadlockMonitor implements AutoCloseable {
moduleIdentifierWithNanosStack.push(current);
top = current;
}
- logger.trace("setCurrentlyInstantiatedModule {}, top {}", currentlyInstantiatedModule, top);
+ LOGGER.trace("setCurrentlyInstantiatedModule {}, top {}", currentlyInstantiatedModule, top);
}
public boolean isAlive() {
@@ -78,7 +78,7 @@ public class DeadlockMonitor implements AutoCloseable {
// is the getInstance() running longer than WARN_AFTER_MILLIS ?
long runningTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - copy.nanoTime);
if (runningTime > WARN_AFTER_MILLIS) {
- logger.warn("{} did not finish after {} ms", copy.moduleIdentifier, runningTime);
+ LOGGER.warn("{} did not finish after {} ms", copy.moduleIdentifier, runningTime);
}
}
try {
@@ -87,7 +87,7 @@ public class DeadlockMonitor implements AutoCloseable {
interrupt();
}
}
- logger.trace("Exiting {}", this);
+ LOGGER.trace("Exiting {}", this);
}
@Override
@@ -122,14 +122,21 @@ public class DeadlockMonitor implements AutoCloseable {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
ModuleIdentifierWithNanos that = (ModuleIdentifierWithNanos) o;
- if (nanoTime != that.nanoTime) return false;
- if (moduleIdentifier != null ? !moduleIdentifier.equals(that.moduleIdentifier) : that.moduleIdentifier != null)
+ if (nanoTime != that.nanoTime) {
return false;
+ }
+ if (moduleIdentifier != null ? !moduleIdentifier.equals(that.moduleIdentifier) : that.moduleIdentifier != null) {
+ return false;
+ }
return true;
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java
index 52bb3f5ed1..0f881e95ad 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java
@@ -38,7 +38,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceReadableRegistry, SearchableServiceReferenceWritableRegistry {
- private static final Logger logger = LoggerFactory.getLogger(ServiceReferenceRegistryImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServiceReferenceRegistryImpl.class);
private final Map factories;
private final Map> factoryNamesToQNames;
@@ -176,7 +176,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
boolean skipChecks = true;
newRegistry.saveServiceReference(refNameEntry.getKey(), currentImplementation, skipChecks);
} catch (InstanceNotFoundException e) {
- logger.error("Cannot save service reference({}, {})", refNameEntry.getKey(), currentImplementation);
+ LOGGER.error("Cannot save service reference({}, {})", refNameEntry.getKey(), currentImplementation);
throw new IllegalStateException("Possible code error", e);
}
}
@@ -201,22 +201,22 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
Map> modifiableFactoryNamesToQNames = new HashMap<>();
Set allAnnotations = new HashSet<>();
- Set allQNames = new HashSet<>();
+ Set allQNameSet = new HashSet<>();
for (Entry entry : factories.entrySet()) {
if (entry.getKey().equals(entry.getValue().getImplementationName()) == false) {
- logger.error("Possible error in code: Mismatch between supplied and actual name of {}", entry);
+ LOGGER.error("Possible error in code: Mismatch between supplied and actual name of {}", entry);
throw new IllegalArgumentException("Possible error in code: Mismatch between supplied and actual name of " + entry);
}
Set siAnnotations = InterfacesHelper.getServiceInterfaceAnnotations(entry.getValue());
Set qNames = InterfacesHelper.getQNames(siAnnotations);
allAnnotations.addAll(siAnnotations);
- allQNames.addAll(qNames);
+ allQNameSet.addAll(qNames);
modifiableFactoryNamesToQNames.put(entry.getKey(), Collections.unmodifiableSet(qNames));
}
this.factoryNamesToQNames = Collections.unmodifiableMap(modifiableFactoryNamesToQNames);
- this.allQNames = Collections.unmodifiableSet(allQNames);
+ this.allQNames = Collections.unmodifiableSet(allQNameSet);
// fill namespacesToAnnotations
Map> modifiableNamespacesToAnnotations =
new HashMap<>();
@@ -228,7 +228,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
modifiableNamespacesToAnnotations.put(sia.namespace(), ofNamespace);
}
if (ofNamespace.containsKey(sia.localName())) {
- logger.error("Cannot construct namespacesToAnnotations map, conflict between local names in {}, offending local name: {}, map so far {}",
+ LOGGER.error("Cannot construct namespacesToAnnotations map, conflict between local names in {}, offending local name: {}, map so far {}",
sia.namespace(), sia.localName(), modifiableNamespacesToAnnotations);
throw new IllegalArgumentException("Conflict between local names in " + sia.namespace() + " : " + sia.localName());
}
@@ -237,7 +237,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
}
this.namespacesToAnnotations = Collections.unmodifiableMap(modifiableNamespacesToAnnotations);
this.serviceQNamesToAnnotations = Collections.unmodifiableMap(modifiableServiceQNamesToAnnotations);
- logger.trace("factoryNamesToQNames:{}", this.factoryNamesToQNames);
+ LOGGER.trace("factoryNamesToQNames:{}", this.factoryNamesToQNames);
}
@Override
@@ -256,7 +256,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
String factoryName = ObjectNameUtil.getFactoryName(objectName);
Set serviceInterfaceAnnotations = factoryNamesToQNames.get(factoryName);
if (serviceInterfaceAnnotations == null) {
- logger.error("Possible error in code: cannot find factory annotations of '{}' extracted from ON {} in {}",
+ LOGGER.error("Possible error in code: cannot find factory annotations of '{}' extracted from ON {} in {}",
factoryName, objectName, factoryNamesToQNames);
throw new IllegalArgumentException("Cannot find factory with name " + factoryName);
}
@@ -267,12 +267,12 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
public synchronized String getServiceInterfaceName(String namespace, String localName) {
Map ofNamespace = namespacesToAnnotations.get(namespace);
if (ofNamespace == null) {
- logger.error("Cannot find namespace {} in {}", namespace, namespacesToAnnotations);
+ LOGGER.error("Cannot find namespace {} in {}", namespace, namespacesToAnnotations);
throw new IllegalArgumentException("Cannot find namespace " + namespace);
}
ServiceInterfaceAnnotation sia = ofNamespace.get(localName);
if (sia == null) {
- logger.error("Cannot find local name {} in namespace {}, found only {}", localName, namespace, ofNamespace);
+ LOGGER.error("Cannot find local name {} in namespace {}, found only {}", localName, namespace, ofNamespace);
throw new IllegalArgumentException("Cannot find local name " + localName + " in namespace " + namespace);
}
return sia.value();
@@ -300,7 +300,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
try {
on = lookupRegistry.lookupConfigBean(moduleIdentifier.getFactoryName(), moduleIdentifier.getInstanceName());
} catch (InstanceNotFoundException e) {
- logger.error("Cannot find instance {}", moduleIdentifier);
+ LOGGER.error("Cannot find instance {}", moduleIdentifier);
throw new IllegalStateException("Cannot find instance " + moduleIdentifier, e);
}
return on;
@@ -311,7 +311,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
ServiceReference serviceReference = new ServiceReference(serviceInterfaceQName, refName);
ModuleIdentifier moduleIdentifier = refNames.get(serviceReference);
if (moduleIdentifier == null) {
- logger.error("Cannot find qname {} and refName {} in {}", serviceInterfaceQName, refName, refName);
+ LOGGER.error("Cannot find qname {} and refName {} in {}", serviceInterfaceQName, refName, refName);
throw new IllegalArgumentException("Cannot find " + serviceReference);
}
return getObjectName(moduleIdentifier);
@@ -322,7 +322,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
Map> serviceMapping = getServiceMapping();
Map innerMap = serviceMapping.get(serviceInterfaceQName);
if (innerMap == null) {
- logger.error("Cannot find qname {} in {}", serviceInterfaceQName, refNames);
+ LOGGER.error("Cannot find qname {} in {}", serviceInterfaceQName, refNames);
throw new IllegalArgumentException("Cannot find " + serviceInterfaceQName);
}
return innerMap;
@@ -348,7 +348,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
String referenceName = ObjectNameUtil.getReferenceName(objectName);
ServiceReference serviceReference = new ServiceReference(serviceQName, referenceName);
if (refNames.containsKey(serviceReference) == false) {
- logger.warn("Cannot find {} in {}", serviceReference, refNames);
+ LOGGER.warn("Cannot find {} in {}", serviceReference, refNames);
throw new InstanceNotFoundException("Service reference not found:" + objectName);
}
}
@@ -387,13 +387,13 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
// check that service interface name exist
Set serviceInterfaceQNames = factoryNamesToQNames.get(moduleIdentifier.getFactoryName());
if (serviceInterfaceQNames == null) {
- logger.error("Possible error in code: cannot find factoryName {} in {}, {}", moduleIdentifier.getFactoryName(),
+ LOGGER.error("Possible error in code: cannot find factoryName {} in {}, {}", moduleIdentifier.getFactoryName(),
factoryNamesToQNames, moduleIdentifier);
throw new IllegalStateException("Possible error in code: cannot find annotations of existing factory " + moduleIdentifier.getFactoryName());
}
// supplied serviceInterfaceName must exist in this collection
if (serviceInterfaceQNames.contains(serviceReference.getServiceInterfaceQName()) == false) {
- logger.error("Cannot find qName {} with factory name {}, found {}", serviceReference.getServiceInterfaceQName(), moduleIdentifier.getFactoryName(), serviceInterfaceQNames);
+ LOGGER.error("Cannot find qName {} with factory name {}, found {}", serviceReference.getServiceInterfaceQName(), moduleIdentifier.getFactoryName(), serviceInterfaceQNames);
throw new IllegalArgumentException("Cannot find service interface " + serviceReference.getServiceInterfaceQName() + " within factory " + moduleIdentifier.getFactoryName());
}
@@ -465,11 +465,11 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
}
private synchronized void removeServiceReference(ServiceReference serviceReference) throws InstanceNotFoundException {
- logger.debug("Removing service reference {} from {}", serviceReference, this);
+ LOGGER.debug("Removing service reference {} from {}", serviceReference, this);
assertWritable();
// is the qName known?
if (allQNames.contains(serviceReference.getServiceInterfaceQName()) == false) {
- logger.error("Cannot find qname {} in {}", serviceReference.getServiceInterfaceQName(), allQNames);
+ LOGGER.error("Cannot find qname {} in {}", serviceReference.getServiceInterfaceQName(), allQNames);
throw new IllegalArgumentException("Cannot find service interface " + serviceReference.getServiceInterfaceQName());
}
ModuleIdentifier removed = refNames.remove(serviceReference);
@@ -518,7 +518,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
private Set findServiceReferencesLinkingTo(ObjectName moduleObjectName, Set serviceInterfaceQNames) {
String factoryName = ObjectNameUtil.getFactoryName(moduleObjectName);
if (serviceInterfaceQNames == null) {
- logger.warn("Possible error in code: cannot find factoryName {} in {}, object name {}", factoryName, factoryNamesToQNames, moduleObjectName);
+ LOGGER.warn("Possible error in code: cannot find factoryName {} in {}, object name {}", factoryName, factoryNamesToQNames, moduleObjectName);
throw new IllegalStateException("Possible error in code: cannot find annotations of existing factory " + factoryName);
}
String instanceName = ObjectNameUtil.getInstanceName(moduleObjectName);
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java
index 4f60a673f5..a7a67d3d16 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
*/
final class DependencyResolverImpl implements DependencyResolver,
Comparable {
- private static final Logger logger = LoggerFactory.getLogger(DependencyResolverImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(DependencyResolverImpl.class);
private final ModulesHolder modulesHolder;
private final ModuleIdentifier name;
@@ -107,9 +107,9 @@ final class DependencyResolverImpl implements DependencyResolver,
), jmxAttribute
);
- dependentReadOnlyON = translateServiceRefIfPossible(dependentReadOnlyON);
+ ObjectName newDependentReadOnlyON = translateServiceRefIfPossible(dependentReadOnlyON);
- ModuleIdentifier moduleIdentifier = ObjectNameUtil.fromON(dependentReadOnlyON, ObjectNameUtil
+ ModuleIdentifier moduleIdentifier = ObjectNameUtil.fromON(newDependentReadOnlyON, ObjectNameUtil
.TYPE_MODULE);
ModuleFactory foundFactory = modulesHolder.findModuleFactory(moduleIdentifier, jmxAttribute);
@@ -122,7 +122,7 @@ final class DependencyResolverImpl implements DependencyResolver,
+ "Module name is %s : %s, expected service interface %s, dependent module ON %s , "
+ "attribute %s",
foundFactory.getImplementationName(), foundFactory,
- expectedServiceInterface, dependentReadOnlyON,
+ expectedServiceInterface, newDependentReadOnlyON,
jmxAttribute
);
throw new JmxAttributeValidationException(message, jmxAttribute);
@@ -134,13 +134,14 @@ final class DependencyResolverImpl implements DependencyResolver,
// translate from serviceref to module ON
private ObjectName translateServiceRefIfPossible(ObjectName dependentReadOnlyON) {
- if (ObjectNameUtil.isServiceReference(dependentReadOnlyON)) {
- String serviceQName = ObjectNameUtil.getServiceQName(dependentReadOnlyON);
- String refName = ObjectNameUtil.getReferenceName(dependentReadOnlyON);
- dependentReadOnlyON = ObjectNameUtil.withoutTransactionName( // strip again of transaction name
+ ObjectName translatedDependentReadOnlyON = dependentReadOnlyON;
+ if (ObjectNameUtil.isServiceReference(translatedDependentReadOnlyON)) {
+ String serviceQName = ObjectNameUtil.getServiceQName(translatedDependentReadOnlyON);
+ String refName = ObjectNameUtil.getReferenceName(translatedDependentReadOnlyON);
+ translatedDependentReadOnlyON = ObjectNameUtil.withoutTransactionName( // strip again of transaction name
readableRegistry.lookupConfigBeanByServiceInterfaceName(serviceQName, refName));
}
- return dependentReadOnlyON;
+ return translatedDependentReadOnlyON;
}
/**
@@ -155,12 +156,12 @@ final class DependencyResolverImpl implements DependencyResolver,
"Null parameters not allowed, got %s %s %s", expectedType,
dependentReadOnlyON, jmxAttribute));
}
- dependentReadOnlyON = translateServiceRefIfPossible(dependentReadOnlyON);
+ ObjectName translatedDependentReadOnlyON = translateServiceRefIfPossible(dependentReadOnlyON);
transactionStatus.checkCommitStarted();
transactionStatus.checkNotCommitted();
ModuleIdentifier dependentModuleIdentifier = ObjectNameUtil.fromON(
- dependentReadOnlyON, ObjectNameUtil.TYPE_MODULE);
+ translatedDependentReadOnlyON, ObjectNameUtil.TYPE_MODULE);
Module module = modulesHolder.findModule(dependentModuleIdentifier,
jmxAttribute);
synchronized (this) {
@@ -199,7 +200,7 @@ final class DependencyResolverImpl implements DependencyResolver,
if (expectedBaseClass.isAssignableFrom(deserialized)) {
return (Class) deserialized;
} else {
- logger.error("Cannot resolve class of identity {} : deserialized class {} is not a subclass of {}.",
+ LOGGER.error("Cannot resolve class of identity {} : deserialized class {} is not a subclass of {}.",
identityRef, deserialized, expectedBaseClass);
throw new IllegalArgumentException("Deserialized identity " + deserialized + " cannot be cast to " + expectedBaseClass);
}
@@ -277,17 +278,17 @@ final class DependencyResolverImpl implements DependencyResolver,
@Override
public Object getAttribute(ObjectName name, String attribute)
throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
- name = translateServiceRefIfPossible(name);
+ ObjectName newName = translateServiceRefIfPossible(name);
// add transaction name
- name = ObjectNameUtil.withTransactionName(name, transactionName);
- return mBeanServer.getAttribute(name, attribute);
+ newName = ObjectNameUtil.withTransactionName(newName, transactionName);
+ return mBeanServer.getAttribute(newName, attribute);
}
@Override
public T newMXBeanProxy(ObjectName name, Class interfaceClass) {
- name = translateServiceRefIfPossible(name);
+ ObjectName newName = translateServiceRefIfPossible(name);
// add transaction name
- name = ObjectNameUtil.withTransactionName(name, transactionName);
- return JMX.newMXBeanProxy(mBeanServer, name, interfaceClass);
+ newName = ObjectNameUtil.withTransactionName(newName, transactionName);
+ return JMX.newMXBeanProxy(mBeanServer, newName, interfaceClass);
}
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java
index 2a1a908e7a..15f5d48a6f 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java
@@ -139,7 +139,7 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
@Override
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
- boolean isGetInstance = method.getName().equals("getInstance");
+ boolean isGetInstance = "getInstance".equals(method.getName());
if (isGetInstance) {
if (cachedInstance != null) {
return cachedInstance;
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java
index 2aa74758d4..ec2418bc6c 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
*/
public class DestroyedModule implements AutoCloseable,
Comparable, Identifiable {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(DestroyedModule.class);
private final ModuleIdentifier identifier;
@@ -43,21 +43,21 @@ public class DestroyedModule implements AutoCloseable,
@Override
public void close() {
- logger.trace("Destroying {}", identifier);
+ LOGGER.trace("Destroying {}", identifier);
try {
instance.close();
} catch (Exception e) {
- logger.error("Error while closing instance of {}", identifier, e);
+ LOGGER.error("Error while closing instance of {}", identifier, e);
}
try {
oldJMXRegistrator.close();
} catch (Exception e) {
- logger.error("Error while closing jmx registrator of {}", identifier, e);
+ LOGGER.error("Error while closing jmx registrator of {}", identifier, e);
}
try {
osgiRegistration.close();
} catch (Exception e) {
- logger.error("Error while closing osgi registration of {}", identifier, e);
+ LOGGER.error("Error while closing osgi registration of {}", identifier, e);
}
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
index 7e48af1caa..4a148669b1 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
@@ -57,7 +57,7 @@ import static java.lang.String.format;
* a read only wrapper.
*/
abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(AbstractDynamicWrapper.class);
protected final boolean writable;
@@ -234,7 +234,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
public Object getAttribute(String attributeName)
throws AttributeNotFoundException, MBeanException,
ReflectionException {
- if (attributeName.equals("MBeanInfo")) {
+ if ("MBeanInfo".equals(attributeName)) {
return getMBeanInfo();
}
@@ -318,7 +318,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
result.add(new Attribute(attributeName, value));
} catch (Exception e) {
- logger.debug("Getting attribute {} failed", attributeName, e);
+ LOGGER.debug("Getting attribute {} failed", attributeName, e);
}
}
return result;
@@ -342,7 +342,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
&& signature[0].equals(AttributeList.class.getName())) {
return setAttributes((AttributeList) params[0]);
} else {
- logger.debug("Operation not found {} ", actionName);
+ LOGGER.debug("Operation not found {} ", actionName);
throw new UnsupportedOperationException(
format("Operation not found on %s. Method invoke is only supported for getInstance and getAttribute(s) "
+ "method, got actionName %s, params %s, signature %s ",
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
index f3e1b4e705..c4dee3513d 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
@@ -17,6 +17,9 @@ import java.util.Set;
public class AnnotationsHelper {
+ private AnnotationsHelper() {
+ }
+
/**
* Look for annotation specified by annotationType on method. First observe
* method's class, then its super classes, then all provided interfaces.
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
index 044f7a9ada..14be254504 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
@@ -136,7 +136,7 @@ class AttributeHolder {
for (RequireInterface ri : foundRequireInterfaces) {
foundValues.add(ri.value());
}
- if (foundValues.size() == 0) {
+ if (foundValues.isEmpty()) {
return null;
} else if (foundValues.size() > 1) {
throw new IllegalStateException("Error finding @RequireInterface. "
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java
index 3a24940a4c..7d3cb277fb 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java
@@ -68,7 +68,7 @@ public class DynamicReadableWrapper extends AbstractDynamicWrapper implements
public Object getAttribute(String attributeName)
throws AttributeNotFoundException, MBeanException,
ReflectionException {
- if (attributeName.equals("getInstance")) {
+ if ("getInstance".equals(attributeName)) {
return getInstance();
}
return super.getAttribute(attributeName);
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java
index 07bd63b7c7..c3885150d5 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java
@@ -47,7 +47,7 @@ import java.lang.reflect.Method;
*/
@ThreadSafe
public class DynamicWritableWrapper extends AbstractDynamicWrapper {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(DynamicWritableWrapper.class);
private final ReadOnlyAtomicBoolean configBeanModificationDisabled;
@@ -77,23 +77,24 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
@Override
public synchronized void setAttribute(Attribute attribute)
throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
+ Attribute newAttribute = attribute;
if (configBeanModificationDisabled.get() == true) {
throw new IllegalStateException("Operation is not allowed now");
}
- if (attribute.getName().equals("Attribute")) {
- setAttribute((Attribute) attribute.getValue());
+ if ("Attribute".equals(newAttribute.getName())) {
+ setAttribute((Attribute) newAttribute.getValue());
return;
}
try {
- if (attribute.getValue() instanceof ObjectName) {
- attribute = fixDependencyAttribute(attribute);
- } else if (attribute.getValue() instanceof ObjectName[]) {
- attribute = fixDependencyListAttribute(attribute);
+ if (newAttribute.getValue() instanceof ObjectName) {
+ newAttribute = fixDependencyAttribute(newAttribute);
+ } else if (newAttribute.getValue() instanceof ObjectName[]) {
+ newAttribute = fixDependencyListAttribute(newAttribute);
}
- internalServer.setAttribute(objectNameInternal, attribute);
+ internalServer.setAttribute(objectNameInternal, newAttribute);
} catch (InstanceNotFoundException e) {
throw new MBeanException(e);
}
@@ -101,21 +102,23 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
}
private Attribute fixDependencyListAttribute(Attribute attribute) {
- AttributeHolder attributeHolder = attributeHolderMap.get(attribute.getName());
+ Attribute newAttribute = attribute;
+ AttributeHolder attributeHolder = attributeHolderMap.get(newAttribute.getName());
if (attributeHolder.getRequireInterfaceOrNull() != null) {
- attribute = new Attribute(attribute.getName(), fixObjectNames((ObjectName[]) attribute.getValue()));
+ newAttribute = new Attribute(newAttribute.getName(), fixObjectNames((ObjectName[]) newAttribute.getValue()));
}
- return attribute;
+ return newAttribute;
}
private Attribute fixDependencyAttribute(Attribute attribute) {
- AttributeHolder attributeHolder = attributeHolderMap.get(attribute.getName());
+ Attribute newAttribute = attribute;
+ AttributeHolder attributeHolder = attributeHolderMap.get(newAttribute.getName());
if (attributeHolder.getRequireInterfaceOrNull() != null) {
- attribute = new Attribute(attribute.getName(), fixObjectName((ObjectName) attribute.getValue()));
+ newAttribute = new Attribute(newAttribute.getName(), fixObjectName((ObjectName) newAttribute.getValue()));
} else {
- attribute = new Attribute(attribute.getName(), attribute.getValue());
+ newAttribute = new Attribute(newAttribute.getName(), newAttribute.getValue());
}
- return attribute;
+ return newAttribute;
}
private ObjectName[] fixObjectNames(ObjectName[] dependencies) {
@@ -137,7 +140,7 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
setAttribute(attribute);
result.add(attribute);
} catch (Exception e) {
- logger.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
+ LOGGER.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
throw new IllegalArgumentException(
"Setting attribute failed - " + attribute.getName()
+ " on " + moduleIdentifier, e);
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java
index 98f0908dc7..ddb9c52c88 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Set;
public class InternalJMXRegistrator implements Closeable {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(InternalJMXRegistrator.class);
private final MBeanServer configMBeanServer;
@@ -53,6 +53,7 @@ public class InternalJMXRegistrator implements Closeable {
@GuardedBy("this")
private final Set registeredObjectNames = new HashSet<>();
+ @GuardedBy("this")
private final List children = new ArrayList<>();
public synchronized InternalJMXRegistration registerMBean(Object object,
@@ -79,9 +80,8 @@ public class InternalJMXRegistrator implements Closeable {
}
}
- public InternalJMXRegistrator createChild() {
- InternalJMXRegistrator child = new InternalJMXRegistrator(
- configMBeanServer);
+ public synchronized InternalJMXRegistrator createChild() {
+ InternalJMXRegistrator child = new InternalJMXRegistrator(configMBeanServer);
children.add(child);
return child;
}
@@ -100,7 +100,7 @@ public class InternalJMXRegistrator implements Closeable {
try {
configMBeanServer.unregisterMBean(on);
} catch (Exception e) {
- logger.warn("Ignoring error while unregistering {}", on, e);
+ LOGGER.warn("Ignoring error while unregistering {}", on, e);
}
}
registeredObjectNames.clear();
@@ -137,7 +137,7 @@ public class InternalJMXRegistrator implements Closeable {
return getSameNames(result);
}
- private Set getSameNames(Set superSet) {
+ private synchronized Set getSameNames(Set superSet) {
Set result = new HashSet<>(superSet);
result.retainAll(registeredObjectNames);
for (InternalJMXRegistrator child : children) {
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ModuleJMXRegistrator.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ModuleJMXRegistrator.java
index 34c0436daf..c0e9b0d101 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ModuleJMXRegistrator.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ModuleJMXRegistrator.java
@@ -46,9 +46,10 @@ public class ModuleJMXRegistrator implements Closeable {
public ModuleJMXRegistration registerMBean(Object object, ObjectName on)
throws InstanceAlreadyExistsException {
ObjectNameUtil.checkType(on, ObjectNameUtil.TYPE_MODULE);
- if (ObjectNameUtil.getTransactionName(on) != null)
+ if (ObjectNameUtil.getTransactionName(on) != null) {
throw new IllegalArgumentException(
"Transaction name not expected in " + on);
+ }
return new ModuleJMXRegistration(childJMXRegistrator.registerMBean(
object, on));
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java
index b592fa3c79..c03bfa4500 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java
@@ -49,7 +49,7 @@ public class BeanToOsgiServiceManager {
public static class OsgiRegistration implements AutoCloseable {
- private static final Logger logger = LoggerFactory.getLogger(OsgiRegistration.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(OsgiRegistration.class);
@GuardedBy("this")
private AutoCloseable instance;
@@ -89,7 +89,7 @@ public class BeanToOsgiServiceManager {
try {
serviceRegistration.unregister();
} catch(IllegalStateException e) {
- logger.trace("Cannot unregister {}", serviceRegistration, e);
+ LOGGER.trace("Cannot unregister {}", serviceRegistration, e);
}
}
serviceRegistrations.clear();
@@ -101,7 +101,7 @@ public class BeanToOsgiServiceManager {
notEquals |= newAnnotationMapping.equals(serviceNamesToAnnotations) == false;
if (notEquals) {
// FIXME: changing from old state to new state can be improved by computing the diff
- logger.debug("Detected change in service registrations for {}: old: {}, new: {}", moduleIdentifier,
+ LOGGER.debug("Detected change in service registrations for {}: old: {}, new: {}", moduleIdentifier,
serviceNamesToAnnotations, newAnnotationMapping);
close();
this.instance = newInstance;
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
index 375ef59487..b115f1acd9 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
* functionality.
*/
public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer {
- private static final Logger logger = LoggerFactory.getLogger(BlankTransactionServiceTracker.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(BlankTransactionServiceTracker.class);
public static final int DEFAULT_MAX_ATTEMPTS = 10;
@@ -65,7 +65,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
try {
// create transaction
CommitStatus commitStatus = blankTransaction.hit();
- logger.debug("Committed blank transaction with status {}", commitStatus);
+ LOGGER.debug("Committed blank transaction with status {}", commitStatus);
return;
} catch (ConflictingVersionException e) {
lastException = e;
@@ -76,7 +76,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
throw new IllegalStateException(interruptedException);
}
} catch (ValidationException e) {
- logger.error("Validation exception while running blank transaction indicates programming error", e);
+ LOGGER.error("Validation exception while running blank transaction indicates programming error", e);
throw new RuntimeException("Validation exception while running blank transaction indicates programming error", e);
}
}
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java
index 1e94e5e9c0..7cb4445328 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java
@@ -25,7 +25,7 @@ import java.util.Map;
*/
public class BundleContextBackedModuleFactoriesResolver implements
ModuleFactoriesResolver {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(BundleContextBackedModuleFactoriesResolver.class);
private final BundleContext bundleContext;
@@ -62,14 +62,14 @@ public class BundleContextBackedModuleFactoriesResolver implements
if (serviceReference.getBundle() == null || serviceReference.getBundle().getBundleContext() == null) {
throw new NullPointerException("Bundle context of " + factory + " ModuleFactory not found.");
}
- logger.debug("Reading factory {} {}", moduleName, factory);
+ LOGGER.debug("Reading factory {} {}", moduleName, factory);
Map.Entry conflicting = result.get(moduleName);
if (conflicting != null) {
String error = String
.format("Module name is not unique. Found two conflicting factories with same name '%s': '%s' '%s'",
moduleName, conflicting.getKey(), factory);
- logger.error(error);
+ LOGGER.error(error);
throw new IllegalArgumentException(error);
} else {
result.put(moduleName, new AbstractMap.SimpleImmutableEntry<>(factory,
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java
index 3015ed229e..3c8fc042a3 100644
--- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java
+++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
*/
public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer
diff --git a/opendaylight/config/shutdown-api/pom.xml b/opendaylight/config/shutdown-api/pom.xml
index 76c1cfdc54..659052e570 100644
--- a/opendaylight/config/shutdown-api/pom.xml
+++ b/opendaylight/config/shutdown-api/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parentshutdown-api
diff --git a/opendaylight/config/shutdown-impl/pom.xml b/opendaylight/config/shutdown-impl/pom.xml
index 9895022df6..f14c285323 100644
--- a/opendaylight/config/shutdown-impl/pom.xml
+++ b/opendaylight/config/shutdown-impl/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parentshutdown-impl
diff --git a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java
index 4df9b036f1..1994e21a6d 100644
--- a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java
+++ b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java
@@ -5,26 +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
*/
-/**
- * Generated file
-
- * Generated from: yang module name: shutdown-impl yang module local name: shutdown
- * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
- * Generated at: Wed Dec 18 14:02:06 CET 2013
- *
- * Do not modify this file unless it is present under src/main directory
- */
package org.opendaylight.controller.config.yang.shutdown.impl;
+import java.util.Arrays;
+import java.util.Set;
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.DependencyResolverFactory;
import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import java.util.Arrays;
-import java.util.Set;
-
public class ShutdownModuleFactory extends AbstractShutdownModuleFactory {
public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
diff --git a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownServiceImpl.java b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownServiceImpl.java
index 4abbd3b36f..7d97fcd964 100644
--- a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownServiceImpl.java
+++ b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownServiceImpl.java
@@ -8,15 +8,14 @@
package org.opendaylight.controller.config.yang.shutdown.impl;
import com.google.common.base.Optional;
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
import org.opendaylight.controller.config.shutdown.ShutdownService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadInfo;
-
public class ShutdownServiceImpl implements ShutdownService, AutoCloseable {
private final ShutdownService impl;
private final ShutdownRuntimeRegistration registration;
@@ -42,7 +41,7 @@ public class ShutdownServiceImpl implements ShutdownService, AutoCloseable {
}
class Impl implements ShutdownService {
- private static final Logger logger = LoggerFactory.getLogger(Impl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(Impl.class);
private final String secret;
private final Bundle systemBundle;
@@ -53,27 +52,27 @@ class Impl implements ShutdownService {
@Override
public void shutdown(String inputSecret, Long maxWaitTime, Optional reason) {
- logger.warn("Shutdown issued with secret {} and reason {}", inputSecret, reason);
+ LOG.warn("Shutdown issued with secret {} and reason {}", inputSecret, reason);
try {
Thread.sleep(1000); // prevent brute force attack
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- logger.warn("Shutdown process interrupted", e);
+ LOG.warn("Shutdown process interrupted", e);
}
if (this.secret.equals(inputSecret)) {
- logger.info("Server is shutting down");
+ LOG.info("Server is shutting down");
// actual work:
Thread stopSystemBundleThread = new StopSystemBundleThread(systemBundle);
stopSystemBundleThread.start();
if (maxWaitTime != null && maxWaitTime > 0) {
Thread systemExitThread = new CallSystemExitThread(maxWaitTime);
- logger.debug("Scheduling {}", systemExitThread);
+ LOG.debug("Scheduling {}", systemExitThread);
systemExitThread.start();
}
// end
} else {
- logger.warn("Unauthorized attempt to shut down server");
+ LOG.warn("Unauthorized attempt to shut down server");
throw new IllegalArgumentException("Invalid secret");
}
}
@@ -81,7 +80,7 @@ class Impl implements ShutdownService {
}
class StopSystemBundleThread extends Thread {
- private static final Logger logger = LoggerFactory.getLogger(StopSystemBundleThread.class);
+ private static final Logger LOG = LoggerFactory.getLogger(StopSystemBundleThread.class);
private final Bundle systemBundle;
StopSystemBundleThread(Bundle systemBundle) {
@@ -94,18 +93,18 @@ class StopSystemBundleThread extends Thread {
try {
// wait so that JMX response is received
Thread.sleep(1000);
- logger.debug("Stopping system bundle");
+ LOG.debug("Stopping system bundle");
systemBundle.stop();
} catch (BundleException e) {
- logger.warn("Can not stop OSGi server", e);
+ LOG.warn("Can not stop OSGi server", e);
} catch (InterruptedException e) {
- logger.warn("Shutdown process interrupted", e);
+ LOG.warn("Shutdown process interrupted", e);
}
}
}
class CallSystemExitThread extends Thread {
- private static final Logger logger = LoggerFactory.getLogger(CallSystemExitThread.class);
+ private static final Logger LOG = LoggerFactory.getLogger(CallSystemExitThread.class);
private final long maxWaitTime;
CallSystemExitThread(long maxWaitTime) {
super("call-system-exit-daemon");
@@ -128,7 +127,7 @@ class CallSystemExitThread extends Thread {
try {
// wait specified time
Thread.sleep(maxWaitTime);
- logger.error("Since some threads are still running, server is going to shut down via System.exit(1) !");
+ LOG.error("Since some threads are still running, server is going to shut down via System.exit(1) !");
// do a thread dump
ThreadInfo[] threads = ManagementFactory.getThreadMXBean().dumpAllThreads(true, true);
StringBuffer sb = new StringBuffer();
@@ -136,10 +135,10 @@ class CallSystemExitThread extends Thread {
sb.append(info);
sb.append("\n");
}
- logger.warn("Thread dump:{}", sb);
+ LOG.warn("Thread dump:{}", sb);
System.exit(1);
} catch (InterruptedException e) {
- logger.warn("Interrupted, not going to call System.exit(1)");
+ LOG.warn("Interrupted, not going to call System.exit(1)");
}
}
}
diff --git a/opendaylight/config/threadpool-config-api/pom.xml b/opendaylight/config/threadpool-config-api/pom.xml
index c9a19515ef..5f0c941a19 100644
--- a/opendaylight/config/threadpool-config-api/pom.xml
+++ b/opendaylight/config/threadpool-config-api/pom.xml
@@ -5,7 +5,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parentthreadpool-config-api
diff --git a/opendaylight/config/threadpool-config-impl/pom.xml b/opendaylight/config/threadpool-config-impl/pom.xml
index 4fd0d681a1..2787b30df4 100644
--- a/opendaylight/config/threadpool-config-impl/pom.xml
+++ b/opendaylight/config/threadpool-config-impl/pom.xml
@@ -5,7 +5,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parentthreadpool-config-impl
diff --git a/opendaylight/config/yang-jmx-generator-it/pom.xml b/opendaylight/config/yang-jmx-generator-it/pom.xml
index f9e0c7036a..6d2663ced5 100644
--- a/opendaylight/config/yang-jmx-generator-it/pom.xml
+++ b/opendaylight/config/yang-jmx-generator-it/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOTyang-jmx-generator-it
diff --git a/opendaylight/config/yang-jmx-generator-plugin/pom.xml b/opendaylight/config/yang-jmx-generator-plugin/pom.xml
index 5f51980b94..6c8a591bb8 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/pom.xml
+++ b/opendaylight/config/yang-jmx-generator-plugin/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT..yang-jmx-generator-plugin
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
index dd2b504da9..cd0f491ebc 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
+++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
@@ -41,18 +41,18 @@ import java.util.Map.Entry;
final class CodeWriter {
- private static final Logger logger = LoggerFactory.getLogger(CodeWriter.class);
- private static final Optional copyright = StringUtil.loadCopyright();
+ private static final Logger LOGGER = LoggerFactory.getLogger(CodeWriter.class);
+ private static final Optional COPYRIGHT = StringUtil.loadCopyright();
public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) {
try {
GeneralInterfaceTemplate generalInterfaceTemplate = TemplateFactory.serviceInterfaceFromSie(sie);
- GeneratedObject go = new GenericGeneratedObjectFactory().toGeneratedObject(generalInterfaceTemplate, copyright);
+ GeneratedObject go = new GenericGeneratedObjectFactory().toGeneratedObject(generalInterfaceTemplate, COPYRIGHT);
return go.persist(outputBaseDir).get().getValue();
} catch (Exception e) {
String message = "An error occurred during Service interface generating, sie:"
+ sie.getTypeName() + ", " + sie.getFullyQualifiedName();
- logger.error(message, e);
+ LOGGER.error(message, e);
throw new RuntimeException(message, e);
}
}
@@ -70,33 +70,33 @@ final class CodeWriter {
// TOs
Map tosFromMbe = TemplateFactory.tOsFromMbe(mbe);
for(GeneralClassTemplate template: tosFromMbe.values()) {
- gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, copyright), true);
+ gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, COPYRIGHT), true);
}
// MXBean interface
GeneralInterfaceTemplate ifcTemplate = TemplateFactory.mXBeanInterfaceTemplateFromMbe(mbe);
- gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(ifcTemplate, copyright), true);
+ gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(ifcTemplate, COPYRIGHT), true);
// generate abstract factory
- gos.put(new AbsFactoryGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true);
+ gos.put(new AbsFactoryGeneratedObjectFactory().toGeneratedObject(mbe, COPYRIGHT), true);
// generate abstract module
- gos.put(new AbsModuleGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true);
+ gos.put(new AbsModuleGeneratedObjectFactory().toGeneratedObject(mbe, COPYRIGHT), true);
// generate concrete factory
StubFactoryTemplate concreteFactory = TemplateFactory.stubFactoryTemplateFromMbe(mbe);
- gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(concreteFactory, copyright), false);
+ gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(concreteFactory, COPYRIGHT), false);
// generate concrete module
- gos.put(new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(mbe, copyright, Optional.absent()), false);
+ gos.put(new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(mbe, COPYRIGHT, Optional.absent()), false);
// write runtime bean MXBeans and registrators
List allFtlFiles = getRuntimeBeanFtlTemplates(mbe.getRuntimeBeans());
for(FtlTemplate template: allFtlFiles) {
- gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, copyright), true);
+ gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, COPYRIGHT), true);
}
generatedFiles.addAll(persistGeneratedObjects(targetBaseDir, mainBaseDir, gos));
@@ -113,7 +113,7 @@ final class CodeWriter {
} catch (Exception e) {
String message = "An error occurred during Module generating, mbe:"
+ mbe.getJavaNamePrefix();
- logger.error(message, e);
+ LOGGER.error(message, e);
throw new RuntimeException(message, e);
}
}
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
index 1b8905b987..c8356274f8 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
+++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
@@ -54,7 +54,7 @@ public class JMXGenerator implements CodeGenerator {
private PackageTranslator packageTranslator;
private final CodeWriter codeWriter;
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(JMXGenerator.class);
private Map namespaceToPackageMapping;
private File resourceBaseDir;
@@ -83,8 +83,9 @@ public class JMXGenerator implements CodeGenerator {
packageTranslator = new PackageTranslator(namespaceToPackageMapping);
- if (!outputBaseDir.exists())
+ if (!outputBaseDir.exists()) {
outputBaseDir.mkdirs();
+ }
GeneratedFilesTracker generatedFiles = new GeneratedFilesTracker();
// create SIE structure qNamesToSIEs
@@ -127,7 +128,7 @@ public class JMXGenerator implements CodeGenerator {
Preconditions.checkNotNull(resourceBaseDir,
"resource base dir attribute was null");
- StringBuffer fullyQualifiedNamesOfFactories = new StringBuffer();
+ StringBuilder fullyQualifiedNamesOfFactories = new StringBuilder();
// create MBEs
for (Module module : yangModulesInCurrentMavenModule) {
String packageName = packageTranslator.getPackageName(module);
@@ -166,7 +167,7 @@ public class JMXGenerator implements CodeGenerator {
fullyQualifiedNamesOfFactories.toString());
} catch (IOException e) {
String message = "Cannot write to " + serviceLoaderFile;
- logger.error(message);
+ LOGGER.error(message);
throw new RuntimeException(message, e);
}
}
@@ -184,10 +185,11 @@ public class JMXGenerator implements CodeGenerator {
@Override
public void setAdditionalConfig(Map additionalCfg) {
- if (logger != null)
- logger.debug(getClass().getCanonicalName(),
+ if (LOGGER != null) {
+ LOGGER.debug(getClass().getCanonicalName(),
": Additional configuration received: ",
additionalCfg.toString());
+ }
this.namespaceToPackageMapping = extractNamespaceMapping(additionalCfg);
this.generateModuleFactoryFile = extractModuleFactoryBoolean(additionalCfg);
}
@@ -195,10 +197,12 @@ public class JMXGenerator implements CodeGenerator {
private boolean extractModuleFactoryBoolean(
Map additionalCfg) {
String bool = additionalCfg.get(MODULE_FACTORY_FILE_BOOLEAN);
- if (bool == null)
+ if (bool == null) {
return true;
- if (bool.equals("false"))
+ }
+ if ("false".equals(bool)) {
return false;
+ }
return true;
}
@@ -250,8 +254,8 @@ public class JMXGenerator implements CodeGenerator {
public void setMavenProject(MavenProject project) {
this.projectBaseDir = project.getBasedir();
- if (logger != null)
- logger.debug(getClass().getCanonicalName(), " project base dir: ",
+ if (LOGGER != null)
+ LOGGER.debug(getClass().getCanonicalName(), " project base dir: ",
projectBaseDir);
}
@@ -268,7 +272,7 @@ public class JMXGenerator implements CodeGenerator {
}
}
if (undeletedFiles.isEmpty() == false) {
- logger.error(
+ LOGGER.error(
"Illegal state occurred: Unable to delete already generated files, undeleted files: {}",
undeletedFiles);
}
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
index c3e51d6550..c3a00b93da 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
+++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
@@ -19,14 +19,14 @@ import java.util.List;
public class AbstractFactoryTemplate extends GeneralClassTemplate {
- private static final List implementedIfcs = Lists
+ private static final List IMPLEMENTED_IFCS = Lists
.newArrayList(ModuleFactory.class.getCanonicalName());
public AbstractFactoryTemplate(Header header, String packageName,
String abstractFactoryName,
List fields) {
super(header, packageName, abstractFactoryName, Collections
- . emptyList(), implementedIfcs, fields, Collections
+ . emptyList(), IMPLEMENTED_IFCS, fields, Collections
. emptyList(), true, false, Collections
. emptyList());
}
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
index d07edae14e..aa696450a9 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
+++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
@@ -108,7 +108,7 @@ public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
.getFullyQualifiedName(rootRB.getPackageName(), rootRB.getJavaNameOfRuntimeMXBean());
String childRegistratorFQN = rootFtlFile.getFullyQualifiedName();
Field rbParameter = new Field(fullyQualifiedNameOfMXBean, "rb");
- StringBuffer registerBody = new StringBuffer();
+ StringBuilder registerBody = new StringBuilder();
registerBody.append(format("%s %s = this.%s.registerRoot(%s);\n",
HierarchicalRuntimeBeanRegistration.class
.getCanonicalName(), hierachchicalRegistration
@@ -200,12 +200,12 @@ public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
unorderedResult.put(entry.getKey(), entry.getValue());
}
- if (childRegistratorMap.size() > 0) {
+ if (!childRegistratorMap.isEmpty()) {
// first entry is the direct descendant according to the create
// contract
RuntimeRegistratorFtlTemplate childRegistrator = childRegistratorMap
.values().iterator().next();
- StringBuffer body = new StringBuffer();
+ StringBuilder body = new StringBuilder();
String key, value;
key = child.getJavaNamePrefix();
body.append(format(
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
index 7b7aab8559..f8f5cd6742 100644
--- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
+++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
@@ -113,7 +113,7 @@ public class TemplateFactory {
static String serializeType(Type type, boolean addWildcards) {
if (type instanceof ParameterizedType){
ParameterizedType parameterizedType = (ParameterizedType) type;
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(parameterizedType.getRawType().getFullyQualifiedName());
sb.append(addWildcards ? " extends " : "<");
boolean first = true;
@@ -282,12 +282,15 @@ public class TemplateFactory {
for (Rpc rpc : rbe.getRpcs()) {
AttributeIfc returnType = rpc.getReturnType();
- if (returnType == VoidAttribute.getInstance())
+ if (returnType == VoidAttribute.getInstance()) {
continue;
- if (returnType instanceof JavaAttribute)
+ }
+ if (returnType instanceof JavaAttribute) {
continue;
- if (returnType instanceof ListAttribute && returnType.getOpenType() instanceof SimpleType)
+ }
+ if (returnType instanceof ListAttribute && returnType.getOpenType() instanceof SimpleType) {
continue;
+ }
Preconditions.checkState(yangPropertiesToTypesMap.containsKey(returnType.getAttributeYangName()) == false,
"Duplicate TO %s for %s", returnType.getAttributeYangName(), rbe);
@@ -449,7 +452,6 @@ public class TemplateFactory {
String returnType;
AttributeIfc attributeIfc = attrEntry.getValue();
- boolean isIdentityRef = false;
if (attributeIfc instanceof TypedAttribute) {
TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
returnType = serializeType(typedAttribute.getType());
diff --git a/opendaylight/config/yang-jmx-generator/pom.xml b/opendaylight/config/yang-jmx-generator/pom.xml
index 133b07ff86..979b39688b 100644
--- a/opendaylight/config/yang-jmx-generator/pom.xml
+++ b/opendaylight/config/yang-jmx-generator/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-subsystem
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ConfigConstants.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ConfigConstants.java
index 775fa9fc20..8cc0ffa165 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ConfigConstants.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ConfigConstants.java
@@ -11,6 +11,9 @@ import org.opendaylight.yangtools.yang.common.QName;
public class ConfigConstants {
+ private ConfigConstants() {
+ }
+
public static final String CONFIG_NAMESPACE = "urn:opendaylight:params:xml:ns:yang:controller:config";
public static final String CONFIG_MODULE = "config";
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java
index e9f0ac8176..f99d378b6f 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java
@@ -93,22 +93,22 @@ final class ModuleMXBeanEntryBuilder {
return this;
}
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(ModuleMXBeanEntryBuilder.class);
// TODO: the XPath should be parsed by code generator IMO
private static final String MAGIC_STRING = "MAGIC_STRING";
private static final String MODULE_CONDITION_XPATH_TEMPLATE = "^/MAGIC_STRING:modules/MAGIC_STRING:module/MAGIC_STRING:type\\s*=\\s*['\"](.+)['\"]$";
- private static final SchemaPath expectedConfigurationAugmentationSchemaPath = SchemaPath.create(true,
+ private static final SchemaPath EXPECTED_CONFIGURATION_AUGMENTATION_SCHEMA_PATH = SchemaPath.create(true,
createConfigQName("modules"), createConfigQName("module"), createConfigQName("configuration"));
- private static final SchemaPath expectedStateAugmentationSchemaPath = SchemaPath.create(true,
+ private static final SchemaPath EXPECTED_STATE_AUGMENTATION_SCHEMA_PATH = SchemaPath.create(true,
createConfigQName("modules"), createConfigQName("module"), createConfigQName("state"));
private static final Pattern PREFIX_COLON_LOCAL_NAME = Pattern
.compile("^(.+):(.+)$");
public Map build() {
- logger.debug("Generating ModuleMXBeans of {} to package {}",
+ LOGGER.debug("Generating ModuleMXBeans of {} to package {}",
currentModule.getNamespace(), packageName);
String configModulePrefix;
@@ -146,7 +146,7 @@ final class ModuleMXBeanEntryBuilder {
checkAttributeNamesUniqueness(uniqueGeneratedClassesNames, result);
checkUnaugumentedIdentities(unaugmentedModuleIdentities);
- logger.debug("Number of ModuleMXBeans to be generated: {}", result.size());
+ LOGGER.debug("Number of ModuleMXBeans to be generated: {}", result.size());
return result;
}
@@ -166,7 +166,7 @@ final class ModuleMXBeanEntryBuilder {
private static void checkUnaugumentedIdentities(final Map unaugmentedModuleIdentities) {
if (unaugmentedModuleIdentities.size() > 0) {
- logger.warn("Augmentation not found for all currentModule identities: {}",
+ LOGGER.warn("Augmentation not found for all currentModule identities: {}",
unaugmentedModuleIdentities.keySet());
}
}
@@ -190,7 +190,7 @@ final class ModuleMXBeanEntryBuilder {
+ identityLocalName);
} else {
moduleIdentities.put(identityLocalName, id);
- logger.debug("Found identity {}", identityLocalName);
+ LOGGER.debug("Found identity {}", identityLocalName);
}
// validation check on unknown schema nodes
boolean providedServiceWasSet = false;
@@ -270,13 +270,13 @@ final class ModuleMXBeanEntryBuilder {
HAS_CHILDREN_AND_QNAME dataNodeContainer = getDataNodeContainer(choiceCaseNode);
- if (expectedConfigurationAugmentationSchemaPath.equals(augmentation.getTargetPath())) {
- logger.debug("Parsing configuration of {}", moduleLocalNameFromXPath);
+ if (EXPECTED_CONFIGURATION_AUGMENTATION_SCHEMA_PATH.equals(augmentation.getTargetPath())) {
+ LOGGER.debug("Parsing configuration of {}", moduleLocalNameFromXPath);
yangToAttributes = fillConfiguration(dataNodeContainer, currentModule, typeProviderWrapper, qNamesToSIEs,
schemaContext, packageName);
checkUniqueAttributesWithGeneratedClass(uniqueGeneratedClassesNames, when.getQName(), yangToAttributes);
- } else if (expectedStateAugmentationSchemaPath.equals(augmentation.getTargetPath())) {
- logger.debug("Parsing state of {}", moduleLocalNameFromXPath);
+ } else if (EXPECTED_STATE_AUGMENTATION_SCHEMA_PATH.equals(augmentation.getTargetPath())) {
+ LOGGER.debug("Parsing state of {}", moduleLocalNameFromXPath);
try {
runtimeBeans = fillRuntimeBeans(dataNodeContainer, currentModule, typeProviderWrapper, packageName,
moduleLocalNameFromXPath, javaNamePrefix);
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleUtil.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleUtil.java
index ccd701d1fb..10267b28e7 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleUtil.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleUtil.java
@@ -12,6 +12,9 @@ import org.opendaylight.yangtools.yang.model.api.Module;
public class ModuleUtil {
+ private ModuleUtil() {
+ }
+
public static QName getQName(final Module currentModule) {
return QName.create(currentModule.getNamespace(), currentModule.getRevision(), currentModule.getName());
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslator.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslator.java
index a6a1ac7dc3..a7f6f2f221 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslator.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslator.java
@@ -58,19 +58,20 @@ public class PackageTranslator {
// TODO add to PackageTranslator
private static String sanitizePackage(String namespace) {
- namespace = namespace.replace("://", ".");
- namespace = namespace.replace("/", ".");
- namespace = namespace.replace(":", ".");
- namespace = namespace.replace("-", "_");
- namespace = namespace.replace("@", ".");
- namespace = namespace.replace("$", ".");
- namespace = namespace.replace("#", ".");
- namespace = namespace.replace("'", ".");
- namespace = namespace.replace("*", ".");
- namespace = namespace.replace("+", ".");
- namespace = namespace.replace(",", ".");
- namespace = namespace.replace(";", ".");
- namespace = namespace.replace("=", ".");
- return namespace;
+ String newNamespace = namespace;
+ newNamespace = newNamespace.replace("://", ".");
+ newNamespace = newNamespace.replace("/", ".");
+ newNamespace = newNamespace.replace(":", ".");
+ newNamespace = newNamespace.replace("-", "_");
+ newNamespace = newNamespace.replace("@", ".");
+ newNamespace = newNamespace.replace("$", ".");
+ newNamespace = newNamespace.replace("#", ".");
+ newNamespace = newNamespace.replace("'", ".");
+ newNamespace = newNamespace.replace("*", ".");
+ newNamespace = newNamespace.replace("+", ".");
+ newNamespace = newNamespace.replace(",", ".");
+ newNamespace = newNamespace.replace(";", ".");
+ newNamespace = newNamespace.replace("=", ".");
+ return newNamespace;
}
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntry.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntry.java
index 67f624175b..aec41152de 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntry.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntry.java
@@ -217,8 +217,6 @@ public class RuntimeBeanEntry {
final Map> identitiesToRpcs) {
List attributes = Lists.newArrayList();
- // List javaAttributes = new ArrayList<>();
- // List toAttributes = new ArrayList<>();
List runtimeBeanEntries = new ArrayList<>();
for (DataSchemaNode child : subtree.getChildNodes()) {
// child leaves can be java attributes, TO attributes, or child
@@ -278,7 +276,7 @@ public class RuntimeBeanEntry {
.findJavaParameter(rpcDefinition);
AttributeIfc returnType;
if (rpcDefinition.getOutput() == null
- || rpcDefinition.getOutput().getChildNodes().size() == 0) {
+ || rpcDefinition.getOutput().getChildNodes().isEmpty()) {
returnType = VoidAttribute.getInstance();
} else if (rpcDefinition.getOutput().getChildNodes().size() == 1) {
DataSchemaNode returnDSN = rpcDefinition.getOutput()
@@ -366,7 +364,7 @@ public class RuntimeBeanEntry {
currentModule, identitiesToRpcs);
Optional keyYangName;
- if (listSchemaNode.getKeyDefinition().size() == 0) {
+ if (listSchemaNode.getKeyDefinition().isEmpty()) {
keyYangName = Optional.absent();
} else if (listSchemaNode.getKeyDefinition().size() == 1) {
// key must be either null or one of supported key types
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java
index ef40d9515b..ee02b303e0 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java
@@ -46,7 +46,7 @@ import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstant
*
*/
public class ServiceInterfaceEntry extends AbstractEntry {
- private static final Logger logger = LoggerFactory
+ private static final Logger LOGGER = LoggerFactory
.getLogger(ServiceInterfaceEntry.class);
private static final String CLASS_NAME_SUFFIX = "ServiceInterface";
@@ -121,16 +121,16 @@ public class ServiceInterfaceEntry extends AbstractEntry {
*/
public static Map create(Module currentModule,
String packageName,Map definedSEItracker) {
- logger.debug("Generating ServiceInterfaces from {} to package {}",
+ LOGGER.debug("Generating ServiceInterfaces from {} to package {}",
currentModule.getNamespace(), packageName);
Map identitiesToSIs = new HashMap<>();
Set notVisited = new HashSet<>(
currentModule.getIdentities());
int lastSize = notVisited.size() + 1;
- while (notVisited.size() > 0) {
+ while (!notVisited.isEmpty()) {
if (notVisited.size() == lastSize) {
- logger.debug(
+ LOGGER.debug(
"Following identities will be ignored while generating ServiceInterfaces, as they are not derived from {} : {}",
SERVICE_TYPE_Q_NAME, notVisited);
break;
@@ -175,7 +175,7 @@ public class ServiceInterfaceEntry extends AbstractEntry {
for (ServiceInterfaceEntry sie : identitiesToSIs.values()) {
resultMap.put(sie.getQName(), sie);
}
- logger.debug("Number of ServiceInterfaces to be generated: {}",
+ LOGGER.debug("Number of ServiceInterfaces to be generated: {}",
resultMap.size());
return resultMap;
}
@@ -198,25 +198,33 @@ public class ServiceInterfaceEntry extends AbstractEntry {
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
+ }
ServiceInterfaceEntry that = (ServiceInterfaceEntry) o;
- if (!maybeBaseCache.equals(that.maybeBaseCache))
+ if (!maybeBaseCache.equals(that.maybeBaseCache)) {
return false;
- if (!nullableDescription.equals(that.nullableDescription))
+ }
+ if (!nullableDescription.equals(that.nullableDescription)) {
return false;
- if (!exportedOsgiClassName.equals(that.exportedOsgiClassName))
+ }
+ if (!exportedOsgiClassName.equals(that.exportedOsgiClassName)) {
return false;
- if (!qName.equals(that.qName))
+ }
+ if (!qName.equals(that.qName)) {
return false;
- if (!packageName.equals(that.packageName))
+ }
+ if (!packageName.equals(that.packageName)) {
return false;
- if (!typeName.equals(that.typeName))
+ }
+ if (!typeName.equals(that.typeName)) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/TypeProviderWrapper.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/TypeProviderWrapper.java
index 3c8c8aa2f4..ac1992932f 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/TypeProviderWrapper.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/TypeProviderWrapper.java
@@ -71,9 +71,10 @@ public class TypeProviderWrapper {
try {
javaType = typeProvider.javaTypeForSchemaDefinitionType(
type, leaf);
- if (javaType == null)
+ if (javaType == null) {
throw new IllegalArgumentException("Unknown type received for "
+ leaf.toString());
+ }
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Error while resolving type of "
+ leaf, e);
@@ -87,9 +88,10 @@ public class TypeProviderWrapper {
try {
javaType = typeProvider.javaTypeForSchemaDefinitionType(
leaf.getType(), leaf);
- if (javaType == null)
+ if (javaType == null) {
throw new IllegalArgumentException(
"Unknown type received for " + leaf.toString());
+ }
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Error while resolving type of "
+ leaf, e);
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractAttribute.java
index edfb4c59af..d9a6dd0452 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractAttribute.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractAttribute.java
@@ -33,17 +33,20 @@ public abstract class AbstractAttribute implements AttributeIfc {
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (!(o instanceof AbstractAttribute))
+ }
+ if (!(o instanceof AbstractAttribute)) {
return false;
+ }
AbstractAttribute that = (AbstractAttribute) o;
if (attributeYangName != null ? !attributeYangName
.equals(that.attributeYangName)
- : that.attributeYangName != null)
+ : that.attributeYangName != null) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractDependencyAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractDependencyAttribute.java
index eb1c9e41a6..205ba893c4 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractDependencyAttribute.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractDependencyAttribute.java
@@ -40,25 +40,31 @@ public abstract class AbstractDependencyAttribute extends AbstractAttribute imp
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
- if (!super.equals(o))
+ }
+ if (!super.equals(o)) {
return false;
+ }
AbstractDependencyAttribute that = (AbstractDependencyAttribute) o;
if (dependency != null ? !dependency.equals(that.dependency)
- : that.dependency != null)
+ : that.dependency != null) {
return false;
+ }
if (nullableDefault != null ? !nullableDefault
- .equals(that.nullableDefault) : that.nullableDefault != null)
+ .equals(that.nullableDefault) : that.nullableDefault != null) {
return false;
+ }
if (nullableDescription != null ? !nullableDescription
.equals(that.nullableDescription)
- : that.nullableDescription != null)
+ : that.nullableDescription != null) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java
index fac4d57432..8d3139999e 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java
@@ -96,24 +96,30 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
- if (!super.equals(o))
+ }
+ if (!super.equals(o)) {
return false;
+ }
JavaAttribute that = (JavaAttribute) o;
if (nullableDefault != null ? !nullableDefault
- .equals(that.nullableDefault) : that.nullableDefault != null)
+ .equals(that.nullableDefault) : that.nullableDefault != null) {
return false;
+ }
if (nullableDescription != null ? !nullableDescription
.equals(that.nullableDescription)
- : that.nullableDescription != null)
+ : that.nullableDescription != null) {
return false;
- if (type != null ? !type.equals(that.type) : that.type != null)
+ }
+ if (type != null ? !type.equals(that.type) : that.type != null) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java
index 73b557e291..bb71f9dbc7 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java
@@ -82,22 +82,27 @@ public class ListAttribute extends AbstractAttribute implements TypedAttribute {
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
- if (!super.equals(o))
+ }
+ if (!super.equals(o)) {
return false;
+ }
ListAttribute that = (ListAttribute) o;
if (nullableDefault != null ? !nullableDefault
- .equals(that.nullableDefault) : that.nullableDefault != null)
+ .equals(that.nullableDefault) : that.nullableDefault != null) {
return false;
+ }
if (nullableDescription != null ? !nullableDescription
.equals(that.nullableDescription)
- : that.nullableDescription != null)
+ : that.nullableDescription != null) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/SimpleTypeResolver.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/SimpleTypeResolver.java
index f4bd979fac..9b5530175c 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/SimpleTypeResolver.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/SimpleTypeResolver.java
@@ -19,6 +19,9 @@ import java.util.Map;
public class SimpleTypeResolver {
+ private SimpleTypeResolver() {
+ }
+
public static SimpleType> getSimpleType(Type type) {
SimpleType> expectedSimpleType = JAVA_TYPE_TO_SIMPLE_TYPE.get(type
.getFullyQualifiedName());
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java
index cbeb5c3b29..e563da1328 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java
@@ -73,18 +73,19 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
TypeProviderWrapper typeProviderWrapper, String packageName) {
Class extends DataSchemaNode> type = isAllowedType(dataSchemaNode);
- if (type.equals(LeafSchemaNode.class))
+ if (type.equals(LeafSchemaNode.class)) {
return new JavaAttribute((LeafSchemaNode) dataSchemaNode,
typeProviderWrapper);
- else if (type.equals(ListSchemaNode.class))
+ } else if (type.equals(ListSchemaNode.class)) {
return ListAttribute.create((ListSchemaNode) dataSchemaNode,
typeProviderWrapper, packageName);
- else if (type.equals(LeafListSchemaNode.class))
+ } else if (type.equals(LeafListSchemaNode.class)) {
return ListAttribute.create((LeafListSchemaNode) dataSchemaNode,
typeProviderWrapper);
- else if (type.equals(ContainerSchemaNode.class))
+ } else if (type.equals(ContainerSchemaNode.class)) {
return TOAttribute.create((ContainerSchemaNode) dataSchemaNode,
typeProviderWrapper, packageName);
+ }
throw new IllegalStateException("This should never happen");
}
@@ -92,8 +93,9 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
private static Class extends DataSchemaNode> isAllowedType(
DataSchemaNode dataSchemaNode) {
for (Class extends DataSchemaNode> allowedType : ALLOWED_CHILDREN) {
- if (allowedType.isAssignableFrom(dataSchemaNode.getClass()) == true)
+ if (allowedType.isAssignableFrom(dataSchemaNode.getClass()) == true) {
return allowedType;
+ }
}
throw new IllegalArgumentException("Illegal child node for TO: "
+ dataSchemaNode.getClass() + " allowed node types: "
@@ -156,26 +158,32 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
- if (!super.equals(o))
+ }
+ if (!super.equals(o)) {
return false;
+ }
TOAttribute that = (TOAttribute) o;
if (nullableDefault != null ? !nullableDefault
- .equals(that.nullableDefault) : that.nullableDefault != null)
+ .equals(that.nullableDefault) : that.nullableDefault != null) {
return false;
+ }
if (nullableDescription != null ? !nullableDescription
.equals(that.nullableDescription)
- : that.nullableDescription != null)
+ : that.nullableDescription != null) {
return false;
+ }
if (yangNameToAttributeMap != null ? !yangNameToAttributeMap
.equals(that.yangNameToAttributeMap)
- : that.yangNameToAttributeMap != null)
+ : that.yangNameToAttributeMap != null) {
return false;
+ }
return true;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Util.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Util.java
index 30c7919c1a..16c4bd1ec5 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Util.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Util.java
@@ -13,17 +13,19 @@ import java.util.Date;
final class Util {
+ private Util() {
+ }
/**
* Used for date <-> xml serialization
*/
- private static final SimpleDateFormat dateFormat = new SimpleDateFormat(
+ private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(
"yyyy-MM-dd");
public static String writeDate(Date date) {
- return dateFormat.format(date);
+ return DATE_FORMAT.format(date);
}
public static Date readDate(String s) throws ParseException {
- return dateFormat.parse(s);
+ return DATE_FORMAT.parse(s);
}
}
diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java
index 50b4485e01..966aff96a0 100644
--- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java
+++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java
@@ -8,6 +8,10 @@
package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
public class FullyQualifiedNameHelper {
+
+ private FullyQualifiedNameHelper() {
+ }
+
public static String getFullyQualifiedName(String packageName,
String className) {
if (packageName.isEmpty())
diff --git a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryNameConflictTest.java b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryNameConflictTest.java
index 9032a2c930..cac0ac705f 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryNameConflictTest.java
+++ b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryNameConflictTest.java
@@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.NameConflictException;
import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils;
@@ -40,6 +41,7 @@ public class ModuleMXBeanEntryNameConflictTest extends AbstractYangTest {
Map testedFilesToYangModules = new HashMap<>();
Map testedYangModulesToExpectedConflictingName = new HashMap<>();
+ @Ignore
@Test
public void testNameConflicts() throws Exception {
prepareSamples();
diff --git a/opendaylight/config/yang-jmx-generator/src/test/resources/config-jmx-it-impl.yang b/opendaylight/config/yang-jmx-generator/src/test/resources/config-jmx-it-impl.yang
index 16085efbba..0cd0d15ad2 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/resources/config-jmx-it-impl.yang
+++ b/opendaylight/config/yang-jmx-generator/src/test/resources/config-jmx-it-impl.yang
@@ -49,7 +49,7 @@ module config-jmx-it-impl {
}
- leaf simpleInt {
+ leaf simpleInt1 {
type uint32;
default 99L;
}
@@ -87,7 +87,7 @@ module config-jmx-it-impl {
}
}
- leaf simpleInt {
+ leaf simpleInt2 {
type uint32;
}
@@ -202,7 +202,7 @@ module config-jmx-it-impl {
case impl-netconf {
when "/config:modules/config:module/config:type = 'impl-netconf'";
// root runtime bean
- leaf created-sessions {
+ leaf created-sessions-1 {
type uint32;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute-in-list.yang b/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute-in-list.yang
index 4901b41157..97fca03877 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute-in-list.yang
+++ b/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute-in-list.yang
@@ -75,7 +75,7 @@ module config-test-duplicate-attribute-in-list {
case netconf {
when "/config:modules/config:module/config:type = 'netconf'";
// root runtime bean
- leaf created-sessions {
+ leaf created-sessions2 {
type uint32;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute.yang b/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute.yang
index bf081028cc..d2d4dc534d 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute.yang
+++ b/opendaylight/config/yang-jmx-generator/src/test/resources/duplicates/config-test-duplicate-attribute.yang
@@ -56,7 +56,7 @@ module config-test-duplicate-attribute {
case netconf {
when "/config:modules/config:module/config:type = 'netconf'";
- container dto-a {
+ container dto-a2 {
leaf simple-arg {
type uint32;
}
@@ -72,7 +72,7 @@ module config-test-duplicate-attribute {
case netconf {
when "/config:modules/config:module/config:type = 'netconf'";
// root runtime bean
- leaf created-sessions {
+ leaf created-sessions2 {
type uint32;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files.yang b/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files.yang
index 1db0279506..f6a0b888bd 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files.yang
+++ b/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files.yang
@@ -62,7 +62,7 @@ module test-config-files {
case netconf {
when "/config:modules/config:module/config:type = 'netconf'";
// root runtime bean
- leaf created-sessions {
+ leaf created-sessions2 {
type uint32;
}
diff --git a/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files1.yang b/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files1.yang
index 0a152e7baa..fc0e0730df 100644
--- a/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files1.yang
+++ b/opendaylight/config/yang-jmx-generator/src/test/resources/test-config-files1.yang
@@ -62,7 +62,7 @@ module test-config-files1 {
case netconf1 {
when "/config:modules/config:module/config:type = 'netconf1'";
// root runtime bean
- leaf created-sessions {
+ leaf created-sessions2 {
type uint32;
}
diff --git a/opendaylight/config/yang-test-plugin/pom.xml b/opendaylight/config/yang-test-plugin/pom.xml
index c7fb73f385..d03cff305b 100644
--- a/opendaylight/config/yang-test-plugin/pom.xml
+++ b/opendaylight/config/yang-test-plugin/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parentyang-test-plugin
diff --git a/opendaylight/config/yang-test/pom.xml b/opendaylight/config/yang-test/pom.xml
index 247b3c0745..5977325574 100644
--- a/opendaylight/config/yang-test/pom.xml
+++ b/opendaylight/config/yang-test/pom.xml
@@ -5,7 +5,7 @@
org.opendaylight.controllerconfig-plugin-parent
- 0.2.5-SNAPSHOT
+ 0.3.0-SNAPSHOT../config-plugin-parent
diff --git a/opendaylight/configuration/api/pom.xml b/opendaylight/configuration/api/pom.xml
index ef27bfd5e4..50f19278c6 100644
--- a/opendaylight/configuration/api/pom.xml
+++ b/opendaylight/configuration/api/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightconfiguration
- 0.4.3-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/configuration/implementation/pom.xml b/opendaylight/configuration/implementation/pom.xml
index a4a7ba6746..4387de70ea 100644
--- a/opendaylight/configuration/implementation/pom.xml
+++ b/opendaylight/configuration/implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightconfiguration.implementation
- 0.4.3-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/configuration/integrationtest/pom.xml b/opendaylight/configuration/integrationtest/pom.xml
index 31b9c07674..238ff12249 100644
--- a/opendaylight/configuration/integrationtest/pom.xml
+++ b/opendaylight/configuration/integrationtest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT../../commons/integrationtestconfiguration.integrationtest
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTch.qos.logback
diff --git a/opendaylight/connectionmanager/api/pom.xml b/opendaylight/connectionmanager/api/pom.xml
index c4ced042d0..2718ed1afe 100644
--- a/opendaylight/connectionmanager/api/pom.xml
+++ b/opendaylight/connectionmanager/api/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightconnectionmanager
- 0.1.2-SNAPSHOT
+ 0.2.0-SNAPSHOTbundle
diff --git a/opendaylight/connectionmanager/implementation/pom.xml b/opendaylight/connectionmanager/implementation/pom.xml
index 8be119d507..fe2514e58a 100644
--- a/opendaylight/connectionmanager/implementation/pom.xml
+++ b/opendaylight/connectionmanager/implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightconnectionmanager.implementation
- 0.1.2-SNAPSHOT
+ 0.2.0-SNAPSHOTbundle
diff --git a/opendaylight/containermanager/api/pom.xml b/opendaylight/containermanager/api/pom.xml
index a19e27189a..c9b54a1b6c 100644
--- a/opendaylight/containermanager/api/pom.xml
+++ b/opendaylight/containermanager/api/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcontainermanager
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/containermanager/implementation/pom.xml b/opendaylight/containermanager/implementation/pom.xml
index 3ead8be65a..013cd62576 100644
--- a/opendaylight/containermanager/implementation/pom.xml
+++ b/opendaylight/containermanager/implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcontainermanager.implementation
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/containermanager/it.implementation/pom.xml b/opendaylight/containermanager/it.implementation/pom.xml
index a3f140d7e1..8e0475d4a3 100644
--- a/opendaylight/containermanager/it.implementation/pom.xml
+++ b/opendaylight/containermanager/it.implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcontainermanager.it.implementation
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/containermanager/shell/pom.xml b/opendaylight/containermanager/shell/pom.xml
index 1eedd4bc87..c1c2d2055b 100644
--- a/opendaylight/containermanager/shell/pom.xml
+++ b/opendaylight/containermanager/shell/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightcontainermanager.shell
diff --git a/opendaylight/distribution/opendaylight-karaf-empty/pom.xml b/opendaylight/distribution/opendaylight-karaf-empty/pom.xml
index d3dfe19c2b..72eaf005ad 100644
--- a/opendaylight/distribution/opendaylight-karaf-empty/pom.xml
+++ b/opendaylight/distribution/opendaylight-karaf-empty/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightopendaylight-karaf-empty
diff --git a/opendaylight/distribution/opendaylight-karaf-resources/pom.xml b/opendaylight/distribution/opendaylight-karaf-resources/pom.xml
index e34a5d3c2c..35aac09339 100644
--- a/opendaylight/distribution/opendaylight-karaf-resources/pom.xml
+++ b/opendaylight/distribution/opendaylight-karaf-resources/pom.xml
@@ -12,7 +12,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightopendaylight-karaf-resources
diff --git a/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv
index 4f240447b4..947c65f6bd 100755
--- a/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv
+++ b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv
@@ -46,10 +46,10 @@
# export KARAF_ETC # Karaf etc folder
# export KARAF_OPTS # Additional available Karaf options
# export KARAF_DEBUG # Enable debug mode
-if [ "x$JAVA_MAX_PERM_MEM" == "x" ]; then
+if [ "x$JAVA_MAX_PERM_MEM" = "x" ]; then
export JAVA_MAX_PERM_MEM="512m"
fi
-if [ "x$JAVA_MAX_MEM" == "x" ]; then
+if [ "x$JAVA_MAX_MEM" = "x" ]; then
export JAVA_MAX_MEM="2048m"
fi
diff --git a/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv.bat b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv.bat
new file mode 100644
index 0000000000..7c6192002c
--- /dev/null
+++ b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/bin/setenv.bat
@@ -0,0 +1,64 @@
+@echo off
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+rem
+
+rem
+rem handle specific scripts; the SCRIPT_NAME is exactly the name of the Karaf
+rem script; for example karaf.bat, start.bat, stop.bat, admin.bat, client.bat, ...
+rem
+rem if "%KARAF_SCRIPT%" == "SCRIPT_NAME" (
+rem Actions go here...
+rem )
+
+rem
+rem general settings which should be applied for all scripts go here; please keep
+rem in mind that it is possible that scripts might be executed more than once, e.g.
+rem in example of the start script where the start script is executed first and the
+rem karaf script afterwards.
+rem
+
+rem
+rem The following section shows the possible configuration options for the default
+rem karaf scripts
+rem
+rem Window name of the windows console
+rem SET KARAF_TITLE
+rem Location of Java installation
+rem SET JAVA_HOME
+rem Minimum memory for the JVM
+rem SET JAVA_MIN_MEM
+rem Maximum memory for the JVM
+rem SET JAVA_MAX_MEM
+rem Minimum perm memory for the JVM
+rem SET JAVA_PERM_MEM
+rem Maximum perm memory for the JVM
+rem SET JAVA_MAX_PERM_MEM
+rem Karaf home folder
+rem SET KARAF_HOME
+rem Karaf data folder
+rem SET KARAF_DATA
+rem Karaf base folder
+rem SET KARAF_BASE
+rem Karaf etc folder
+rem SET KARAF_ETC
+rem Additional available Karaf options
+rem SET KARAF_OPTS
+rem Enable debug mode
+rem SET KARAF_DEBUG
+IF "%JAVA_MAX_PERM_MEM%"=="" SET JAVA_MAX_PERM_MEM=512m
+IF "%JAVA_MAX_MEM%"=="" SET JAVA_MAX_MEM=2048m
diff --git a/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/etc/custom.properties b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/etc/custom.properties
index e0e2759b37..4a8f5ae795 100644
--- a/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/etc/custom.properties
+++ b/opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/etc/custom.properties
@@ -94,6 +94,10 @@ ovsdb.listenPort=6640
# default Openflow version = 1.0, we also support 1.3.
# ovsdb.of.version=1.3
+# ovsdb can be configured with ml2 to perform l3 forwarding. The config below enables that functionality, which is
+# disabled by default.
+# ovsdb.l3.fwd.enabled=yes
+
# ovsdb can be configured with ml2 to perform l3 forwarding. When used in that scenario, the mac address of the default
# gateway --on the external subnet-- is expected to be resolved from its inet address. The config below overrides that
# specific arp/neighDiscovery lookup.
@@ -127,3 +131,9 @@ java.util.logging.config.file=configuration/tomcat-logging.properties
#Hosttracker hostsdb key scheme setting
hosttracker.keyscheme=IP
+# LISP Flow Mapping configuration
+# Map-Register messages overwrite existing RLOC sets in EID-to-RLOC mappings
+lisp.mappingOverwrite = true
+# Enable the Solicit-Map-Request (SMR) mechanism
+lisp.smr = false
+
diff --git a/opendaylight/distribution/opendaylight-karaf/pom.xml b/opendaylight/distribution/opendaylight-karaf/pom.xml
index 795f68c397..3a2f4b0580 100644
--- a/opendaylight/distribution/opendaylight-karaf/pom.xml
+++ b/opendaylight/distribution/opendaylight-karaf/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightdistribution.opendaylight-karaf
@@ -58,18 +58,21 @@
features-basefeaturesxml
+ runtimeorg.opendaylight.controllerfeatures-adsalfeaturesxml
+ runtimeorg.opendaylight.controllerfeatures-nsffeaturesxml
+ runtime
@@ -77,13 +80,31 @@
features-mdsalfeaturesxml
+ runtimeorg.opendaylight.controllerfeatures-flowfeaturesxml
+ runtime
+
+ org.opendaylight.controller
+ features-restconf
+ 1.2.0-SNAPSHOT
+ features
+ xml
+ runtime
+
+
+
+ org.opendaylight.controller
+ features-netconf-connector
+ features
+ xml
+
+
diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml
index fcb452f422..4f0df441fa 100644
--- a/opendaylight/distribution/opendaylight/pom.xml
+++ b/opendaylight/distribution/opendaylight/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightdistribution.opendaylight
- 0.1.2-SNAPSHOT
+ 0.2.0-SNAPSHOTpom3.0
@@ -1020,7 +1020,7 @@
org.opendaylight.controllersal-inmemory-datastore
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTorg.opendaylight.controller
@@ -1133,7 +1133,7 @@
org.opendaylight.controller.modelmodel-topology
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT
@@ -1163,7 +1163,6 @@
org.opendaylight.yangtoolsbinding-generator-api
- ${yangtools.version}org.opendaylight.yangtools
@@ -1184,7 +1183,6 @@
org.opendaylight.yangtoolsbinding-model-api
- ${yangtools.version}org.opendaylight.yangtools
@@ -1316,6 +1314,41 @@
org.opendaylight.controllersal-clustering-config
+
+ org.eclipse.jetty
+ jetty-servlets
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-client
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-continuation
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-util
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-server
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-io
+ 8.1.14.v20131031
+
+
+ org.eclipse.jetty
+ jetty-http
+ 8.1.14.v20131031
+
@@ -1412,7 +1445,7 @@
org.opendaylight.controllerswagger-ui
- 0.0.1-SNAPSHOT
+ 0.1.0-SNAPSHOT
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
index 530e46e14a..691d83d45e 100644
--- a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
+++ b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
@@ -116,6 +116,10 @@ ovsdb.listenPort=6640
# default Openflow version = 1.3, we also support 1.0.
ovsdb.of.version=1.3
+# ovsdb can be configured with ml2 to perform l3 forwarding. The config below enables that functionality, which is
+# disabled by default.
+# ovsdb.l3.fwd.enabled=yes
+
# ovsdb can be configured with ml2 to perform l3 forwarding. When used in that scenario, the mac address of the default
# gateway --on the external subnet-- is expected to be resolved from its inet address. The config below overrides that
# specific arp/neighDiscovery lookup.
diff --git a/opendaylight/distribution/p2site/pom.xml b/opendaylight/distribution/p2site/pom.xml
index 78661d8df2..5a66a6191b 100644
--- a/opendaylight/distribution/p2site/pom.xml
+++ b/opendaylight/distribution/p2site/pom.xml
@@ -14,7 +14,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.0-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylight
@@ -32,7 +32,7 @@
org.opendaylight.controllerdistribution.p2site
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOTpom
diff --git a/opendaylight/distribution/sanitytest/pom.xml b/opendaylight/distribution/sanitytest/pom.xml
index 793e835647..9955afa274 100644
--- a/opendaylight/distribution/sanitytest/pom.xml
+++ b/opendaylight/distribution/sanitytest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightsanitytest
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/dummy-console/pom.xml b/opendaylight/dummy-console/pom.xml
index 8901c2e0b5..4195e53310 100644
--- a/opendaylight/dummy-console/pom.xml
+++ b/opendaylight/dummy-console/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../commons/opendaylightdummy-console
- 1.1.0-SNAPSHOT
+ 1.2.0-SNAPSHOTbundleDummy Console Interfaces for Equinox-specific CLI
diff --git a/opendaylight/forwarding/staticrouting/pom.xml b/opendaylight/forwarding/staticrouting/pom.xml
index 37c0a3a09d..b006cece40 100644
--- a/opendaylight/forwarding/staticrouting/pom.xml
+++ b/opendaylight/forwarding/staticrouting/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightforwarding.staticrouting
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/forwardingrulesmanager/api/pom.xml b/opendaylight/forwardingrulesmanager/api/pom.xml
index b6e1dd68d1..3f667e16f0 100644
--- a/opendaylight/forwardingrulesmanager/api/pom.xml
+++ b/opendaylight/forwardingrulesmanager/api/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightforwardingrulesmanager
- 0.6.0-SNAPSHOT
+ 0.7.0-SNAPSHOTbundle
diff --git a/opendaylight/forwardingrulesmanager/implementation/pom.xml b/opendaylight/forwardingrulesmanager/implementation/pom.xml
index f87bed8780..959b71f855 100644
--- a/opendaylight/forwardingrulesmanager/implementation/pom.xml
+++ b/opendaylight/forwardingrulesmanager/implementation/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightforwardingrulesmanager.implementation
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml
index ff0bfcc1ef..60b934a492 100644
--- a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml
+++ b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT../../commons/integrationtestforwardingrulesmanager.integrationtest
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOT../implementation/target/jacoco-it.exec
diff --git a/opendaylight/hosttracker/api/pom.xml b/opendaylight/hosttracker/api/pom.xml
index b48d7abd72..10532baa6e 100644
--- a/opendaylight/hosttracker/api/pom.xml
+++ b/opendaylight/hosttracker/api/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylighthosttracker
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/hosttracker/implementation/pom.xml b/opendaylight/hosttracker/implementation/pom.xml
index cb09322b64..370f88defa 100644
--- a/opendaylight/hosttracker/implementation/pom.xml
+++ b/opendaylight/hosttracker/implementation/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylighthosttracker.implementation
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOTbundle
diff --git a/opendaylight/hosttracker/integrationtest/pom.xml b/opendaylight/hosttracker/integrationtest/pom.xml
index 65fc23265a..dabccf3f71 100644
--- a/opendaylight/hosttracker/integrationtest/pom.xml
+++ b/opendaylight/hosttracker/integrationtest/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT../../commons/integrationtesthosttracker.integrationtest
- 0.5.2-SNAPSHOT
+ 0.6.0-SNAPSHOT../implementaiton/target/jacoco-it.exec
diff --git a/opendaylight/hosttracker/shell/pom.xml b/opendaylight/hosttracker/shell/pom.xml
index 3f73303180..9088ae359b 100644
--- a/opendaylight/hosttracker/shell/pom.xml
+++ b/opendaylight/hosttracker/shell/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylighthosttracker.shell
diff --git a/opendaylight/hosttracker_new/api/pom.xml b/opendaylight/hosttracker_new/api/pom.xml
index 240976b9c8..db27345d18 100644
--- a/opendaylight/hosttracker_new/api/pom.xml
+++ b/opendaylight/hosttracker_new/api/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylighthosttracker_new
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/hosttracker_new/implementation/pom.xml b/opendaylight/hosttracker_new/implementation/pom.xml
index 036dd5dd31..d3661a12c8 100644
--- a/opendaylight/hosttracker_new/implementation/pom.xml
+++ b/opendaylight/hosttracker_new/implementation/pom.xml
@@ -4,11 +4,11 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylighthosttracker_new.implementation
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/karaf-branding/.gitignore b/opendaylight/karaf-branding/.gitignore
new file mode 100644
index 0000000000..b83d22266a
--- /dev/null
+++ b/opendaylight/karaf-branding/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/opendaylight/karaf-branding/pom.xml b/opendaylight/karaf-branding/pom.xml
index 727f224fa1..dfdc3b76cb 100644
--- a/opendaylight/karaf-branding/pom.xml
+++ b/opendaylight/karaf-branding/pom.xml
@@ -1,34 +1,37 @@
- 4.0.0
-
+ 4.0.0
+ org.opendaylight.controller
- karaf.branding
- 1.0.0-SNAPSHOT
- bundle
- OpenDaylight :: Karaf :: Branding
+ releasepom
+ 0.2.0-SNAPSHOT
+ ../..
+
+ org.opendaylight.controller
+ karaf.branding
+ 1.1.0-SNAPSHOT
+ bundle
+ OpenDaylight :: Karaf :: Branding
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 2.4.0
- true
-
-
- ${project.artifactId}
- *
- !*
-
- org.apache.karaf.branding
-
- *;public-context:=false
-
-
-
-
-
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ 2.4.0
+ true
+
+
+ ${project.artifactId}
+ *
+ !*
+ org.apache.karaf.branding
+ *;public-context:=false
+
+
+
+
+
diff --git a/opendaylight/karaf-tomcat-security/pom.xml b/opendaylight/karaf-tomcat-security/pom.xml
index 817e0faeec..30d57d048a 100644
--- a/opendaylight/karaf-tomcat-security/pom.xml
+++ b/opendaylight/karaf-tomcat-security/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../commons/opendaylightkaraf-tomcat-security
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/logging/bridge/pom.xml b/opendaylight/logging/bridge/pom.xml
index 82bc6cd9c1..dc37e30179 100644
--- a/opendaylight/logging/bridge/pom.xml
+++ b/opendaylight/logging/bridge/pom.xml
@@ -4,12 +4,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../../commons/opendaylightlogging.bridge
- 0.4.2-SNAPSHOT
+ 0.5.0-SNAPSHOTbundle
diff --git a/opendaylight/md-sal/benchmark-data-store/pom.xml b/opendaylight/md-sal/benchmark-data-store/pom.xml
index 1af2287a10..ac384319b8 100644
--- a/opendaylight/md-sal/benchmark-data-store/pom.xml
+++ b/opendaylight/md-sal/benchmark-data-store/pom.xml
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
sal-parentorg.opendaylight.controller
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT4.0.0
diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java
index 4b9d66f4f2..77a4966ec3 100644
--- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java
+++ b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java
@@ -7,19 +7,21 @@
*/
package org.opendaylight.controller.md.sal.dom.store.benchmark;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
-import org.openjdk.jmh.annotations.Level;
-import org.openjdk.jmh.annotations.Setup;
-import org.openjdk.jmh.annotations.TearDown;
-import org.openjdk.jmh.annotations.Fork;
-import org.openjdk.jmh.annotations.Scope;
-import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
/**
* Benchmark for testing of performance of write operations for InMemoryDataStore. The instance
@@ -41,14 +43,15 @@ public class InMemoryDataStoreWithExecutorServiceBenchmark extends AbstractInMem
private static final int MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
private static final int MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE = 5000;
+ @Override
@Setup(Level.Trial)
public void setUp() throws Exception {
final String name = "DS_BENCHMARK";
final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL");
- final ExecutorService domStoreExecutor = SpecialExecutors.newBoundedSingleThreadExecutor(
- MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE, "DOMStore-" + name );
+ final ListeningExecutorService domStoreExecutor = MoreExecutors.listeningDecorator(SpecialExecutors.newBoundedSingleThreadExecutor(
+ MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE, "DOMStore-" + name ));
domStore = new InMemoryDOMDataStore(name, domStoreExecutor,
dataChangeListenerExecutor);
@@ -57,6 +60,7 @@ public class InMemoryDataStoreWithExecutorServiceBenchmark extends AbstractInMem
initTestNode();
}
+ @Override
@TearDown
public void tearDown() {
schemaContext = null;
diff --git a/opendaylight/md-sal/compatibility/pom.xml b/opendaylight/md-sal/compatibility/pom.xml
index b9e9d19b48..a7da4a1e9c 100644
--- a/opendaylight/md-sal/compatibility/pom.xml
+++ b/opendaylight/md-sal/compatibility/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTcompatibility-parentpom
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml b/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml
index 168dd14d10..32014decd5 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllercompatibility-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTsal-compatibilitybundle
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java
new file mode 100644
index 0000000000..2306508759
--- /dev/null
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java
@@ -0,0 +1,146 @@
+/**
+ * Copyright (c) 2014 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.controller.sal.compatibility;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+public abstract class AbstractDataChangeListener implements AutoCloseable,DataChangeListener{
+
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractDataChangeListener.class);
+ protected InventoryAndReadAdapter adapter;
+ protected final Class clazz;
+ protected ListenerRegistration listenerRegistration;
+
+ public AbstractDataChangeListener(final InventoryAndReadAdapter adapter, DataBroker db, final Class clazz) {
+ this.adapter = Preconditions.checkNotNull(adapter, "InventoryAndReadAdapter can not be null!");
+ this.clazz = Preconditions.checkNotNull(clazz, "Class can not be null!");
+ Preconditions.checkNotNull(db, "DataBroker can not be null!");
+ registrationListener(db, 5);
+ }
+
+ @Override
+ public void onDataChanged(AsyncDataChangeEvent, DataObject> changeEvent) {
+ Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
+ /* All DataObjects for create */
+ final Map, DataObject> createdData = changeEvent.getCreatedData() != null
+ ? changeEvent.getCreatedData() : Collections., DataObject> emptyMap();
+ /* All DataObjects for remove */
+ final Set> removeData = changeEvent.getRemovedPaths() != null
+ ? changeEvent.getRemovedPaths() : Collections.> emptySet();
+ /* All DataObjects for updates */
+ final Map, DataObject> updateData = changeEvent.getUpdatedData() != null
+ ? changeEvent.getUpdatedData() : Collections., DataObject> emptyMap();
+ /* All Original DataObjects */
+ final Map, DataObject> originalData = changeEvent.getOriginalData() != null
+ ? changeEvent.getOriginalData() : Collections., DataObject> emptyMap();
+ this.createData(createdData);
+ this.updateData(updateData, originalData);
+ this.removeData(removeData, originalData);
+ }
+
+ @SuppressWarnings("unchecked")
+ private void createData(final Map, DataObject> createdData) {
+ final Set> keys = createdData.keySet() != null
+ ? createdData.keySet() : Collections.> emptySet();
+ for (InstanceIdentifier> key : keys) {
+ if (clazz.equals(key.getTargetType())) {
+ InstanceIdentifier createKeyIdent = key.firstIdentifierOf(clazz);
+ final Optional value = Optional.of(createdData.get(key));
+ if (value.isPresent()) {
+ this.add(createKeyIdent, (T)value.get());
+ }
+ }
+ }
+ }
+
+ abstract protected void add(InstanceIdentifier createKeyIdent, T node);
+
+ @SuppressWarnings("unchecked")
+ private void updateData(final Map, DataObject> updateData, final Map, DataObject> originalData) {
+
+ final Set> keys = updateData.keySet() != null
+ ? updateData.keySet() : Collections.> emptySet();
+ for (InstanceIdentifier> key : keys) {
+ if (clazz.equals(key.getTargetType())) {
+ InstanceIdentifier updateKeyIdent = key.firstIdentifierOf(clazz);
+ final Optional value = Optional.of(updateData.get(key));
+ final Optional original = Optional.of(originalData.get(key));
+ if (value.isPresent() && original.isPresent()) {
+ this.update(updateKeyIdent, (T)original.get(), (T)value.get());
+ }
+ }
+ }
+ }
+
+ abstract protected void update(InstanceIdentifier updateKeyIdent, T node,
+ T node2);
+
+ @SuppressWarnings("unchecked")
+ private void removeData(final Set> removeData, final Map, DataObject> originalData) {
+
+ for (InstanceIdentifier> key : removeData) {
+ if (clazz.equals(key.getTargetType())) {
+ final InstanceIdentifier ident = key.firstIdentifierOf(clazz);
+ final DataObject removeValue = originalData.get(key);
+ this.remove(ident, (T)removeValue);
+ }
+ }
+ }
+
+ abstract protected void remove(InstanceIdentifier ident, T removeValue);
+
+ protected void registrationListener(final DataBroker db, int i) {
+ try {
+ listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
+ getWildCardPath(), this, DataChangeScope.BASE);
+ } catch (final Exception e) {
+ if (i >= 1) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ LOG.error("Thread interrupted '{}'", e1);
+ Thread.currentThread().interrupt();
+ }
+ registrationListener(db, --i);
+ } else {
+ LOG.error("AbstractDataChangeListener registration fail!", e);
+ throw new IllegalStateException("AbstractDataChangeListener registration Listener fail! System needs restart.", e);
+ }
+ }
+ }
+
+ protected abstract InstanceIdentifier> getWildCardPath();
+
+ @Override
+ public void close() {
+ if (listenerRegistration != null) {
+ try {
+ listenerRegistration.close();
+ } catch (final Exception e) {
+ LOG.error("Error by stop AbstractDataChangeListener.", e);
+ }
+ listenerRegistration = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java
index d71858e5c3..6a8e3c0e5b 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java
@@ -7,9 +7,7 @@
*/
package org.opendaylight.controller.sal.compatibility;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
+import com.google.common.base.Preconditions;
import org.apache.felix.dm.Component;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
@@ -36,7 +34,8 @@ import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
import org.opendaylight.controller.sal.utils.INodeFactory;
import org.osgi.framework.BundleContext;
-import com.google.common.base.Preconditions;
+import java.util.Dictionary;
+import java.util.Hashtable;
public class ComponentActivator extends ComponentActivatorAbstractBase {
private final INodeConnectorFactory nodeConnectorFactory = new MDSalNodeConnectorFactory();
@@ -90,8 +89,8 @@ public class ComponentActivator extends ComponentActivatorAbstractBase {
@Override
public void start(final BundleContext context) {
- super.start(context);
this.context = Preconditions.checkNotNull(context);
+ super.start(context);
}
public ProviderContext setBroker(final BindingAwareBroker broker) {
@@ -101,14 +100,14 @@ public class ComponentActivator extends ComponentActivatorAbstractBase {
@Override
protected Object[] getGlobalImplementations() {
return new Object[] {
+ this, // Used for setBroker callback
flow,
inventory,
dataPacket,
nodeFactory,
nodeConnectorFactory,
topology,
- tpProvider,
- this // Used for setBroker callback
+ tpProvider
};
}
@@ -139,6 +138,7 @@ public class ComponentActivator extends ComponentActivatorAbstractBase {
protected Object[] getImplementations() {
return new Object[] {
dataPacketService,
+ inventory,
};
}
@@ -148,6 +148,8 @@ public class ComponentActivator extends ComponentActivatorAbstractBase {
_instanceConfigure((ComponentActivator)imp, c, containerName);
} else if (imp instanceof DataPacketServiceAdapter) {
_instanceConfigure((DataPacketServiceAdapter)imp, c, containerName);
+ } else if (imp instanceof InventoryAndReadAdapter) {
+ _instanceConfigure((InventoryAndReadAdapter)imp, c, containerName);
} else {
throw new IllegalArgumentException(String.format("Unhandled implementation class %s", imp.getClass()));
}
@@ -213,6 +215,28 @@ public class ComponentActivator extends ComponentActivatorAbstractBase {
.setService(IDiscoveryService.class)
.setCallbacks("setDiscoveryPublisher", "setDiscoveryPublisher")
.setRequired(false));
+ it.add(createServiceDependency()
+ .setService(BindingAwareBroker.class)
+ .setRequired(true));
+ }
+
+ private void _instanceConfigure(final InventoryAndReadAdapter imp, final Component it, String containerName) {
+ it.setInterface(new String[] {
+ IPluginInInventoryService.class.getName(),
+ IPluginInReadService.class.getName(),
+ }, properties());
+
+ it.add(createServiceDependency()
+ .setService(IPluginOutReadService.class)
+ .setCallbacks("setReadPublisher", "unsetReadPublisher")
+ .setRequired(false));
+ it.add(createServiceDependency()
+ .setService(IPluginOutInventoryService.class)
+ .setCallbacks("setInventoryPublisher", "unsetInventoryPublisher")
+ .setRequired(false));
+ it.add(createServiceDependency()
+ .setService(BindingAwareBroker.class)
+ .setRequired(true));
}
private void _configure(final TopologyAdapter imp, final Component it) {
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java
index 1b648dc98c..ecf1a94c18 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java
@@ -61,10 +61,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
import com.google.common.net.InetAddresses;
-public class FromSalConversionsUtils {
+/**
+ * MD-SAL to AD-SAL conversions collection
+ */
+public final class FromSalConversionsUtils {
- private FromSalConversionsUtils() {
+ /** http://en.wikipedia.org/wiki/IPv4#Packet_structure (end of octet number 1, bit 14.+15.) */
+ public static final int ENC_FIELD_BIT_SIZE = 2;
+ private FromSalConversionsUtils() {
+ throw new IllegalAccessError("forcing no instance for factory");
}
@SuppressWarnings("unused")
@@ -469,5 +475,12 @@ public class FromSalConversionsUtils {
return true;
}
+ /**
+ * @param nwDscp NW-DSCP
+ * @return shifted to NW-TOS (with empty ECN part)
+ */
+ public static int dscpToTos(int nwDscp) {
+ return (short) (nwDscp << ENC_FIELD_BIT_SIZE);
+ }
}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java
index e2c1386775..bbb6673a8e 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java
@@ -7,8 +7,6 @@
*/
package org.opendaylight.controller.sal.compatibility;
-import com.google.common.collect.Iterables;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -48,7 +46,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.ta
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
@@ -71,7 +68,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
@@ -90,7 +86,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInInventoryService, OpendaylightInventoryListener, OpendaylightFlowStatisticsListener, OpendaylightFlowTableStatisticsListener, OpendaylightPortStatisticsListener {
+import com.google.common.collect.Iterables;
+
+public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInInventoryService, OpendaylightFlowStatisticsListener, OpendaylightFlowTableStatisticsListener, OpendaylightPortStatisticsListener {
private static final Logger LOG = LoggerFactory.getLogger(InventoryAndReadAdapter.class);
private static final short OPENFLOWV10_TABLE_ID = 0;
@@ -241,20 +239,20 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
* @param id Table id
* @return Table contents, or null if not present
*/
- private Table readConfigTable(final Node node, final short id) {
+ private Table readOperationalTable(final Node node, final short id) {
final InstanceIdentifier
tableRef = InstanceIdentifier.builder(Nodes.class)
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, InventoryMapping.toNodeKey(node))
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, NodeMapping.toNodeKey(node))
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(id))
.build();
- return (Table) startChange().readConfigurationData(tableRef);
+ return (Table) startChange().readOperationalData(tableRef);
}
@Override
public List readAllFlow(final Node node, final boolean cached) {
final ArrayList output = new ArrayList<>();
- final Table table = readConfigTable(node, OPENFLOWV10_TABLE_ID);
+ final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
if (table != null) {
final List flows = table.getFlow();
LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
@@ -268,12 +266,6 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
}
}
- // TODO (main): Shall we send request to the switch? It will make async request to the switch.
- // Once the plugin receives a response, it will let the adaptor know through onFlowStatisticsUpdate()
- // If we assume that md-sal statistics manager will always be running, then it is not required
- // But if not, then sending request will collect the latest data for adaptor at least.
- getFlowStatisticsService().getAllFlowsStatisticsFromAllFlowTables(
- new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder().setNode(NodeMapping.toNodeRef(node)).build());
return output;
}
@@ -334,7 +326,7 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
@Override
public FlowOnNode readFlow(final Node node, final org.opendaylight.controller.sal.flowprogrammer.Flow targetFlow, final boolean cached) {
FlowOnNode ret = null;
- final Table table = readConfigTable(node, OPENFLOWV10_TABLE_ID);
+ final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
if (table != null) {
final List flows = table.getFlow();
InventoryAndReadAdapter.LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
@@ -386,7 +378,7 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
@Override
public NodeTableStatistics readNodeTable(final NodeTable nodeTable, final boolean cached) {
NodeTableStatistics nodeStats = null;
- final Table table = readConfigTable(nodeTable.getNode(), (short) nodeTable.getID());
+ final Table table = readOperationalTable(nodeTable.getNode(), (short) nodeTable.getID());
if (table != null) {
final FlowTableStatisticsData tableStats = table.getAugmentation(FlowTableStatisticsData.class);
if (tableStats != null) {
@@ -405,13 +397,11 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
return nodeStats;
}
- @Override
- public void onNodeConnectorRemoved(final NodeConnectorRemoved update) {
+ public void onNodeConnectorRemovedInternal(final NodeConnectorRemoved update) {
// Never received
}
- @Override
- public void onNodeRemoved(final NodeRemoved notification) {
+ public void onNodeRemovedInternal(final NodeRemoved notification) {
this.removeNodeConnectors(notification.getNodeRef().getValue());
try {
final Node aDNode = NodeMapping.toADNode(notification.getNodeRef());
@@ -421,8 +411,7 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
}
}
- @Override
- public void onNodeConnectorUpdated(final NodeConnectorUpdated update) {
+ public void onNodeConnectorUpdatedInternal(final NodeConnectorUpdated update) {
final NodeConnectorRef ref = update.getNodeConnectorRef();
final UpdateType updateType;
if (!this.isKnownNodeConnector(ref.getValue())) {
@@ -441,8 +430,7 @@ public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInI
}
}
- @Override
- public void onNodeUpdated(final NodeUpdated notification) {
+ public void onNodeUpdatedInternal(final NodeUpdated notification) {
final NodeRef ref = notification.getNodeRef();
final UpdateType updateType;
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java
index 5837e35b3a..00511bc744 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java
@@ -315,7 +315,7 @@ public final class MDFlowMapping {
private static SetNwTosActionCase _toAction(final SetNwTos sourceAction) {
return new SetNwTosActionCaseBuilder()
- .setSetNwTosAction(new SetNwTosActionBuilder().setTos(sourceAction.getNwTos()).build())
+ .setSetNwTosAction(new SetNwTosActionBuilder().setTos(FromSalConversionsUtils.dscpToTos(sourceAction.getNwTos())).build())
.build();
}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java
new file mode 100644
index 0000000000..d93d40d2a6
--- /dev/null
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2014 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.controller.sal.compatibility;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdatedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemovedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdatedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NCDataChangeListener extends AbstractDataChangeListener {
+ private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
+ private ListenerRegistration listenerRegistration;
+ public NCDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
+ super(adapter,db,NodeConnector.class);
+ }
+
+ @Override
+ protected void add(InstanceIdentifier createKeyIdent, NodeConnector node) {
+ FlowCapableNodeConnector fcnc = node.getAugmentation(FlowCapableNodeConnector.class);
+ if(fcnc != null) {
+ FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder(fcnc);
+ NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder();
+ builder.setId(node.getId());
+ builder.setNodeConnectorRef(new NodeConnectorRef(createKeyIdent));
+ builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build());
+ adapter.onNodeConnectorUpdatedInternal(builder.build());
+ }
+ }
+
+ @Override
+ protected void update(InstanceIdentifier updateKeyIdent, NodeConnector original,
+ NodeConnector update) {
+ add(updateKeyIdent,update);
+ }
+
+ @Override
+ protected void remove(InstanceIdentifier ident, NodeConnector removeValue) {
+ NodeConnectorRemovedBuilder builder = new NodeConnectorRemovedBuilder();
+ builder.setNodeConnectorRef(new NodeConnectorRef(ident));
+ adapter.onNodeConnectorRemovedInternal(builder.build());
+ }
+
+ protected InstanceIdentifier getWildCardPath() {
+ return InstanceIdentifier.create(Nodes.class).child(Node.class).child(NodeConnector.class);
+ }
+}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java
new file mode 100644
index 0000000000..cdb26162c0
--- /dev/null
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2014 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.controller.sal.compatibility;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NodeDataChangeListener extends AbstractDataChangeListener {
+ private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
+
+
+ public NodeDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
+ super(adapter,db,Node.class);
+ }
+
+ protected void add(InstanceIdentifier createKeyIdent, Node node) {
+ FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
+ if(fcn != null) {
+ FlowCapableNodeUpdatedBuilder fcbnu = new FlowCapableNodeUpdatedBuilder(fcn);
+ NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
+ builder.setId(node.getId());
+ builder.setNodeRef(new NodeRef(createKeyIdent));
+ builder.setNodeConnector(node.getNodeConnector());
+ builder.addAugmentation(FlowCapableNodeUpdated.class, fcbnu.build());
+ adapter.onNodeUpdatedInternal(builder.build());
+ }
+ }
+
+ protected void update(InstanceIdentifier updateKeyIdent, Node original,
+ Node update) {
+ this.add(updateKeyIdent, update);
+ }
+
+ protected void remove(InstanceIdentifier ident, Node removeValue) {
+ NodeRemovedBuilder builder = new NodeRemovedBuilder();
+ builder.setNodeRef(new NodeRef(ident));
+ adapter.onNodeRemovedInternal(builder.build());
+ }
+
+ protected InstanceIdentifier getWildCardPath() {
+ return InstanceIdentifier.create(Nodes.class).child(Node.class);
+ }
+
+}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
index b873f8a9fe..bcb2367e7a 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
@@ -168,7 +168,22 @@ public final class NodeMapping {
* @return
*/
private static NodeId toNodeId(org.opendaylight.controller.sal.core.Node aDNode) {
- return new NodeId(aDNode.getType() + ":" + String.valueOf(aDNode.getID()));
+ String targetPrefix = null;
+ if (NodeIDType.OPENFLOW.equals(aDNode.getType())) {
+ targetPrefix = OPENFLOW_ID_PREFIX;
+ } else {
+ targetPrefix = aDNode.getType() + ":";
+ }
+
+ return new NodeId(targetPrefix + String.valueOf(aDNode.getID()));
+ }
+
+ /**
+ * @param aDNode
+ * @return md-sal {@link NodeKey}
+ */
+ public static NodeKey toNodeKey(org.opendaylight.controller.sal.core.Node aDNode) {
+ return new NodeKey(toNodeId(aDNode));
}
public static String toNodeConnectorType(final NodeConnectorId ncId, final NodeId nodeId) {
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
index 0ddbcaa2e0..f8f2b37819 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
@@ -10,6 +10,7 @@ package org.opendaylight.controller.sal.compatibility;
import java.util.Collection;
import java.util.Collections;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
@@ -68,6 +69,10 @@ class SalCompatibilityProvider implements BindingAwareProvider {
inv.setNodeConnectorStatisticsService(session.getRpcService(OpendaylightPortStatisticsService.class));
inv.setTopologyDiscovery(session.getRpcService(FlowTopologyDiscoveryService.class));
inv.setDataProviderService(session.getSALService(DataProviderService.class));
+
+ final NodeDataChangeListener ndcl = new NodeDataChangeListener(inv,session.getSALService(DataBroker.class));
+ final NCDataChangeListener ncdcl = new NCDataChangeListener(inv,session.getSALService(DataBroker.class));
+
// FIXME: remember registration for clean shutdown
subscribe.registerNotificationListener(inv);
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
index 28dd57c3b7..dcc1a4660b 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
@@ -128,7 +128,7 @@ public class ToSalConversionsUtils {
private static final Logger LOG = LoggerFactory.getLogger(ToSalConversionsUtils.class);
private ToSalConversionsUtils() {
-
+ throw new IllegalAccessError("forcing no instance for factory");
}
public static Flow toFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source, Node node) {
@@ -287,7 +287,7 @@ public class ToSalConversionsUtils {
} else if (sourceAction instanceof SetNwTosActionCase) {
Integer tos = ((SetNwTosActionCase) sourceAction).getSetNwTosAction().getTos();
if (tos != null) {
- targetAction.add(new SetNwTos(tos));
+ targetAction.add(new SetNwTos(ToSalConversionsUtils.tosToNwDscp(tos)));
}
} else if (sourceAction instanceof SetTpDstActionCase) {
PortNumber port = ((SetTpDstActionCase) sourceAction).getSetTpDstAction().getPort();
@@ -643,4 +643,12 @@ public class ToSalConversionsUtils {
return mac;
}
+
+ /**
+ * @param nwTos NW-TOS
+ * @return shifted to NW-DSCP
+ */
+ public static int tosToNwDscp(int nwTos) {
+ return (short) (nwTos >>> FromSalConversionsUtils.ENC_FIELD_BIT_SIZE);
+ }
}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java
index 6bc669f60b..ae723a3165 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java
@@ -7,12 +7,8 @@
*/
package org.opendaylight.controller.sal.compatibility.topology;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-
+import com.google.common.base.Function;
+import com.google.common.collect.FluentIterable;
import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
import org.opendaylight.controller.sal.compatibility.NodeMapping;
import org.opendaylight.controller.sal.core.ConstructionException;
@@ -33,11 +29,16 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.regex.Pattern;
+
+import static com.google.common.base.Preconditions.checkNotNull;
public final class TopologyMapping {
private static final Logger LOG = LoggerFactory.getLogger(TopologyMapping.class);
+ private final static Pattern NUMBERS_ONLY = Pattern.compile("[0-9]+");
private TopologyMapping() {
throw new UnsupportedOperationException("Utility class. Instantiation is not allowed.");
@@ -100,7 +101,13 @@ public final class TopologyMapping {
public static NodeConnector toADNodeConnector(final TpId source, final NodeId nodeId) throws ConstructionException {
checkNotNull(source);
- return new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf(toADNodeConnectorId(source)), toADNode(nodeId));
+ String nodeConnectorIdStripped = toADNodeConnectorId(source);
+ if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) {
+ return new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf(nodeConnectorIdStripped), toADNode(nodeId));
+ }
+ LOG.debug("NodeConnectorId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE + "instead");
+ NodeConnectorIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class, NodeMapping.MD_SAL_TYPE);
+ return new NodeConnector(NodeMapping.MD_SAL_TYPE, nodeConnectorIdStripped, toADNode(nodeId));
}
public static String toADNodeConnectorId(final TpId nodeConnectorId) {
@@ -109,6 +116,12 @@ public final class TopologyMapping {
public static Node toADNode(final NodeId nodeId) throws ConstructionException {
checkNotNull(nodeId);
- return new Node(NodeIDType.OPENFLOW, Long.valueOf(toADNodeId(nodeId)));
+ String nodeIdStripped = toADNodeId(nodeId);
+ if (NUMBERS_ONLY.matcher(nodeIdStripped).matches()) {
+ return new Node(NodeIDType.OPENFLOW, Long.valueOf(nodeIdStripped));
+ }
+ LOG.debug("NodeId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE + "instead");
+ NodeIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class);
+ return new Node(NodeMapping.MD_SAL_TYPE, nodeId.getValue());
}
}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java
new file mode 100644
index 0000000000..b09e816f61
--- /dev/null
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2014 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.controller.sal.compatibility.test;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils;
+
+/**
+ * test of {@link FromSalConversionsUtils}
+ */
+public class FromSalConversionsUtilsTest {
+
+ /**
+ * Test method for {@link org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils#dscpToTos(int)}.
+ */
+ @Test
+ public void testDscpToTos() {
+ Assert.assertEquals(0, FromSalConversionsUtils.dscpToTos(0));
+ Assert.assertEquals(4, FromSalConversionsUtils.dscpToTos(1));
+ Assert.assertEquals(252, FromSalConversionsUtils.dscpToTos(63));
+ Assert.assertEquals(256, FromSalConversionsUtils.dscpToTos(64));
+ Assert.assertEquals(-4, FromSalConversionsUtils.dscpToTos(-1));
+ }
+
+}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java
index a776ef2312..759e69f5eb 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java
@@ -196,6 +196,19 @@ public class NodeMappingTest {
Assert.assertEquals(0xCC4E241C4A000000L, NodeMapping.openflowFullNodeIdToLong("14721743935839928320").longValue());
}
+ /**
+ * Test method for
+ * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toNodeKey(org.opendaylight.controller.sal.core.Node)}
+ * .
+ * @throws ConstructionException
+ */
+ @Test
+ public void testToNodeKey() throws ConstructionException {
+ org.opendaylight.controller.sal.core.Node aDNode = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
+ NodeKey nodeKey = NodeMapping.toNodeKey(aDNode);
+ Assert.assertEquals("openflow:42", nodeKey.getId().getValue());
+ }
+
/**
* @param nodeId
* @param portId
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java
index 9f787b7e39..98df90112d 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java
@@ -293,7 +293,7 @@ public class TestFromSalConversionsUtils {
}
assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
} else if (innerAction instanceof SetNwTosActionCase) {
- assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 63, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
+ assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 252, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
} else if (innerAction instanceof SetNwDstActionCase) {
Address address = ((SetNwDstActionCase) innerAction).getSetNwDstAction().getAddress();
boolean ipv4AddressFound = false;
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
index 60b77394c1..16d0bb424d 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
@@ -499,7 +499,7 @@ public class TestToSalConversionsUtils {
private void prepareActionSetNwTos(SetNwTosActionCaseBuilder wrapper) {
SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
- setNwTosActionBuilder.setTos(63);
+ setNwTosActionBuilder.setTos(252);
wrapper.setSetNwTosAction(setNwTosActionBuilder.build());
}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java
new file mode 100644
index 0000000000..aa25c18317
--- /dev/null
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2014 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.controller.sal.compatibility.test;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
+
+/**
+ * test of {@link ToSalConversionsUtils}
+ */
+public class ToSalConversionsUtilsTest {
+
+ /**
+ * Test method for {@link org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils#tosToNwDscp(int)}.
+ */
+ @Test
+ public void testTosToNwDscp() {
+ Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(0));
+ Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(1));
+ Assert.assertEquals(1, ToSalConversionsUtils.tosToNwDscp(4));
+ Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(252));
+ Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(253));
+ Assert.assertEquals(-1, ToSalConversionsUtils.tosToNwDscp(-1));
+ }
+}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java
index b76370a538..9369217d78 100644
--- a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java
+++ b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java
@@ -69,4 +69,17 @@ public class TopologyMappingTest {
Assert.assertEquals("OF|00:00:00:00:00:00:00:01", observedNode.toString());
}
+ /**
+ * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
+ * @throws ConstructionException
+ */
+ @Test
+ public void bug1309ToADNodeConnector() throws ConstructionException {
+ NodeId nodeId = new NodeId("some_unknown_node");
+ TpId source = new TpId("192.168.0.1");
+ NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
+
+ Assert.assertEquals("MD_SAL_DEPRECATED|192.168.0.1@MD_SAL_DEPRECATED|some_unknown_node", observedNodeConnector.toString());
+ }
+
}
diff --git a/opendaylight/md-sal/forwardingrules-manager/pom.xml b/opendaylight/md-sal/forwardingrules-manager/pom.xml
index 5a9b190219..12458f5ab9 100644
--- a/opendaylight/md-sal/forwardingrules-manager/pom.xml
+++ b/opendaylight/md-sal/forwardingrules-manager/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTorg.opendaylight.controller.mdforwardingrules-manager
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java
index 9951bf7448..698dbcb0d1 100644
--- a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java
+++ b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java
@@ -7,7 +7,6 @@
*/
package org.opendaylight.controller.frm.impl;
-import com.google.common.base.Preconditions;
import org.opendaylight.controller.frm.ForwardingRulesManager;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
@@ -33,6 +32,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Preconditions;
+
/**
* GroupForwarder
* It implements {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener}}
@@ -52,8 +53,27 @@ public class FlowForwarder extends AbstractListeningCommiter {
public FlowForwarder (final ForwardingRulesManager manager, final DataBroker db) {
super(manager, Flow.class);
Preconditions.checkNotNull(db, "DataBroker can not be null!");
- this.listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
- getWildCardPath(), FlowForwarder.this, DataChangeScope.SUBTREE);
+ registrationListener(db, 5);
+ }
+
+ private void registrationListener(final DataBroker db, int i) {
+ try {
+ listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
+ getWildCardPath(), FlowForwarder.this, DataChangeScope.SUBTREE);
+ } catch (final Exception e) {
+ if (i >= 1) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ LOG.error("Thread interrupted '{}'", e1);
+ Thread.currentThread().interrupt();
+ }
+ registrationListener(db, --i);
+ } else {
+ LOG.error("FRM Flow DataChange listener registration fail!", e);
+ throw new IllegalStateException("FlowForwarder registration Listener fail! System needs restart.", e);
+ }
+ }
}
@Override
@@ -61,7 +81,7 @@ public class FlowForwarder extends AbstractListeningCommiter {
if (listenerRegistration != null) {
try {
listenerRegistration.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.error("Error by stop FRM FlowChangeListener.", e);
}
listenerRegistration = null;
@@ -80,7 +100,7 @@ public class FlowForwarder extends AbstractListeningCommiter {
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- this.provider.getSalFlowService().removeFlow(builder.build());
+ provider.getSalFlowService().removeFlow(builder.build());
}
}
@@ -99,7 +119,7 @@ public class FlowForwarder extends AbstractListeningCommiter {
builder.setUpdatedFlow((new UpdatedFlowBuilder(update)).build());
builder.setOriginalFlow((new OriginalFlowBuilder(original)).build());
- this.provider.getSalFlowService().updateFlow(builder.build());
+ provider.getSalFlowService().updateFlow(builder.build());
}
}
@@ -116,7 +136,7 @@ public class FlowForwarder extends AbstractListeningCommiter {
builder.setFlowRef(new FlowRef(identifier));
builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- this.provider.getSalFlowService().addFlow(builder.build());
+ provider.getSalFlowService().addFlow(builder.build());
}
}
@@ -129,7 +149,7 @@ public class FlowForwarder extends AbstractListeningCommiter {
private boolean tableIdValidationPrecondition (final TableKey tableKey, final Flow flow) {
Preconditions.checkNotNull(tableKey, "TableKey can not be null or empty!");
Preconditions.checkNotNull(flow, "Flow can not be null or empty!");
- if (flow.getTableId() != tableKey.getId()) {
+ if (! tableKey.getId().equals(flow.getTableId())) {
LOG.error("TableID in URI tableId={} and in palyload tableId={} is not same.",
flow.getTableId(), tableKey.getId());
return false;
diff --git a/opendaylight/md-sal/inventory-manager/pom.xml b/opendaylight/md-sal/inventory-manager/pom.xml
index 1706996ce4..77e4203269 100644
--- a/opendaylight/md-sal/inventory-manager/pom.xml
+++ b/opendaylight/md-sal/inventory-manager/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTorg.opendaylight.controller.mdinventory-manager
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java
index 3db929b99d..618fcfc133 100644
--- a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java
+++ b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java
@@ -7,24 +7,23 @@
*/
package org.opendaylight.controller.md.inventory.manager;
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
+import java.util.ArrayList;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
+
import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Preconditions;
+
class FlowCapableInventoryProvider implements AutoCloseable, Runnable, TransactionChainListener {
private static final Logger LOG = LoggerFactory.getLogger(FlowCapableInventoryProvider.class);
private static final int QUEUE_DEPTH = 500;
@@ -47,7 +46,7 @@ class FlowCapableInventoryProvider implements AutoCloseable, Runnable, Transacti
final NodeChangeCommiter changeCommiter = new NodeChangeCommiter(FlowCapableInventoryProvider.this);
this.listenerRegistration = this.notificationService.registerNotificationListener(changeCommiter);
- this.txChain = dataBroker.createTransactionChain(this);
+ this.txChain = (dataBroker.createTransactionChain(this));
thread = new Thread(this);
thread.setDaemon(true);
thread.setName("FlowCapableInventoryProvider");
@@ -59,49 +58,20 @@ class FlowCapableInventoryProvider implements AutoCloseable, Runnable, Transacti
void enqueue(final InventoryOperation op) {
try {
queue.put(op);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
LOG.warn("Failed to enqueue operation {}", op, e);
}
}
- @Override
- public void close() throws InterruptedException {
- LOG.info("Flow Capable Inventory Provider stopped.");
- if (this.listenerRegistration != null) {
- try {
- this.listenerRegistration.close();
- } catch (Exception e) {
- LOG.error("Failed to stop inventory provider", e);
- }
- listenerRegistration = null;
- }
-
- if (thread != null) {
- thread.interrupt();
- thread.join();
- thread = null;
- }
- if (txChain != null) {
- txChain.close();
- txChain = null;
- }
-
-
- }
-
@Override
public void run() {
try {
for (; ; ) {
InventoryOperation op = queue.take();
-
- final ReadWriteTransaction tx = txChain.newReadWriteTransaction();
- LOG.debug("New operations available, starting transaction {}", tx.getIdentifier());
-
int ops = 0;
+ final ArrayList opsToApply = new ArrayList<>(MAX_BATCH);
do {
- op.applyOperation(tx);
-
+ opsToApply.add(op);
ops++;
if (ops < MAX_BATCH) {
op = queue.poll();
@@ -109,23 +79,9 @@ class FlowCapableInventoryProvider implements AutoCloseable, Runnable, Transacti
op = null;
}
} while (op != null);
-
- LOG.debug("Processed {} operations, submitting transaction {}", ops, tx.getIdentifier());
-
- final CheckedFuture result = tx.submit();
- Futures.addCallback(result, new FutureCallback() {
- @Override
- public void onSuccess(final Void aVoid) {
- //NOOP
- }
-
- @Override
- public void onFailure(final Throwable throwable) {
- LOG.error("Transaction {} failed.", tx.getIdentifier(), throwable);
- }
- });
+ submitOperations(opsToApply);
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
LOG.info("Processing interrupted, terminating", e);
}
@@ -135,15 +91,131 @@ class FlowCapableInventoryProvider implements AutoCloseable, Runnable, Transacti
}
}
+ /**
+ * Starts new empty transaction, custimizes it with submitted operations
+ * and submit it to data broker.
+ *
+ * If transaction chain failed during customization of transaction
+ * it allocates new chain and empty transaction and customizes it
+ * with submitted operations.
+ *
+ * This does not retry failed transaction. It only retries it when
+ * chain failed during customization of transaction chain.
+ *
+ * @param opsToApply
+ */
+ private void submitOperations(final ArrayList opsToApply) {
+ final ReadWriteTransaction tx = createCustomizedTransaction(opsToApply);
+ LOG.debug("Processed {} operations, submitting transaction {}", opsToApply.size(), tx.getIdentifier());
+ try {
+ tx.submit();
+ } catch (final IllegalStateException e) {
+ /*
+ * Transaction chain failed during doing batch, so we need to null
+ * tx chain and continue processing queue.
+ *
+ * We fail current txChain which was allocated with createTransaction.
+ */
+ failCurrentChain(txChain);
+ /*
+ * We will retry transaction once in order to not loose any data.
+ *
+ */
+ final ReadWriteTransaction retryTx = createCustomizedTransaction(opsToApply);
+ retryTx.submit();
+ }
+ }
+
+ /**
+ * Creates new empty ReadWriteTransaction. If transaction chain
+ * was failed, it will allocate new transaction chain
+ * and assign it with this Operation Executor.
+ *
+ * This call is synchronized to prevent reace with {@link #failCurrentChain(TransactionChain)}.
+ *
+ * @return New Empty ReadWrite transaction, which continues this chain or starts new transaction
+ * chain.
+ */
+ private synchronized ReadWriteTransaction newEmptyTransaction() {
+ try {
+ if(txChain == null) {
+ // Chain was broken so we need to replace it.
+ txChain = dataBroker.createTransactionChain(this);
+ }
+ return txChain.newReadWriteTransaction();
+ } catch (final IllegalStateException e) {
+ LOG.debug("Chain is broken, need to allocate new transaction chain.",e);
+ /*
+ * Chain was broken by previous transaction,
+ * but there was race between this.
+ * Chain will be closed by #onTransactionChainFailed method.
+ */
+ txChain = dataBroker.createTransactionChain(this);
+ return txChain.newReadWriteTransaction();
+ }
+ }
+
+ /**
+ * Creates customized not-submitted transaction, which is ready to be submitted.
+ *
+ * @param opsToApply Operations which are used to customize transaction.
+ * @return Non-empty transaction.
+ */
+ private ReadWriteTransaction createCustomizedTransaction(final ArrayList opsToApply) {
+ final ReadWriteTransaction tx = newEmptyTransaction();
+ for(final InventoryOperation op : opsToApply) {
+ op.applyOperation(tx);
+ }
+ return tx;
+ }
+
+ private synchronized void failCurrentChain(final TransactionChain, ?> chain) {
+ if(txChain == chain) {
+ txChain = null;
+ }
+ }
+
@Override
public void onTransactionChainFailed(final TransactionChain, ?> chain, final AsyncTransaction, ?> transaction,
final Throwable cause) {
LOG.error("Failed to export Flow Capable Inventory, Transaction {} failed.", transaction.getIdentifier(), cause);
-
+ chain.close();
+ if(txChain == chain) {
+ // Current chain is broken, so we will null it, in order to not use it.
+ failCurrentChain(chain);
+ }
}
@Override
public void onTransactionChainSuccessful(final TransactionChain, ?> chain) {
// NOOP
}
+
+ @Override
+ public void close() throws InterruptedException {
+ LOG.info("Flow Capable Inventory Provider stopped.");
+ if (this.listenerRegistration != null) {
+ try {
+ this.listenerRegistration.close();
+ } catch (final Exception e) {
+ LOG.error("Failed to stop inventory provider", e);
+ }
+ listenerRegistration = null;
+ }
+
+ if (thread != null) {
+ thread.interrupt();
+ thread.join();
+ thread = null;
+ }
+ if (txChain != null) {
+ try {
+ txChain.close();
+ } catch (final IllegalStateException e) {
+ // It is possible chain failed and was closed by #onTransactionChainFailed
+ LOG.debug("Chain was already closed.");
+ }
+ txChain = null;
+ }
+ }
}
diff --git a/opendaylight/md-sal/md-sal-config/pom.xml b/opendaylight/md-sal/md-sal-config/pom.xml
index 2e19b5a60c..bd1586054d 100644
--- a/opendaylight/md-sal/md-sal-config/pom.xml
+++ b/opendaylight/md-sal/md-sal-config/pom.xml
@@ -12,7 +12,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmd-sal-configConfiguration files for md-sal
diff --git a/opendaylight/md-sal/model/model-flow-base/pom.xml b/opendaylight/md-sal/model/model-flow-base/pom.xml
index eb8d6a8ddb..cad0e9ea93 100644
--- a/opendaylight/md-sal/model/model-flow-base/pom.xml
+++ b/opendaylight/md-sal/model/model-flow-base/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controller.modelmodel-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmodel-flow-basebundle
diff --git a/opendaylight/md-sal/model/model-flow-service/pom.xml b/opendaylight/md-sal/model/model-flow-service/pom.xml
index 0842bb4505..0f735d7f43 100644
--- a/opendaylight/md-sal/model/model-flow-service/pom.xml
+++ b/opendaylight/md-sal/model/model-flow-service/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controller.modelmodel-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmodel-flow-servicebundle
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang
index 5a40022963..fc0eb4cf72 100644
--- a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang
+++ b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang
@@ -236,13 +236,17 @@ module flow-node-inventory {
}
augment "/inv:nodes/inv:node/table" {
- ext:augment-identifier "flow-cookie-mapping";
- list flow-cookie-map {
- key "cookie";
- leaf cookie {
- type flow:flow-cookie;
+ ext:augment-identifier "flow-hash-id-mapping";
+ description "Flow is identified by match and priority on device. So Operational/DS
+ has to simulate that behavior and contract between FlowId and match+priority
+ identification should represent Flow hashCode. Flow has to contain only
+ match priority and flowCookie for create a hashCode";
+ list flow-hash-id-map {
+ key "hash";
+ leaf hash {
+ type string;
}
- leaf-list flow-ids {
+ leaf flow-id {
type flow-id;
}
}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang
new file mode 100644
index 0000000000..98c3228190
--- /dev/null
+++ b/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang
@@ -0,0 +1,39 @@
+module node-config {
+ namespace "urn:opendaylight:module:config";
+ prefix node-config;
+
+ import flow-capable-transaction {prefix tr;}
+ import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
+
+ revision "2014-10-15" {
+ description "Initial revision of node configuration service";
+ }
+
+ grouping node-ref {
+ uses "inv:node-context-ref";
+ }
+
+
+
+ /** Base configuration structure **/
+ grouping node-config {
+ leaf flag {
+ type string;
+ description "Switch config flag. Expected values FRAGNORMAL, OFPCFRAGDROP, OFPCFRAGREASM, OFPCFRAGMASK";
+ }
+ leaf miss-search-length{
+ type uint16;
+ }
+ }
+
+ rpc set-config {
+ input {
+ uses node-config;
+ uses tr:transaction-aware;
+ uses node-ref;
+ }
+ output {
+ uses tr:transaction-aware;
+ }
+ }
+}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/pom.xml b/opendaylight/md-sal/model/model-flow-statistics/pom.xml
index cd26e32781..7a53f062d7 100644
--- a/opendaylight/md-sal/model/model-flow-statistics/pom.xml
+++ b/opendaylight/md-sal/model/model-flow-statistics/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controller.modelmodel-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmodel-flow-statisticsbundle
diff --git a/opendaylight/md-sal/model/model-inventory/pom.xml b/opendaylight/md-sal/model/model-inventory/pom.xml
index c2f4f70c40..00aa7761b9 100644
--- a/opendaylight/md-sal/model/model-inventory/pom.xml
+++ b/opendaylight/md-sal/model/model-inventory/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controller.modelmodel-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmodel-inventorybundle
diff --git a/opendaylight/md-sal/model/model-topology/pom.xml b/opendaylight/md-sal/model/model-topology/pom.xml
index e87e4f180d..09a063e887 100644
--- a/opendaylight/md-sal/model/model-topology/pom.xml
+++ b/opendaylight/md-sal/model/model-topology/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controller.modelmodel-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTmodel-topologybundle
diff --git a/opendaylight/md-sal/model/pom.xml b/opendaylight/md-sal/model/pom.xml
index 5e6a86745c..3f389f3298 100644
--- a/opendaylight/md-sal/model/pom.xml
+++ b/opendaylight/md-sal/model/pom.xml
@@ -6,7 +6,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTorg.opendaylight.controller.modelmodel-parent
diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml
index 71a0de9939..1f646f2bba 100644
--- a/opendaylight/md-sal/pom.xml
+++ b/opendaylight/md-sal/pom.xml
@@ -5,12 +5,12 @@
org.opendaylight.controllercommons.opendaylight
- 1.4.2-SNAPSHOT
+ 1.5.0-SNAPSHOT../commons/opendaylightsal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTpom
@@ -77,6 +77,7 @@
sal-dom-xsql
+ sal-karaf-xsqlsal-dom-xsql-config
diff --git a/opendaylight/md-sal/sal-akka-raft/pom.xml b/opendaylight/md-sal/sal-akka-raft/pom.xml
index e68e781525..53353cded1 100644
--- a/opendaylight/md-sal/sal-akka-raft/pom.xml
+++ b/opendaylight/md-sal/sal-akka-raft/pom.xml
@@ -4,7 +4,7 @@
org.opendaylight.controllersal-parent
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTsal-akka-raftbundle
@@ -13,7 +13,7 @@
org.opendaylight.controllersal-clustering-commons
- 1.1-SNAPSHOT
+ 1.2.0-SNAPSHOTcom.google.guava
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
index c4ff108611..97b912ef74 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
@@ -11,8 +11,10 @@ package org.opendaylight.controller.cluster.example;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.japi.Creator;
+
import com.google.common.base.Optional;
import com.google.protobuf.ByteString;
+
import org.opendaylight.controller.cluster.example.messages.KeyValue;
import org.opendaylight.controller.cluster.example.messages.KeyValueSaved;
import org.opendaylight.controller.cluster.example.messages.PrintRole;
@@ -67,11 +69,15 @@ public class ExampleActor extends RaftActor {
}
} else if (message instanceof PrintState) {
- LOG.debug("State of the node:{} has entries={}, {}",
- getId(), state.size(), getReplicatedLogState());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("State of the node:{} has entries={}, {}",
+ getId(), state.size(), getReplicatedLogState());
+ }
} else if (message instanceof PrintRole) {
- LOG.debug("{} = {}, Peers={}", getId(), getRaftState(),getPeers());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("{} = {}, Peers={}", getId(), getRaftState(), getPeers());
+ }
} else {
super.onReceiveCommand(message);
@@ -94,7 +100,7 @@ public class ExampleActor extends RaftActor {
try {
bs = fromObject(state);
} catch (Exception e) {
- LOG.error("Exception in creating snapshot", e);
+ LOG.error(e, "Exception in creating snapshot");
}
getSelf().tell(new CaptureSnapshotReply(bs), null);
}
@@ -104,9 +110,11 @@ public class ExampleActor extends RaftActor {
try {
state.putAll((HashMap) toObject(snapshot));
} catch (Exception e) {
- LOG.error("Exception in applying snapshot", e);
+ LOG.error(e, "Exception in applying snapshot");
+ }
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Snapshot applied to state : {}", ((HashMap) state).size());
}
- LOG.debug("Snapshot applied to state :" + ((HashMap) state).size());
}
private ByteString fromObject(Object snapshot) throws Exception {
@@ -159,4 +167,24 @@ public class ExampleActor extends RaftActor {
@Override public String persistenceId() {
return getId();
}
+
+ @Override
+ protected void startLogRecoveryBatch(int maxBatchSize) {
+ }
+
+ @Override
+ protected void appendRecoveredLogEntry(Payload data) {
+ }
+
+ @Override
+ protected void applyCurrentLogRecoveryBatch() {
+ }
+
+ @Override
+ protected void onRecoveryComplete() {
+ }
+
+ @Override
+ protected void applyRecoverySnapshot(ByteString snapshot) {
+ }
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java
index 978ea91089..cb51a8951a 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java
@@ -7,7 +7,6 @@ import org.opendaylight.controller.cluster.example.messages.PrintRole;
import org.opendaylight.controller.cluster.example.messages.PrintState;
import org.opendaylight.controller.cluster.raft.ConfigParams;
import org.opendaylight.controller.cluster.raft.client.messages.AddRaftPeer;
-import org.opendaylight.controller.cluster.raft.client.messages.RemoveRaftPeer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -196,11 +195,6 @@ public class TestDriver {
actorSystem.stop(actorRef);
actorRefs.remove(actorName);
-
- for (ActorRef actor : actorRefs.values()) {
- actor.tell(new RemoveRaftPeer(actorName), null);
- }
-
allPeers.remove(actorName);
}
@@ -209,11 +203,6 @@ public class TestDriver {
allPeers.put(actorName, address);
ActorRef exampleActor = createExampleActor(actorName);
-
- for (ActorRef actor : actorRefs.values()) {
- actor.tell(new AddRaftPeer(actorName, address), null);
- }
-
actorRefs.put(actorName, exampleActor);
addClientsToNode(actorName, 1);
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
index b436bce500..2be4a0c36f 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
@@ -18,13 +18,14 @@ import java.util.List;
*/
public abstract class AbstractReplicatedLogImpl implements ReplicatedLog {
- protected List journal;
+ // We define this as ArrayList so we can use ensureCapacity.
+ protected ArrayList journal;
protected ByteString snapshot;
protected long snapshotIndex = -1;
protected long snapshotTerm = -1;
// to be used for rollback during save snapshot failure
- protected List snapshottedJournal;
+ protected ArrayList snapshottedJournal;
protected ByteString previousSnapshot;
protected long previousSnapshotIndex = -1;
protected long previousSnapshotTerm = -1;
@@ -106,6 +107,11 @@ public abstract class AbstractReplicatedLogImpl implements ReplicatedLog {
journal.add(replicatedLogEntry);
}
+ @Override
+ public void increaseJournalLogCapacity(int amount) {
+ journal.ensureCapacity(journal.size() + amount);
+ }
+
@Override
public List getFrom(long logEntryIndex) {
return getFrom(logEntryIndex, journal.size());
@@ -208,7 +214,6 @@ public abstract class AbstractReplicatedLogImpl implements ReplicatedLog {
@Override
public void snapshotCommit() {
- snapshottedJournal.clear();
snapshottedJournal = null;
previousSnapshotIndex = -1;
previousSnapshotTerm = -1;
@@ -218,7 +223,6 @@ public abstract class AbstractReplicatedLogImpl implements ReplicatedLog {
@Override
public void snapshotRollback() {
snapshottedJournal.addAll(journal);
- journal.clear();
journal = snapshottedJournal;
snapshottedJournal = null;
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java
index ed6439d8c3..bff2a27797 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java
@@ -26,7 +26,7 @@ public interface ConfigParams {
*
* @return long
*/
- public long getSnapshotBatchCount();
+ long getSnapshotBatchCount();
/**
* The interval at which a heart beat message will be sent to the remote
@@ -34,7 +34,7 @@ public interface ConfigParams {
*
* @return FiniteDuration
*/
- public FiniteDuration getHeartBeatInterval();
+ FiniteDuration getHeartBeatInterval();
/**
* The interval in which a new election would get triggered if no leader is found
@@ -43,7 +43,7 @@ public interface ConfigParams {
*
* @return FiniteDuration
*/
- public FiniteDuration getElectionTimeOutInterval();
+ FiniteDuration getElectionTimeOutInterval();
/**
* The maximum election time variance. The election is scheduled using both
@@ -51,10 +51,15 @@ public interface ConfigParams {
*
* @return int
*/
- public int getElectionTimeVariance();
+ int getElectionTimeVariance();
/**
* The size (in bytes) of the snapshot chunk sent from Leader
*/
- public int getSnapshotChunkSize();
+ int getSnapshotChunkSize();
+
+ /**
+ * The number of journal log entries to batch on recovery before applying.
+ */
+ int getJournalRecoveryLogBatchSize();
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
index 9d06f63604..dc4145358a 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
@@ -20,12 +20,14 @@ public class DefaultConfigParamsImpl implements ConfigParams {
private static final int SNAPSHOT_BATCH_COUNT = 20000;
+ private static final int JOURNAL_RECOVERY_LOG_BATCH_SIZE = 1000;
+
/**
* The maximum election time variance
*/
private static final int ELECTION_TIME_MAX_VARIANCE = 100;
- private final int SNAPSHOT_CHUNK_SIZE = 2048 * 1000; //2MB
+ private static final int SNAPSHOT_CHUNK_SIZE = 2048 * 1000; //2MB
/**
@@ -39,17 +41,32 @@ public class DefaultConfigParamsImpl implements ConfigParams {
new FiniteDuration(100, TimeUnit.MILLISECONDS);
+ private FiniteDuration heartBeatInterval = HEART_BEAT_INTERVAL;
+ private long snapshotBatchCount = SNAPSHOT_BATCH_COUNT;
+ private int journalRecoveryLogBatchSize = JOURNAL_RECOVERY_LOG_BATCH_SIZE;
+
+ public void setHeartBeatInterval(FiniteDuration heartBeatInterval) {
+ this.heartBeatInterval = heartBeatInterval;
+ }
+
+ public void setSnapshotBatchCount(long snapshotBatchCount) {
+ this.snapshotBatchCount = snapshotBatchCount;
+ }
+
+ public void setJournalRecoveryLogBatchSize(int journalRecoveryLogBatchSize) {
+ this.journalRecoveryLogBatchSize = journalRecoveryLogBatchSize;
+ }
+
@Override
public long getSnapshotBatchCount() {
- return SNAPSHOT_BATCH_COUNT;
+ return snapshotBatchCount;
}
@Override
public FiniteDuration getHeartBeatInterval() {
- return HEART_BEAT_INTERVAL;
+ return heartBeatInterval;
}
-
@Override
public FiniteDuration getElectionTimeOutInterval() {
// returns 2 times the heart beat interval
@@ -65,4 +82,9 @@ public class DefaultConfigParamsImpl implements ConfigParams {
public int getSnapshotChunkSize() {
return SNAPSHOT_CHUNK_SIZE;
}
+
+ @Override
+ public int getJournalRecoveryLogBatchSize() {
+ return journalRecoveryLogBatchSize;
+ }
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
index 190f1bd409..66a46ef3bd 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
@@ -20,16 +20,16 @@ import akka.persistence.SnapshotOffer;
import akka.persistence.SnapshotSelectionCriteria;
import akka.persistence.UntypedPersistentActor;
import com.google.common.base.Optional;
+import com.google.common.base.Stopwatch;
import com.google.protobuf.ByteString;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot;
import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshotReply;
import org.opendaylight.controller.cluster.raft.base.messages.Replicate;
import org.opendaylight.controller.cluster.raft.base.messages.SendHeartBeat;
-import org.opendaylight.controller.cluster.raft.behaviors.Candidate;
import org.opendaylight.controller.cluster.raft.behaviors.Follower;
-import org.opendaylight.controller.cluster.raft.behaviors.Leader;
import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
import org.opendaylight.controller.cluster.raft.client.messages.AddRaftPeer;
import org.opendaylight.controller.cluster.raft.client.messages.FindLeader;
@@ -38,7 +38,6 @@ import org.opendaylight.controller.cluster.raft.client.messages.RemoveRaftPeer;
import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages;
-
import java.io.Serializable;
import java.util.Map;
@@ -96,7 +95,7 @@ public abstract class RaftActor extends UntypedPersistentActor {
* This context should NOT be passed directly to any other actor it is
* only to be consumed by the RaftActorBehaviors
*/
- private RaftActorContext context;
+ private final RaftActorContext context;
/**
* The in-memory journal
@@ -107,6 +106,10 @@ public abstract class RaftActor extends UntypedPersistentActor {
private volatile boolean hasSnapshotCaptureInitiated = false;
+ private Stopwatch recoveryTimer;
+
+ private int currentRecoveryBatchCount;
+
public RaftActor(String id, Map peerAddresses) {
this(id, peerAddresses, Optional.absent());
}
@@ -121,71 +124,169 @@ public abstract class RaftActor extends UntypedPersistentActor {
LOG);
}
- @Override public void onReceiveRecover(Object message) {
- if (message instanceof SnapshotOffer) {
- LOG.info("SnapshotOffer called..");
- SnapshotOffer offer = (SnapshotOffer) message;
- Snapshot snapshot = (Snapshot) offer.snapshot();
-
- // Create a replicated log with the snapshot information
- // The replicated log can be used later on to retrieve this snapshot
- // when we need to install it on a peer
- replicatedLog = new ReplicatedLogImpl(snapshot);
-
- context.setReplicatedLog(replicatedLog);
- context.setLastApplied(snapshot.getLastAppliedIndex());
-
- LOG.info("Applied snapshot to replicatedLog. " +
- "snapshotIndex={}, snapshotTerm={}, journal-size={}",
- replicatedLog.snapshotIndex, replicatedLog.snapshotTerm,
- replicatedLog.size()
- );
+ private void initRecoveryTimer() {
+ if(recoveryTimer == null) {
+ recoveryTimer = new Stopwatch();
+ recoveryTimer.start();
+ }
+ }
- // Apply the snapshot to the actors state
- applySnapshot(ByteString.copyFrom(snapshot.getState()));
+ @Override
+ public void preStart() throws Exception {
+ LOG.info("Starting recovery for {} with journal batch size {}", persistenceId(),
+ context.getConfigParams().getJournalRecoveryLogBatchSize());
+ super.preStart();
+ }
+ @Override
+ public void onReceiveRecover(Object message) {
+ if (message instanceof SnapshotOffer) {
+ onRecoveredSnapshot((SnapshotOffer)message);
} else if (message instanceof ReplicatedLogEntry) {
- ReplicatedLogEntry logEntry = (ReplicatedLogEntry) message;
-
- // Apply State immediately
- replicatedLog.append(logEntry);
- applyState(null, "recovery", logEntry.getData());
- context.setLastApplied(logEntry.getIndex());
- context.setCommitIndex(logEntry.getIndex());
+ onRecoveredJournalLogEntry((ReplicatedLogEntry)message);
+ } else if (message instanceof ApplyLogEntries) {
+ onRecoveredApplyLogEntries((ApplyLogEntries)message);
} else if (message instanceof DeleteEntries) {
replicatedLog.removeFrom(((DeleteEntries) message).getFromIndex());
} else if (message instanceof UpdateElectionTerm) {
- context.getTermInformation().update(((UpdateElectionTerm) message).getCurrentTerm(), ((UpdateElectionTerm) message).getVotedFor());
+ context.getTermInformation().update(((UpdateElectionTerm) message).getCurrentTerm(),
+ ((UpdateElectionTerm) message).getVotedFor());
} else if (message instanceof RecoveryCompleted) {
- LOG.debug(
- "RecoveryCompleted - Switching actor to Follower - " +
- "Persistence Id = " + persistenceId() +
- " Last index in log:{}, snapshotIndex={}, snapshotTerm={}, " +
- "journal-size={}",
- replicatedLog.lastIndex(), replicatedLog.snapshotIndex,
- replicatedLog.snapshotTerm, replicatedLog.size());
- currentBehavior = switchBehavior(RaftState.Follower);
- onStateChanged();
+ onRecoveryCompletedMessage();
}
}
+ private void onRecoveredSnapshot(SnapshotOffer offer) {
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("SnapshotOffer called..");
+ }
+
+ initRecoveryTimer();
+
+ Snapshot snapshot = (Snapshot) offer.snapshot();
+
+ // Create a replicated log with the snapshot information
+ // The replicated log can be used later on to retrieve this snapshot
+ // when we need to install it on a peer
+ replicatedLog = new ReplicatedLogImpl(snapshot);
+
+ context.setReplicatedLog(replicatedLog);
+ context.setLastApplied(snapshot.getLastAppliedIndex());
+ context.setCommitIndex(snapshot.getLastAppliedIndex());
+
+ Stopwatch timer = new Stopwatch();
+ timer.start();
+
+ // Apply the snapshot to the actors state
+ applyRecoverySnapshot(ByteString.copyFrom(snapshot.getState()));
+
+ timer.stop();
+ LOG.info("Recovery snapshot applied for {} in {}: snapshotIndex={}, snapshotTerm={}, journal-size=" +
+ replicatedLog.size(), persistenceId(), timer.toString(),
+ replicatedLog.snapshotIndex, replicatedLog.snapshotTerm);
+ }
+
+ private void onRecoveredJournalLogEntry(ReplicatedLogEntry logEntry) {
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Received ReplicatedLogEntry for recovery: {}", logEntry.getIndex());
+ }
+
+ replicatedLog.append(logEntry);
+ }
+
+ private void onRecoveredApplyLogEntries(ApplyLogEntries ale) {
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Received ApplyLogEntries for recovery, applying to state: {} to {}",
+ context.getLastApplied() + 1, ale.getToIndex());
+ }
+
+ for (long i = context.getLastApplied() + 1; i <= ale.getToIndex(); i++) {
+ batchRecoveredLogEntry(replicatedLog.get(i));
+ }
+
+ context.setLastApplied(ale.getToIndex());
+ context.setCommitIndex(ale.getToIndex());
+ }
+
+ private void batchRecoveredLogEntry(ReplicatedLogEntry logEntry) {
+ initRecoveryTimer();
+
+ int batchSize = context.getConfigParams().getJournalRecoveryLogBatchSize();
+ if(currentRecoveryBatchCount == 0) {
+ startLogRecoveryBatch(batchSize);
+ }
+
+ appendRecoveredLogEntry(logEntry.getData());
+
+ if(++currentRecoveryBatchCount >= batchSize) {
+ endCurrentLogRecoveryBatch();
+ }
+ }
+
+ private void endCurrentLogRecoveryBatch() {
+ applyCurrentLogRecoveryBatch();
+ currentRecoveryBatchCount = 0;
+ }
+
+ private void onRecoveryCompletedMessage() {
+ if(currentRecoveryBatchCount > 0) {
+ endCurrentLogRecoveryBatch();
+ }
+
+ onRecoveryComplete();
+
+ String recoveryTime = "";
+ if(recoveryTimer != null) {
+ recoveryTimer.stop();
+ recoveryTime = " in " + recoveryTimer.toString();
+ recoveryTimer = null;
+ }
+
+ LOG.info(
+ "Recovery completed" + recoveryTime + " - Switching actor to Follower - " +
+ "Persistence Id = " + persistenceId() +
+ " Last index in log={}, snapshotIndex={}, snapshotTerm={}, " +
+ "journal-size={}",
+ replicatedLog.lastIndex(), replicatedLog.snapshotIndex,
+ replicatedLog.snapshotTerm, replicatedLog.size());
+
+ currentBehavior = new Follower(context);
+ onStateChanged();
+ }
+
@Override public void onReceiveCommand(Object message) {
if (message instanceof ApplyState){
ApplyState applyState = (ApplyState) message;
- LOG.debug("Applying state for log index {} data {}",
- applyState.getReplicatedLogEntry().getIndex(),
- applyState.getReplicatedLogEntry().getData());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Applying state for log index {} data {}",
+ applyState.getReplicatedLogEntry().getIndex(),
+ applyState.getReplicatedLogEntry().getData());
+ }
applyState(applyState.getClientActor(), applyState.getIdentifier(),
applyState.getReplicatedLogEntry().getData());
+ } else if (message instanceof ApplyLogEntries){
+ ApplyLogEntries ale = (ApplyLogEntries) message;
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Persisting ApplyLogEntries with index={}", ale.getToIndex());
+ }
+ persist(new ApplyLogEntries(ale.getToIndex()), new Procedure() {
+ @Override
+ public void apply(ApplyLogEntries param) throws Exception {
+ }
+ });
+
} else if(message instanceof ApplySnapshot ) {
Snapshot snapshot = ((ApplySnapshot) message).getSnapshot();
- LOG.debug("ApplySnapshot called on Follower Actor " +
- "snapshotIndex:{}, snapshotTerm:{}", snapshot.getLastAppliedIndex(),
- snapshot.getLastAppliedTerm());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("ApplySnapshot called on Follower Actor " +
+ "snapshotIndex:{}, snapshotTerm:{}", snapshot.getLastAppliedIndex(),
+ snapshot.getLastAppliedTerm()
+ );
+ }
applySnapshot(ByteString.copyFrom(snapshot.getState()));
//clears the followers log, sets the snapshot index to ensure adjusted-index works
@@ -253,13 +354,14 @@ public abstract class RaftActor extends UntypedPersistentActor {
} else {
if (!(message instanceof AppendEntriesMessages.AppendEntries)
&& !(message instanceof AppendEntriesReply) && !(message instanceof SendHeartBeat)) {
- LOG.debug("onReceiveCommand: message:" + message.getClass());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("onReceiveCommand: message: {}", message.getClass());
+ }
}
- RaftState state =
- currentBehavior.handleMessage(getSender(), message);
RaftActorBehavior oldBehavior = currentBehavior;
- currentBehavior = switchBehavior(state);
+ currentBehavior = currentBehavior.handleMessage(getSender(), message);
+
if(oldBehavior != currentBehavior){
onStateChanged();
}
@@ -294,7 +396,9 @@ public abstract class RaftActor extends UntypedPersistentActor {
context.getReplicatedLog().lastIndex() + 1,
context.getTermInformation().getCurrentTerm(), data);
- LOG.debug("Persist data {}", replicatedLogEntry);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Persist data {}", replicatedLogEntry);
+ }
replicatedLog
.appendAndPersist(clientActor, identifier, replicatedLogEntry);
@@ -359,6 +463,10 @@ public abstract class RaftActor extends UntypedPersistentActor {
return context.getLastApplied();
}
+ protected RaftActorContext getRaftActorContext() {
+ return context;
+ }
+
/**
* setPeerAddress sets the address of a known peer at a later time.
*
@@ -399,6 +507,38 @@ public abstract class RaftActor extends UntypedPersistentActor {
protected abstract void applyState(ActorRef clientActor, String identifier,
Object data);
+ /**
+ * This method is called during recovery at the start of a batch of state entries. Derived
+ * classes should perform any initialization needed to start a batch.
+ */
+ protected abstract void startLogRecoveryBatch(int maxBatchSize);
+
+ /**
+ * This method is called during recovery to append state data to the current batch. This method
+ * is called 1 or more times after {@link #startRecoveryStateBatch}.
+ *
+ * @param data the state data
+ */
+ protected abstract void appendRecoveredLogEntry(Payload data);
+
+ /**
+ * This method is called during recovery to reconstruct the state of the actor.
+ *
+ * @param snapshot A snapshot of the state of the actor
+ */
+ protected abstract void applyRecoverySnapshot(ByteString snapshot);
+
+ /**
+ * This method is called during recovery at the end of a batch to apply the current batched
+ * log entries. This method is called after {@link #appendRecoveryLogEntry}.
+ */
+ protected abstract void applyCurrentLogRecoveryBatch();
+
+ /**
+ * This method is called when recovery is complete.
+ */
+ protected abstract void onRecoveryComplete();
+
/**
* This method will be called by the RaftActor when a snapshot needs to be
* created. The derived actor should respond with its current state.
@@ -411,10 +551,7 @@ public abstract class RaftActor extends UntypedPersistentActor {
protected abstract void createSnapshot();
/**
- * This method will be called by the RaftActor during recovery to
- * reconstruct the state of the actor.
- *
- * This method may also be called at any other point during normal
+ * This method can be called at any other point during normal
* operations when the derived actor is out of sync with it's peers
* and the only way to bring it in sync is by applying a snapshot
*
@@ -431,38 +568,6 @@ public abstract class RaftActor extends UntypedPersistentActor {
protected void onLeaderChanged(String oldLeader, String newLeader){};
- private RaftActorBehavior switchBehavior(RaftState state) {
- if (currentBehavior != null) {
- if (currentBehavior.state() == state) {
- return currentBehavior;
- }
- LOG.info("Switching from state " + currentBehavior.state() + " to "
- + state);
-
- try {
- currentBehavior.close();
- } catch (Exception e) {
- LOG.error(e,
- "Failed to close behavior : " + currentBehavior.state());
- }
-
- } else {
- LOG.info("Switching behavior to " + state);
- }
- RaftActorBehavior behavior = null;
- if (state == RaftState.Candidate) {
- behavior = new Candidate(context);
- } else if (state == RaftState.Follower) {
- behavior = new Follower(context);
- } else {
- behavior = new Leader(context);
- }
-
-
-
- return behavior;
- }
-
private void trimPersistentData(long sequenceNumber) {
// Trim akka snapshots
// FIXME : Not sure how exactly the SnapshotSelectionCriteria is applied
@@ -483,8 +588,10 @@ public abstract class RaftActor extends UntypedPersistentActor {
return null;
}
String peerAddress = context.getPeerAddress(leaderId);
- LOG.debug("getLeaderAddress leaderId = " + leaderId + " peerAddress = "
- + peerAddress);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("getLeaderAddress leaderId = {} peerAddress = {}",
+ leaderId, peerAddress);
+ }
return peerAddress;
}
@@ -557,8 +664,11 @@ public abstract class RaftActor extends UntypedPersistentActor {
public void appendAndPersist(final ActorRef clientActor,
final String identifier,
final ReplicatedLogEntry replicatedLogEntry) {
- context.getLogger().debug(
- "Append log entry and persist {} ", replicatedLogEntry);
+
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Append log entry and persist {} ", replicatedLogEntry);
+ }
+
// FIXME : By adding the replicated log entry to the in-memory journal we are not truly ensuring durability of the logs
journal.add(replicatedLogEntry);
@@ -569,6 +679,7 @@ public abstract class RaftActor extends UntypedPersistentActor {
// of a single command.
persist(replicatedLogEntry,
new Procedure() {
+ @Override
public void apply(ReplicatedLogEntry evt) throws Exception {
// when a snaphsot is being taken, captureSnapshot != null
if (hasSnapshotCaptureInitiated == false &&
@@ -584,10 +695,13 @@ public abstract class RaftActor extends UntypedPersistentActor {
lastAppliedTerm = lastAppliedEntry.getTerm();
}
- LOG.debug("Snapshot Capture logSize: {}", journal.size());
- LOG.debug("Snapshot Capture lastApplied:{} ", context.getLastApplied());
- LOG.debug("Snapshot Capture lastAppliedIndex:{}", lastAppliedIndex);
- LOG.debug("Snapshot Capture lastAppliedTerm:{}", lastAppliedTerm);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Snapshot Capture logSize: {}", journal.size());
+ LOG.debug("Snapshot Capture lastApplied:{} ",
+ context.getLastApplied());
+ LOG.debug("Snapshot Capture lastAppliedIndex:{}", lastAppliedIndex);
+ LOG.debug("Snapshot Capture lastAppliedTerm:{}", lastAppliedTerm);
+ }
// send a CaptureSnapshot to self to make the expensive operation async.
getSelf().tell(new CaptureSnapshot(
@@ -630,17 +744,20 @@ public abstract class RaftActor extends UntypedPersistentActor {
private long currentTerm = 0;
private String votedFor = null;
+ @Override
public long getCurrentTerm() {
return currentTerm;
}
+ @Override
public String getVotedFor() {
return votedFor;
}
@Override public void update(long currentTerm, String votedFor) {
- LOG.debug("Set currentTerm={}, votedFor={}", currentTerm, votedFor);
-
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Set currentTerm={}, votedFor={}", currentTerm, votedFor);
+ }
this.currentTerm = currentTerm;
this.votedFor = votedFor;
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java
index 25da37105c..e4aef0a844 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java
@@ -59,26 +59,32 @@ public class RaftActorContextImpl implements RaftActorContext {
this.LOG = logger;
}
+ @Override
public ActorRef actorOf(Props props){
return context.actorOf(props);
}
+ @Override
public ActorSelection actorSelection(String path){
return context.actorSelection(path);
}
+ @Override
public String getId() {
return id;
}
+ @Override
public ActorRef getActor() {
return actor;
}
+ @Override
public ElectionTerm getTermInformation() {
return termInformation;
}
+ @Override
public long getCommitIndex() {
return commitIndex;
}
@@ -87,6 +93,7 @@ public class RaftActorContextImpl implements RaftActorContext {
this.commitIndex = commitIndex;
}
+ @Override
public long getLastApplied() {
return lastApplied;
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java
index c17f5448c6..85893333c2 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java
@@ -74,6 +74,13 @@ public interface ReplicatedLog {
*/
void append(ReplicatedLogEntry replicatedLogEntry);
+ /**
+ * Optimization method to increase the capacity of the journal log prior to appending entries.
+ *
+ * @param amount the amount to increase by
+ */
+ void increaseJournalLogCapacity(int amount);
+
/**
*
* @param replicatedLogEntry
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java
new file mode 100644
index 0000000000..af3c4fd87d
--- /dev/null
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014 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.controller.cluster.raft.base.messages;
+
+import java.io.Serializable;
+
+/**
+ * ApplyLogEntries serves as a message which is stored in the akka's persistent
+ * journal.
+ * During recovery if this message is found, then all in-mem journal entries from
+ * context.lastApplied to ApplyLogEntries.toIndex are applied to the state
+ *
+ * This class is also used as a internal message sent from Behaviour to
+ * RaftActor to persist the ApplyLogEntries
+ *
+ */
+public class ApplyLogEntries implements Serializable {
+ private final int toIndex;
+
+ public ApplyLogEntries(int toIndex) {
+ this.toIndex = toIndex;
+ }
+
+ public int getToIndex() {
+ return toIndex;
+ }
+}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
index 86447509d7..eed74bba82 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
@@ -10,11 +10,12 @@ package org.opendaylight.controller.cluster.raft.behaviors;
import akka.actor.ActorRef;
import akka.actor.Cancellable;
+import akka.event.LoggingAdapter;
import org.opendaylight.controller.cluster.raft.ClientRequestTracker;
import org.opendaylight.controller.cluster.raft.RaftActorContext;
-import org.opendaylight.controller.cluster.raft.RaftState;
import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
import org.opendaylight.controller.cluster.raft.SerializationUtils;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
@@ -43,6 +44,11 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
*/
protected final RaftActorContext context;
+ /**
+ *
+ */
+ protected final LoggingAdapter LOG;
+
/**
*
*/
@@ -56,6 +62,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
protected AbstractRaftActorBehavior(RaftActorContext context) {
this.context = context;
+ this.LOG = context.getLogger();
}
/**
@@ -70,7 +77,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
* @param appendEntries The AppendEntries message
* @return
*/
- protected abstract RaftState handleAppendEntries(ActorRef sender,
+ protected abstract RaftActorBehavior handleAppendEntries(ActorRef sender,
AppendEntries appendEntries);
@@ -82,19 +89,21 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
* @param appendEntries
* @return
*/
- protected RaftState appendEntries(ActorRef sender,
+ protected RaftActorBehavior appendEntries(ActorRef sender,
AppendEntries appendEntries) {
// 1. Reply false if term < currentTerm (§5.1)
if (appendEntries.getTerm() < currentTerm()) {
- context.getLogger().debug(
- "Cannot append entries because sender term " + appendEntries
- .getTerm() + " is less than " + currentTerm());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Cannot append entries because sender term {} is less than {}",
+ appendEntries.getTerm(), currentTerm());
+ }
+
sender.tell(
new AppendEntriesReply(context.getId(), currentTerm(), false,
lastIndex(), lastTerm()), actor()
);
- return state();
+ return this;
}
@@ -113,7 +122,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
* @param appendEntriesReply The AppendEntriesReply message
* @return
*/
- protected abstract RaftState handleAppendEntriesReply(ActorRef sender,
+ protected abstract RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
AppendEntriesReply appendEntriesReply);
/**
@@ -124,11 +133,12 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
* @param requestVote
* @return
*/
- protected RaftState requestVote(ActorRef sender,
+ protected RaftActorBehavior requestVote(ActorRef sender,
RequestVote requestVote) {
-
- context.getLogger().debug(requestVote.toString());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(requestVote.toString());
+ }
boolean grantVote = false;
@@ -166,7 +176,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
sender.tell(new RequestVoteReply(currentTerm(), grantVote), actor());
- return state();
+ return this;
}
/**
@@ -181,7 +191,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
* @param requestVoteReply The RequestVoteReply message
* @return
*/
- protected abstract RaftState handleRequestVoteReply(ActorRef sender,
+ protected abstract RaftActorBehavior handleRequestVoteReply(ActorRef sender,
RequestVoteReply requestVoteReply);
/**
@@ -272,6 +282,17 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
return null;
}
+ /**
+ * Find the client request tracker for a specific logIndex
+ *
+ * @param logIndex
+ * @return
+ */
+ protected ClientRequestTracker removeClientRequestTracker(long logIndex) {
+ return null;
+ }
+
+
/**
* Find the log index from the previous to last entry in the log
*
@@ -311,7 +332,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
i < index + 1; i++) {
ActorRef clientActor = null;
String identifier = null;
- ClientRequestTracker tracker = findClientRequestTracker(i);
+ ClientRequestTracker tracker = removeClientRequestTracker(i);
if (tracker != null) {
clientActor = tracker.getClientActor();
@@ -329,13 +350,21 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
} else {
//if one index is not present in the log, no point in looping
// around as the rest wont be present either
- context.getLogger().warning(
- "Missing index {} from log. Cannot apply state. Ignoring {} to {}", i, i, index );
+ LOG.warning(
+ "Missing index {} from log. Cannot apply state. Ignoring {} to {}", i, i, index);
break;
}
}
- context.getLogger().debug("Setting last applied to {}", newLastApplied);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Setting last applied to {}", newLastApplied);
+ }
context.setLastApplied(newLastApplied);
+
+ // send a message to persist a ApplyLogEntries marker message into akka's persistent journal
+ // will be used during recovery
+ //in case if the above code throws an error and this message is not sent, it would be fine
+ // as the append entries received later would initiate add this message to the journal
+ actor().tell(new ApplyLogEntries((int) context.getLastApplied()), actor());
}
protected Object fromSerializableMessage(Object serializable){
@@ -343,7 +372,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
}
@Override
- public RaftState handleMessage(ActorRef sender, Object message) {
+ public RaftActorBehavior handleMessage(ActorRef sender, Object message) {
if (message instanceof AppendEntries) {
return appendEntries(sender, (AppendEntries) message);
} else if (message instanceof AppendEntriesReply) {
@@ -353,10 +382,21 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
} else if (message instanceof RequestVoteReply) {
return handleRequestVoteReply(sender, (RequestVoteReply) message);
}
- return state();
+ return this;
}
@Override public String getLeaderId() {
return leaderId;
}
+
+ protected RaftActorBehavior switchBehavior(RaftActorBehavior behavior) {
+ LOG.info("Switching from behavior {} to {}", this.state(), behavior.state());
+ try {
+ close();
+ } catch (Exception e) {
+ LOG.error(e, "Failed to close behavior : {}", this.state());
+ }
+
+ return behavior;
+ }
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
index bb1927ef23..4a3e2c5d66 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
@@ -52,7 +52,9 @@ public class Candidate extends AbstractRaftActorBehavior {
peers = context.getPeerAddresses().keySet();
- context.getLogger().debug("Election:Candidate has following peers:"+ peers);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Election:Candidate has following peers: {}", peers);
+ }
if(peers.size() > 0) {
// Votes are required from a majority of the peers including self.
@@ -78,21 +80,23 @@ public class Candidate extends AbstractRaftActorBehavior {
scheduleElection(electionDuration());
}
- @Override protected RaftState handleAppendEntries(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntries(ActorRef sender,
AppendEntries appendEntries) {
- context.getLogger().debug(appendEntries.toString());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(appendEntries.toString());
+ }
- return state();
+ return this;
}
- @Override protected RaftState handleAppendEntriesReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
AppendEntriesReply appendEntriesReply) {
- return state();
+ return this;
}
- @Override protected RaftState handleRequestVoteReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleRequestVoteReply(ActorRef sender,
RequestVoteReply requestVoteReply) {
if (requestVoteReply.isVoteGranted()) {
@@ -100,10 +104,10 @@ public class Candidate extends AbstractRaftActorBehavior {
}
if (voteCount >= votesRequired) {
- return RaftState.Leader;
+ return switchBehavior(new Leader(context));
}
- return state();
+ return this;
}
@Override public RaftState state() {
@@ -111,7 +115,7 @@ public class Candidate extends AbstractRaftActorBehavior {
}
@Override
- public RaftState handleMessage(ActorRef sender, Object originalMessage) {
+ public RaftActorBehavior handleMessage(ActorRef sender, Object originalMessage) {
Object message = fromSerializableMessage(originalMessage);
@@ -119,14 +123,17 @@ public class Candidate extends AbstractRaftActorBehavior {
RaftRPC rpc = (RaftRPC) message;
- context.getLogger().debug("RaftRPC message received {} my term is {}", rpc.toString(), context.getTermInformation().getCurrentTerm());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("RaftRPC message received {} my term is {}", rpc, context.getTermInformation().getCurrentTerm());
+ }
// If RPC request or response contains term T > currentTerm:
// set currentTerm = T, convert to follower (§5.1)
// This applies to all RPC messages and responses
if (rpc.getTerm() > context.getTermInformation().getCurrentTerm()) {
context.getTermInformation().updateAndPersist(rpc.getTerm(), null);
- return RaftState.Follower;
+
+ return switchBehavior(new Follower(context));
}
}
@@ -137,11 +144,12 @@ public class Candidate extends AbstractRaftActorBehavior {
// ourselves the leader. This gives enough time for a leader
// who we do not know about (as a peer)
// to send a message to the candidate
- return RaftState.Leader;
+
+ return switchBehavior(new Leader(context));
}
startNewTerm();
scheduleElection(electionDuration());
- return state();
+ return this;
}
return super.handleMessage(sender, message);
@@ -159,7 +167,9 @@ public class Candidate extends AbstractRaftActorBehavior {
context.getTermInformation().updateAndPersist(currentTerm + 1,
context.getId());
- context.getLogger().debug("Starting new term " + (currentTerm + 1));
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Starting new term {}", (currentTerm + 1));
+ }
// Request for a vote
// TODO: Retry request for vote if replies do not arrive in a reasonable
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
index 610fdc987f..7ada8b31c5 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
@@ -44,12 +44,13 @@ public class Follower extends AbstractRaftActorBehavior {
scheduleElection(electionDuration());
}
- @Override protected RaftState handleAppendEntries(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntries(ActorRef sender,
AppendEntries appendEntries) {
if(appendEntries.getEntries() != null && appendEntries.getEntries().size() > 0) {
- context.getLogger()
- .debug(appendEntries.toString());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(appendEntries.toString());
+ }
}
// TODO : Refactor this method into a bunch of smaller methods
@@ -79,9 +80,10 @@ public class Follower extends AbstractRaftActorBehavior {
// an entry at prevLogIndex and this follower has no entries in
// it's log.
- context.getLogger().debug(
- "The followers log is empty and the senders prevLogIndex is {}",
- appendEntries.getPrevLogIndex());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("The followers log is empty and the senders prevLogIndex is {}",
+ appendEntries.getPrevLogIndex());
+ }
} else if (lastIndex() > -1
&& appendEntries.getPrevLogIndex() != -1
@@ -90,9 +92,10 @@ public class Follower extends AbstractRaftActorBehavior {
// The follower's log is out of sync because the Leader's
// prevLogIndex entry was not found in it's log
- context.getLogger().debug(
- "The log is not empty but the prevLogIndex {} was not found in it",
- appendEntries.getPrevLogIndex());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("The log is not empty but the prevLogIndex {} was not found in it",
+ appendEntries.getPrevLogIndex());
+ }
} else if (lastIndex() > -1
&& previousEntry != null
@@ -102,10 +105,12 @@ public class Follower extends AbstractRaftActorBehavior {
// prevLogIndex entry does exist in the follower's log but it has
// a different term in it
- context.getLogger().debug(
- "Cannot append entries because previous entry term {} is not equal to append entries prevLogTerm {}"
- , previousEntry.getTerm()
- , appendEntries.getPrevLogTerm());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(
+ "Cannot append entries because previous entry term {} is not equal to append entries prevLogTerm {}"
+ , previousEntry.getTerm()
+ , appendEntries.getPrevLogTerm());
+ }
} else {
outOfSync = false;
}
@@ -113,22 +118,26 @@ public class Follower extends AbstractRaftActorBehavior {
if (outOfSync) {
// We found that the log was out of sync so just send a negative
// reply and return
- context.getLogger().debug("Follower is out-of-sync, " +
- "so sending negative reply, lastIndex():{}, lastTerm():{}",
- lastIndex(), lastTerm());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Follower is out-of-sync, " +
+ "so sending negative reply, lastIndex():{}, lastTerm():{}",
+ lastIndex(), lastTerm()
+ );
+ }
sender.tell(
new AppendEntriesReply(context.getId(), currentTerm(), false,
lastIndex(), lastTerm()), actor()
);
- return state();
+ return this;
}
if (appendEntries.getEntries() != null
&& appendEntries.getEntries().size() > 0) {
- context.getLogger().debug(
- "Number of entries to be appended = " + appendEntries
- .getEntries().size()
- );
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(
+ "Number of entries to be appended = {}", appendEntries.getEntries().size()
+ );
+ }
// 3. If an existing entry conflicts with a new one (same index
// but different terms), delete the existing entry and all that
@@ -151,10 +160,11 @@ public class Follower extends AbstractRaftActorBehavior {
continue;
}
- context.getLogger().debug(
- "Removing entries from log starting at "
- + matchEntry.getIndex()
- );
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(
+ "Removing entries from log starting at {}", matchEntry.getIndex()
+ );
+ }
// Entries do not match so remove all subsequent entries
context.getReplicatedLog()
@@ -163,26 +173,24 @@ public class Follower extends AbstractRaftActorBehavior {
}
}
- context.getLogger().debug(
- "After cleanup entries to be added from = " + (addEntriesFrom
- + lastIndex())
- );
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("After cleanup entries to be added from = {}", (addEntriesFrom + lastIndex())
+ );
+ }
// 4. Append any new entries not already in the log
for (int i = addEntriesFrom;
i < appendEntries.getEntries().size(); i++) {
- context.getLogger().info(
- "Append entry to log " + appendEntries.getEntries().get(
- i).getData()
- .toString()
- );
- context.getReplicatedLog()
- .appendAndPersist(appendEntries.getEntries().get(i));
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Append entry to log {}", appendEntries.getEntries().get(i).getData());
+ }
+ context.getReplicatedLog().appendAndPersist(appendEntries.getEntries().get(i));
}
- context.getLogger().debug(
- "Log size is now " + context.getReplicatedLog().size());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Log size is now {}", context.getReplicatedLog().size());
+ }
}
@@ -195,8 +203,9 @@ public class Follower extends AbstractRaftActorBehavior {
context.getReplicatedLog().lastIndex()));
if (prevCommitIndex != context.getCommitIndex()) {
- context.getLogger()
- .debug("Commit index set to " + context.getCommitIndex());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Commit index set to {}", context.getCommitIndex());
+ }
}
// If commitIndex > lastApplied: increment lastApplied, apply
@@ -204,34 +213,38 @@ public class Follower extends AbstractRaftActorBehavior {
// check if there are any entries to be applied. last-applied can be equal to last-index
if (appendEntries.getLeaderCommit() > context.getLastApplied() &&
context.getLastApplied() < lastIndex()) {
- context.getLogger().debug("applyLogToStateMachine, " +
- "appendEntries.getLeaderCommit():{}," +
- "context.getLastApplied():{}, lastIndex():{}",
- appendEntries.getLeaderCommit(), context.getLastApplied(), lastIndex());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("applyLogToStateMachine, " +
+ "appendEntries.getLeaderCommit():{}," +
+ "context.getLastApplied():{}, lastIndex():{}",
+ appendEntries.getLeaderCommit(), context.getLastApplied(), lastIndex()
+ );
+ }
+
applyLogToStateMachine(appendEntries.getLeaderCommit());
}
sender.tell(new AppendEntriesReply(context.getId(), currentTerm(), true,
lastIndex(), lastTerm()), actor());
- return state();
+ return this;
}
- @Override protected RaftState handleAppendEntriesReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
AppendEntriesReply appendEntriesReply) {
- return state();
+ return this;
}
- @Override protected RaftState handleRequestVoteReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleRequestVoteReply(ActorRef sender,
RequestVoteReply requestVoteReply) {
- return state();
+ return this;
}
@Override public RaftState state() {
return RaftState.Follower;
}
- @Override public RaftState handleMessage(ActorRef sender, Object originalMessage) {
+ @Override public RaftActorBehavior handleMessage(ActorRef sender, Object originalMessage) {
Object message = fromSerializableMessage(originalMessage);
@@ -246,7 +259,7 @@ public class Follower extends AbstractRaftActorBehavior {
}
if (message instanceof ElectionTimeout) {
- return RaftState.Candidate;
+ return switchBehavior(new Candidate(context));
} else if (message instanceof InstallSnapshot) {
InstallSnapshot installSnapshot = (InstallSnapshot) message;
@@ -259,17 +272,23 @@ public class Follower extends AbstractRaftActorBehavior {
}
private void handleInstallSnapshot(ActorRef sender, InstallSnapshot installSnapshot) {
- context.getLogger().debug("InstallSnapshot received by follower " +
- "datasize:{} , Chunk:{}/{}", installSnapshot.getData().size(),
- installSnapshot.getChunkIndex(), installSnapshot.getTotalChunks());
+
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("InstallSnapshot received by follower " +
+ "datasize:{} , Chunk:{}/{}", installSnapshot.getData().size(),
+ installSnapshot.getChunkIndex(), installSnapshot.getTotalChunks()
+ );
+ }
try {
if (installSnapshot.getChunkIndex() == installSnapshot.getTotalChunks()) {
// this is the last chunk, create a snapshot object and apply
snapshotChunksCollected = snapshotChunksCollected.concat(installSnapshot.getData());
- context.getLogger().debug("Last chunk received: snapshotChunksCollected.size:{}",
- snapshotChunksCollected.size());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Last chunk received: snapshotChunksCollected.size:{}",
+ snapshotChunksCollected.size());
+ }
Snapshot snapshot = Snapshot.create(snapshotChunksCollected.toByteArray(),
new ArrayList(),
@@ -283,8 +302,11 @@ public class Follower extends AbstractRaftActorBehavior {
} else {
// we have more to go
snapshotChunksCollected = snapshotChunksCollected.concat(installSnapshot.getData());
- context.getLogger().debug("Chunk={},snapshotChunksCollected.size:{}",
- installSnapshot.getChunkIndex(), snapshotChunksCollected.size());
+
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Chunk={},snapshotChunksCollected.size:{}",
+ installSnapshot.getChunkIndex(), snapshotChunksCollected.size());
+ }
}
sender.tell(new InstallSnapshotReply(
@@ -292,7 +314,7 @@ public class Follower extends AbstractRaftActorBehavior {
true), actor());
} catch (Exception e) {
- context.getLogger().error("Exception in InstallSnapshot of follower", e);
+ LOG.error(e, "Exception in InstallSnapshot of follower:");
//send reply with success as false. The chunk will be sent again on failure
sender.tell(new InstallSnapshotReply(currentTerm(), context.getId(),
installSnapshot.getChunkIndex(), false), actor());
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java
index 90948ffef7..9edba85865 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java
@@ -83,22 +83,20 @@ public class Leader extends AbstractRaftActorBehavior {
public Leader(RaftActorContext context) {
super(context);
- if (lastIndex() >= 0) {
- context.setCommitIndex(lastIndex());
- }
-
followers = context.getPeerAddresses().keySet();
for (String followerId : followers) {
FollowerLogInformation followerLogInformation =
new FollowerLogInformationImpl(followerId,
- new AtomicLong(lastIndex()),
+ new AtomicLong(context.getCommitIndex()),
new AtomicLong(-1));
followerToLog.put(followerId, followerLogInformation);
}
- context.getLogger().debug("Election:Leader has following peers:"+ followers);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Election:Leader has following peers: {}", followers);
+ }
if (followers.size() > 0) {
minReplicationCount = (followers.size() + 1) / 2 + 1;
@@ -120,20 +118,23 @@ public class Leader extends AbstractRaftActorBehavior {
}
- @Override protected RaftState handleAppendEntries(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntries(ActorRef sender,
AppendEntries appendEntries) {
- context.getLogger().debug(appendEntries.toString());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(appendEntries.toString());
+ }
- return state();
+ return this;
}
- @Override protected RaftState handleAppendEntriesReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
AppendEntriesReply appendEntriesReply) {
if(! appendEntriesReply.isSuccess()) {
- context.getLogger()
- .debug(appendEntriesReply.toString());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug(appendEntriesReply.toString());
+ }
}
// Update the FollowerLogInformation
@@ -142,8 +143,8 @@ public class Leader extends AbstractRaftActorBehavior {
followerToLog.get(followerId);
if(followerLogInformation == null){
- context.getLogger().error("Unknown follower {}", followerId);
- return state();
+ LOG.error("Unknown follower {}", followerId);
+ return this;
}
if (appendEntriesReply.isSuccess()) {
@@ -193,7 +194,17 @@ public class Leader extends AbstractRaftActorBehavior {
applyLogToStateMachine(context.getCommitIndex());
}
- return state();
+ return this;
+ }
+
+ protected ClientRequestTracker removeClientRequestTracker(long logIndex) {
+
+ ClientRequestTracker toRemove = findClientRequestTracker(logIndex);
+ if(toRemove != null) {
+ trackerList.remove(toRemove);
+ }
+
+ return toRemove;
}
protected ClientRequestTracker findClientRequestTracker(long logIndex) {
@@ -206,16 +217,16 @@ public class Leader extends AbstractRaftActorBehavior {
return null;
}
- @Override protected RaftState handleRequestVoteReply(ActorRef sender,
+ @Override protected RaftActorBehavior handleRequestVoteReply(ActorRef sender,
RequestVoteReply requestVoteReply) {
- return state();
+ return this;
}
@Override public RaftState state() {
return RaftState.Leader;
}
- @Override public RaftState handleMessage(ActorRef sender, Object originalMessage) {
+ @Override public RaftActorBehavior handleMessage(ActorRef sender, Object originalMessage) {
Preconditions.checkNotNull(sender, "sender should not be null");
Object message = fromSerializableMessage(originalMessage);
@@ -227,13 +238,15 @@ public class Leader extends AbstractRaftActorBehavior {
// This applies to all RPC messages and responses
if (rpc.getTerm() > context.getTermInformation().getCurrentTerm()) {
context.getTermInformation().updateAndPersist(rpc.getTerm(), null);
- return RaftState.Follower;
+
+ return switchBehavior(new Follower(context));
}
}
try {
if (message instanceof SendHeartBeat) {
- return sendHeartBeat();
+ sendHeartBeat();
+ return this;
} else if(message instanceof SendInstallSnapshot) {
installSnapshotIfNeeded();
} else if (message instanceof Replicate) {
@@ -260,10 +273,13 @@ public class Leader extends AbstractRaftActorBehavior {
if (reply.isSuccess()) {
if(followerToSnapshot.isLastChunk(reply.getChunkIndex())) {
//this was the last chunk reply
- context.getLogger().debug("InstallSnapshotReply received, " +
- "last chunk received, Chunk:{}. Follower:{} Setting nextIndex:{}",
- reply.getChunkIndex(), followerId,
- context.getReplicatedLog().getSnapshotIndex() + 1);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("InstallSnapshotReply received, " +
+ "last chunk received, Chunk:{}. Follower:{} Setting nextIndex:{}",
+ reply.getChunkIndex(), followerId,
+ context.getReplicatedLog().getSnapshotIndex() + 1
+ );
+ }
FollowerLogInformation followerLogInformation =
followerToLog.get(followerId);
@@ -272,31 +288,38 @@ public class Leader extends AbstractRaftActorBehavior {
followerLogInformation.setNextIndex(
context.getReplicatedLog().getSnapshotIndex() + 1);
mapFollowerToSnapshot.remove(followerId);
- context.getLogger().debug("followerToLog.get(followerId).getNextIndex().get()=" +
- followerToLog.get(followerId).getNextIndex().get());
+
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("followerToLog.get(followerId).getNextIndex().get()=" +
+ followerToLog.get(followerId).getNextIndex().get());
+ }
} else {
followerToSnapshot.markSendStatus(true);
}
} else {
- context.getLogger().info("InstallSnapshotReply received, " +
- "sending snapshot chunk failed, Will retry, Chunk:{}",
- reply.getChunkIndex());
+ LOG.info("InstallSnapshotReply received, " +
+ "sending snapshot chunk failed, Will retry, Chunk:{}",
+ reply.getChunkIndex()
+ );
followerToSnapshot.markSendStatus(false);
}
} else {
- context.getLogger().error("ERROR!!" +
- "FollowerId in InstallSnapshotReply not known to Leader" +
- " or Chunk Index in InstallSnapshotReply not matching {} != {}",
- followerToSnapshot.getChunkIndex(), reply.getChunkIndex() );
+ LOG.error("ERROR!!" +
+ "FollowerId in InstallSnapshotReply not known to Leader" +
+ " or Chunk Index in InstallSnapshotReply not matching {} != {}",
+ followerToSnapshot.getChunkIndex(), reply.getChunkIndex()
+ );
}
}
private void replicate(Replicate replicate) {
long logIndex = replicate.getReplicatedLogEntry().getIndex();
- context.getLogger().debug("Replicate message " + logIndex);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Replicate message {}", logIndex);
+ }
// Create a tracker entry we will use this later to notify the
// client actor
@@ -350,10 +373,13 @@ public class Leader extends AbstractRaftActorBehavior {
if (followerNextIndex >= 0 && leaderLastIndex >= followerNextIndex ) {
// if the follower is just not starting and leader's index
// is more than followers index
- context.getLogger().debug("SendInstallSnapshot to follower:{}," +
- "follower-nextIndex:{}, leader-snapshot-index:{}, " +
- "leader-last-index:{}", followerId,
- followerNextIndex, leaderSnapShotIndex, leaderLastIndex);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("SendInstallSnapshot to follower:{}," +
+ "follower-nextIndex:{}, leader-snapshot-index:{}, " +
+ "leader-last-index:{}", followerId,
+ followerNextIndex, leaderSnapShotIndex, leaderLastIndex
+ );
+ }
actor().tell(new SendInstallSnapshot(), actor());
} else {
@@ -412,11 +438,11 @@ public class Leader extends AbstractRaftActorBehavior {
).toSerializable(),
actor()
);
- context.getLogger().info("InstallSnapshot sent to follower {}, Chunk: {}/{}",
+ LOG.info("InstallSnapshot sent to follower {}, Chunk: {}/{}",
followerActor.path(), mapFollowerToSnapshot.get(followerId).getChunkIndex(),
mapFollowerToSnapshot.get(followerId).getTotalChunks());
} catch (IOException e) {
- context.getLogger().error("InstallSnapshot failed for Leader.", e);
+ LOG.error(e, "InstallSnapshot failed for Leader.");
}
}
@@ -431,16 +457,17 @@ public class Leader extends AbstractRaftActorBehavior {
mapFollowerToSnapshot.put(followerId, followerToSnapshot);
}
ByteString nextChunk = followerToSnapshot.getNextChunk();
- context.getLogger().debug("Leader's snapshot nextChunk size:{}", nextChunk.size());
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Leader's snapshot nextChunk size:{}", nextChunk.size());
+ }
return nextChunk;
}
- private RaftState sendHeartBeat() {
+ private void sendHeartBeat() {
if (followers.size() > 0) {
sendAppendEntries();
}
- return state();
}
private void stopHeartBeat() {
@@ -526,8 +553,10 @@ public class Leader extends AbstractRaftActorBehavior {
int size = snapshotBytes.size();
totalChunks = ( size / context.getConfigParams().getSnapshotChunkSize()) +
((size % context.getConfigParams().getSnapshotChunkSize()) > 0 ? 1 : 0);
- context.getLogger().debug("Snapshot {} bytes, total chunks to send:{}",
- size, totalChunks);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Snapshot {} bytes, total chunks to send:{}",
+ size, totalChunks);
+ }
}
public ByteString getSnapshotBytes() {
@@ -591,8 +620,10 @@ public class Leader extends AbstractRaftActorBehavior {
}
}
- context.getLogger().debug("length={}, offset={},size={}",
- snapshotLength, start, size);
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("length={}, offset={},size={}",
+ snapshotLength, start, size);
+ }
return getSnapshotBytes().substring(start, start + size);
}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java
index ca2d916ecf..064cd8b88c 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java
@@ -25,17 +25,18 @@ import org.opendaylight.controller.cluster.raft.RaftState;
* differently.
*/
public interface RaftActorBehavior extends AutoCloseable{
+
/**
* Handle a message. If the processing of the message warrants a state
- * change then a new state should be returned otherwise this method should
- * return the state for the current behavior.
+ * change then a new behavior should be returned otherwise this method should
+ * return the current behavior.
*
* @param sender The sender of the message
* @param message A message that needs to be processed
*
- * @return The new state or self (this)
+ * @return The new behavior or current behavior
*/
- RaftState handleMessage(ActorRef sender, Object message);
+ RaftActorBehavior handleMessage(ActorRef sender, Object message);
/**
* The state associated with a given behavior
diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
index ca34a34ca4..0d5f644b3d 100644
--- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
+++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
@@ -200,6 +200,10 @@ public class MockRaftActorContext implements RaftActorContext {
public static class MockPayload extends Payload implements Serializable {
private String value = "";
+ public MockPayload(){
+
+ }
+
public MockPayload(String s) {
this.value = s;
}
@@ -251,4 +255,24 @@ public class MockRaftActorContext implements RaftActorContext {
return index;
}
}
+
+ public static class MockReplicatedLogBuilder {
+ private ReplicatedLog mockLog = new SimpleReplicatedLog();
+
+ public MockReplicatedLogBuilder createEntries(int start, int end, int term) {
+ for (int i=start; i peerAddresses) {
- super(id, peerAddresses);
+ public static final class MockRaftActorCreator implements Creator {
+ private final Map peerAddresses;
+ private final String id;
+ private final Optional config;
+
+ private MockRaftActorCreator(Map peerAddresses, String id,
+ Optional config) {
+ this.peerAddresses = peerAddresses;
+ this.id = id;
+ this.config = config;
+ }
+
+ @Override
+ public MockRaftActor create() throws Exception {
+ return new MockRaftActor(id, peerAddresses, config);
+ }
}
- public static Props props(final String id, final Map peerAddresses){
- return Props.create(new Creator(){
+ private final CountDownLatch recoveryComplete = new CountDownLatch(1);
+ private final List