From: Ed Warnicke Date: Mon, 21 Apr 2014 21:35:07 +0000 (+0000) Subject: Merge "Bug 509: Improve logging in InMemoryDataStore." X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~192 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=b23703bef6c3aaafe2dc83608a03b738ad42f945;hp=481d8d9e4d9a12754eea1f3271d424cb6bb45fa2 Merge "Bug 509: Improve logging in InMemoryDataStore." --- diff --git a/opendaylight/appauth/pom.xml b/opendaylight/appauth/pom.xml index 30879c6565..f07c855877 100644 --- a/opendaylight/appauth/pom.xml +++ b/opendaylight/appauth/pom.xml @@ -7,62 +7,57 @@ 1.4.2-SNAPSHOT ../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - appauth 0.4.2-SNAPSHOT bundle - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.opendaylight.controller.configuration, + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + usermanager + + + + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.opendaylight.controller.configuration, org.opendaylight.controller.containermanager, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.utils, org.opendaylight.controller.usermanager, org.slf4j, - org.apache.felix.dm, - - - org.opendaylight.controller.appauth, - org.opendaylight.controller.appauth.authorization - - - - - - - - - - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - usermanager - - + org.apache.felix.dm, + org.opendaylight.controller.appauth, + org.opendaylight.controller.appauth.authorization + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/arphandler/pom.xml b/opendaylight/arphandler/pom.xml index d7d185e725..8d62c1da4b 100644 --- a/opendaylight/arphandler/pom.xml +++ b/opendaylight/arphandler/pom.xml @@ -7,15 +7,43 @@ 1.4.2-SNAPSHOT ../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - arphandler 0.5.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -26,8 +54,7 @@ true - - org.opendaylight.controller.sal.packet.address, + org.opendaylight.controller.sal.packet.address, org.opendaylight.controller.connectionmanager, org.opendaylight.controller.sal.connection, org.opendaylight.controller.sal.core, @@ -41,52 +68,19 @@ org.opendaylight.controller.hosttracker.hostAware, org.apache.felix.dm, org.osgi.service.component, - org.slf4j - - - org.opendaylight.controller.arphandler - - - org.opendaylight.controller.arphandler.internal.Activator - + org.slf4j + org.opendaylight.controller.arphandler + org.opendaylight.controller.arphandler.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/clustering/integrationtest/pom.xml b/opendaylight/clustering/integrationtest/pom.xml index 069f197ada..62c182c3b9 100644 --- a/opendaylight/clustering/integrationtest/pom.xml +++ b/opendaylight/clustering/integrationtest/pom.xml @@ -7,28 +7,39 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - clustering.services.integrationtest 0.4.2-SNAPSHOT + + ../implementation/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + - org.opendaylight.controller - clustering.services + ch.qos.logback + logback-classic - org.opendaylight.controller - sal + ch.qos.logback + logback-core + + + eclipselink + javax.resource + + + junit + junit + + + org.apache.felix + org.apache.felix.dependencymanager.shell org.opendaylight.controller - sal.implementation + clustering.services org.opendaylight.controller @@ -42,74 +53,49 @@ org.opendaylight.controller containermanager.it.implementation - - junit - junit + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.implementation - org.ops4j.pax.exam - pax-exam-container-native - test - - - org.ops4j.pax.exam - pax-exam-junit4 - test - - - org.ops4j.pax.exam - pax-exam-link-mvn - test - - - org.ops4j.pax.url - pax-url-aether - test - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - org.apache.felix - org.apache.felix.dependencymanager.shell - - - eclipselink - javax.resource - + org.slf4j + log4j-over-slf4j + + + org.ops4j.pax.exam + pax-exam-container-native + test + + + org.ops4j.pax.exam + pax-exam-junit4 + test + + + org.ops4j.pax.exam + pax-exam-link-mvn + test + + + org.ops4j.pax.url + pax-url-aether + test + - - - ../implementation/target/jacoco.exec - ../implementation/target/jacoco-it.exec - - - - - org.jacoco - jacoco-maven-plugin - 0.5.3.201107060350 - - - org.jacoco jacoco-maven-plugin - ${jacoco.version} ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -128,4 +114,10 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/clustering/services/pom.xml b/opendaylight/clustering/services/pom.xml index fedb8d4dbe..3806421df8 100644 --- a/opendaylight/clustering/services/pom.xml +++ b/opendaylight/clustering/services/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - clustering.services 0.5.1-SNAPSHOT @@ -34,16 +28,18 @@ true - - org.opendaylight.controller.clustering.services - - - javax.transaction - + org.opendaylight.controller.clustering.services + javax.transaction ${project.basedir}/META-INF + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/clustering/services_implementation/pom.xml b/opendaylight/clustering/services_implementation/pom.xml index 1b72630b8c..4acfae0d29 100644 --- a/opendaylight/clustering/services_implementation/pom.xml +++ b/opendaylight/clustering/services_implementation/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - clustering.services-implementation 0.4.3-SNAPSHOT @@ -23,6 +17,38 @@ target/jacoco.exec target/jacoco-it.exec + + + equinoxSDK381 + org.apache.felix.gogo.runtime + + + junit + junit + + + org.infinispan + infinispan-core + 6.0.2.Final + + + org.jboss.jbossts.jta + narayana-jta + 4.17.7.Final + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + commons.logback_settings + + + org.opendaylight.controller + sal + + @@ -41,8 +67,7 @@ true - - org.slf4j, + org.slf4j, !org.apache.logging.log4j.*, !bsh*, !net.jcip.*, @@ -52,11 +77,8 @@ javax.transaction, *, org.opendaylight.controller.clustering.services, - org.opendaylight.controller.sal.core - - - org.opendaylight.controller.clustering.services_implementation.internal.Activator - + org.opendaylight.controller.sal.core + org.opendaylight.controller.clustering.services_implementation.internal.Activator @@ -64,41 +86,13 @@ - - * - - - infinispan-core,infinispan-commons,jgroups,jboss-marshalling-river,jboss-marshalling,jboss-logging,staxmapper,narayana-jta;type=!pom;inline=false - - - true - + * + infinispan-core,infinispan-commons,jgroups,jboss-marshalling-river,jboss-marshalling,jboss-logging,staxmapper,narayana-jta;type=!pom;inline=false + true ${project.basedir}/META-INF - - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - - org.apache.maven.plugins maven-enforcer-plugin @@ -125,38 +119,36 @@ + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + - - - org.infinispan - infinispan-core - 6.0.2.Final - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - org.jboss.jbossts.jta - narayana-jta - 4.17.7.Final - - - equinoxSDK381 - org.apache.felix.gogo.runtime - - - junit - junit - - - org.opendaylight.controller - commons.logback_settings - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/clustering/stub/pom.xml b/opendaylight/clustering/stub/pom.xml index 2f0ac1d9a0..7a0c1378b6 100644 --- a/opendaylight/clustering/stub/pom.xml +++ b/opendaylight/clustering/stub/pom.xml @@ -7,16 +7,24 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - clustering.stub 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + sal + + @@ -27,34 +35,22 @@ true - - javax.transaction, + javax.transaction, org.apache.felix.dm, org.slf4j, org.opendaylight.controller.clustering.services, - org.opendaylight.controller.sal.core - - - org.opendaylight.controller.clustering.stub.internal.Activator - + org.opendaylight.controller.sal.core + org.opendaylight.controller.clustering.stub.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/clustering/test/pom.xml b/opendaylight/clustering/test/pom.xml index ca0fc83bea..02a231b78c 100644 --- a/opendaylight/clustering/test/pom.xml +++ b/opendaylight/clustering/test/pom.xml @@ -7,83 +7,46 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - clustering.test 0.4.2-SNAPSHOT bundle - - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.slf4j, - javax.transaction, - org.eclipse.osgi.framework.console, - ch.qos.logback.classic, - org.opendaylight.controller.clustering.services, - org.opendaylight.controller.sal.core, - org.apache.felix.dm - - - org.opendaylight.controller.clustering.test.internal - - - org.opendaylight.controller.clustering.test.internal.Activator - - - ${project.basedir}/META-INF - - - - - org.opendaylight.controller - clustering.services + ch.qos.logback + logback-classic - org.opendaylight.controller - sal + ch.qos.logback + logback-core equinoxSDK381 - org.eclipse.osgi.services + org.apache.felix.gogo.command equinoxSDK381 - org.eclipse.osgi + org.apache.felix.gogo.runtime equinoxSDK381 - org.apache.felix.gogo.command + org.apache.felix.gogo.shell equinoxSDK381 - org.apache.felix.gogo.runtime + org.eclipse.osgi equinoxSDK381 - org.apache.felix.gogo.shell + org.eclipse.osgi.services - ch.qos.logback - logback-core + org.opendaylight.controller + clustering.services - ch.qos.logback - logback-classic + org.opendaylight.controller + sal junit @@ -91,4 +54,35 @@ test + + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.slf4j, + javax.transaction, + org.eclipse.osgi.framework.console, + ch.qos.logback.classic, + org.opendaylight.controller.clustering.services, + org.opendaylight.controller.sal.core, + org.apache.felix.dm + org.opendaylight.controller.clustering.test.internal + org.opendaylight.controller.clustering.test.internal.Activator + + ${project.basedir}/META-INF + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/commons/concepts/pom.xml b/opendaylight/commons/concepts/pom.xml index 6113fcce47..de263cb41f 100644 --- a/opendaylight/commons/concepts/pom.xml +++ b/opendaylight/commons/concepts/pom.xml @@ -7,16 +7,16 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - concepts 0.5.2-SNAPSHOT bundle + + + junit + junit + + @@ -27,9 +27,7 @@ true - - org.opendaylight.controller.concepts.transform - + org.opendaylight.controller.concepts.transform ${project.basedir}/META-INF @@ -38,6 +36,10 @@ org.apache.maven.plugins maven-checkstyle-plugin ${checkstyle.version} + + true + controller/checkstyle.xml + org.opendaylight.controller @@ -45,17 +47,13 @@ 0.0.3-SNAPSHOT - - true - controller/checkstyle.xml - - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/commons/httpclient/pom.xml b/opendaylight/commons/httpclient/pom.xml index c078884ccf..f068fded4e 100644 --- a/opendaylight/commons/httpclient/pom.xml +++ b/opendaylight/commons/httpclient/pom.xml @@ -7,16 +7,31 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - commons.httpclient 0.1.2-SNAPSHOT bundle + + + commons-logging + commons-logging + 1.1.3 + + + junit + junit + + + org.apache.httpcomponents + httpclient + 4.3 + + + org.apache.httpcomponents + httpcore + 4.3 + + @@ -27,8 +42,7 @@ true - - javax.crypto, + javax.crypto, javax.crypto.spec, javax.net, javax.net.ssl, @@ -38,14 +52,9 @@ org.ietf.jgss, !org.apache.commons.codec.*, !org.apache.log, - !org.apache.avalon.framework.* - - - org.opendaylight.controller.commons.httpclient - - - httpclient,httpcore,commons-logging - + !org.apache.avalon.framework.* + org.opendaylight.controller.commons.httpclient + httpclient,httpcore,commons-logging false ${project.basedir}/META-INF @@ -55,6 +64,10 @@ org.apache.maven.plugins maven-checkstyle-plugin ${checkstyle.version} + + true + controller/checkstyle.xml + org.opendaylight.controller @@ -62,32 +75,13 @@ 0.0.3-SNAPSHOT - - true - controller/checkstyle.xml - - - - junit - junit - - - org.apache.httpcomponents - httpclient - 4.3 - - - org.apache.httpcomponents - httpcore - 4.3 - - - commons-logging - commons-logging - 1.1.3 - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/commons/integrationtest/pom.xml b/opendaylight/commons/integrationtest/pom.xml index 5dec7757b2..315611f647 100644 --- a/opendaylight/commons/integrationtest/pom.xml +++ b/opendaylight/commons/integrationtest/pom.xml @@ -7,50 +7,56 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - commons.integrationtest 0.5.2-SNAPSHOT pom + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + equinoxSDK381 - org.eclipse.equinox.console + org.apache.felix.gogo.command equinoxSDK381 - org.eclipse.equinox.util + org.apache.felix.gogo.runtime equinoxSDK381 - org.eclipse.osgi.services + org.apache.felix.gogo.shell equinoxSDK381 - org.eclipse.equinox.ds + org.eclipse.equinox.console equinoxSDK381 - org.apache.felix.gogo.command + org.eclipse.equinox.ds equinoxSDK381 - org.apache.felix.gogo.runtime + org.eclipse.equinox.util equinoxSDK381 - org.apache.felix.gogo.shell + org.eclipse.osgi.services junit junit + + org.slf4j + log4j-over-slf4j + org.ops4j.pax.exam @@ -67,57 +73,32 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.version} - - true - - - - org.ops4j.pax.exam - maven-paxexam-plugin - 1.2.4 - - - generate-config - - generate-depends-file - - - - org.apache.maven.plugins maven-checkstyle-plugin ${checkstyle.version} + + true + controller/checkstyle.xml + org.opendaylight.controller checkstyle 0.0.3-SNAPSHOT - + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} - true - controller/checkstyle.xml + true @@ -140,6 +121,25 @@ + + org.ops4j.pax.exam + maven-paxexam-plugin + 1.2.4 + + + generate-config + + generate-depends-file + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/commons/logback_settings/pom.xml b/opendaylight/commons/logback_settings/pom.xml index 3ea13d0122..11a7ffbd0e 100644 --- a/opendaylight/commons/logback_settings/pom.xml +++ b/opendaylight/commons/logback_settings/pom.xml @@ -1,17 +1,18 @@ + 4.0.0 + + org.opendaylight.controller + commons.parent + 1.0.2-SNAPSHOT + ../parent + commons.logback_settings 0.0.2-SNAPSHOT scm:git:ssh://git.opendaylight.org:29418/controller.git scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - - org.opendaylight.controller - commons.parent - 1.0.2-SNAPSHOT - ../parent - diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index d5d7e8e5c4..406da302aa 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -1,206 +1,192 @@ 4.0.0 - - 3.0 - - commons.opendaylight - 1.4.2-SNAPSHOT - pom org.opendaylight.controller commons.parent 1.0.2-SNAPSHOT ../parent - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + commons.opendaylight + 1.4.2-SNAPSHOT + pom + + 3.0 + - - 1.7 - 1.7 - - http://nexus.opendaylight.org/content - - 1.0-alpha-2 - https://sonar.opendaylight.org/ - dav:http://nexus.opendaylight.org/content/sites/site - 3.2 - 2.6 - UTF-8 - UTF-8 + 0.5.2-SNAPSHOT + 2.3.7 + 0.4.2-SNAPSHOT + 2.10 + 0.5.1-SNAPSHOT + 0.4.3-SNAPSHOT + 0.4.2-SNAPSHOT + 0.1.2-SNAPSHOT + 2.4 + 3.1 2.3.2 - 2.15 - 2.15 - 3.0.0 - 1.5.0 + 0.5.2-SNAPSHOT + 0.2.5-SNAPSHOT + 0.4.3-SNAPSHOT + 0.1.2-SNAPSHOT + 0.5.2-SNAPSHOT + 0.5.2-SNAPSHOT + + 7.0.42 + + 1.3.1 1.26.2 - ${user.name}-private-view - org.openflow.openflowj,net.sf.jung2 - 1.0.9 - 1.7.2 - 2.3.0 - 3.1.3.RELEASE - 3.1.3.RELEASE - 1.2.1 - 1.17 - 3.6.0.RELEASE + 3.0.0 + + + 0000.0002.0035.0-SNAPSHOT + 2.15 + 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT 2.2.0.RELEASE - 1.1.4 - 2.10 - -Xmx1024m -XX:MaxPermSize=256m 14.0.1 - 5.0.0 + 0.5.2-SNAPSHOT + 0.5.2-SNAPSHOT + 0.4.2-SNAPSHOT 2010.09.24.4-SNAPSHOT - 2010.09.24.4-SNAPSHOT 2013.10.21.2-SNAPSHOT - 2013.08.27.4-SNAPSHOT - 2013.09.07.4-SNAPSHOT + 2010.09.24.4-SNAPSHOT + 2.3.0 + 0.6.2.201302030002 + 2.4 + 1.7 + 1.7 3.17.1-GA - 2.3.2 - 3.1 - 0.5.3.201107060350 - 1.3.1 - 2.3.7 + + 1.17 + 1.17 + src/main/yang-gen-config + 1.1.4 4.8.1 - 0.6.2-SNAPSHOT - - 0.4.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.4.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.2.5-SNAPSHOT - 0.2.5-SNAPSHOT + 1.0.9 + 0.4.2-SNAPSHOT + 2.5.1 + + 1.7 + 1.7 1.1-SNAPSHOT - 0.5.2-SNAPSHOT - 0.5.2-SNAPSHOT - 0.7.1-SNAPSHOT - 0.1.2-SNAPSHOT - 0.8.1-SNAPSHOT - 0.0.3-SNAPSHOT - 0.1.2-SNAPSHOT + 1.9.5 + 0.2.5-SNAPSHOT + 4.0.17.Final 0.0.3-SNAPSHOT - 0.1.2-SNAPSHOT - 0.5.2-SNAPSHOT + + http://nexus.opendaylight.org/content + 2013.08.27.4-SNAPSHOT + 5.0.0 + UTF-8 + UTF-8 + 2.6 + + 1.0-alpha-2 0.5.0-SNAPSHOT - 4.0.17.Final - 2.4 - 0.4.2-SNAPSHOT - 0.4.2-SNAPSHOT - 0.6.0-SNAPSHOT - 0.5.1-SNAPSHOT - 0.5.1-SNAPSHOT - 0.4.3-SNAPSHOT - 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT - 0.4.2-SNAPSHOT - 0.4.3-SNAPSHOT - - 1.17 - 7.0.42 + 2.3.2 + 0.1.2-SNAPSHOT + 0.0.3-SNAPSHOT + 0.8.1-SNAPSHOT + src/main/yang-gen-sal + 0.5.2-SNAPSHOT + 0.4.2-SNAPSHOT + dav:http://nexus.opendaylight.org/content/sites/site + 3.2 + 1.7.2 + ${user.name}-private-view + https://sonar.opendaylight.org/ jacoco java - 2.5.1 - 1.7 - 1.7 - - 1.3.1 - 2.4.3 + org.openflow.openflowj,net.sf.jung2 + 1.2.1 + 3.1.3.RELEASE + 3.1.3.RELEASE + 0.5.1-SNAPSHOT + 2.15 + 0.7.1-SNAPSHOT + -Xmx1024m -XX:MaxPermSize=256m + 0.4.2-SNAPSHOT + 1.5.0 + 0.4.2-SNAPSHOT + 3.6.0.RELEASE src/main/xtend-gen - src/main/yang-gen-config - src/main/yang-gen-sal + 2.4.3 + 2013.09.07.4-SNAPSHOT + 0.6.2-SNAPSHOT + - junit - junit - ${junit.version} - test - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.osgi - org.osgi.core - ${osgi.core.version} - provided - - - org.slf4j - slf4j-api - ${slf4j.version} - compile + ${project.groupId} + ietf-netconf-monitoring + ${netconf.version} - org.slf4j - log4j-over-slf4j - ${slf4j.version} + ${project.groupId} + ietf-netconf-monitoring-extension + ${netconf.version} ch.qos.logback - logback-core + logback-classic ${logback.version} ch.qos.logback - logback-classic + logback-core ${logback.version} - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + - + com.fasterxml.jackson.jaxrs jackson-jaxrs-base ${jackson.version} - + - + com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson.version} - + - + com.fasterxml.jackson.module jackson-module-jaxb-annotations ${jackson.version} - - + - org.codehaus.jettison - jettison - 1.3.3 + com.google.code.findbugs + jsr305 + 2.0.1 + + + com.google.code.gson + gson + 2.2.4 com.google.guava @@ -208,64 +194,60 @@ ${guava.version} - org.javassist - javassist - ${javassist.version} + com.sun.jersey + jersey-client + ${jersey.version} + - commons-io - commons-io - ${commons.io.version} + com.sun.jersey + jersey-core + ${jersey.version} + + + com.sun.jersey + jersey-server + ${jersey.version} commons-codec commons-codec 1.7 - - org.apache.commons - commons-lang3 - ${commons.lang.version} - commons-fileupload commons-fileupload 1.2.2 - commons-net - commons-net - 3.0.1 - - - equinoxSDK381 - javax.servlet - 3.0.0.v201112011016 + commons-io + commons-io + ${commons.io.version} - equinoxSDK381 - javax.servlet.jsp - 2.2.0.v201112011158 + commons-net + commons-net + 3.0.1 - equinoxSDK381 - org.eclipse.equinox.ds - 1.4.0.v20120522-1841 + eclipselink + javax.persistence + 2.0.4.v201112161009 - equinoxSDK381 - org.eclipse.equinox.util - 1.0.400.v20120522-2049 + eclipselink + javax.resource + 1.5.0.v200906010428 equinoxSDK381 - org.eclipse.osgi.services - 3.3.100.v20120522-1822 + javax.servlet + 3.0.0.v201112011016 equinoxSDK381 - org.eclipse.osgi - 3.8.1.v20120830-144521 + javax.servlet.jsp + 2.2.0.v201112011158 equinoxSDK381 @@ -292,11 +274,31 @@ org.eclipse.equinox.console 1.0.0.v20120522-1841 + + equinoxSDK381 + org.eclipse.equinox.ds + 1.4.0.v20120522-1841 + equinoxSDK381 org.eclipse.equinox.launcher 1.3.0.v20120522-1813 + + equinoxSDK381 + org.eclipse.equinox.util + 1.0.400.v20120522-2049 + + + equinoxSDK381 + org.eclipse.osgi + 3.8.1.v20120830-144521 + + + equinoxSDK381 + org.eclipse.osgi.services + 3.3.100.v20120522-1822 + geminiweb @@ -349,39 +351,36 @@ ${virgo.version} - org.apache.felix - org.apache.felix.dependencymanager - 3.1.0 - - - org.apache.felix - org.apache.felix.dependencymanager.shell - 3.0.1 + io.netty + netty-buffer + ${netty.version} - com.google.code.gson - gson - 2.2.4 + io.netty + netty-codec + ${netty.version} - org.jboss.spec.javax.transaction - jboss-transaction-api_1.1_spec - 1.0.1.Final + io.netty + netty-codec-http + ${netty.version} - org.apache.felix - org.apache.felix.fileinstall - 3.1.6 + io.netty + netty-common + ${netty.version} + + - virgomirror - org.eclipse.jdt.core.compiler.batch - 3.8.0.I20120518-2145 + io.netty + netty-handler + ${netty.version} - eclipselink - javax.persistence - 2.0.4.v201112161009 + io.netty + netty-transport + ${netty.version} orbit @@ -408,6 +407,16 @@ javax.mail.glassfish 1.4.1.v201108011116 + + orbit + javax.servlet.jsp.jstl + 1.2.0.v201105211821 + + + orbit + javax.servlet.jsp.jstl.impl + 1.2.0.v201210211230 + orbit javax.xml.rpc @@ -459,329 +468,307 @@ 7.0.32.v201211201952 - orbit - javax.servlet.jsp.jstl - 1.2.0.v201105211821 + org.aopalliance + com.springsource.org.aopalliance + 1.0.0 - orbit - javax.servlet.jsp.jstl.impl - 1.2.0.v201210211230 + org.apache.commons + commons-lang3 + ${commons.lang.version} - eclipselink - javax.resource - 1.5.0.v200906010428 + org.apache.felix + org.apache.felix.dependencymanager + 3.1.0 - - org.ops4j.pax.exam - pax-exam-container-native - ${exam.version} - test + org.apache.felix + org.apache.felix.dependencymanager.shell + 3.0.1 - org.ops4j.pax.exam - pax-exam-junit4 - ${exam.version} - test + org.apache.felix + org.apache.felix.fileinstall + 3.1.6 + - org.ops4j.pax.exam - pax-exam-link-mvn - ${exam.version} - test + org.apache.felix + org.apache.felix.webconsole + 4.2.0 + + all - org.ops4j.pax.url - pax-url-aether - ${url.version} - test + org.bouncycastle + bcpkix-jdk15on + 1.50 - org.springframework - org.springframework.asm - ${spring.version} + org.bouncycastle + bcprov-jdk15on + 1.50 - org.springframework - org.springframework.aop - ${spring.version} + org.codehaus.enunciate + enunciate-core-annotations + ${enunciate.version} + - org.springframework - org.springframework.context - ${spring.version} + org.codehaus.jettison + jettison + 1.3.3 + + - org.springframework - org.springframework.context.support - ${spring.version} + org.eclipse.equinox.http + servlet + 1.0.0-v20070606 - org.springframework - org.springframework.core - ${spring.version} + org.eclipse.persistence + org.eclipse.persistence.antlr + 2.5.0 - org.springframework - org.springframework.beans - ${spring.version} + org.eclipse.persistence + org.eclipse.persistence.core + 2.5.0 - org.springframework - org.springframework.expression - ${spring.version} + org.eclipse.persistence + org.eclipse.persistence.moxy + 2.5.0 + + - org.springframework - org.springframework.web - ${spring.version} + org.eclipse.xtend + org.eclipse.xtend.lib + ${xtend.version} - org.aopalliance - com.springsource.org.aopalliance - 1.0.0 + org.javassist + javassist + ${javassist.version} - org.springframework - org.springframework.web.servlet - ${spring.version} + org.jboss.spec.javax.transaction + jboss-transaction-api_1.1_spec + 1.0.1.Final - - org.springframework.osgi - spring-osgi-mock - ${spring-osgi.version} - test + org.jolokia + jolokia-osgi + ${jolokia.version} - - - org.springframework.security - spring-security-config - ${spring-security.version} + org.opendaylight.controller + appauth + 0.4.2-SNAPSHOT - org.springframework.security - spring-security-core - ${spring-security.version} + org.opendaylight.controller + arphandler + ${arphandler.version} - org.springframework.security - spring-security-web - ${spring-security.version} + org.opendaylight.controller + bundlescanner + ${bundlescanner.version} - org.springframework.security - spring-security-taglibs - ${spring-security.version} + org.opendaylight.controller + bundlescanner.implementation + ${bundlescanner.version} - org.springframework - org.springframework.transaction - ${spring-security.version} + org.opendaylight.controller + clustering.services + ${clustering.services.version} - - org.ow2.chameleon.management - chameleon-mbeans - 1.0.0 + org.opendaylight.controller + clustering.services-implementation + ${clustering.services_implementation.version} - - com.sun.jersey - jersey-core - ${jersey.version} + org.opendaylight.controller + clustering.stub + ${clustering.stub.version} + + - com.sun.jersey - jersey-server - ${jersey.version} + org.opendaylight.controller + clustering.test + 0.4.2-SNAPSHOT - com.sun.jersey - jersey-client - ${jersey.version} + org.opendaylight.controller + commons.httpclient + ${commons.httpclient.version} + - org.ow2.asm - asm-all - 4.1 + org.opendaylight.controller + commons.northbound + 0.4.2-SNAPSHOT - org.eclipse.persistence - org.eclipse.persistence.moxy - 2.5.0 + org.opendaylight.controller + concepts + ${concepts.version} + + - org.eclipse.persistence - org.eclipse.persistence.core - 2.5.0 + org.opendaylight.controller + config-api + ${config.version} - org.eclipse.persistence - org.eclipse.persistence.antlr - 2.5.0 + org.opendaylight.controller + config-manager + ${config.version} + test-jar - - org.opendaylight.controller.thirdparty - net.sf.jung2 - 2.0.1 + org.opendaylight.controller + config-manager + ${config.version} - org.opendaylight.controller.thirdparty - org.openflow.openflowj - 1.0.2 + org.opendaylight.controller + config-netconf-connector + ${netconf.version} - org.opendaylight.controller.thirdparty - com.sun.jersey.jersey-servlet - ${jersey-servlet.version} + org.opendaylight.controller + config-persister-api + ${config.version} + test-jar - org.opendaylight.controller.thirdparty - org.apache.catalina.filters.CorsFilter - ${corsfilter.version} + org.opendaylight.controller + config-persister-api + ${config.version} - org.opendaylight.controller.thirdparty - ganymed - 1.1-SNAPSHOT + org.opendaylight.controller + config-persister-directory-xml-adapter + ${config.version} - com.google.code.findbugs - jsr305 - 2.0.1 + org.opendaylight.controller + config-persister-file-xml-adapter + ${config.version} - org.opendaylight.yangtools - mockito-configuration - ${yangtools.version} - test + org.opendaylight.controller + config-persister-impl + ${netconf.version} - + - org.opendaylight.yangtools.model - ietf-inet-types - ${ietf-inet-types.version} + org.opendaylight.controller + config-util + ${config.version} + + + org.opendaylight.controller + config-util + ${config.version} + test-jar - org.opendaylight.yangtools.model - ietf-yang-types - ${ietf-yang-types.version} + org.opendaylight.controller + configuration + ${configuration.version} + + + org.opendaylight.controller + configuration.implementation + 0.4.2-SNAPSHOT - org.opendaylight.yangtools.model - ietf-topology - ${ietf-topology.version} + org.opendaylight.controller + connectionmanager + ${connectionmanager.version} - org.opendaylight.yangtools.model - ietf-topology-l3-unicast-igp - ${ietf-topology.version} + org.opendaylight.controller + connectionmanager.implementation + ${connectionmanager.version} - org.opendaylight.yangtools.model - opendaylight-l2-types - ${opendaylight-l2-types.version} + org.opendaylight.controller + connectionmanager.northbound + ${connectionmanager.version} - org.opendaylight.yangtools.model - yang-ext - ${yang-ext.version} + org.opendaylight.controller + containermanager + ${containermanager.version} - org.opendaylight.controller - protocol-framework - ${protocol-framework.version} + containermanager.implementation + ${containermanager.version} - org.opendaylight.yangtools - concepts - ${yangtools.version} + org.opendaylight.controller + containermanager.it.implementation + ${containermanager.it.version} - org.opendaylight.yangtools - restconf-client-api - ${yangtools.version} + org.opendaylight.controller + containermanager.northbound + 0.4.2-SNAPSHOT - org.opendaylight.yangtools - restconf-client-impl - ${yangtools.version} + org.opendaylight.controller + controllermanager.northbound + 0.0.2-SNAPSHOT - - - - io.netty - netty-handler - ${netty.version} - - - io.netty - netty-codec - ${netty.version} - - - io.netty - netty-buffer - ${netty.version} - - - io.netty - netty-transport - ${netty.version} - - - io.netty - netty-common - ${netty.version} - - - io.netty - netty-codec-http - ${netty.version} - - - - org.opendaylight.yangtools - yang-binding - ${yangtools.version} + org.opendaylight.controller + devices.web + 0.4.2-SNAPSHOT - org.opendaylight.yangtools - yang-common - ${yangtools.version} + org.opendaylight.controller + flowprogrammer.northbound + 0.4.2-SNAPSHOT - org.opendaylight.yangtools - yang-data-api - ${yangtools.version} + org.opendaylight.controller + flows.web + 0.4.2-SNAPSHOT - org.opendaylight.yangtools - yang-data-impl - ${yangtools.version} + org.opendaylight.controller + forwarding.staticrouting + ${forwarding.staticrouting} - org.opendaylight.yangtools - yang-data-util - ${yangtools.version} + org.opendaylight.controller + forwarding.staticrouting.northbound + 0.4.2-SNAPSHOT - org.opendaylight.yangtools - yang-model-api - ${yangtools.version} + org.opendaylight.controller + forwardingrulesmanager + ${forwardingrulesmanager.version} - org.opendaylight.yangtools - yang-model-util - ${yangtools.version} + org.opendaylight.controller + forwardingrulesmanager.implementation + 0.4.2-SNAPSHOT @@ -794,6 +781,11 @@ hosttracker.implementation ${hosttracker.implementation.version} + + org.opendaylight.controller + hosttracker.northbound + 0.4.2-SNAPSHOT + org.opendaylight.controller hosttracker_new @@ -801,902 +793,1116 @@ org.opendaylight.controller - forwarding.staticrouting - ${forwarding.staticrouting} + httpservice-bridge + 0.0.2-SNAPSHOT org.opendaylight.controller - clustering.services - ${clustering.services.version} + jolokia-bridge + 0.0.2-SNAPSHOT org.opendaylight.controller - clustering.services-implementation - ${clustering.services_implementation.version} + logback-config + ${config.version} + org.opendaylight.controller - clustering.stub - ${clustering.stub.version} + logging.bridge + ${logging.bridge.version} + + org.opendaylight.controller - configuration.implementation - ${controller.version} + netconf-api + ${netconf.version} org.opendaylight.controller - routing.dijkstra_implementation - ${controller.version} + netconf-client + ${netconf.version} org.opendaylight.controller - arphandler - ${arphandler.version} + netconf-impl + ${netconf.version} org.opendaylight.controller - containermanager - ${containermanager.version} + netconf-impl + ${netconf.version} + test-jar org.opendaylight.controller - containermanager.implementation - ${containermanager.version} + netconf-mapping-api + ${netconf.version} org.opendaylight.controller - containermanager.it.implementation - ${containermanager.it.version} + netconf-monitoring + ${netconf.version} org.opendaylight.controller - appauth - ${controller.version} + netconf-ssh + ${netconf.version} org.opendaylight.controller - switchmanager - ${switchmanager.api.version} + netconf-ssh + ${netconf.version} + test-jar org.opendaylight.controller - switchmanager.implementation - ${controller.version} + netconf-util + ${netconf.version} org.opendaylight.controller - statisticsmanager - ${statisticsmanager.version} + netconf-util + ${netconf.version} + test-jar org.opendaylight.controller - statisticsmanager.implementation - ${controller.version} + netty-config-api + ${config.version} org.opendaylight.controller - topologymanager - ${topologymanager.version} + netty-event-executor-config + ${config.version} org.opendaylight.controller - usermanager - ${usermanager.version} + netty-threadgroup-config + ${config.version} org.opendaylight.controller - usermanager.implementation - ${usermanager.version} + netty-timer-config + ${config.version} org.opendaylight.controller - connectionmanager - ${connectionmanager.version} + networkconfig.bridgedomain.northbound + ${networkconfig.bridgedomain.northbound.version} + + org.opendaylight.controller - connectionmanager.implementation - ${connectionmanager.version} + networkconfig.neutron + 0.4.2-SNAPSHOT org.opendaylight.controller - security - ${controller.version} + networkconfig.neutron.implementation + 0.4.2-SNAPSHOT org.opendaylight.controller - forwardingrulesmanager - ${forwardingrulesmanager.version} + networkconfig.neutron.northbound + 0.4.2-SNAPSHOT org.opendaylight.controller - forwardingrulesmanager.implementation - ${controller.version} + osgi-brandfragment.web + 0.0.2-SNAPSHOT - org.opendaylight.controller - sal - ${sal.version} + protocol-framework + ${protocol-framework.version} + + org.opendaylight.controller - sal.implementation - ${controller.version} + protocol_plugins.openflow + 0.4.2-SNAPSHOT - - org.opendaylight.controller - sal.connection - ${sal.connection.version} + protocol_plugins.stub + ${protocol_plugin.stub.version} org.opendaylight.controller - sal.connection.implementation - ${sal.connection.version} + routing.dijkstra_implementation + 0.4.2-SNAPSHOT + + org.opendaylight.controller - sal.networkconfiguration - ${sal.networkconfiguration.version} + sal + ${sal.version} org.opendaylight.controller - sal.networkconfiguration.implementation - ${sal.networkconfiguration.version} + sal-binding-api + ${mdsal.version} - - org.opendaylight.controller - web - ${controller.version} + sal-binding-broker-impl + ${mdsal.version} org.opendaylight.controller - flows.web - ${controller.version} + sal-binding-config + ${mdsal.version} org.opendaylight.controller - devices.web - ${controller.version} + sal-binding-util + ${mdsal.version} org.opendaylight.controller - troubleshoot.web - ${controller.version} + sal-broker-impl + ${mdsal.version} org.opendaylight.controller - topology.web - ${controller.version} + sal-common + ${mdsal.version} org.opendaylight.controller - osgi-brandfragment.web - 0.0.2-SNAPSHOT + sal-common-api + ${mdsal.version} - - org.opendaylight.controller - networkconfig.neutron - ${controller.version} + sal-common-impl + ${mdsal.version} org.opendaylight.controller - networkconfig.neutron.implementation - ${controller.version} + sal-common-util + ${mdsal.version} org.opendaylight.controller - networkconfig.neutron.northbound - ${controller.version} + sal-compatibility + ${mdsal.version} - - org.opendaylight.controller - commons.northbound - ${controller.version} + sal-connector-api + ${mdsal.version} org.opendaylight.controller - bundlescanner - ${bundlescanner.version} + sal-core-api + ${mdsal.version} org.opendaylight.controller - bundlescanner.implementation - ${bundlescanner.version} + sal-core-spi + ${mdsal.version} org.opendaylight.controller - topology.northbound - ${controller.version} + sal-netconf-connector + ${mdsal.version} org.opendaylight.controller - forwarding.staticrouting.northbound - ${controller.version} + sal-remote + ${mdsal.version} org.opendaylight.controller - statistics.northbound - ${controller.version} + sal-remoterpc-connector + ${mdsal.version} org.opendaylight.controller - flowprogrammer.northbound - ${controller.version} + sal-rest-connector + ${mdsal.version} org.opendaylight.controller - hosttracker.northbound - ${controller.version} + sal-restconf-broker + ${mdsal.version} + + org.opendaylight.controller - subnets.northbound - ${controller.version} + sal.connection + ${sal.connection.version} org.opendaylight.controller - switchmanager.northbound - ${controller.version} + sal.connection.implementation + ${sal.connection.version} org.opendaylight.controller - containermanager.northbound - ${controller.version} + sal.implementation + 0.4.2-SNAPSHOT org.opendaylight.controller - networkconfig.bridgedomain.northbound - ${networkconfig.bridgedomain.northbound.version} + sal.networkconfiguration + ${sal.networkconfiguration.version} org.opendaylight.controller - httpservice-bridge - 0.0.2-SNAPSHOT + sal.networkconfiguration.implementation + ${sal.networkconfiguration.version} + + org.opendaylight.controller - jolokia-bridge - 0.0.2-SNAPSHOT + samples.loadbalancer + ${samples.loadbalancer} org.opendaylight.controller - connectionmanager.northbound - ${connectionmanager.version} + samples.loadbalancer.northbound + 0.4.2-SNAPSHOT org.opendaylight.controller - usermanager.northbound - 0.0.2-SNAPSHOT + samples.simpleforwarding + 0.4.2-SNAPSHOT org.opendaylight.controller - controllermanager.northbound - 0.0.2-SNAPSHOT + sanitytest + ${sanitytest.version} - org.opendaylight.controller - logging.bridge - ${controller.version} + security + 0.4.2-SNAPSHOT - org.opendaylight.controller - protocol_plugins.openflow - ${controller.version} + shutdown-api + ${config.version} org.opendaylight.controller - protocol_plugins.stub - ${protocol_plugin.stub.version} + shutdown-impl + ${config.version} - - org.opendaylight.controller - samples.loadbalancer - ${samples.loadbalancer} + statistics.northbound + 0.4.2-SNAPSHOT org.opendaylight.controller - samples.loadbalancer.northbound - ${controller.version} + statisticsmanager + ${statisticsmanager.version} org.opendaylight.controller - samples.simpleforwarding - ${controller.version} + statisticsmanager.implementation + 0.4.2-SNAPSHOT - - org.opendaylight.controller - clustering.test - ${controller.version} + subnets.northbound + 0.4.2-SNAPSHOT org.opendaylight.controller - commons.httpclient - ${commons.httpclient.version} + switchmanager + ${switchmanager.api.version} org.opendaylight.controller - sanitytest - ${controller.version} + switchmanager.implementation + 0.4.2-SNAPSHOT + + + org.opendaylight.controller + switchmanager.northbound + 0.4.2-SNAPSHOT - + - org.eclipse.equinox.http - servlet - 1.0.0-v20070606 + org.opendaylight.controller + threadpool-config-api + ${config.version} - - org.apache.felix - org.apache.felix.webconsole - 4.2.0 - - all + org.opendaylight.controller + threadpool-config-impl + ${config.version} - org.jolokia - jolokia-osgi - ${jolokia.version} + org.opendaylight.controller + topology.northbound + 0.4.2-SNAPSHOT org.opendaylight.controller - commons.logback_settings - 0.0.2-SNAPSHOT - test + topology.web + 0.4.2-SNAPSHOT - org.codehaus.enunciate - enunciate-core-annotations - ${enunciate.version} + org.opendaylight.controller + topologymanager + ${topologymanager.version} + + + org.opendaylight.controller + troubleshoot.web + 0.4.2-SNAPSHOT + + + org.opendaylight.controller + usermanager + ${usermanager.version} + + + org.opendaylight.controller + usermanager.implementation + ${usermanager.version} + + + org.opendaylight.controller + usermanager.northbound + 0.0.2-SNAPSHOT - - - org.eclipse.xtend - org.eclipse.xtend.lib - ${xtend.version} - - - org.opendaylight.controller - sal-common - ${mdsal.version} - - - org.opendaylight.controller - sal-common-util - ${mdsal.version} - - - org.opendaylight.controller - sal-netconf-connector - ${mdsal.version} - - - org.opendaylight.controller - sal-core-api - ${mdsal.version} - - - org.opendaylight.controller - sal-broker-impl - ${mdsal.version} - - - org.opendaylight.controller - sal-core-spi - ${mdsal.version} - - - org.opendaylight.controller - sal-common-api - ${mdsal.version} - - - org.opendaylight.controller - sal-common-impl - ${mdsal.version} - - - org.opendaylight.controller - sal-binding-api - ${mdsal.version} - - - org.opendaylight.controller - sal-binding-config - ${mdsal.version} - - - org.opendaylight.controller - sal-binding-broker-impl - ${mdsal.version} - - - org.opendaylight.controller - sal-binding-broker-impl - ${mdsal.version} - test-jar - test - - - org.opendaylight.controller - sal-compatibility - ${mdsal.version} - - - org.opendaylight.controller - sal-connector-api - ${mdsal.version} - - - org.opendaylight.controller - sal-rest-connector - ${mdsal.version} - - - org.opendaylight.controller.model - model-inventory - ${mdsal.version} - - - org.opendaylight.controller.model - model-flow-base - ${mdsal.version} - - - org.opendaylight.controller.model - model-flow-service - ${mdsal.version} - - - org.opendaylight.controller.model - model-flow-statistics - ${mdsal.version} - - - org.opendaylight.controller.model - model-flow-management - ${mdsal.version} - - - org.opendaylight.controller.md - inventory-manager - ${mdsal.version} - - - org.opendaylight.controller.md - forwardingrules-manager - ${mdsal.version} - - - org.opendaylight.controller.md - topology-lldp-discovery - ${mdsal.version} - - - org.opendaylight.controller.md - topology-manager - ${mdsal.version} - - - org.opendaylight.controller.md - statistics-manager - ${mdsal.version} - - - org.opendaylight.controller - sal-remote - ${mdsal.version} - - - org.opendaylight.controller - sal-restconf-broker - ${mdsal.version} - - - org.opendaylight.controller - sal-binding-util - ${mdsal.version} - - - org.opendaylight.controller - concepts - ${concepts.version} - - - org.opendaylight.controller - sal-remoterpc-connector - ${mdsal.version} - - - - - - org.opendaylight.controller - config-api - ${config.version} - - - org.opendaylight.controller - config-manager - ${config.version} - - - org.opendaylight.controller - yang-jmx-generator - ${config.version} - - - org.opendaylight.controller - logback-config - ${config.version} - - - org.opendaylight.controller - config-persister-api - ${config.version} - - - org.opendaylight.controller - config-persister-file-xml-adapter - ${config.version} - - - org.opendaylight.controller - config-persister-directory-xml-adapter - ${config.version} - - - - org.opendaylight.controller - shutdown-api - ${config.version} - - - org.opendaylight.controller - shutdown-impl - ${config.version} - + + + org.opendaylight.controller + web + 0.4.2-SNAPSHOT + + + org.opendaylight.controller + yang-jmx-generator + ${config.version} + + + org.opendaylight.controller + yang-jmx-generator + ${config.version} + test-jar + + + org.opendaylight.controller + yang-test + ${config.version} + + + org.opendaylight.controller.md + forwardingrules-manager + ${mdsal.version} + + + org.opendaylight.controller.md + inventory-manager + ${mdsal.version} + + + org.opendaylight.controller.md + statistics-manager + ${mdsal.version} + + + org.opendaylight.controller.md + topology-lldp-discovery + ${mdsal.version} + + + org.opendaylight.controller.md + topology-manager + ${mdsal.version} + + + org.opendaylight.controller.model + model-flow-base + ${mdsal.version} + + + org.opendaylight.controller.model + model-flow-management + ${mdsal.version} + + + org.opendaylight.controller.model + model-flow-service + ${mdsal.version} + + + org.opendaylight.controller.model + model-flow-statistics + ${mdsal.version} + + + org.opendaylight.controller.model + model-inventory + ${mdsal.version} + + + org.opendaylight.controller.thirdparty + com.sun.jersey.jersey-servlet + ${jersey-servlet.version} + + + org.opendaylight.controller.thirdparty + ganymed + 1.1-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena + ${exi.nagasena.version} + + + org.opendaylight.controller.thirdparty + nagasena-rta + ${exi.nagasena.version} + + + + org.opendaylight.controller.thirdparty + net.sf.jung2 + 2.0.1 + + + org.opendaylight.controller.thirdparty + org.apache.catalina.filters.CorsFilter + ${corsfilter.version} + + + org.opendaylight.controller.thirdparty + org.openflow.openflowj + 1.0.2 + + + org.opendaylight.yangtools + binding-generator-impl + ${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 + restconf-client-api + ${yangtools.version} + + + org.opendaylight.yangtools + restconf-client-impl + ${yangtools.version} + - - - org.opendaylight.controller - netconf-api - ${netconf.version} - - - org.opendaylight.controller - netconf-impl - ${netconf.version} - - - org.opendaylight.controller - netconf-util - ${netconf.version} - - - org.opendaylight.controller - netconf-client - ${netconf.version} - - - org.opendaylight.controller - netconf-mapping-api - ${netconf.version} - - - org.opendaylight.controller - netconf-ssh - ${netconf.version} - - - org.opendaylight.controller - config-netconf-connector - ${netconf.version} - - - org.opendaylight.controller - netconf-monitoring - ${netconf.version} - - - ${project.groupId} - ietf-netconf-monitoring - ${netconf.version} - - - ${project.groupId} - ietf-netconf-monitoring-extension - ${netconf.version} - - - org.opendaylight.controller - config-persister-impl - ${netconf.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.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-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 + opendaylight-l2-types + ${opendaylight-l2-types.version} + + + org.opendaylight.yangtools.model + yang-ext + ${yang-ext.version} + + + org.osgi + org.osgi.compendium + ${osgi.core.version} + + + org.osgi + org.osgi.core + ${osgi.core.version} + - - - org.opendaylight.controller - threadpool-config-api - ${config.version} - - - org.opendaylight.controller - netty-config-api - ${config.version} - - - org.opendaylight.controller - threadpool-config-impl - ${config.version} - - - org.opendaylight.controller - netty-threadgroup-config - ${config.version} - - - org.opendaylight.controller - netty-event-executor-config - ${config.version} - - - org.opendaylight.controller - netty-timer-config - ${config.version} - - - org.opendaylight.controller - configuration - ${configuration.version} - - - org.bouncycastle - bcprov-jdk15on - 1.50 - - - org.bouncycastle - bcpkix-jdk15on - 1.50 - + + org.ow2.asm + asm-all + 4.1 + + + + org.ow2.chameleon.management + chameleon-mbeans + 1.0.0 + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + compile + + + org.springframework + org.springframework.aop + ${spring.version} + + + org.springframework + org.springframework.asm + ${spring.version} + + + org.springframework + org.springframework.beans + ${spring.version} + + + org.springframework + org.springframework.context + ${spring.version} + + + org.springframework + org.springframework.context.support + ${spring.version} + + + org.springframework + org.springframework.core + ${spring.version} + + + org.springframework + org.springframework.expression + ${spring.version} + + + org.springframework + org.springframework.transaction + ${spring-security.version} + + + org.springframework + org.springframework.web + ${spring.version} + + + org.springframework + org.springframework.web.servlet + ${spring.version} + + + + + org.springframework.security + spring-security-config + ${spring-security.version} + + + org.springframework.security + spring-security-core + ${spring-security.version} + + + org.springframework.security + spring-security-taglibs + ${spring-security.version} + + + org.springframework.security + spring-security-web + ${spring-security.version} + + + virgomirror + org.eclipse.jdt.core.compiler.batch + 3.8.0.I20120518-2145 + + + junit + junit + ${junit.version} + test + + + org.mockito + mockito-all + ${mockito.version} + test + + + org.opendaylight.controller + commons.logback_settings + 0.0.2-SNAPSHOT + test + + + org.opendaylight.controller + sal-binding-broker-impl + ${mdsal.version} + test-jar + test + + + org.opendaylight.controller + sal-binding-it + ${mdsal.version} + test + + + org.opendaylight.yangtools + mockito-configuration + ${yangtools.version} + test + + + + org.ops4j.pax.exam + pax-exam-container-native + ${exam.version} + test + + + org.ops4j.pax.exam + pax-exam-junit4 + ${exam.version} + test + + + org.ops4j.pax.exam + pax-exam-link-mvn + ${exam.version} + test + + + org.ops4j.pax.url + pax-url-aether + ${url.version} + test + + + + org.springframework.osgi + spring-osgi-mock + ${spring-osgi.version} + test + + + xmlunit + xmlunit + 1.5 + test + - - - - opendaylight-mirror - opendaylight-mirror - ${nexusproxy}/groups/public/ - - false - - - true - never - - - - - opendaylight-snapshot - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - true - - - false - - - - - - - IDE - - - m2e.version - - - - - target-ide - - - - viewbuild - - true - - - ${project.version} - - - - jenkins - - - BUILDSUFFIX - - - - ${BUILDSUFFIX} - - - - fastreassembly - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.4 - - - copyfastreassembly - install - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - ${project.groupId}.${project.artifactId}-${project.version}.jar - - - ${fastreassembly.directory} - - - - - - - - - - - - - - opendaylight-mirror - opendaylight-mirror - ${nexusproxy}/groups/public/ - - false - - - true - never - - - - - opendaylight-snapshot - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - true - - - false - - - - - - - opendaylight-release - ${nexusproxy}/repositories/${nexus.repository.release}/ - - - - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - - - website - ${sitedeploy} - - + + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + maven-clean-plugin + + + + ${xtend.dstdir} + + ** + + + + ${jmxGeneratorPath} + + ** + + + + ${salGeneratorPath} + + ** + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compile.plugin.version} + + ${java.version.source} + ${java.version.target} + ${java.version.source} + ${java.version.target} + + + + org.apache.maven.plugins + maven-jar-plugin + ${jar.plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8.1 + + org.jboss.apiviz.APIviz + + org.jboss.apiviz + apiviz + 1.3.2.GA + + ${project.artifactId}-${build.suffix} + true + UTF-8 + UTF-8 + UTF-8 + true + true + true + true + net.sf.jnetlib.*:cern.*:corejava:*.internal:edu.uci.* + false + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + true + true + target/apidocs + + + + org.apache.maven.plugins + maven-release-plugin + ${releaseplugin.version} + + + org.codehaus.enunciate + maven-enunciate-plugin + ${enunciate.version} + + enunciate.xml + + + + org.opendaylight.controller + commons.logback_settings + 0.0.2-SNAPSHOT + + + + + + docs + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.8 + + + add-source + + add-source + + generate-sources + + + ${jmxGeneratorPath} + ${salGeneratorPath} + ${xtend.dstdir} + + + + + - - true - ${project.build.directory}/site - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${projectinfo} - - false - false - - - - - index - project-team - license - mailing-list - plugin-management - cim - issue-tracking - scm - summary - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.3 - - true - true - - + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + properties-maven-plugin + [0.0,) + + set-system-properties + + + + + + + + + org.codehaus.enunciate + maven-enunciate-plugin + [0.0,) + + docs + + + + + + + + + org.jacoco + jacoco-maven-plugin + [0.0,) + + prepare-agent + pre-test + post-test + + + + + + + + + org.ops4j.pax.exam + maven-paxexam-plugin + [1.2.4,) + + generate-depends-file + + + + + false + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + [2.0,) + + check + + + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + [0.5,) + + generate-sources + + + + + + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + execute + + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.version} + + enforce + + + + + + + + + + + + org.eclipse.xtend + xtend-maven-plugin + ${xtend.version} + + + + compile + + + ${xtend.dstdir} + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + org.opendaylight.yangtools + yang-maven-plugin + ${yangtools.version} + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + org.osgi + org.osgi.core + ${osgi.core.version} + + + + + + org.apache.maven.plugins maven-checkstyle-plugin ${checkstyle.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - org.jboss.apiviz.APIviz - - org.jboss.apiviz - apiviz - 1.3.2.GA - - ${project.artifactId}-${build.suffix} - true - UTF-8 - UTF-8 - UTF-8 - true - true - true - true - *.internal:edu.uci.* + true + controller/checkstyle.xml + true + true + ${project.basedir} + **\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat + **\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/ - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.version} org.opendaylight.controller @@ -1706,21 +1912,32 @@ - process-sources check + process-sources + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.version} + + + enforce-java + + enforce + + + + + 1.7.0 + + + - - true - controller/checkstyle.xml - true - true - ${project.basedir} - **\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat - **\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/ - org.apache.maven.plugins @@ -1738,17 +1955,17 @@ failsafe-integration-tests - integration-test integration-test + integration-test failsafe-verify - verify verify + verify @@ -1766,298 +1983,225 @@ + + org.codehaus.mojo + build-helper-maven-plugin + + + + + + ${project.build.directory}/site + true + org.apache.maven.plugins - maven-enforcer-plugin - ${enforcer.version} - - - enforce-java - - enforce - - - - - 1.7.0 - - - - - + maven-checkstyle-plugin + ${checkstyle.version} - org.codehaus.mojo - build-helper-maven-plugin + org.apache.maven.plugins + maven-javadoc-plugin + 2.8.1 + + org.jboss.apiviz.APIviz + + org.jboss.apiviz + apiviz + 1.3.2.GA + + ${project.artifactId}-${build.suffix} + true + UTF-8 + UTF-8 + UTF-8 + true + true + true + true + *.internal:edu.uci.* + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + true + true + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${projectinfo} + + false + false + + + + + index + project-team + license + mailing-list + plugin-management + cim + issue-tracking + scm + summary + + + - - - - org.apache.maven.plugins - maven-release-plugin - ${releaseplugin.version} - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - org.opendaylight.yangtools - yang-maven-plugin - ${yangtools.version} - + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + + + + + true + never + + + false + + opendaylight-mirror + opendaylight-mirror + ${nexusproxy}/groups/public/ + + + + + false + + + true + + opendaylight-snapshot + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + + + + + true + never + + + false + + opendaylight-mirror + opendaylight-mirror + ${nexusproxy}/groups/public/ + + + + + false + + + true + + opendaylight-snapshot + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + + + opendaylight-release + ${nexusproxy}/repositories/${nexus.repository.release}/ + + + + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + website + ${sitedeploy} + + - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - properties-maven-plugin - [0.0,) - - set-system-properties - - - - - - - - - org.codehaus.enunciate - maven-enunciate-plugin - [0.0,) - - docs - - - - - - - - - org.jacoco - jacoco-maven-plugin - [0.0,) - - prepare-agent - pre-test - post-test - - - - - - - - - org.ops4j.pax.exam - maven-paxexam-plugin - [1.2.4,) - - generate-depends-file - - - - - false - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - [2.0,) - - check - - - - - - - - - org.opendaylight.yangtools - yang-maven-plugin - [0.5,) - - generate-sources - - - - - - - - - org.codehaus.groovy.maven - gmaven-plugin - 1.0 - - execute - - - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - ${enforcer.version} - - enforce - - - - - - - - - - - - org.codehaus.enunciate - maven-enunciate-plugin - ${enunciate.version} - - enunciate.xml - - - - - docs - - - - - - org.opendaylight.controller - commons.logback_settings - 0.0.2-SNAPSHOT - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - org.jboss.apiviz.APIviz - - org.jboss.apiviz - apiviz - 1.3.2.GA - - ${project.artifactId}-${build.suffix} - true - UTF-8 - UTF-8 - UTF-8 - true - true - true - true - net.sf.jnetlib.*:cern.*:corejava:*.internal:edu.uci.* - false - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.3 - - true - true - target/apidocs - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compile.plugin.version} - - ${java.version.source} - ${java.version.target} - ${java.version.source} - ${java.version.target} - - + + + IDE + + + m2e.version + + + + + target-ide + + + + viewbuild + + true + + + ${project.version} + + + + jenkins + + + BUILDSUFFIX + + + + ${BUILDSUFFIX} + + + + fastreassembly + + - org.eclipse.xtend - xtend-maven-plugin - ${xtend.version} - - - - compile - - - ${xtend.dstdir} - - - + org.apache.maven.plugins + maven-dependency-plugin + 2.4 + + + copyfastreassembly + + copy + + install + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${project.groupId}.${project.artifactId}-${project.version}.jar + + + ${fastreassembly.directory} + + + - - maven-clean-plugin - - - - ${xtend.dstdir} - - ** - - - - ${jmxGeneratorPath} - - ** - - - - ${salGeneratorPath} - - ** - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - add-source - generate-sources - - add-source - - - - ${jmxGeneratorPath} - ${salGeneratorPath} - ${xtend.dstdir} - - - - - - - - + + + + diff --git a/opendaylight/commons/parent/pom.xml b/opendaylight/commons/parent/pom.xml index c81dba75de..67d1cb419b 100644 --- a/opendaylight/commons/parent/pom.xml +++ b/opendaylight/commons/parent/pom.xml @@ -1,29 +1,47 @@ 4.0.0 - - 3.0 - org.opendaylight.controller commons.parent 1.0.2-SNAPSHOT pom - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + 3.0 + - http://nexus.opendaylight.org/content opendaylight.release opendaylight.snapshot - dav:http://nexus.opendaylight.org/content/sites/site + http://nexus.opendaylight.org/content 2.3.2 + dav:http://nexus.opendaylight.org/content/sites/site + + com.google.code.sortpom + maven-sortpom-plugin + 2.2.1 + + false + ${project.build.sourceEncoding} + true + \n + 2 + custom_1 + scope,groupId,artifactId + groupId,artifactId + true + + + + + sort + + verify + + + org.apache.maven.plugins maven-release-plugin @@ -31,6 +49,12 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/commons/protocol-framework/pom.xml b/opendaylight/commons/protocol-framework/pom.xml index 1a1a2561cc..f70698731a 100644 --- a/opendaylight/commons/protocol-framework/pom.xml +++ b/opendaylight/commons/protocol-framework/pom.xml @@ -2,191 +2,185 @@ - 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../commons/opendaylight - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + - protocol-framework - 0.5.0-SNAPSHOT - Common protocol framework - bundle - ${project.artifactId} - - 3.0.4 - + protocol-framework + 0.5.0-SNAPSHOT + bundle + ${project.artifactId} + Common protocol framework + + 3.0.4 + - - - io.netty - netty-buffer - - - io.netty - netty-codec - - - io.netty - netty-common - - - io.netty - netty-transport - - - com.google.guava - guava - - - com.google.code.findbugs - jsr305 - - - org.slf4j - slf4j-api - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - netty-config-api - + + + com.google.code.findbugs + jsr305 + + + com.google.guava + guava + + + io.netty + netty-buffer + + + io.netty + netty-codec + + + io.netty + netty-common + + + io.netty + netty-transport + + + junit + junit + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + netty-config-api + - - - org.opendaylight.yangtools - mockito-configuration - - - junit - junit - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-manager - ${config.version} - test - test-jar - - + + + org.opendaylight.yangtools + mockito-configuration + + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-util + test + + + org.opendaylight.controller + netty-event-executor-config + test + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + package + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + + add-source + + generate-sources + + + ${jmxGeneratorPath} + ${salGeneratorPath} + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + + org.opendaylight.controller - config-util + yang-jmx-generator-plugin ${config.version} - test - - - org.opendaylight.controller - netty-event-executor-config - test - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - test-jar - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - generate-sources - - add-source - - - - ${jmxGeneratorPath} - ${salGeneratorPath} - - - - - - - + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + + + + + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/config/config-api/pom.xml b/opendaylight/config/config-api/pom.xml index cab2e8c44e..58a93a188b 100644 --- a/opendaylight/config/config-api/pom.xml +++ b/opendaylight/config/config-api/pom.xml @@ -1,61 +1,58 @@ - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + - config-api - ${project.artifactId} - bundle + config-api + bundle + ${project.artifactId} + + + com.google.code.findbugs + jsr305 + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.osgi + org.osgi.core + + - - - com.google.code.findbugs - jsr305 - - - org.osgi - org.osgi.core - - - org.opendaylight.yangtools - yang-binding - - - org.opendaylight.yangtools - yang-common - - - - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.api, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.api, org.opendaylight.controller.config.api.annotations, org.opendaylight.controller.config.spi, org.opendaylight.controller.config.api.jmx, org.opendaylight.controller.config.api.jmx.constants, org.opendaylight.controller.config.api.runtime, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.*, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.*, - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/config-manager/pom.xml b/opendaylight/config/config-manager/pom.xml index 7d7d9d697a..79fd5268e6 100644 --- a/opendaylight/config/config-manager/pom.xml +++ b/opendaylight/config/config-manager/pom.xml @@ -1,117 +1,113 @@ + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - config-manager - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + config-manager + bundle + ${project.artifactId} - - - - - ${project.groupId} - config-api - - - org.slf4j - slf4j-api - - - org.osgi - org.osgi.core - - - com.google.code.findbugs - jsr305 - - + + ${project.groupId} + config-api + + + com.google.code.findbugs + jsr305 + + + com.google.guava + guava + + - - commons-io - commons-io - + + commons-io + commons-io + - - - org.opendaylight.yangtools - mockito-configuration - + + + org.opendaylight.yangtools + binding-generator-impl + + + org.opendaylight.yangtools + concepts + - - - org.opendaylight.yangtools - binding-generator-impl - - + + + org.opendaylight.yangtools + mockito-configuration + + + org.opendaylight.yangtools + yang-data-impl + + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + - - ${project.groupId} - config-util - test - - - ${project.groupId} - config-util - test - test-jar - - - com.google.guava - guava - - - org.opendaylight.yangtools - concepts - - - org.opendaylight.yangtools - yang-data-impl - - + + ${project.groupId} + config-util + test + + + ${project.groupId} + config-util + test-jar + test + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.config.manager.impl.osgi.ConfigManagerActivator - - - org.opendaylight.controller.config.manager.*, - javax.annotation.*, - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - 1 - false - false - 1 - - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.manager.impl.osgi.ConfigManagerActivator + org.opendaylight.controller.config.manager.*, + javax.annotation.*, + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + false + 1 + + + + 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 fb0718a721..e914162671 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 @@ -283,6 +283,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe int orderingIdx = 0; for (ModuleIdentifier moduleIdentifier : orderedModuleIdentifiers) { + logger.trace("Registering {}", moduleIdentifier); ModuleInternalTransactionalInfo entry = commitInfo.getCommitted() .get(moduleIdentifier); if (entry == null) { 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 6b7251c302..bc4de5cc15 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 @@ -44,6 +44,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.String.format; /** @@ -380,7 +381,8 @@ class ConfigTransactionControllerImpl implements try { logger.debug("About to commit {} in transaction {}", name, getTransactionIdentifier()); - module.getInstance(); + AutoCloseable instance = module.getInstance(); + checkNotNull(instance, "Instance is null:{} in transaction {}", name, getTransactionIdentifier()); } catch (Exception e) { logger.error("Commit failed on {} in transaction {}", name, getTransactionIdentifier(), e); diff --git a/opendaylight/config/config-module-archetype/pom.xml b/opendaylight/config/config-module-archetype/pom.xml index 7fb622460f..57d18e2f62 100644 --- a/opendaylight/config/config-module-archetype/pom.xml +++ b/opendaylight/config/config-module-archetype/pom.xml @@ -1,6 +1,5 @@ - - + + 4.0.0 org.opendaylight.controller diff --git a/opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml b/opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml index 80abd87262..6ddb1306c5 100644 --- a/opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml +++ b/opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml @@ -20,7 +20,6 @@ org.opendaylight.controller config-api - ${config.version} @@ -79,7 +78,6 @@ org.apache.felix maven-bundle-plugin - ${maven.bundle.version} true diff --git a/opendaylight/config/config-persister-api/pom.xml b/opendaylight/config/config-persister-api/pom.xml index f800e36985..2899acf5df 100644 --- a/opendaylight/config/config-persister-api/pom.xml +++ b/opendaylight/config/config-persister-api/pom.xml @@ -1,44 +1,43 @@ + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - config-persister-api - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + config-persister-api + bundle + ${project.artifactId} - - - ${project.groupId} - config-util - - - com.google.guava - guava - - + + + ${project.groupId} + config-util + + + com.google.guava + guava + + - - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.persist.api, - org.opendaylight.controller.config.persist.api.storage, - - - - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.persist.api, + org.opendaylight.controller.config.persist.api.storage, + + + + + org.apache.maven.plugins + maven-jar-plugin + + + diff --git a/opendaylight/config/config-persister-directory-xml-adapter/pom.xml b/opendaylight/config/config-persister-directory-xml-adapter/pom.xml index 75188fe9b3..0cbc0a1db9 100644 --- a/opendaylight/config/config-persister-directory-xml-adapter/pom.xml +++ b/opendaylight/config/config-persister-directory-xml-adapter/pom.xml @@ -1,98 +1,81 @@ - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - config-persister-directory-xml-adapter - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + config-persister-directory-xml-adapter + bundle + ${project.artifactId} - - - - ${project.groupId} - config-persister-api - - - org.apache.commons - commons-lang3 - - - com.google.guava - guava - - - org.opendaylight.controller - config-persister-file-xml-adapter - + + + + ${project.groupId} + config-persister-api + + + com.google.guava + guava + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + org.eclipse.persistence + org.eclipse.persistence.core + - - org.eclipse.persistence - org.eclipse.persistence.moxy - - - org.eclipse.persistence - org.eclipse.persistence.core - + + org.eclipse.persistence + org.eclipse.persistence.moxy + + + org.opendaylight.controller + config-persister-file-xml-adapter + - - org.slf4j - slf4j-api - - - commons-io - commons-io - + + + org.opendaylight.yangtools + mockito-configuration + - - - org.opendaylight.yangtools - mockito-configuration - - - ${project.groupId} - config-persister-api - test-jar - test - + + org.slf4j + slf4j-api + + + xmlunit + xmlunit + + + ${project.groupId} + config-persister-api + test-jar + test + - + - - - - - org.codehaus.groovy.maven - gmaven-plugin - - - generate-sources - - execute - - - - System.setProperty("osgiversion", "${project.version}".replace('-', '.')) - - - - - - - org.apache.felix - maven-bundle-plugin - - - ${project.groupId}.config-persister-impl;bundle-version=${osgiversion} - - org.opendaylight.controller.config.persister.storage.adapter - - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + ${project.groupId}.config-persister-impl + org.opendaylight.controller.config.persister.storage.adapter + com.google.common.base, com.google.common.io, org.apache.commons.io, org.opendaylight.controller.config.persist.api, @@ -100,18 +83,15 @@ com.google.common.collect, javax.xml.bind, javax.xml.bind.annotation, + javax.xml.bind.annotation.adapters, javax.xml.transform, javax.xml.transform.stream, org.eclipse.persistence.jaxb, - org.apache.commons.lang3 - - - org.opendaylight.controller.config.persist.storage.file.xml.model, - - - - - - - + org.apache.commons.lang3 + org.opendaylight.controller.config.persist.storage.file.xml.model, + + + + + diff --git a/opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java b/opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java index da442ef4b2..7af06bd3e3 100644 --- a/opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java +++ b/opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java @@ -8,21 +8,26 @@ package org.opendaylight.controller.config.persist.storage.directory.xml; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.File; +import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.SortedSet; -import com.google.common.base.Optional; import org.junit.Test; import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder; import org.opendaylight.controller.config.persist.api.Persister; import org.opendaylight.controller.config.persist.test.PropertiesProviderTest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.xml.sax.SAXException; + +import com.google.common.base.Optional; public class DirectoryStorageAdapterTest { Persister tested; @@ -95,8 +100,8 @@ public class DirectoryStorageAdapterTest { logger.info("Testing : " + tested.toString()); } - private void assertResult(ConfigSnapshotHolder result, String s, String... caps) { - assertEquals(s, result.getConfigSnapshot().replaceAll("\\s", "")); + private void assertResult(ConfigSnapshotHolder result, String s, String... caps) throws SAXException, IOException { + assertXMLEqual(s, result.getConfigSnapshot()); int i = 0; for (String capFromSnapshot : result.getCapabilities()) { assertEquals(capFromSnapshot, caps[i++]); diff --git a/opendaylight/config/config-persister-file-xml-adapter/pom.xml b/opendaylight/config/config-persister-file-xml-adapter/pom.xml index dd2079550e..d8c81ea971 100644 --- a/opendaylight/config/config-persister-file-xml-adapter/pom.xml +++ b/opendaylight/config/config-persister-file-xml-adapter/pom.xml @@ -1,90 +1,74 @@ - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - config-persister-file-xml-adapter - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + config-persister-file-xml-adapter + bundle + ${project.artifactId} - - - - ${project.groupId} - config-persister-api - - - org.apache.commons - commons-lang3 - - - com.google.guava - guava - - - org.slf4j - slf4j-api - + + + + ${project.groupId} + config-persister-api + + + com.google.guava + guava + + + org.apache.commons + commons-lang3 + + + org.eclipse.persistence + org.eclipse.persistence.core + - - org.eclipse.persistence - org.eclipse.persistence.moxy - - - org.eclipse.persistence - org.eclipse.persistence.core - + + org.eclipse.persistence + org.eclipse.persistence.moxy + - - - org.opendaylight.yangtools - mockito-configuration - - - ${project.groupId} - config-persister-api - test-jar - test - - + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + + + xmlunit + xmlunit + + + ${project.groupId} + config-persister-api + test-jar + test + + - - - - - org.codehaus.groovy.maven - gmaven-plugin - - - generate-sources - - execute - - - - System.setProperty("osgiversion", "${project.version}".replace('-', '.')) - - - - - - - org.apache.felix - maven-bundle-plugin - - - ${project.groupId}.config-persister-impl;bundle-version=${osgiversion} - - org.opendaylight.controller.config.persister.storage.adapter - - - - - - + + + + org.apache.felix + maven-bundle-plugin + + + ${project.groupId}.config-persister-impl + org.opendaylight.controller.config.persister.storage.adapter + + + + + diff --git a/opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java b/opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java index 5322f6357a..2bfe70adb8 100644 --- a/opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java +++ b/opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java @@ -8,7 +8,12 @@ package org.opendaylight.controller.config.persist.storage.file.xml; -import com.google.common.base.Charsets; +import static junit.framework.Assert.assertFalse; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -16,16 +21,16 @@ import java.nio.file.Files; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; + import junit.framework.Assert; + import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder; import org.opendaylight.controller.config.persist.test.PropertiesProviderTest; -import static junit.framework.Assert.assertFalse; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; + +import com.google.common.base.Charsets; public class FileStorageAdapterTest { @@ -96,8 +101,7 @@ public class FileStorageAdapterTest { List lastConf = storage.loadLastConfigs(); assertEquals(1, lastConf.size()); ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0); - assertEquals("2", - configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", "")); + assertXMLEqual("2", configSnapshotHolder.getConfigSnapshot()); assertEquals(createCaps(), configSnapshotHolder.getCapabilities()); storage = new XmlFileStorageAdapter(); @@ -147,8 +151,7 @@ public class FileStorageAdapterTest { List lastConf = storage.loadLastConfigs(); assertEquals(1, lastConf.size()); ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0); - assertEquals("2", - configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", "")); + assertXMLEqual("2", configSnapshotHolder.getConfigSnapshot()); } @Test @@ -178,8 +181,7 @@ public class FileStorageAdapterTest { List lastConf = storage.loadLastConfigs(); assertEquals(1, lastConf.size()); ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0); - assertEquals("3", - configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", "")); + assertXMLEqual("3", configSnapshotHolder.getConfigSnapshot()); assertFalse(readLines.contains(holder.getConfigSnapshot())); } diff --git a/opendaylight/config/config-plugin-parent/pom.xml b/opendaylight/config/config-plugin-parent/pom.xml index 2c607f81d0..e66a4cfd3f 100644 --- a/opendaylight/config/config-plugin-parent/pom.xml +++ b/opendaylight/config/config-plugin-parent/pom.xml @@ -1,58 +1,55 @@ - - org.opendaylight.controller - config-subsystem - 0.2.5-SNAPSHOT - - 4.0.0 - config-plugin-parent - ${project.artifactId} - pom - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + ../ + + config-plugin-parent + pom + ${project.artifactId} + + 3.0.4 + - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - config - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - - - - + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + org.opendaylight.controller + yang-jmx-generator-plugin + ${config.version} + + + + + config + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + true + + + + + + + diff --git a/opendaylight/config/config-util/pom.xml b/opendaylight/config/config-util/pom.xml index 9b866efb13..b6e2efcd45 100644 --- a/opendaylight/config/config-util/pom.xml +++ b/opendaylight/config/config-util/pom.xml @@ -1,47 +1,48 @@ + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - config-util - ${project.artifactId} - jar + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + config-util + jar + ${project.artifactId} - - - - ${project.groupId} - config-api - - - - com.google.guava - guava - test - - + + + + ${project.groupId} + config-api + + + + com.google.guava + guava + test + + - - - - org.apache.maven.plugins - maven-surefire-plugin - - 1 - false - false - 1 - - - - - org.apache.maven.plugins - maven-jar-plugin - - - + + + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + false + 1 + + + + diff --git a/opendaylight/config/logback-config/pom.xml b/opendaylight/config/logback-config/pom.xml index 2fe515c312..0fd62aa427 100644 --- a/opendaylight/config/logback-config/pom.xml +++ b/opendaylight/config/logback-config/pom.xml @@ -1,95 +1,92 @@ - 4.0.0 - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - logback-config - ${project.artifactId} - bundle - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + logback-config + bundle + ${project.artifactId} + + 3.0.4 + - - - ${project.groupId} - config-api - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - - - ch.qos.logback - logback-core - + + + ${project.groupId} + config-api + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + - - com.google.guava - guava - - - commons-io - commons-io - + + com.google.guava + guava + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + - + - - ${project.groupId} - config-manager - test - test-jar - - - ${project.groupId} - config-manager - test - - - ${project.groupId} - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - - - org.apache.commons - commons-lang3 - - - - - - org.apache.felix - maven-bundle-plugin - - - - - - org.opendaylight.controller.config.yang.logback.config, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.logback.config.rev130716.*, - - - - - - org.opendaylight.yangtools - yang-maven-plugin - + + ${project.groupId} + config-manager + test-jar + test + + + ${project.groupId} + config-manager + test + + + ${project.groupId} + config-util + test + + + + + + org.apache.felix + maven-bundle-plugin + + + + org.opendaylight.controller.config.yang.logback.config, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.logback.config.rev130716.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + - - + + diff --git a/opendaylight/config/netty-config-api/pom.xml b/opendaylight/config/netty-config-api/pom.xml index 2a53e445f5..ca1e28e14c 100644 --- a/opendaylight/config/netty-config-api/pom.xml +++ b/opendaylight/config/netty-config-api/pom.xml @@ -1,52 +1,50 @@ + 4.0.0 org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent - 4.0.0 netty-config-api - ${project.artifactId} - bundle - - 3.0.4 - + bundle + ${project.artifactId} + + 3.0.4 + - - - org.opendaylight.controller - config-api - - - com.google.guava - guava - - - io.netty - netty-transport - - - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.yang.netty, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.rev131119.*, - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - + + + com.google.guava + guava + + + io.netty + netty-transport + + + org.opendaylight.controller + config-api + + + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.yang.netty, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.rev131119.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/netty-event-executor-config/pom.xml b/opendaylight/config/netty-event-executor-config/pom.xml index 452c5ac715..b001dc76f7 100644 --- a/opendaylight/config/netty-event-executor-config/pom.xml +++ b/opendaylight/config/netty-event-executor-config/pom.xml @@ -1,92 +1,90 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - netty-event-executor-config - Configuration Wrapper around netty's event executor - bundle - ${project.artifactId} - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + netty-event-executor-config + bundle + ${project.artifactId} + Configuration Wrapper around netty's event executor + + 3.0.4 + - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - netty-config-api - - - org.slf4j - slf4j-api - + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + netty-config-api + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + - - - junit - junit - test - - - org.opendaylight.controller - config-manager - test - test-jar - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - + + + junit + junit + test + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-util + test + - + - - - - org.opendaylight.yangtools - yang-maven-plugin - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.eventexecutor.rev131112.*, - - - - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.eventexecutor.rev131112.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + - - - ${project.artifactId} - NETTY-EVENT-EXECUTOR-CONFIG Module site - ${basedir}/target/site/${project.artifactId} - - + + + ${project.artifactId} + NETTY-EVENT-EXECUTOR-CONFIG Module site + ${basedir}/target/site/${project.artifactId} + + diff --git a/opendaylight/config/netty-threadgroup-config/pom.xml b/opendaylight/config/netty-threadgroup-config/pom.xml index 332426faa5..8c86ca8354 100644 --- a/opendaylight/config/netty-threadgroup-config/pom.xml +++ b/opendaylight/config/netty-threadgroup-config/pom.xml @@ -2,94 +2,92 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - + 4.0.0 - 4.0.0 - netty-threadgroup-config - Configuration Wrapper around netty's event group - bundle - ${project.artifactId} - - 3.0.4 - + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + netty-threadgroup-config + bundle + ${project.artifactId} + Configuration Wrapper around netty's event group + + 3.0.4 + - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - netty-config-api - - - org.slf4j - slf4j-api - + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + netty-config-api + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + - - - junit - junit - test - - - org.opendaylight.controller - config-manager - test - test-jar - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - + + + junit + junit + test + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-util + test + - + - - + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.threadgroup.rev131107.*, + + + - - org.opendaylight.yangtools - yang-maven-plugin - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.threadgroup.rev131107.*, - - - - - - + + org.opendaylight.yangtools + yang-maven-plugin + + + - - - ${project.artifactId} - NETTY-THREADGROUP-CONFIG Module site - ${basedir}/target/site/${project.artifactId} - - + + + ${project.artifactId} + NETTY-THREADGROUP-CONFIG Module site + ${basedir}/target/site/${project.artifactId} + + diff --git a/opendaylight/config/netty-timer-config/pom.xml b/opendaylight/config/netty-timer-config/pom.xml index a056a1c126..6b3ecdbceb 100644 --- a/opendaylight/config/netty-timer-config/pom.xml +++ b/opendaylight/config/netty-timer-config/pom.xml @@ -1,100 +1,98 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - netty-timer-config - Configuration Wrapper around netty's timer - bundle - ${project.artifactId} - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + netty-timer-config + bundle + ${project.artifactId} + Configuration Wrapper around netty's timer + + 3.0.4 + - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - netty-config-api - - - org.opendaylight.controller - threadpool-config-api - - - org.slf4j - slf4j-api - + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + netty-config-api + + + org.opendaylight.controller + threadpool-config-api + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + - - - junit - junit - test - - - org.opendaylight.controller - config-manager - test - test-jar - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - - - org.opendaylight.controller - threadpool-config-impl - test - + + + junit + junit + test + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-util + test + + + org.opendaylight.controller + threadpool-config-impl + test + - + - - - - org.opendaylight.yangtools - yang-maven-plugin - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.timer.rev131119.*, - - - - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.netty.timer.rev131119.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + - - - ${project.artifactId} - NETTY-TIMER-CONFIG Module site - ${basedir}/target/site/${project.artifactId} - - + + + ${project.artifactId} + NETTY-TIMER-CONFIG Module site + ${basedir}/target/site/${project.artifactId} + + diff --git a/opendaylight/config/pom.xml b/opendaylight/config/pom.xml index 8efed2d9f6..bd2924ad9d 100644 --- a/opendaylight/config/pom.xml +++ b/opendaylight/config/pom.xml @@ -1,390 +1,228 @@ - - 4.0.0 - - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../commons/opendaylight - - - - 0.2.5-SNAPSHOT - config-subsystem - pom - ${project.artifactId} - - 3.0.4 - - - config-api - config-manager - config-plugin-parent - config-util - config-persister-api - config-persister-file-xml-adapter - yang-jmx-generator - yang-jmx-generator-plugin - yang-test - logback-config - threadpool-config-api - netty-config-api - threadpool-config-impl - netty-threadgroup-config - netty-event-executor-config - netty-timer-config - config-persister-directory-xml-adapter - yang-test-plugin - shutdown-api - shutdown-impl - config-module-archetype - - - - - integrationtests - - false - - - yang-jmx-generator-it - - - - - - UTF-8 - 1.7 - 1.7 - 4.10 - 2.4.0 - 5.0.0 - 0.6.2.201302030002 - 1.7.2 - - - - - junit - junit - test - - - ch.qos.logback - logback-classic - test - - - - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.osgi - org.osgi.core - ${osgi.version} - - - commons-io - commons-io - 2.4 - - - com.google.guava - guava - 14.0.1 - - - junit - junit - ${junit.version} - - - org.apache.commons - commons-lang3 - ${commons.lang.version} - - - - ${project.groupId} - config-api - ${config.version} - - - - ${project.groupId} - config-util - ${config.version} - - - ${project.groupId} - config-util - ${config.version} - test-jar - - - ${project.groupId} - config-manager - ${config.version} - - - ${project.groupId} - config-manager - ${config.version} - test-jar - - - ${project.groupId} - config-persister-api - ${config.version} - - - ${project.groupId} - config-persister-api - ${config.version} - test-jar - - - org.opendaylight.yangtools - binding-generator-spi - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-util - ${yangtools.version} - - - org.opendaylight.yangtools - yang-parser-impl - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-impl - ${yangtools.version} - - - ${project.groupId} - yang-test - ${config.version} - - - org.opendaylight.controller - yang-jmx-generator - ${config.version} - - - org.opendaylight.controller - yang-jmx-generator - ${config.version} - test-jar - - - org.opendaylight.yangtools - binding-type-provider - ${yangtools.version} - - - org.opendaylight.yangtools - yang-maven-plugin-spi - ${yangtools.version} - - - - org.opendaylight.controller - shutdown-api - ${config.version} - - - - - org.opendaylight.yangtools - yang-binding - ${yangtools.version} - - - org.opendaylight.yangtools - yang-common - ${yangtools.version} - - - org.opendaylight.yangtools - concepts - ${yangtools.version} - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - - prepare-agent - - - - report - prepare-package - - check - report - - - ${project.build.directory}/jacoco - false - - 80 - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - - - - + + + 4.0.0 + + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../commons/opendaylight + + config-subsystem + + 0.2.5-SNAPSHOT + pom + ${project.artifactId} + + 3.0.4 + + + config-api + config-manager + config-plugin-parent + config-util + config-persister-api + config-persister-file-xml-adapter + yang-jmx-generator + yang-jmx-generator-plugin + yang-test + logback-config + threadpool-config-api + netty-config-api + threadpool-config-impl + netty-threadgroup-config + netty-event-executor-config + netty-timer-config + config-persister-directory-xml-adapter + yang-test-plugin + shutdown-api + shutdown-impl + config-module-archetype + + + + + org.osgi + org.osgi.compendium + + + org.osgi + org.osgi.core + + + ch.qos.logback + logback-classic + test + + + junit + junit + test + + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + test-jar + + package + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.14.1 + + true + classes + 1C + false + true + 2 + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + org.opendaylight.yangtools yang-maven-plugin - ${yangtools.version} - - - sal - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - ${project.build.directory}/site/models - - - true - - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - package - - test-jar - - - - - - org.apache.felix - maven-bundle-plugin - ${maven.bundle.version} - true - - - ${project.groupId}.${project.artifactId} - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.14.1 - - true - classes - 1C - false - true - 2 - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.3 - - - org.codehaus.groovy.maven - gmaven-plugin - 1.0 - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.opendaylight.yangtools - - - yang-maven-plugin - - - [0.5.7-SNAPSHOT,) - - - - generate-sources - - - - - - - - - - - - - - + [0.5.7-SNAPSHOT,) + + generate-sources + + + + + + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${yangtools.version} + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + + + sal + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + ${project.build.directory}/site/models + + + true + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + + check + report + + prepare-package + + ${project.build.directory}/jacoco + false + + 80 + + + + + + + + + + + + integrationtests + + false + + + yang-jmx-generator-it + + + diff --git a/opendaylight/config/shutdown-api/pom.xml b/opendaylight/config/shutdown-api/pom.xml index 1e14bc4961..76c1cfdc54 100644 --- a/opendaylight/config/shutdown-api/pom.xml +++ b/opendaylight/config/shutdown-api/pom.xml @@ -1,46 +1,44 @@ - - config-plugin-parent - org.opendaylight.controller - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - bundle - shutdown-api + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + shutdown-api + bundle - - - com.google.guava - guava - - - org.opendaylight.controller - config-api - - + + + com.google.guava + guava + + + org.opendaylight.controller + config-api + + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.shutdown, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.shutdown, org.opendaylight.controller.config.yang.shutdown, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.shutdown.rev131218 - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.shutdown.rev131218 + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/shutdown-impl/pom.xml b/opendaylight/config/shutdown-impl/pom.xml index 8cf164d2a5..9895022df6 100644 --- a/opendaylight/config/shutdown-impl/pom.xml +++ b/opendaylight/config/shutdown-impl/pom.xml @@ -1,61 +1,61 @@ - - config-plugin-parent - org.opendaylight.controller - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - bundle - shutdown-impl + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + shutdown-impl + bundle - - - com.google.guava - guava - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - shutdown-api - - - org.opendaylight.controller - config-manager - test - test-jar - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - - + + + com.google.guava + guava + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + shutdown-api + + + org.opendaylight.yangtools + mockito-configuration + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-util + test + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.yangtools - yang-maven-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/threadpool-config-api/pom.xml b/opendaylight/config/threadpool-config-api/pom.xml index 7e45fa3c6b..c9a19515ef 100644 --- a/opendaylight/config/threadpool-config-api/pom.xml +++ b/opendaylight/config/threadpool-config-api/pom.xml @@ -1,50 +1,48 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - threadpool-config-api - ${project.artifactId} - bundle - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + threadpool-config-api + bundle + ${project.artifactId} + + 3.0.4 + - - - org.opendaylight.controller - config-api - - - com.google.guava - guava - - + + + com.google.guava + guava + + + org.opendaylight.controller + config-api + + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.threadpool, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.threadpool, org.opendaylight.controller.config.yang.threadpool, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.rev130409.*, - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.rev130409.*, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/threadpool-config-impl/pom.xml b/opendaylight/config/threadpool-config-impl/pom.xml index fcedbd85f1..4bc080bbff 100644 --- a/opendaylight/config/threadpool-config-impl/pom.xml +++ b/opendaylight/config/threadpool-config-impl/pom.xml @@ -1,91 +1,87 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - threadpool-config-impl - ${project.artifactId} - bundle - - 3.0.4 - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + threadpool-config-impl + bundle + ${project.artifactId} + + 3.0.4 + - - - ${project.groupId} - config-api - - - ${project.groupId} - threadpool-config-api - ${project.version} - - - com.google.guava - guava - - - org.slf4j - slf4j-api - + + + ${project.groupId} + config-api + + + ${project.groupId} + threadpool-config-api + ${project.version} + + + com.google.guava + guava + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + - - - org.opendaylight.controller - config-manager - test - test-jar - - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - - + + + org.opendaylight.controller + config-manager + test-jar + test + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-util + test + + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.threadpool.util, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.threadpool.util, javax.annotation.*, - org.opendaylight.controller.config.yang.threadpool.impl*, - - - org.opendaylight.controller.config.threadpool.util, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.impl.*, - - - - - - org.apache.maven.plugins - maven-jar-plugin - + org.opendaylight.controller.config.yang.threadpool.impl*, + org.opendaylight.controller.config.threadpool.util, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.threadpool.impl.*, + + + + + org.apache.maven.plugins + maven-jar-plugin + - - org.opendaylight.yangtools - yang-maven-plugin - - - + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java index b9731cd46d..177adc1588 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java @@ -1,107 +1,107 @@ -/* - * Copyright (c) 2013 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.config.threadpool.async; - -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.ObjectName; - -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.api.jmx.CommitStatus; -import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; -import org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory; -import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; -import org.opendaylight.controller.config.threadpool.scheduled.TestingScheduledThreadPoolModule; -import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; -import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleMXBean; - -public class AsyncEventBusConfigBeanTest extends AbstractConfigTest { - - private AsyncEventBusModuleFactory factory; - private final String instanceName = "async1"; - private final String poolImplName = "fixed1"; - - @Before - public void setUp() { - - ClassBasedModuleFactory scheduledThreadPoolConfigFactory = createClassBasedCBF( - TestingScheduledThreadPoolModule.class, poolImplName); - - factory = new AsyncEventBusModuleFactory(); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, - scheduledThreadPoolConfigFactory)); - } - - @Test - public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test")); - transaction.validateConfig(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 2, 0, 0); - } - - @Test - public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, - ValidationException { - - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test")); - - transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - - transaction = configRegistryClient.createTransaction(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 0, 0, 2); - - } - - @Test - public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, - InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - ObjectName poolCB = transaction.createModule(poolImplName, "pool-test"); - createAsynced(transaction, instanceName, poolCB); - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - try { - createAsynced(transaction, instanceName, poolCB); - fail(); - } catch (InstanceAlreadyExistsException e) { - assertThat( - e.getMessage(), - containsString("There is an instance registered with name ModuleIdentifier{factoryName='async-eventbus', instanceName='async1'}")); - } - } - - private ObjectName createAsynced(ConfigTransactionJMXClient transaction, String instanceName, ObjectName threadPool) - throws InstanceAlreadyExistsException { - ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); - AsyncEventBusModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, AsyncEventBusModuleMXBean.class); - mxBean.setThreadpool(threadPool); - return nameCreated; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.async; + +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.ObjectName; + +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.config.api.ConflictingVersionException; +import org.opendaylight.controller.config.api.ValidationException; +import org.opendaylight.controller.config.api.jmx.CommitStatus; +import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; +import org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory; +import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; +import org.opendaylight.controller.config.threadpool.scheduled.TestingScheduledThreadPoolModule; +import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleMXBean; + +public class AsyncEventBusConfigBeanTest extends AbstractConfigTest { + + private AsyncEventBusModuleFactory factory; + private final String instanceName = "async1"; + private final String poolImplName = "fixed1"; + + @Before + public void setUp() { + + ClassBasedModuleFactory scheduledThreadPoolConfigFactory = createClassBasedCBF( + TestingScheduledThreadPoolModule.class, poolImplName); + + factory = new AsyncEventBusModuleFactory(); + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, + scheduledThreadPoolConfigFactory)); + } + + @Test + public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test")); + transaction.validateConfig(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 2, 0, 0); + } + + @Test + public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, + ValidationException { + + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test")); + + transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + + transaction = configRegistryClient.createTransaction(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 0, 0, 2); + + } + + @Test + public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, + InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + ObjectName poolCB = transaction.createModule(poolImplName, "pool-test"); + createAsynced(transaction, instanceName, poolCB); + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + try { + createAsynced(transaction, instanceName, poolCB); + fail(); + } catch (InstanceAlreadyExistsException e) { + assertThat( + e.getMessage(), + containsString("There is an instance registered with name ModuleIdentifier{factoryName='async-eventbus', instanceName='async1'}")); + } + } + + private ObjectName createAsynced(ConfigTransactionJMXClient transaction, String instanceName, ObjectName threadPool) + throws InstanceAlreadyExistsException { + ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); + AsyncEventBusModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, AsyncEventBusModuleMXBean.class); + mxBean.setThreadpool(threadPool); + return nameCreated; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java index 01a89a987b..4431f78edb 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java @@ -1,35 +1,35 @@ -/* - * Copyright (c) 2013 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.config.threadpool.eventbus; - -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.mock; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.CloseableEventBus; -import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface; -import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean; - -public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface, - EventBusModuleMXBean { - - public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { - super(old, id); - } - - @Override - protected AutoCloseable prepareMockedInstance() throws Exception { - CloseableEventBus bus = mock(CloseableEventBus.class); - doNothing().when(bus).close(); - return bus; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.eventbus; + +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; + +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.CloseableEventBus; +import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean; + +public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface, + EventBusModuleMXBean { + + public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { + super(old, id); + } + + @Override + protected AutoCloseable prepareMockedInstance() throws Exception { + CloseableEventBus bus = mock(CloseableEventBus.class); + doNothing().when(bus).close(); + return bus; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java index 8bfd049b4b..781215da43 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java @@ -1,136 +1,136 @@ -/* - * Copyright (c) 2013 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.config.threadpool.fixed; - -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.api.jmx.CommitStatus; -import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; -import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; -import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; -import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleMXBean; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.ObjectName; - -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; - -public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest { - - private FixedThreadPoolModuleFactory factory; - private final String nameInstance = "fixedInstance"; - - @Before - public void setUp() { - factory = new FixedThreadPoolModuleFactory(); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, - new NamingThreadFactoryModuleFactory())); - } - - @Test - public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFixed(transaction, nameInstance, 2); - - transaction.validateConfig(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 2, 0, 0); - } - - @Test - public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, - ValidationException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFixed(transaction, nameInstance, 4); - - transaction.validateConfig(); - transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - - transaction = configRegistryClient.createTransaction(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 0, 0, 2); - } - - @Test - public void testNegative() throws ConflictingVersionException, ValidationException, InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createFixed(transaction, nameInstance, 5); - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - try { - createFixed(transaction, nameInstance, 0); - fail(); - } catch (InstanceAlreadyExistsException e) { - assertThat( - e.getMessage(), - containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-fixed', instanceName='fixedInstance'}")); - } - } - - @Test - public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException, - InstanceNotFoundException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFixed(transaction, nameInstance, 1); - - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - transaction.destroyConfigBean(factory.getImplementationName(), nameInstance); - CommitStatus status = transaction.commit(); - - assertBeanCount(0, factory.getImplementationName()); - assertStatus(status, 0, 0, 1); - } - - @Test - public void testValidationException() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFixed(transaction, nameInstance, -1); - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero")); - } - } - - private ObjectName createFixed(ConfigTransactionJMXClient transaction, String name, int numberOfThreads) - throws InstanceAlreadyExistsException { - ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), name); - FixedThreadPoolModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, FixedThreadPoolModuleMXBean.class); - mxBean.setMaxThreadCount(numberOfThreads); - - ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming"); - NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, - NamingThreadFactoryModuleMXBean.class); - namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); - - mxBean.setThreadFactory(threadFactoryON); - - return nameCreated; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.fixed; + +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.config.api.ConflictingVersionException; +import org.opendaylight.controller.config.api.ValidationException; +import org.opendaylight.controller.config.api.jmx.CommitStatus; +import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; +import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; +import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; +import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleMXBean; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.ObjectName; + +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; + +public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest { + + private FixedThreadPoolModuleFactory factory; + private final String nameInstance = "fixedInstance"; + + @Before + public void setUp() { + factory = new FixedThreadPoolModuleFactory(); + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, + new NamingThreadFactoryModuleFactory())); + } + + @Test + public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFixed(transaction, nameInstance, 2); + + transaction.validateConfig(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 2, 0, 0); + } + + @Test + public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, + ValidationException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFixed(transaction, nameInstance, 4); + + transaction.validateConfig(); + transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + + transaction = configRegistryClient.createTransaction(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 0, 0, 2); + } + + @Test + public void testNegative() throws ConflictingVersionException, ValidationException, InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createFixed(transaction, nameInstance, 5); + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + try { + createFixed(transaction, nameInstance, 0); + fail(); + } catch (InstanceAlreadyExistsException e) { + assertThat( + e.getMessage(), + containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-fixed', instanceName='fixedInstance'}")); + } + } + + @Test + public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException, + InstanceNotFoundException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFixed(transaction, nameInstance, 1); + + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + transaction.destroyConfigBean(factory.getImplementationName(), nameInstance); + CommitStatus status = transaction.commit(); + + assertBeanCount(0, factory.getImplementationName()); + assertStatus(status, 0, 0, 1); + } + + @Test + public void testValidationException() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFixed(transaction, nameInstance, -1); + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero")); + } + } + + private ObjectName createFixed(ConfigTransactionJMXClient transaction, String name, int numberOfThreads) + throws InstanceAlreadyExistsException { + ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), name); + FixedThreadPoolModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, FixedThreadPoolModuleMXBean.class); + mxBean.setMaxThreadCount(numberOfThreads); + + ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming"); + NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, + NamingThreadFactoryModuleMXBean.class); + namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); + + mxBean.setThreadFactory(threadFactoryON); + + return nameCreated; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java index 1fc0821405..03cf9d63a2 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java @@ -1,37 +1,37 @@ -/* - * Copyright (c) 2013 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.config.threadpool.fixed; - -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -import java.util.concurrent.ExecutorService; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper; -import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface; - -public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module { - - public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { - super(old, id); - } - - @Override - protected AutoCloseable prepareMockedInstance() throws Exception { - FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class); - doNothing().when(pool).close(); - doReturn(mock(ExecutorService.class)).when(pool).getExecutor(); - return pool; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.fixed; + +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import java.util.concurrent.ExecutorService; + +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper; +import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface; + +public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module { + + public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { + super(old, id); + } + + @Override + protected AutoCloseable prepareMockedInstance() throws Exception { + FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class); + doNothing().when(pool).close(); + doReturn(mock(ExecutorService.class)).when(pool).getExecutor(); + return pool; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java index 43cb7e1bcb..f0e8a108e7 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java @@ -1,180 +1,180 @@ -/* - * Copyright (c) 2013 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.config.threadpool.flexible; - -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.api.jmx.CommitStatus; -import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; -import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; -import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; -import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleMXBean; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.ObjectName; - -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; - -public class FlexibleThreadPoolConfigBeanTest extends AbstractConfigTest { - - private FlexibleThreadPoolModuleFactory flexibleFactory; - private final String instanceName = "flexible1"; - private final String threadFactoryName = "threadFactoryName"; - - @Before - public void setUp() { - - flexibleFactory = new FlexibleThreadPoolModuleFactory(); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(flexibleFactory, - new NamingThreadFactoryModuleFactory())); - } - - @Test - public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 20); - transaction.validateConfig(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, flexibleFactory.getImplementationName()); - assertStatus(status, 2, 0, 0); - } - - @Test - public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, - ValidationException { - - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 10); - - transaction.commit(); - - assertBeanCount(1, flexibleFactory.getImplementationName()); - - transaction = configRegistryClient.createTransaction(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, flexibleFactory.getImplementationName()); - assertStatus(status, 0, 0, 2); - - } - - @Test - public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - try { - createFlexible(transaction, instanceName, threadFactoryName, 1, 1, 2); - transaction.commit(); - } catch (InstanceAlreadyExistsException e1) { - fail(); - } - - transaction = configRegistryClient.createTransaction(); - try { - createFlexible(transaction, instanceName, "threadFactoryName1", 2, 2, 2); - fail(); - } catch (InstanceAlreadyExistsException e) { - assertThat( - e.getMessage(), - containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-flexible', instanceName='flexible1'}")); - } - } - - @Test - public void testValidationException() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createFlexible(transaction, instanceName, threadFactoryName, 0, 10, 10); - - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertThat(e.getMessage(), containsString("MinThreadCount must be greater than zero")); - } - } - - @Test - public void testValidationException2() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createFlexible(transaction, instanceName, threadFactoryName, 0, 0, 10); - - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertThat(e.getMessage(), containsString("KeepAliveMillis must be greater than zero")); - } - } - - @Test - public void testValidationException3() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createFlexible(transaction, instanceName, threadFactoryName, 10, 50, 0); - - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero")); - } - } - - private ObjectName createFlexible(ConfigTransactionJMXClient transaction, String instanceName, - String threadFactoryName, int minThreadCount, long keepAliveMillis, int maxThreadCount) - throws InstanceAlreadyExistsException { - - ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, threadFactoryName); - NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, - NamingThreadFactoryModuleMXBean.class); - namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); - - ObjectName flexibleON = transaction.createModule(flexibleFactory.getImplementationName(), instanceName); - FlexibleThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(flexibleON, - FlexibleThreadPoolModuleMXBean.class); - mxBean.setKeepAliveMillis(keepAliveMillis); - mxBean.setMaxThreadCount(maxThreadCount); - mxBean.setMinThreadCount(minThreadCount); - mxBean.setThreadFactory(threadFactoryON); - return flexibleON; - } - - @Test - public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException, InstanceNotFoundException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createFlexible(transaction, instanceName, threadFactoryName, 2, 2, 2); - - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - ObjectName databaseNew = transaction.lookupConfigBean(flexibleFactory.getImplementationName(), instanceName); - FlexibleThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, - FlexibleThreadPoolModuleMXBean.class); - proxy.setMaxThreadCount(99); - - CommitStatus status = transaction.commit(); - - assertBeanCount(1, flexibleFactory.getImplementationName()); - assertStatus(status, 0, 1, 1); - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.flexible; + +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.config.api.ConflictingVersionException; +import org.opendaylight.controller.config.api.ValidationException; +import org.opendaylight.controller.config.api.jmx.CommitStatus; +import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; +import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; +import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; +import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleMXBean; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.ObjectName; + +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; + +public class FlexibleThreadPoolConfigBeanTest extends AbstractConfigTest { + + private FlexibleThreadPoolModuleFactory flexibleFactory; + private final String instanceName = "flexible1"; + private final String threadFactoryName = "threadFactoryName"; + + @Before + public void setUp() { + + flexibleFactory = new FlexibleThreadPoolModuleFactory(); + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(flexibleFactory, + new NamingThreadFactoryModuleFactory())); + } + + @Test + public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 20); + transaction.validateConfig(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, flexibleFactory.getImplementationName()); + assertStatus(status, 2, 0, 0); + } + + @Test + public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, + ValidationException { + + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 10); + + transaction.commit(); + + assertBeanCount(1, flexibleFactory.getImplementationName()); + + transaction = configRegistryClient.createTransaction(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, flexibleFactory.getImplementationName()); + assertStatus(status, 0, 0, 2); + + } + + @Test + public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + try { + createFlexible(transaction, instanceName, threadFactoryName, 1, 1, 2); + transaction.commit(); + } catch (InstanceAlreadyExistsException e1) { + fail(); + } + + transaction = configRegistryClient.createTransaction(); + try { + createFlexible(transaction, instanceName, "threadFactoryName1", 2, 2, 2); + fail(); + } catch (InstanceAlreadyExistsException e) { + assertThat( + e.getMessage(), + containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-flexible', instanceName='flexible1'}")); + } + } + + @Test + public void testValidationException() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createFlexible(transaction, instanceName, threadFactoryName, 0, 10, 10); + + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertThat(e.getMessage(), containsString("MinThreadCount must be greater than zero")); + } + } + + @Test + public void testValidationException2() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createFlexible(transaction, instanceName, threadFactoryName, 0, 0, 10); + + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertThat(e.getMessage(), containsString("KeepAliveMillis must be greater than zero")); + } + } + + @Test + public void testValidationException3() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createFlexible(transaction, instanceName, threadFactoryName, 10, 50, 0); + + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero")); + } + } + + private ObjectName createFlexible(ConfigTransactionJMXClient transaction, String instanceName, + String threadFactoryName, int minThreadCount, long keepAliveMillis, int maxThreadCount) + throws InstanceAlreadyExistsException { + + ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, threadFactoryName); + NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, + NamingThreadFactoryModuleMXBean.class); + namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); + + ObjectName flexibleON = transaction.createModule(flexibleFactory.getImplementationName(), instanceName); + FlexibleThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(flexibleON, + FlexibleThreadPoolModuleMXBean.class); + mxBean.setKeepAliveMillis(keepAliveMillis); + mxBean.setMaxThreadCount(maxThreadCount); + mxBean.setMinThreadCount(minThreadCount); + mxBean.setThreadFactory(threadFactoryON); + return flexibleON; + } + + @Test + public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException, InstanceNotFoundException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createFlexible(transaction, instanceName, threadFactoryName, 2, 2, 2); + + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + ObjectName databaseNew = transaction.lookupConfigBean(flexibleFactory.getImplementationName(), instanceName); + FlexibleThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, + FlexibleThreadPoolModuleMXBean.class); + proxy.setMaxThreadCount(99); + + CommitStatus status = transaction.commit(); + + assertBeanCount(1, flexibleFactory.getImplementationName()); + assertStatus(status, 0, 1, 1); + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/NamingThreadPoolFactoryConfigBeanTest.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/NamingThreadPoolFactoryConfigBeanTest.java index 7280b04103..6dea96e21f 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/NamingThreadPoolFactoryConfigBeanTest.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/NamingThreadPoolFactoryConfigBeanTest.java @@ -1,143 +1,143 @@ -/* - * Copyright (c) 2013 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.config.threadpool.naming; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.ObjectName; - -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.api.jmx.CommitStatus; -import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; -import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; -import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; -import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; - -public class NamingThreadPoolFactoryConfigBeanTest extends AbstractConfigTest { - - private NamingThreadFactoryModuleFactory factory; - private final String instanceName = "named"; - - @Before - public void setUp() { - - factory = new NamingThreadFactoryModuleFactory(); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory)); - } - - @Test - public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createNamed(transaction, instanceName, "prefixes"); - transaction.validateConfig(); - CommitStatus status = transaction.commit(); - - assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); - assertEquals(1, status.getNewInstances().size()); - assertEquals(0, status.getRecreatedInstances().size()); - assertEquals(0, status.getReusedInstances().size()); - } - - @Test - public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, - ValidationException { - - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createNamed(transaction, instanceName, "prefixes"); - - transaction.commit(); - - assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); - - transaction = configRegistryClient.createTransaction(); - CommitStatus status = transaction.commit(); - - assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); - assertEquals(0, status.getNewInstances().size()); - assertEquals(0, status.getRecreatedInstances().size()); - assertEquals(1, status.getReusedInstances().size()); - - } - - @Test - public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, - InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createNamed(transaction, instanceName, "prefixes"); - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - try { - createNamed(transaction, instanceName, "prefixes1"); - fail(); - } catch (InstanceAlreadyExistsException e) { - assertThat( - e.getMessage(), - containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadfactory-naming', instanceName='named'}")); - } - } - - @Test - public void testValidationException() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); - transaction.newMXBeanProxy(nameCreated, ThreadFactoryServiceInterface.class); - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName())); - assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size()); - } - } - - @Test - public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException, InstanceNotFoundException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createNamed(transaction, instanceName, "pref"); - - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName); - NamingThreadFactoryModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, - NamingThreadFactoryModuleMXBean.class); - proxy.setNamePrefix("pref1"); - - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 0, 1, 0); - } - - private ObjectName createNamed(ConfigTransactionJMXClient transaction, String instanceName, String prefixes) - throws InstanceAlreadyExistsException { - ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); - NamingThreadFactoryModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, - NamingThreadFactoryModuleMXBean.class); - mxBean.setNamePrefix(prefixes); - return nameCreated; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.naming; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.ObjectName; + +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.config.api.ConflictingVersionException; +import org.opendaylight.controller.config.api.ValidationException; +import org.opendaylight.controller.config.api.jmx.CommitStatus; +import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; +import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; +import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; + +public class NamingThreadPoolFactoryConfigBeanTest extends AbstractConfigTest { + + private NamingThreadFactoryModuleFactory factory; + private final String instanceName = "named"; + + @Before + public void setUp() { + + factory = new NamingThreadFactoryModuleFactory(); + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory)); + } + + @Test + public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createNamed(transaction, instanceName, "prefixes"); + transaction.validateConfig(); + CommitStatus status = transaction.commit(); + + assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); + assertEquals(1, status.getNewInstances().size()); + assertEquals(0, status.getRecreatedInstances().size()); + assertEquals(0, status.getReusedInstances().size()); + } + + @Test + public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, + ValidationException { + + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createNamed(transaction, instanceName, "prefixes"); + + transaction.commit(); + + assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); + + transaction = configRegistryClient.createTransaction(); + CommitStatus status = transaction.commit(); + + assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size()); + assertEquals(0, status.getNewInstances().size()); + assertEquals(0, status.getRecreatedInstances().size()); + assertEquals(1, status.getReusedInstances().size()); + + } + + @Test + public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, + InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createNamed(transaction, instanceName, "prefixes"); + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + try { + createNamed(transaction, instanceName, "prefixes1"); + fail(); + } catch (InstanceAlreadyExistsException e) { + assertThat( + e.getMessage(), + containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadfactory-naming', instanceName='named'}")); + } + } + + @Test + public void testValidationException() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); + transaction.newMXBeanProxy(nameCreated, ThreadFactoryServiceInterface.class); + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName())); + assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size()); + } + } + + @Test + public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException, InstanceNotFoundException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createNamed(transaction, instanceName, "pref"); + + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName); + NamingThreadFactoryModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, + NamingThreadFactoryModuleMXBean.class); + proxy.setNamePrefix("pref1"); + + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 0, 1, 0); + } + + private ObjectName createNamed(ConfigTransactionJMXClient transaction, String instanceName, String prefixes) + throws InstanceAlreadyExistsException { + ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); + NamingThreadFactoryModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, + NamingThreadFactoryModuleMXBean.class); + mxBean.setNamePrefix(prefixes); + return nameCreated; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java index f22da34d76..47613bfb1b 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java @@ -1,66 +1,66 @@ -/* - * Copyright (c) 2013 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.config.threadpool.naming; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -import java.io.Closeable; -import java.io.IOException; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory; -import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; - -public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface, - NamingThreadFactoryModuleMXBean { - - private final NamingThreadPoolFactory fact; - - public TestingNamingThreadPoolFactoryModule() throws IOException { - fact = mock(NamingThreadPoolFactory.class); - Thread thread = mock(Thread.class); - doNothing().when(thread).start(); - doReturn(thread).when(fact).newThread(any(Runnable.class)); - doNothing().when(fact).close(); - } - - public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) { - fact = (NamingThreadPoolFactory) old.getInstance(); - } - - @Override - public ModuleIdentifier getIdentifier() { - return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock"); - } - - @Override - public String getNamePrefix() { - return null; - } - - @Override - public void setNamePrefix(String arg) { - throw new UnsupportedOperationException(); - } - - @Override - public void validate() { - } - - @Override - public Closeable getInstance() { - return fact; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.naming; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import java.io.Closeable; +import java.io.IOException; + +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory; +import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; + +public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface, + NamingThreadFactoryModuleMXBean { + + private final NamingThreadPoolFactory fact; + + public TestingNamingThreadPoolFactoryModule() throws IOException { + fact = mock(NamingThreadPoolFactory.class); + Thread thread = mock(Thread.class); + doNothing().when(thread).start(); + doReturn(thread).when(fact).newThread(any(Runnable.class)); + doNothing().when(fact).close(); + } + + public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) { + fact = (NamingThreadPoolFactory) old.getInstance(); + } + + @Override + public ModuleIdentifier getIdentifier() { + return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock"); + } + + @Override + public String getNamePrefix() { + return null; + } + + @Override + public void setNamePrefix(String arg) { + throw new UnsupportedOperationException(); + } + + @Override + public void validate() { + } + + @Override + public Closeable getInstance() { + return fact; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/ScheduledThreadPoolConfigBeanTest.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/ScheduledThreadPoolConfigBeanTest.java index 6183cb56c1..538d43726b 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/ScheduledThreadPoolConfigBeanTest.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/ScheduledThreadPoolConfigBeanTest.java @@ -1,161 +1,161 @@ -/* - * Copyright (c) 2013 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.config.threadpool.scheduled; - -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.config.api.ValidationException; -import org.opendaylight.controller.config.api.jmx.CommitStatus; -import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; -import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; -import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; -import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleFactory; -import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.ObjectName; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; - -public class ScheduledThreadPoolConfigBeanTest extends AbstractConfigTest { - - private ScheduledThreadPoolModuleFactory factory; - private final String instanceName = "scheduled1"; - - @Before - public void setUp() { - - factory = new ScheduledThreadPoolModuleFactory(); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, - new NamingThreadFactoryModuleFactory())); - } - - @Test - public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - - createScheduled(transaction, instanceName, 1); - transaction.validateConfig(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 2, 0, 0); - } - - @Test - public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, - ValidationException { - - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createScheduled(transaction, instanceName, 1); - - transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - - transaction = configRegistryClient.createTransaction(); - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 0, 0, 2); - } - - @Test - public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, - ConflictingVersionException, InstanceNotFoundException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createScheduled(transaction, instanceName, 1); - - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName); - ScheduledThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, - ScheduledThreadPoolModuleMXBean.class); - proxy.setMaxThreadCount(99); - - CommitStatus status = transaction.commit(); - - assertBeanCount(1, factory.getImplementationName()); - assertStatus(status, 0, 1, 1); - } - - @Test - public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException, - InstanceNotFoundException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createScheduled(transaction, instanceName, 1); - - transaction.commit(); - - transaction = configRegistryClient.createTransaction(); - transaction.destroyConfigBean(factory.getImplementationName(), instanceName); - CommitStatus status = transaction.commit(); - - assertBeanCount(0, factory.getImplementationName()); - assertStatus(status, 0, 0, 1); - } - - @Test - public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, - InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createScheduled(transaction, instanceName, 1); - transaction.commit(); - transaction = configRegistryClient.createTransaction(); - try { - createScheduled(transaction, instanceName, 2); - fail(); - } catch (InstanceAlreadyExistsException e) { - assertThat( - e.getMessage(), - containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-scheduled', instanceName='scheduled1'}")); - } - } - - @Test - public void testValidationException() throws InstanceAlreadyExistsException { - ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); - createScheduled(transaction, instanceName, 0); - - try { - transaction.validateConfig(); - fail(); - } catch (ValidationException e) { - assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName())); - assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size()); - } - } - - private ObjectName createScheduled(ConfigTransactionJMXClient transaction, String instanceName, int maxThreadCount) - throws InstanceAlreadyExistsException { - ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); - ScheduledThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, - ScheduledThreadPoolModuleMXBean.class); - mxBean.setMaxThreadCount(maxThreadCount); - - ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming"); - NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, - NamingThreadFactoryModuleMXBean.class); - namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); - - mxBean.setThreadFactory(threadFactoryON); - - return nameCreated; - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.scheduled; + +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.config.api.ConflictingVersionException; +import org.opendaylight.controller.config.api.ValidationException; +import org.opendaylight.controller.config.api.jmx.CommitStatus; +import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; +import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; +import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; +import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleFactory; +import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.ObjectName; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; + +public class ScheduledThreadPoolConfigBeanTest extends AbstractConfigTest { + + private ScheduledThreadPoolModuleFactory factory; + private final String instanceName = "scheduled1"; + + @Before + public void setUp() { + + factory = new ScheduledThreadPoolModuleFactory(); + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory, + new NamingThreadFactoryModuleFactory())); + } + + @Test + public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + + createScheduled(transaction, instanceName, 1); + transaction.validateConfig(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 2, 0, 0); + } + + @Test + public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, + ValidationException { + + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createScheduled(transaction, instanceName, 1); + + transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + + transaction = configRegistryClient.createTransaction(); + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 0, 0, 2); + } + + @Test + public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException, + ConflictingVersionException, InstanceNotFoundException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createScheduled(transaction, instanceName, 1); + + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName); + ScheduledThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew, + ScheduledThreadPoolModuleMXBean.class); + proxy.setMaxThreadCount(99); + + CommitStatus status = transaction.commit(); + + assertBeanCount(1, factory.getImplementationName()); + assertStatus(status, 0, 1, 1); + } + + @Test + public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException, + InstanceNotFoundException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createScheduled(transaction, instanceName, 1); + + transaction.commit(); + + transaction = configRegistryClient.createTransaction(); + transaction.destroyConfigBean(factory.getImplementationName(), instanceName); + CommitStatus status = transaction.commit(); + + assertBeanCount(0, factory.getImplementationName()); + assertStatus(status, 0, 0, 1); + } + + @Test + public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException, + InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createScheduled(transaction, instanceName, 1); + transaction.commit(); + transaction = configRegistryClient.createTransaction(); + try { + createScheduled(transaction, instanceName, 2); + fail(); + } catch (InstanceAlreadyExistsException e) { + assertThat( + e.getMessage(), + containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-scheduled', instanceName='scheduled1'}")); + } + } + + @Test + public void testValidationException() throws InstanceAlreadyExistsException { + ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction(); + createScheduled(transaction, instanceName, 0); + + try { + transaction.validateConfig(); + fail(); + } catch (ValidationException e) { + assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName())); + assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size()); + } + } + + private ObjectName createScheduled(ConfigTransactionJMXClient transaction, String instanceName, int maxThreadCount) + throws InstanceAlreadyExistsException { + ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName); + ScheduledThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, + ScheduledThreadPoolModuleMXBean.class); + mxBean.setMaxThreadCount(maxThreadCount); + + ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming"); + NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON, + NamingThreadFactoryModuleMXBean.class); + namingThreadFactoryModuleMXBean.setNamePrefix("prefix"); + + mxBean.setThreadFactory(threadFactoryON); + + return nameCreated; + } + +} diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java index 0fe5b0d183..2ba1b3b20d 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java @@ -1,82 +1,82 @@ -/* - * Copyright (c) 2013 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.config.threadpool.scheduled; - -import com.google.common.util.concurrent.ListenableFutureTask; -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWrapper; -import org.opendaylight.controller.config.yang.threadpool.ScheduledThreadPoolServiceInterface; -import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean; - -import javax.management.ObjectName; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -public class TestingScheduledThreadPoolModule extends AbstractMockedModule implements - ScheduledThreadPoolServiceInterface, Module, ScheduledThreadPoolModuleMXBean { - - public TestingScheduledThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { - super(old, id); - } - - @Override - protected AutoCloseable prepareMockedInstance() throws Exception { - ScheduledThreadPoolWrapper instance = mock(ScheduledThreadPoolWrapper.class); - ScheduledExecutorService ses = mock(ScheduledExecutorService.class); - {// mockFuture - ScheduledFuture future = mock(ScheduledFuture.class); - doReturn(false).when(future).cancel(anyBoolean()); - try { - doReturn(mock(Object.class)).when(future).get(); - } catch (Exception e) { - throw new RuntimeException(e); - } - doReturn(future).when(ses).schedule(any(Runnable.class), any(Long.class), any(TimeUnit.class)); - doReturn(future).when(ses).scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(), - any(TimeUnit.class)); - - } - doNothing().when(ses).execute(any(Runnable.class)); - doNothing().when(ses).execute(any(ListenableFutureTask.class)); - doReturn(ses).when(instance).getExecutor(); - doNothing().when(instance).close(); - - doReturn(1).when(instance).getMaxThreadCount(); - return instance; - } - - @Override - public ObjectName getThreadFactory() { - return any(ObjectName.class); - } - - @Override - public void setThreadFactory(ObjectName threadFactory) { - } - - @Override - public Integer getMaxThreadCount() { - return 1; - } - - @Override - public void setMaxThreadCount(Integer maxThreadCount) { - } - -} +/* + * Copyright (c) 2013 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.config.threadpool.scheduled; + +import com.google.common.util.concurrent.ListenableFutureTask; +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWrapper; +import org.opendaylight.controller.config.yang.threadpool.ScheduledThreadPoolServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean; + +import javax.management.ObjectName; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Matchers.anyLong; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +public class TestingScheduledThreadPoolModule extends AbstractMockedModule implements + ScheduledThreadPoolServiceInterface, Module, ScheduledThreadPoolModuleMXBean { + + public TestingScheduledThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { + super(old, id); + } + + @Override + protected AutoCloseable prepareMockedInstance() throws Exception { + ScheduledThreadPoolWrapper instance = mock(ScheduledThreadPoolWrapper.class); + ScheduledExecutorService ses = mock(ScheduledExecutorService.class); + {// mockFuture + ScheduledFuture future = mock(ScheduledFuture.class); + doReturn(false).when(future).cancel(anyBoolean()); + try { + doReturn(mock(Object.class)).when(future).get(); + } catch (Exception e) { + throw new RuntimeException(e); + } + doReturn(future).when(ses).schedule(any(Runnable.class), any(Long.class), any(TimeUnit.class)); + doReturn(future).when(ses).scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(), + any(TimeUnit.class)); + + } + doNothing().when(ses).execute(any(Runnable.class)); + doNothing().when(ses).execute(any(ListenableFutureTask.class)); + doReturn(ses).when(instance).getExecutor(); + doNothing().when(instance).close(); + + doReturn(1).when(instance).getMaxThreadCount(); + return instance; + } + + @Override + public ObjectName getThreadFactory() { + return any(ObjectName.class); + } + + @Override + public void setThreadFactory(ObjectName threadFactory) { + } + + @Override + public Integer getMaxThreadCount() { + return 1; + } + + @Override + public void setMaxThreadCount(Integer maxThreadCount) { + } + +} diff --git a/opendaylight/config/yang-jmx-generator-it/pom.xml b/opendaylight/config/yang-jmx-generator-it/pom.xml index f081b7bd38..c91881bd3e 100644 --- a/opendaylight/config/yang-jmx-generator-it/pom.xml +++ b/opendaylight/config/yang-jmx-generator-it/pom.xml @@ -1,80 +1,80 @@ - + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + - yang-jmx-generator-it - ${project.artifactId} + yang-jmx-generator-it + ${project.artifactId} - - - ${project.groupId} - config-api - test - - - ${project.groupId} - yang-test - test - - - ${project.groupId} - config-manager - test - test-jar - - - ${project.groupId} - config-manager - test - - - ${project.groupId} - config-util - test - - - org.opendaylight.yangtools - mockito-configuration - - + + + org.opendaylight.yangtools + mockito-configuration + + + ${project.groupId} + config-api + test + + + ${project.groupId} + config-manager + test-jar + test + + + ${project.groupId} + config-manager + test + + + ${project.groupId} + config-util + test + + + ${project.groupId} + yang-test + test + + - - - - org.apache.maven.plugins - maven-surefire-plugin - - 1 - false - false - - - - default-test - - true - - - - integration-tests - integration-test - - test - - - - **/org/opendaylight/controller/config/yangjmxgenerator/it/*.java - - false - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + false + + + + default-test + + true + + + + integration-tests + + test + + integration-test + + + **/org/opendaylight/controller/config/yangjmxgenerator/it/*.java + + false + + + + + + diff --git a/opendaylight/config/yang-jmx-generator-plugin/pom.xml b/opendaylight/config/yang-jmx-generator-plugin/pom.xml index a8119b81ae..2d49ed7fab 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/pom.xml +++ b/opendaylight/config/yang-jmx-generator-plugin/pom.xml @@ -1,123 +1,155 @@ + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - .. - - yang-jmx-generator-plugin - - - - - org.slf4j - slf4j-api - - - - org.opendaylight.controller - yang-jmx-generator - - - - org.opendaylight.yangtools - yang-maven-plugin-spi - - - - org.opendaylight.yangtools - binding-type-provider - - - - org.eclipse.jdt - core - 3.3.0-v_771 - test - - - - org.eclipse.equinox - app - - - - - - - org.eclipse.equinox - app - 1.0.0-v20070606 - test - - - - - org.freemarker - freemarker - 2.3.20 - - - - ${project.groupId} - config-api - - - - commons-io - commons-io - - - - com.jcabi - jcabi-maven-slf4j - 0.8 - - - - com.google.guava - guava - - - - org.opendaylight.controller - yang-jmx-generator - test - test-jar - - - - org.eclipse - jdt - 3.3.0-v20070607-1300 - test - - - - org.eclipse.equinox - app - - - - - - org.opendaylight.yangtools - mockito-configuration - - - - org.apache.commons - commons-lang3 - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + .. + + yang-jmx-generator-plugin + + + + + ${project.groupId} + config-api + + + + com.google.guava + guava + + + + com.jcabi + jcabi-maven-slf4j + 0.8 + + + + commons-io + commons-io + + + + org.apache.commons + commons-lang3 + + + + org.codehaus.gmaven.runtime + gmaven-runtime-2.0 + 1.5 + + + org.sonatype.gossip + gossip + + + + + + org.opendaylight.controller + yang-jmx-generator + + + + org.opendaylight.yangtools + binding-type-provider + + + + org.opendaylight.yangtools + mockito-configuration + + + + org.opendaylight.yangtools + yang-maven-plugin-spi + + + + org.slf4j + slf4j-api + + + + net.sourceforge.pmd + pmd + 5.1.0 + test + + + + org.eclipse + jdt + 3.3.0-v20070607-1300 + test + + + + org.eclipse.equinox + app + + + + + + org.eclipse.equinox + app + 1.0.0-v20070606 + test + + + + org.eclipse.jdt + core + 3.3.0-v_771 + test + + + + org.eclipse.equinox + app + + + + + + + org.opendaylight.controller + yang-jmx-generator + test-jar + test + + + + + + + + maven-compiler-plugin + 3.1 + + groovy-eclipse-compiler + false + + + + + org.codehaus.groovy + groovy-eclipse-batch + 2.1.8-01 + + + org.codehaus.groovy + groovy-eclipse-compiler + 2.8.0-01 + + + + + + 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 13d828a430..dd2b504da9 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 @@ -7,17 +7,155 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin; +import com.google.common.base.Optional; +import com.google.common.collect.Lists; +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; +import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry; +import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralClassTemplate; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralInterfaceTemplate; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.StubFactoryTemplate; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.AbsFactoryGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.AbsModuleGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.ConcreteModuleGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.GenericGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; -import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; -import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry; +final class CodeWriter { + + 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); + 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); + throw new RuntimeException(message, e); + } + } + + public List writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir, + File mainBaseDir) { + try { + List generatedFiles = Lists.newArrayList(); + + + Map gos = new HashMap<>(); + + // generate mx interface and abstract factory + + // TOs + Map tosFromMbe = TemplateFactory.tOsFromMbe(mbe); + for(GeneralClassTemplate template: tosFromMbe.values()) { + gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, copyright), true); + } + + // MXBean interface + GeneralInterfaceTemplate ifcTemplate = TemplateFactory.mXBeanInterfaceTemplateFromMbe(mbe); + gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(ifcTemplate, copyright), true); + + + // generate abstract factory + gos.put(new AbsFactoryGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true); + + // generate abstract module + gos.put(new AbsModuleGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true); + + // generate concrete factory + StubFactoryTemplate concreteFactory = TemplateFactory.stubFactoryTemplateFromMbe(mbe); + gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(concreteFactory, copyright), false); + + + // generate concrete module + + 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); + } + + generatedFiles.addAll(persistGeneratedObjects(targetBaseDir, mainBaseDir, gos)); + + // purge nulls + for (Iterator it = generatedFiles.iterator(); it.hasNext(); ) { + if (it.next() == null) { + it.remove(); + } + } + + return generatedFiles; + + } catch (Exception e) { + String message = "An error occurred during Module generating, mbe:" + + mbe.getJavaNamePrefix(); + logger.error(message, e); + throw new RuntimeException(message, e); + } + } -public interface CodeWriter { + private List persistGeneratedObjects(File targetBaseDir, File mainBaseDir, Map gos) throws IOException { + List generatedFiles = new ArrayList<>(); + for (Entry entry : gos.entrySet()) { + boolean overwrite = entry.getValue(); + File dst; + if (overwrite) { + dst = targetBaseDir; + } else { + dst = mainBaseDir; + } + Optional> maybePersistEntry = entry.getKey().persist(dst, overwrite); - File writeSie(ServiceInterfaceEntry sie, File targetBaseDir); + if (maybePersistEntry.isPresent()) { + generatedFiles.add(maybePersistEntry.get().getValue()); + } + } + return generatedFiles; + } - List writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir, - File mainBaseDir, File resourceBaseDir); + private List getRuntimeBeanFtlTemplates(Collection runtimeBeans) { + if (runtimeBeans.isEmpty()) { + return Collections.emptyList(); + } + List allFtlFiles = new ArrayList<>(); + { // registrators + Map registratorNamesToFtls = RuntimeRegistratorFtlTemplate + .create(RuntimeRegistratorFtlTemplate.findRoot(runtimeBeans)); + allFtlFiles.addAll(registratorNamesToFtls.values()); + } + { // TOs, MXBean interfaces + for (RuntimeBeanEntry runtimeBeanEntry : runtimeBeans) { + Collection ftlFiles = TemplateFactory + .getTOAndMXInterfaceFtlFiles(runtimeBeanEntry) + .values(); + allFtlFiles.addAll(ftlFiles); + } + } + return allFtlFiles; + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java deleted file mode 100644 index 2b84ed1d45..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; -import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry; -import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlFilePersister; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Lists; - -final class FreeMarkerCodeWriterImpl implements CodeWriter { - - private static final Logger logger = LoggerFactory - .getLogger(FreeMarkerCodeWriterImpl.class); - - private final FtlFilePersister ftlFilePersister = new FtlFilePersister(); - - public FreeMarkerCodeWriterImpl() { - } - - @Override - public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) { - try { - Collection values = TemplateFactory.getFtlTemplates( - sie).values(); - return ftlFilePersister.persist(values, outputBaseDir, true).get(0); - } catch (Exception e) { - String message = "An error occurred during Service interface generating, sie:" - + sie.getTypeName() + ", " + sie.getFullyQualifiedName(); - logger.error(message, e); - throw new RuntimeException(message, e); - } - } - - @Override - public List writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir, - File mainBaseDir, File resourceBaseDir) { - try { - List generatedFiles = Lists.newArrayList(); - - generatedFiles.addAll(ftlFilePersister.persist(TemplateFactory - .getFtlTemplates(mbe).values(), targetBaseDir, true)); - generatedFiles.addAll(ftlFilePersister.persist(TemplateFactory - .getFtlStubTemplates(mbe).values(), mainBaseDir, false)); - - // write runtime bean MXBeans and registrators - Collection runtimeBeans = mbe.getRuntimeBeans(); - if (runtimeBeans.size() > 0) { - List allFtlFiles = new ArrayList<>(); - { // registrators - Map registratorNamesToFtls = RuntimeRegistratorFtlTemplate - .create(RuntimeRegistratorFtlTemplate.findRoot(runtimeBeans)); - - allFtlFiles.addAll(registratorNamesToFtls.values()); - } - { // TOs, MXBean interfaces - for (RuntimeBeanEntry runtimeBeanEntry : runtimeBeans) { - Collection ftlFiles = TemplateFactory - .getTOAndMXInterfaceFtlFiles(runtimeBeanEntry) - .values(); - allFtlFiles.addAll(ftlFiles); - } - } - boolean overwrite = true; - - FtlFilePersister ftlFilePersister = new FtlFilePersister(); - List persisted = ftlFilePersister.persist(allFtlFiles, - targetBaseDir, overwrite); - // FIXME: check for intersection - generatedFiles.addAll(persisted); - } - - // purge nulls - for (Iterator it = generatedFiles.iterator(); it.hasNext();) { - if (it.next() == null) { - it.remove(); - } - } - - return generatedFiles; - - } catch (Exception e) { - String message = "An error occurred during Module generating, mbe:" - + mbe.getJavaNamePrefix(); - 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 e41ac66952..1b8905b987 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 @@ -12,16 +12,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.apache.commons.io.FileUtils; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; @@ -40,6 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.impl.StaticLoggerBinder; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * This class interfaces with yang-maven-plugin. Gets parsed yang modules in * {@link SchemaContext}, and parameters form the plugin configuration, and @@ -61,7 +62,7 @@ public class JMXGenerator implements CodeGenerator { private boolean generateModuleFactoryFile = true; public JMXGenerator() { - this.codeWriter = new FreeMarkerCodeWriterImpl(); + this.codeWriter = new CodeWriter(); } public JMXGenerator(CodeWriter codeWriter) { @@ -139,7 +140,7 @@ public class JMXGenerator implements CodeGenerator { ModuleMXBeanEntry mbe = mbeEntry.getValue(); try { List files1 = codeWriter.writeMbe(mbe, outputBaseDir, - mainBaseDir, resourceBaseDir); + mainBaseDir); generatedFiles.addFile(files1); } catch (Exception e) { throw new RuntimeException( 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 35dc7a3600..c3e51d6550 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 @@ -8,94 +8,26 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; import com.google.common.collect.Lists; -import org.opendaylight.controller.config.api.DependencyResolver; -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface; -import org.opendaylight.controller.config.spi.Module; import org.opendaylight.controller.config.spi.ModuleFactory; -import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition; -import org.osgi.framework.BundleContext; import java.util.Collections; import java.util.List; -/** - * - */ public class AbstractFactoryTemplate extends GeneralClassTemplate { private static final List implementedIfcs = Lists .newArrayList(ModuleFactory.class.getCanonicalName()); - private final String globallyUniqueName, moduleInstanceType; - private final List providedServices; - private final ModuleMXBeanEntry mbe; - public AbstractFactoryTemplate(Header header, String packageName, - String abstractFactoryName, String globallyUniqueName, - String moduleInstanceType, List fields, - List providedServices, ModuleMXBeanEntry mbe) { + String abstractFactoryName, + List fields) { super(header, packageName, abstractFactoryName, Collections . emptyList(), implementedIfcs, fields, Collections . emptyList(), true, false, Collections . emptyList()); - this.globallyUniqueName = globallyUniqueName; - this.moduleInstanceType = moduleInstanceType; - this.providedServices = providedServices; - this.mbe = mbe; - } - - public String getGloballyUniqueName() { - return globallyUniqueName; - } - - public String getInstanceType() { - return AutoCloseable.class.getCanonicalName(); - } - - public String getModuleNameType() { - return ModuleIdentifier.class.getCanonicalName(); - } - - public String getModuleInstanceType() { - return moduleInstanceType; - } - - public String getAbstractServiceInterfaceType() { - return AbstractServiceInterface.class.getCanonicalName(); - } - - public List getProvidedServices() { - return providedServices; - } - - public String getModuleType() { - return Module.class.getCanonicalName(); - } - - public String getDependencyResolverType() { - return DependencyResolver.class.getCanonicalName(); - } - - public String getDynamicMBeanWithInstanceType() { - return DynamicMBeanWithInstance.class.getCanonicalName(); - } - - public String getBundleContextType() { - return BundleContext.class.getCanonicalName(); - } - - @Override - public String getFtlTempleteLocation() { - return "factory_abs_template.ftl"; - } - - public ModuleMXBeanEntry getMbe() { - return mbe; } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java index 7f80299f00..a9599783e6 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java @@ -7,17 +7,18 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; -import java.io.File; -import java.util.List; - +import com.google.common.base.Optional; +import com.google.common.collect.Lists; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration; import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper; -import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; public abstract class AbstractFtlTemplate implements FtlTemplate { private final String packageName; @@ -44,6 +45,15 @@ public abstract class AbstractFtlTemplate implements FtlTemplate { return header; } + @Override + public Optional getHeaderString() { + if (header == null) { + return Optional.absent(); + } else { + return Optional.of(header.toString()); + } + } + @Override public String getFullyQualifiedName() { return FullyQualifiedNameHelper.getFullyQualifiedName(getPackageName(), @@ -60,9 +70,14 @@ public abstract class AbstractFtlTemplate implements FtlTemplate { return typeDeclaration; } + @Override - public String getJavadoc() { - return javadoc; + public Optional getMaybeJavadoc() { + if (javadoc == null) { + return Optional.absent(); + } else { + return Optional.of(javadoc); + } } public void setJavadoc(String javadoc) { @@ -84,15 +99,10 @@ public abstract class AbstractFtlTemplate implements FtlTemplate { return methods; } - @Override - public File getRelativeFile() { - return new File(packageName.replace(".", File.separator), - getTypeDeclaration().getName() + ".java"); - } @Override - public String getFtlTempleteLocation() { - return "abstract_ftl_file.ftl"; + public List getConstructors() { + return Collections.emptyList(); } @Override diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java index c40bfdfb9f..92a71c2530 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java @@ -7,26 +7,15 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; -import java.util.Collections; -import java.util.List; - -import org.opendaylight.controller.config.api.DependencyResolver; -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface; -import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator; -import org.opendaylight.controller.config.spi.Module; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -/** - * - */ +import java.util.Collections; +import java.util.List; + public class AbstractModuleTemplate extends GeneralClassTemplate { private final List moduleFields; @@ -50,22 +39,6 @@ public class AbstractModuleTemplate extends GeneralClassTemplate { return moduleFields; } - public String getInstanceType() { - return AutoCloseable.class.getCanonicalName(); - } - - public String getModuleNameType() { - return ModuleIdentifier.class.getCanonicalName(); - } - - public String getAbstractServiceInterfaceType() { - return AbstractServiceInterface.class.getCanonicalName(); - } - - public String getModuleType() { - return Module.class.getCanonicalName(); - } - public String getRegistratorType() { return registratorType; } @@ -74,29 +47,4 @@ public class AbstractModuleTemplate extends GeneralClassTemplate { return runtime; } - public String getDependencyResolverType() { - return DependencyResolver.class.getCanonicalName(); - } - - public String getDynamicMBeanWithInstanceType() { - return DynamicMBeanWithInstance.class.getCanonicalName(); - } - - public String getRootRuntimeRegistratorType() { - return RootRuntimeBeanRegistrator.class.getCanonicalName(); - } - - @Override - public String getFtlTempleteLocation() { - return "module_abs_template_new.ftl"; - } - - public String getLoggerType() { - return Logger.class.getCanonicalName(); - } - - public String getLoggerFactoryType() { - return LoggerFactory.class.getCanonicalName(); - } - } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java deleted file mode 100644 index 37d5e6bd3f..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl; - -import com.google.common.annotations.VisibleForTesting; -import freemarker.template.Configuration; -import freemarker.template.Template; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.AnnotationsDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.ConstructorsDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.FieldsDirectiveProg; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.HeaderDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.JavadocDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.MethodsDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.ModuleFieldsDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.TypeDeclarationDirective; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.UnimplementedExceptionDirective; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.regex.Pattern; - -public class FtlFilePersister { - private static final Logger logger = LoggerFactory - .getLogger(FtlFilePersister.class); - - private static final Pattern TRAILING_WHITESPACES = Pattern.compile(" +$", Pattern.MULTILINE); - - @VisibleForTesting - public Map serializeFtls( - Collection ftlFiles) { - Map result = new HashMap<>(); - for (FtlTemplate ftlFile : ftlFiles) { - - try (Writer writer = new StringWriter()) { - Template template = getCfg().getTemplate( - ftlFile.getFtlTempleteLocation()); - try { - template.process(ftlFile, writer); - } catch (Exception e) { - throw new IllegalStateException( - "Template error while generating " + ftlFile, e); - } - String fileContent = writer.toString(); - // remove trailing spaces - fileContent = TRAILING_WHITESPACES.matcher(fileContent).replaceAll(""); - result.put(ftlFile, fileContent); - } catch (IOException e) { - throw new IllegalStateException( - "Exception while processing template", e); - } - } - - return result; - } - - public List persist(Collection ftlFiles, - File dstFolder, boolean overwrite) throws IOException { - Map ftlFileStringMap = serializeFtls(ftlFiles); - List result = new ArrayList<>(); - for (Entry entry : ftlFileStringMap.entrySet()) { - FtlTemplate ftlFile = entry.getKey(); - File targetFile = new File(dstFolder, ftlFile.getRelativeFile() - .getPath()); - File pathToFile = targetFile.getParentFile(); - if (pathToFile.exists() == false) { - pathToFile.mkdirs(); - } - if (targetFile.exists() && overwrite == false) { - logger.trace("Skipping {} since it already exists", targetFile); - } else { - try (Writer fileWriter = new FileWriter(targetFile)) { - fileWriter.write(entry.getValue()); - } - logger.trace("{}: File {} generated successfully", - JMXGenerator.class.getCanonicalName(), targetFile); - result.add(targetFile); - } - } - return result; - } - - private Configuration getCfg() { - Configuration cfg = new Configuration(); - cfg.setClassForTemplateLoading(getClass(), "/freeMarker/"); - cfg.setSharedVariable("javadocD", new JavadocDirective()); - cfg.setSharedVariable("annotationsD", new AnnotationsDirective()); - cfg.setSharedVariable("typeDeclarationD", - new TypeDeclarationDirective()); - cfg.setSharedVariable("constructorsD", new ConstructorsDirective()); - cfg.setSharedVariable("fieldsD", new FieldsDirectiveProg()); - cfg.setSharedVariable("moduleFieldsD", new ModuleFieldsDirective()); - cfg.setSharedVariable("methodsD", new MethodsDirective()); - cfg.setSharedVariable("headerD", new HeaderDirective()); - cfg.setSharedVariable("unimplementedExceptionD", - new UnimplementedExceptionDirective()); - return cfg; - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java index 8172a58af6..d01f3f9223 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java @@ -7,22 +7,24 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; -import java.io.File; -import java.util.List; - +import com.google.common.base.Optional; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration; +import java.util.List; + public interface FtlTemplate { Header getHeader(); + Optional getHeaderString(); String getPackageName(); - String getJavadoc(); + Optional getMaybeJavadoc(); public List getAnnotations(); @@ -34,14 +36,5 @@ public interface FtlTemplate { List getMethods(); - /** - * @return relative path to file to be created. - */ - public File getRelativeFile(); - - /** - * - * @return ftl template location - */ - public String getFtlTempleteLocation(); + List getConstructors(); } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java index be49f93bca..5d2d6644b0 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java @@ -7,33 +7,21 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; -import java.util.Collections; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import com.google.common.collect.Lists; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition; -import com.google.common.collect.Lists; +import java.util.Collections; public class StubFactoryTemplate extends GeneralClassTemplate { - private final String moduleInstanceType; - public StubFactoryTemplate(Header header, String packageName, String name, - String extendedClass, String moduleInstanceType) { + String extendedClass) { super(header, packageName, name, Lists.newArrayList(extendedClass), Collections. emptyList(), Collections . emptyList(), Collections . emptyList()); - this.moduleInstanceType = moduleInstanceType; - } - - public String getModuleInstanceType() { - return moduleInstanceType; } - public String getDynamicMBeanWithInstanceType() { - return DynamicMBeanWithInstance.class.getCanonicalName(); - } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java deleted file mode 100644 index f49bbbacab..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl; - -import java.util.Collections; - -import org.opendaylight.controller.config.api.DependencyResolver; -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition; - -import com.google.common.collect.Lists; - -/** - * - */ -public class StubModuleTemplate extends GeneralClassTemplate { - - private final String extendedClass; - - public StubModuleTemplate(Header header, String packageName, - String stubModuleName, String extendedClass) { - super(header, packageName, stubModuleName, Lists - .newArrayList(extendedClass), Collections. emptyList(), - Collections. emptyList(), Collections - . emptyList(), false, true, - Collections. emptyList()); - this.extendedClass = extendedClass; - } - - public String getExtendedClass() { - return extendedClass; - } - - public String getInstanceType() { - return AutoCloseable.class.getCanonicalName(); - } - - public String getModuleNameType() { - return ModuleIdentifier.class.getCanonicalName(); - } - - public String getAbstractServiceInterfaceType() { - return AbstractServiceInterface.class.getCanonicalName(); - } - - public String getModuleType() { - return Module.class.getCanonicalName(); - } - - public String getDependencyResolverType() { - return DependencyResolver.class.getCanonicalName(); - } - - public String getDynamicMBeanWithInstanceType() { - return DynamicMBeanWithInstance.class.getCanonicalName(); - } - - @Override - public String getFtlTempleteLocation() { - return "module_stub_template.ftl"; - } -} 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 fea9a79616..7b7aab8559 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 @@ -7,9 +7,7 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl; -import com.google.common.base.Function; import com.google.common.base.Preconditions; -import com.google.common.collect.Collections2; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.opendaylight.controller.config.api.DependencyResolver; @@ -45,12 +43,10 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQual import org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil; import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType; import org.opendaylight.yangtools.sal.binding.model.api.Type; -import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition; import javax.management.openmbean.SimpleType; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -59,49 +55,6 @@ import java.util.Map.Entry; public class TemplateFactory { - public static Map getFtlTemplates( - ModuleMXBeanEntry entry) { - Map result = new HashMap<>(); - - result.putAll(TemplateFactory.tOsFromMbe(entry)); - - // IFC - result.put(entry.getMXBeanInterfaceName() + ".java", - TemplateFactory.mXBeanInterfaceTemplateFromMbe(entry)); - - // ABS fact - result.put(entry.getAbstractFactoryName() + ".java", - TemplateFactory.abstractFactoryTemplateFromMbe(entry)); - - // ABS module - result.put(entry.getAbstractModuleName() + ".java", - TemplateFactory.abstractModuleTemplateFromMbe(entry)); - - return result; - } - - public static Map getFtlStubTemplates( - ModuleMXBeanEntry entry) { - Map result = new HashMap<>(); - // STUB fact - result.put(entry.getStubFactoryName() + ".java", - TemplateFactory.stubFactoryTemplateFromMbe(entry)); - - result.put(entry.getStubModuleName() + ".java", - TemplateFactory.stubModuleTemplateFromMbe(entry)); - return result; - } - - public static Map getFtlTemplates( - ServiceInterfaceEntry entry) { - - Map result = new HashMap<>(); - result.put(entry.getTypeName() + ".java", - TemplateFactory.serviceInterfaceFromSie(entry)); - - return result; - } - /** * Get map of file name as key, FtlFile instance representing runtime mx * bean as value that should be persisted from this instance. @@ -183,11 +136,6 @@ public class TemplateFactory { return serializeType(type, false); } - private static boolean isIdentityRefType(Type type) { - return type instanceof IdentityrefTypeDefinition; - } - - private static String getReturnType(AttributeIfc attributeIfc) { String returnType; if (attributeIfc instanceof TypedAttribute) { @@ -234,28 +182,17 @@ public class TemplateFactory { attrProcessor.processAttributes(mbe.getAttributes(), mbe.getPackageName()); - Collection transformed = Collections2.transform(mbe - .getProvidedServices().keySet(), - new Function() { - @Override - public String apply(String input) { - return input + ".class"; - } - }); return new AbstractFactoryTemplate(getHeaderFromEntry(mbe), mbe.getPackageName(), mbe.getAbstractFactoryName(), - mbe.getGloballyUniqueName(), mbe.getFullyQualifiedName(mbe - .getStubModuleName()), attrProcessor.getFields(), - Lists.newArrayList(transformed), mbe); + attrProcessor.getFields() + ); } public static AbstractModuleTemplate abstractModuleTemplateFromMbe( ModuleMXBeanEntry mbe) { - AbstractModuleAttributesProcessor attrProcessor = new AbstractModuleAttributesProcessor(); - attrProcessor.processAttributes(mbe.getAttributes(), - mbe.getPackageName()); + AbstractModuleAttributesProcessor attrProcessor = new AbstractModuleAttributesProcessor(mbe.getAttributes()); List moduleFields = attrProcessor.getModuleFields(); List implementedIfcs = Lists.newArrayList( @@ -298,15 +235,8 @@ public class TemplateFactory { ModuleMXBeanEntry mbe) { return new StubFactoryTemplate(getHeaderFromEntry(mbe), mbe.getPackageName(), mbe.getStubFactoryName(), - mbe.getFullyQualifiedName(mbe.getAbstractFactoryName()), - mbe.getStubModuleName()); - } - - public static StubModuleTemplate stubModuleTemplateFromMbe( - ModuleMXBeanEntry mbe) { - return new StubModuleTemplate(getHeaderFromEntry(mbe), - mbe.getPackageName(), mbe.getStubModuleName(), - mbe.getFullyQualifiedName(mbe.getAbstractModuleName())); + mbe.getFullyQualifiedName(mbe.getAbstractFactoryName()) + ); } public static GeneralInterfaceTemplate mXBeanInterfaceTemplateFromMbe( @@ -612,12 +542,26 @@ public class TemplateFactory { } private static class AbstractModuleAttributesProcessor { + private static class Holder { + private final List moduleFields; + private final List methods; + + private Holder(List moduleFields, List methods) { + this.moduleFields = Collections.unmodifiableList(moduleFields); + this.methods = Collections.unmodifiableList(methods); + } + } - private final List moduleFields = Lists.newArrayList(); - private final List methods = Lists.newArrayList(); + private final Holder holder; - void processAttributes(Map attributes, - String packageName) { + + private AbstractModuleAttributesProcessor(Map attributes) { + this.holder = processAttributes(attributes); + } + + private static Holder processAttributes(Map attributes) { + List moduleFields = new ArrayList<>(); + List methods = new ArrayList<>(); for (Entry attrEntry : attributes.entrySet()) { String type, nullableDefaultWrapped = null; AttributeIfc attributeIfc = attrEntry.getValue(); @@ -661,7 +605,7 @@ public class TemplateFactory { String varName = BindingGeneratorUtil .parseToValidParamName(attrEntry.getKey()); - + { ModuleField field; if (isIdentity) { @@ -695,7 +639,7 @@ public class TemplateFactory { nullableDefaultWrapped, isDependency, dependency, isListOfDependencies, needsDepResolver); } moduleFields.add(field); - + } String getterName = "get" + attributeIfc.getUpperCaseCammelCase(); MethodDefinition getter = new MethodDefinition(type, @@ -727,14 +671,15 @@ public class TemplateFactory { methods.add(setter); } + return new Holder(moduleFields, methods); } List getModuleFields() { - return moduleFields; + return holder.moduleFields; } List getMethods() { - return methods; + return holder.methods; } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java deleted file mode 100644 index 4a34a1f294..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter; - -import com.google.common.collect.Lists; - -import freemarker.core.Environment; -import freemarker.template.SimpleSequence; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class AnnotationsDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - List annotations = Lists.newArrayList(); - - if (object != null) { - if (object instanceof SimpleSequence) - annotations = ((SimpleSequence) object).toList(); - else if (object instanceof FtlTemplate) { - annotations = ((FtlTemplate) object).getAnnotations(); - } else - throw new IllegalArgumentException( - "Object must be a SimpleSequence or instance of " - + FtlTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - writeAnnotations(annotations, build, ""); - - if (!annotations.isEmpty()) - out.write(build.toString().toCharArray()); - } - - static void writeAnnotations(List annotations, - StringBuilder build, String linePrefix) { - for (Annotation annotation : annotations) { - build.append(linePrefix + "@"); - build.append(annotation.getName()); - if (!annotation.getParams().isEmpty()) { - build.append("("); - for (Parameter param : annotation.getParams()) { - build.append(param.getKey()); - build.append(" = "); - build.append(fixString(param.getValue())); - build.append(", "); - } - build.setCharAt(build.length() - 2, ')'); - } - build.append(System.lineSeparator()); - } - } - - private static String fixString(String value) { - // TODO replace with compress single line if possible - return value.replaceAll("\\r\\n|\\r|\\n", " ").replaceAll(" +", " "); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java deleted file mode 100644 index 56b7286eb5..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralClassTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor; - -import com.google.common.collect.Lists; - -import freemarker.core.Environment; -import freemarker.template.SimpleSequence; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class ConstructorsDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - List constructors = Lists.newArrayList(); - - if (object != null) { - if (object instanceof SimpleSequence) - constructors = ((SimpleSequence) object).toList(); - else if (object instanceof GeneralClassTemplate) { - constructors = ((GeneralClassTemplate) object) - .getConstructors(); - } else - throw new IllegalArgumentException( - "Object must be a SimpleSequence or instance of " - + GeneralClassTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - for (Constructor constr : constructors) { - build.append(" "); - if (constr.isPublic()) - build.append("public "); - build.append(constr.getTypeName() + " "); - build.append("() {"); - build.append(System.lineSeparator()); - build.append(" "); - build.append(" "); - build.append(constr.getBody()); - build.append(System.lineSeparator()); - build.append(" "); - build.append("}"); - build.append(System.lineSeparator()); - build.append(System.lineSeparator()); - } - - if (!constructors.isEmpty()) - out.write(build.toString().toCharArray()); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java deleted file mode 100644 index 7dd0f8e992..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; - -import com.google.common.collect.Lists; - -import freemarker.core.Environment; -import freemarker.template.SimpleSequence; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add fields to freemarker template. - */ -public class FieldsDirectiveProg implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - List fields = Lists.newArrayList(); - - if (object != null) { - if (object instanceof SimpleSequence) - fields = ((SimpleSequence) object).toList(); - else if (object instanceof FtlTemplate) { - fields = ((FtlTemplate) object).getFields(); - } else - throw new IllegalArgumentException( - "Object must be a SimpleSequence or instance of " - + FtlTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - for (Field field : fields) { - build.append(" private "); - for (String mod : field.getModifiers()) { - build.append(mod + " "); - } - build.append(field.getType() + " "); - build.append(field.getName()); - if (field.getDefinition() != null) - build.append(" = " + field.getDefinition()); - build.append(";"); - build.append(System.lineSeparator()); - } - - if (!fields.isEmpty()) - out.write(build.toString().toCharArray()); - } - - // String templateStr = "Hello ${user}"; - // Template t = new Template("name", new StringReader(templateStr), new - // Configuration()); -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveTemplate.java deleted file mode 100644 index 268d898477..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveTemplate.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.StringReader; -import java.io.Writer; -import java.util.Map; - -import com.google.common.collect.Maps; - -import freemarker.core.Environment; -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add fields to freemarker template. - */ -public class FieldsDirectiveTemplate implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - - // TODO check type - - String templateStr = " <#list fields as field>" - + "private <#if field.final==true>final <#if field.static==true>static " - + "${field.type} ${field.name}<#if field.definition??> = ${field.definition};" - + System.lineSeparator() + " "; - Template t = new Template("name", new StringReader(templateStr), - new Configuration()); - - try { - Map map = Maps.newHashMap(); - map.put("fields", object); - Writer out = env.getOut(); - t.process(map, out); - } catch (TemplateException e) { - throw new IllegalStateException( - "Template error while generating fields" + e); - } - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/HeaderDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/HeaderDirective.java deleted file mode 100644 index 93fde59e96..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/HeaderDirective.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.Date; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header; - -import com.google.common.base.Preconditions; - -import freemarker.core.Environment; -import freemarker.ext.beans.StringModel; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class HeaderDirective implements TemplateDirectiveModel { - - private static final String GENERATOR_CLASS = JMXGenerator.class - .getCanonicalName(); - private static final String OBJECT = "header"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - - // FIXME do not allow null header - // Preconditions.checkNotNull(object, "Null type declaration"); - Object object = params.get(OBJECT); - Header header = null; - if (object != null) { - object = ((StringModel) object).getWrappedObject(); - Preconditions.checkArgument(object instanceof Header, - "Template header should be instance of " + Header.class - + " but was " + object.getClass()); - - header = (Header) object; - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - build.append("/**"); - build.append(System.lineSeparator()); - build.append("* "); - build.append("Generated file"); - build.append(System.lineSeparator()); - build.append(System.lineSeparator()); - build.append("* "); - build.append("Generated from: "); - build.append(header != null ? header.toString() : ""); - build.append(System.lineSeparator()); - build.append("* "); - build.append("Generated by: " + GENERATOR_CLASS); - build.append(System.lineSeparator()); - build.append("* "); - build.append("Generated at: " + new Date()); - build.append(System.lineSeparator()); - build.append("* "); - build.append(System.lineSeparator()); - build.append("* "); - build.append("Do not modify this file unless it is present under src/main directory "); - build.append(System.lineSeparator()); - build.append("*/"); - build.append(System.lineSeparator()); - - out.write(build.toString().toCharArray()); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/JavadocDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/JavadocDirective.java deleted file mode 100644 index 9817be3ea3..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/JavadocDirective.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; - -import freemarker.core.Environment; -import freemarker.template.SimpleScalar; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add javadoc to freemarker template as String. - */ -public class JavadocDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - String javadoc = ""; - - if (object != null) { - if (object instanceof SimpleScalar) - javadoc = ((SimpleScalar) object).getAsString(); - else if (object instanceof FtlTemplate) { - javadoc = ((FtlTemplate) object).getJavadoc(); - } else - throw new IllegalArgumentException( - "Object must be a String or instance of " - + FtlTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - writeJavadoc(build, javadoc, ""); - out.write(build.toString().toCharArray()); - } - - static void writeJavadoc(StringBuilder build, String javadoc, - String linePrefix) { - build.append(linePrefix + "/**"); - build.append(System.lineSeparator()); - build.append(linePrefix + "* "); - build.append(javadoc == null ? "" : javadoc); - build.append(System.lineSeparator()); - build.append(linePrefix + "*/"); - build.append(System.lineSeparator()); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/MethodsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/MethodsDirective.java deleted file mode 100644 index 975d8fd620..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/MethodsDirective.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition; - -import com.google.common.collect.Lists; - -import freemarker.core.Environment; -import freemarker.template.SimpleSequence; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class MethodsDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - List methods = Lists.newArrayList(); - - if (object != null) { - if (object instanceof SimpleSequence) - methods = ((SimpleSequence) object).toList(); - else if (object instanceof FtlTemplate) { - methods = ((FtlTemplate) object).getMethods(); - } else - throw new IllegalArgumentException( - "Object must be a SimpleSequence or instance of " - + FtlTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - for (Method method : methods) { - if (method.getJavadoc() != null) - JavadocDirective.writeJavadoc(build, method.getJavadoc(), " "); - - if (!method.getAnnotations().isEmpty()) { - AnnotationsDirective.writeAnnotations(method.getAnnotations(), - build, " "); - } - - build.append(" " + "public "); - for (String mod : method.getModifiers()) { - build.append(mod + " "); - } - build.append(method.getReturnType() + " "); - - build.append(method.getName() + "("); - for (Field param : method.getParameters()) { - for (String mod : param.getModifiers()) { - build.append(mod + " "); - } - build.append(param.getType() + " "); - build.append(param.getName() + ", "); - } - if (method.getParameters().isEmpty()) - build.append(")"); - else { - build.deleteCharAt(build.length() - 1); - build.deleteCharAt(build.length() - 1); - build.append(')'); - } - - if (method instanceof MethodDeclaration) { - build.append(";"); - build.append(System.lineSeparator()); - } else if (method instanceof MethodDefinition) { - if (!((MethodDefinition) method).getThrowsExceptions() - .isEmpty()) - build.append(" throws "); - for (String ex : ((MethodDefinition) method) - .getThrowsExceptions()) { - build.append(ex + " "); - } - build.append(" {"); - build.append(System.lineSeparator()); - build.append(" "); - build.append(((MethodDefinition) method).getBody()); - build.append(System.lineSeparator()); - build.append(" "); - build.append("}"); - build.append(System.lineSeparator()); - } - build.append(System.lineSeparator()); - - } - - if (!methods.isEmpty()) - out.write(build.toString().toCharArray()); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ModuleFieldsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ModuleFieldsDirective.java deleted file mode 100644 index 144419e8ae..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ModuleFieldsDirective.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.opendaylight.controller.config.api.JmxAttribute; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractModuleTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField; - -import com.google.common.collect.Lists; - -import freemarker.core.Environment; -import freemarker.template.SimpleSequence; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class ModuleFieldsDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "moduleFields"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - List fields = Lists.newArrayList(); - - if (object != null) { - if (object instanceof SimpleSequence) - fields = ((SimpleSequence) object).toList(); - else if (object instanceof AbstractModuleTemplate) { - fields = ((AbstractModuleTemplate) object).getModuleFields(); - } else - throw new IllegalArgumentException( - "Object must be a SimpleSequence or instance of " - + AbstractModuleTemplate.class + "but was " - + object.getClass()); - } - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - for (ModuleField field : fields) { - build.append(" "); - build.append("protected final " - + JmxAttribute.class.getCanonicalName() + " " - + field.getName() + "JmxAttribute = new " - + JmxAttribute.class.getCanonicalName() + "(\"" - + field.getAttributeName() + "\");"); - build.append(System.lineSeparator()); - - build.append(" private "); - for (String mod : field.getModifiers()) { - build.append(mod + " "); - } - build.append(field.getType() + " "); - build.append(field.getName()); - if (field.getNullableDefault() != null) - build.append(" = " + field.getNullableDefault()); - build.append(";"); - - if (field.isDependent()) { - String comment = field.getDependency().isMandatory() ? "mandatory" - : "optional"; - build.append(" // " + comment); - } - build.append(System.lineSeparator()); - - build.append(System.lineSeparator()); - - } - - if (!fields.isEmpty()) - out.write(build.toString().toCharArray()); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/TypeDeclarationDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/TypeDeclarationDirective.java deleted file mode 100644 index 42556c243e..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/TypeDeclarationDirective.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.Collection; -import java.util.Map; - -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration; - -import com.google.common.base.Preconditions; - -import freemarker.core.Environment; -import freemarker.ext.beans.StringModel; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add type declaration to freemarker template. - */ -public class TypeDeclarationDirective implements TemplateDirectiveModel { - - private static final String OBJECT = "object"; - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - Object object = params.get(OBJECT); - Preconditions.checkNotNull(object, "Null type declaration"); - - object = ((StringModel) object).getWrappedObject(); - Preconditions.checkArgument( - object instanceof TypeDeclaration, - "Type declaration should be instance of " - + TypeDeclaration.class + " but was " - + object.getClass()); - - TypeDeclaration type = (TypeDeclaration) object; - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder("public "); - if (type.isAbstract()) - build.append("abstract "); - if (type.isFinal()) - build.append("final "); - build.append(type.getType() + " "); - build.append(type.getName() + " "); - - generateExtendOrImplement(build, "extends", type.getExtended()); - - generateExtendOrImplement(build, "implements", type.getImplemented()); - - build.append(System.lineSeparator()); - out.write(build.toString().toCharArray()); - } - - private void generateExtendOrImplement(StringBuilder build, String prefix, - Collection elements) { - if (elements.isEmpty()) - return; - - build.append(prefix + " "); - - for (String extended : elements) { - build.append(extended); - build.append(", "); - } - build.deleteCharAt(build.length() - 1); - build.deleteCharAt(build.length() - 1); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/UnimplementedExceptionDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/UnimplementedExceptionDirective.java deleted file mode 100644 index 5175ade438..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/UnimplementedExceptionDirective.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.directives; - -import java.io.IOException; -import java.io.Writer; -import java.util.Map; - -import freemarker.core.Environment; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; - -/** - * Add annotations to freemarker template. - */ -public class UnimplementedExceptionDirective implements TemplateDirectiveModel { - - @Override - public void execute(Environment env, Map params, TemplateModel[] loopVars, - TemplateDirectiveBody body) throws TemplateException, IOException { - - Writer out = env.getOut(); - StringBuilder build = new StringBuilder(); - build.append(" "); - build.append("throw new " - + UnsupportedOperationException.class.getCanonicalName() - + "(\"Unimplemented stub method\");"); - build.append(System.lineSeparator()); - - out.write(build.toString().toCharArray()); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java index 7cf241725d..a8ddabc4cf 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java @@ -7,18 +7,21 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import org.opendaylight.controller.config.api.annotations.Description; import org.opendaylight.controller.config.api.annotations.RequireInterface; import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation; -import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName; import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry; +import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName; +import org.opendaylight.yangtools.yang.common.QName; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; public class Annotation { final String name; @@ -37,6 +40,14 @@ public class Annotation { return params; } + public static Annotation createFromMap(Class annotationClass, Map parameters) { + List parameterList = new ArrayList<>(); + for(Entry entry: parameters.entrySet()) { + parameterList.add(new Parameter(entry.getKey(), entry.getValue())); + } + return new Annotation(annotationClass.getCanonicalName(), parameterList); + } + public static Annotation createDescriptionAnnotation(String description) { Preconditions.checkNotNull(description, "Cannot create annotation from null description"); @@ -44,6 +55,14 @@ public class Annotation { Lists.newArrayList(new Parameter("value", q(description)))); } + public static Annotation createModuleQNameANnotation(QName qName) { + Map parameters = new HashMap<>(); + parameters.put("namespace", q(qName.getNamespace().toString())); + parameters.put("revision", q(qName.getFormattedRevision())); + parameters.put("name", q(qName.getLocalName())); + return Annotation.createFromMap(ModuleQName.class, parameters); + } + public static Collection createSieAnnotations(ServiceInterfaceEntry sie){ String exportedClassName = sie.getExportedOsgiClassName(); @@ -85,7 +104,7 @@ public class Annotation { private static final String quote = "\""; - private static String q(String nullableDescription) { + public static String q(String nullableDescription) { return nullableDescription == null ? null : quote + nullableDescription + quote; } @@ -107,4 +126,8 @@ public class Annotation { } } + @Override + public String toString() { + return AnnotationSerializer.toString(this); + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/AnnotationSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/AnnotationSerializer.java new file mode 100644 index 0000000000..6b4ce38621 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/AnnotationSerializer.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter; + +class AnnotationSerializer { + + static String toString(Annotation annotation) { + StringBuilder builder = new StringBuilder(); + builder.append("@"); + builder.append(annotation.getName()); + if (!annotation.getParams().isEmpty()) { + builder.append("("); + for (Parameter param : annotation.getParams()) { + builder.append(param.getKey()); + builder.append(" = "); + builder.append(fixString(param.getValue())); + builder.append(", "); + } + builder.setCharAt(builder.length() - 2, ')'); + } + builder.append("\n"); + return builder.toString(); + } + + private static String fixString(String value) { + // TODO replace with compress single line if possible + return value.replaceAll("\\r\\n|\\r|\\n", " ").replaceAll(" +", " "); + } + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Constructor.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Constructor.java index 1aeb86d25d..91c1cc3966 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Constructor.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Constructor.java @@ -37,4 +37,8 @@ public class Constructor { return isPublic; } + @Override + public String toString() { + return ConstructorSerializer.toString(this); + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ConstructorSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ConstructorSerializer.java new file mode 100644 index 0000000000..c257aa6dda --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ConstructorSerializer.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +public class ConstructorSerializer { + + public static String toString(Constructor constr) { + StringBuilder build = new StringBuilder(); + build.append(" "); + if (constr.isPublic()) { + build.append("public "); + } + build.append(constr.getTypeName() + " "); + build.append("() {"); + build.append("\n"); + build.append(" "); + build.append(" "); + build.append(constr.getBody()); + build.append("\n"); + build.append(" "); + build.append("}"); + build.append("\n"); + build.append("\n"); + return build.toString(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java index ad5cbb287c..3639b6d727 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java @@ -11,6 +11,8 @@ import com.google.common.collect.Lists; import java.util.List; +import static com.google.common.base.Preconditions.checkNotNull; + public class Field { private final String type; private final String name; @@ -36,11 +38,11 @@ public class Field { } public Field(List modifiers, String type, String name, - String definition, boolean needsDepResolver) { - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.definition = definition; + String nullableDefinition, boolean needsDepResolver) { + this.modifiers = checkNotNull(modifiers); + this.type = checkNotNull(type); + this.name = checkNotNull(name); + this.definition = nullableDefinition; this.needsDepResolver = needsDepResolver; } @@ -56,6 +58,10 @@ public class Field { return type; } + public String getGenericInnerType() { + return type.substring(type.indexOf("<") + 1, type.indexOf(">")); + } + public List getModifiers() { return modifiers; } @@ -71,4 +77,9 @@ public class Field { public boolean isArray() { return type.endsWith("[]"); } + + @Override + public String toString() { + return FieldSerializer.toString(this); + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/FieldSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/FieldSerializer.java new file mode 100644 index 0000000000..90a2b5694c --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/FieldSerializer.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +public class FieldSerializer { + + public static String toString(Field field) { + StringBuilder build = new StringBuilder(); + build.append("private "); + for (String mod : field.getModifiers()) { + build.append(mod + " "); + } + build.append(field.getType() + " "); + build.append(field.getName()); + if (field.getDefinition() != null) { + build.append(" = " + field.getDefinition()); + } + build.append(";"); + build.append("\n"); + return build.toString(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Header.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Header.java index 047e87a3dc..b9a628495d 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Header.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Header.java @@ -26,8 +26,7 @@ public class Header { @Override public String toString() { - return "yang module name: " + yangModuleName + " " - + " yang module local name: " + yangModuleLocalName; + return HeaderSerializer.toString(this); } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java new file mode 100644 index 0000000000..eb07c80e15 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator; + +import java.util.Date; + +public class HeaderSerializer { + private static final String GENERATOR_CLASS = JMXGenerator.class.getCanonicalName(); + + public static String toString(Header header) { + StringBuilder build = new StringBuilder(); + + + build.append("Generated file"); + build.append("\n"); + build.append("\n"); + build.append("Generated from: "); + //build.append(header.toString()); + + build.append("yang module name: "); + build.append(header.getYangModuleName()); + build.append(" yang module local name: "); + build.append(header.getYangModuleLocalName()); + + build.append("\n"); + build.append("Generated by: " + GENERATOR_CLASS); + build.append("\n"); + build.append("Generated at: " + new Date()); + build.append("\n"); + build.append("\n"); + build.append("Do not modify this file unless it is present under src/main directory "); + + return build.toString(); + } + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java index bd4e22e084..be6b23e879 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java @@ -63,4 +63,9 @@ public class MethodDeclaration implements Method { public List getModifiers() { return Collections.emptyList(); } + + @Override + public String toString() { + return MethodSerializer.toString(this); + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java index bf453ac135..9af011fe71 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java @@ -93,4 +93,9 @@ public class MethodDefinition implements Method { public List getModifiers() { return modifiers; } + + @Override + public String toString() { + return MethodSerializer.toString(this); + } } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodSerializer.java new file mode 100644 index 0000000000..7d2b9fcdaf --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodSerializer.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil; + +class MethodSerializer { + + static String toString(Method method) { + StringBuilder build = new StringBuilder(); + if (method.getJavadoc() != null) { + build.append(StringUtil.writeComment(method.getJavadoc(), true)); + } + + for(Annotation a: method.getAnnotations()) { + build.append(a); + } + + build.append(" " + "public "); + for (String mod : method.getModifiers()) { + build.append(mod + " "); + } + build.append(method.getReturnType() + " "); + + build.append(method.getName() + "("); + for (Field param : method.getParameters()) { + for (String mod : param.getModifiers()) { + build.append(mod + " "); + } + build.append(param.getType() + " "); + build.append(param.getName() + ", "); + } + if (method.getParameters().isEmpty()) { + build.append(")"); + } else { + build.deleteCharAt(build.length() - 1); + build.deleteCharAt(build.length() - 1); + build.append(')'); + } + + if (method instanceof MethodDeclaration) { + build.append(";"); + build.append("\n"); + } else if (method instanceof MethodDefinition) { + if (!((MethodDefinition) method).getThrowsExceptions() + .isEmpty()) { + build.append(" throws "); + } + for (String ex : ((MethodDefinition) method) + .getThrowsExceptions()) { + build.append(ex + " "); + } + build.append(" {"); + build.append("\n"); + build.append(" "); + build.append(((MethodDefinition) method).getBody()); + build.append("\n"); + build.append(" "); + build.append("}"); + build.append("\n"); + } + build.append("\n"); + return build.toString(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java index 74e5bb0490..37d660353f 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java @@ -44,6 +44,11 @@ public class ModuleField extends Field { return false; } + @Override + public String toString() { + return ModuleFieldSerializer.toString(this); + } + public Dependency getDependency() { return dependency; } @@ -64,4 +69,9 @@ public class ModuleField extends Field { return attributeName; } + + public boolean isList() { + return getType().startsWith("java.util.List"); + } + } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleFieldSerializer.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleFieldSerializer.java new file mode 100644 index 0000000000..c0e3bc1ad8 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleFieldSerializer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl.model; + +import org.opendaylight.controller.config.api.JmxAttribute; + +public class ModuleFieldSerializer { + + + public static String toString(ModuleField moduleField) { + StringBuilder builder = new StringBuilder(); + builder.append(" "); + builder.append("protected final " + + JmxAttribute.class.getCanonicalName() + " " + + moduleField.getName() + "JmxAttribute = new " + + JmxAttribute.class.getCanonicalName() + "(\"" + + moduleField.getAttributeName() + "\");"); + builder.append("\n"); + + builder.append(" private "); + for (String mod : moduleField.getModifiers()) { + builder.append(mod + " "); + } + builder.append(moduleField.getType() + " "); + builder.append(moduleField.getName()); + if (moduleField.getNullableDefault() != null) { + builder.append(" = " + moduleField.getNullableDefault()); + } + builder.append(";"); + + if (moduleField.isDependent()) { + String comment = moduleField.getDependency().isMandatory() ? "mandatory" + : "optional"; + builder.append(" // " + comment); + } + builder.append("\n"); + + builder.append("\n"); + + return builder.toString(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java index ee0aa2ff5c..a5bb987fd3 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java @@ -7,6 +7,8 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName; + import java.util.List; public class TypeDeclaration { @@ -54,6 +56,24 @@ public class TypeDeclaration { return implemented; } + public TypeName toTypeName() { + if ("interface".equals(type)) { + return TypeName.interfaceType; + } else if ("class".equals(type)) { + if (isAbstract) { + return TypeName.absClassType; + } else if (isFinal) { + return TypeName.finalClassType; + } else { + return TypeName.classType; + } + } else if ("enum".equals(type)) { + return TypeName.enumType; + } else { + throw new IllegalStateException("Type not supported: " + type); + } + } + @Override public String toString() { return "TypeDeclaration{" + "type='" + type + '\'' + ", name='" + name diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsFactoryGeneratedObjectFactory.groovy b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsFactoryGeneratedObjectFactory.groovy new file mode 100644 index 0000000000..baff88c8f3 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsFactoryGeneratedObjectFactory.groovy @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.gofactory +import com.google.common.base.Optional +import org.opendaylight.controller.config.api.DependencyResolver +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance +import org.opendaylight.controller.config.api.ModuleIdentifier +import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface +import org.opendaylight.controller.config.api.annotations.Description +import org.opendaylight.controller.config.spi.Module +import org.opendaylight.controller.config.spi.ModuleFactory +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.* +import org.opendaylight.yangtools.yang.common.QName +import org.osgi.framework.BundleContext + +public class AbsFactoryGeneratedObjectFactory { + + public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional copyright) { + FullyQualifiedName absFactoryFQN = new FullyQualifiedName(mbe.packageName, mbe.abstractFactoryName) + FullyQualifiedName moduleFQN = new FullyQualifiedName(mbe.packageName, mbe.stubModuleName) + Optional classJavaDoc = Optional.fromNullable(mbe.getNullableDescription()) + + AbstractFactoryTemplate abstractFactoryTemplate = TemplateFactory.abstractFactoryTemplateFromMbe(mbe) + Optional header = abstractFactoryTemplate.headerString; + List providedServices = mbe.providedServices.keySet().collect { + FullyQualifiedName.fromString(it) + } + + + return toGeneratedObject(absFactoryFQN, copyright, + header, classJavaDoc, mbe.yangModuleQName, + mbe.globallyUniqueName, + providedServices, + moduleFQN, + abstractFactoryTemplate.fields) + } + + public GeneratedObject toGeneratedObject(FullyQualifiedName absFactoryFQN, Optional copyright, + Optional header, Optional classJavaDoc, QName yangModuleQName, + String globallyUniqueName, + List providedServices, + FullyQualifiedName moduleFQN, + List moduleFields) { + JavaFileInputBuilder b = new JavaFileInputBuilder() + Annotation moduleQNameAnnotation = Annotation.createModuleQNameANnotation(yangModuleQName) + b.addClassAnnotation(moduleQNameAnnotation) + + b.setFqn(absFactoryFQN) + b.setTypeName(TypeName.absClassType) + + b.setCopyright(copyright); + b.setHeader(header); + b.setClassJavaDoc(classJavaDoc); + b.addImplementsFQN(new FullyQualifiedName(ModuleFactory)) + if (classJavaDoc.isPresent()) { + b.addClassAnnotation("@${Description.canonicalName}(value=\"${classJavaDoc.get()}\")") + } + + b.addToBody("public static final java.lang.String NAME = \"${globallyUniqueName}\";") + b.addToBody("private static final java.util.Set> serviceIfcs;") + + b.addToBody("@Override\n public final String getImplementationName() { \n return NAME; \n}") + + b.addToBody(getServiceIfcsInitialization(providedServices)) + + // createModule + b.addToBody(""" + @Override + public ${Module.canonicalName} createModule(String instanceName, ${DependencyResolver.canonicalName} dependencyResolver, ${BundleContext.canonicalName} bundleContext) { + return instantiateModule(instanceName, dependencyResolver, bundleContext); + } + """) + + b.addToBody(getCreateModule(moduleFQN, moduleFields)) + + b.addToBody(""" + public ${moduleFQN} instantiateModule(String instanceName, ${DependencyResolver.canonicalName} dependencyResolver, ${moduleFQN} oldModule, ${AutoCloseable.canonicalName} oldInstance, ${BundleContext.canonicalName} bundleContext) { + return new ${moduleFQN}(new ${ModuleIdentifier.canonicalName}(NAME, instanceName), dependencyResolver, oldModule, oldInstance); + } + """) + + b.addToBody(""" + public ${moduleFQN} instantiateModule(String instanceName, ${DependencyResolver.canonicalName} dependencyResolver, ${BundleContext.canonicalName} bundleContext) { + return new ${moduleFQN}(new ${ModuleIdentifier.canonicalName}(NAME, instanceName), dependencyResolver); + } + """) + + b.addToBody(""" + public ${moduleFQN} handleChangedClass(${DynamicMBeanWithInstance.canonicalName} old) throws Exception { + throw new UnsupportedOperationException("Class reloading is not supported"); + } + """) + + b.addToBody(""" + @Override + public java.util.Set<${moduleFQN}> getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory dependencyResolverFactory, ${BundleContext.canonicalName} bundleContext) { + return new java.util.HashSet<${moduleFQN}>(); + } + """) + + return new GeneratedObjectBuilder(b.build()).toGeneratedObject() + } + + private static String getCreateModule(FullyQualifiedName moduleFQN, List moduleFields) { + String result = """ + @Override + public ${Module.canonicalName} createModule(String instanceName, ${DependencyResolver.canonicalName} dependencyResolver, ${DynamicMBeanWithInstance.canonicalName} old, ${BundleContext.canonicalName} bundleContext) throws Exception { + ${moduleFQN} oldModule = null; + try { + oldModule = (${moduleFQN}) old.getModule(); + } catch(Exception e) { + return handleChangedClass(old); + } + ${moduleFQN} module = instantiateModule(instanceName, dependencyResolver, oldModule, old.getInstance(), bundleContext); + """ + result += moduleFields.collect{"module.set${it.name}(oldModule.get${it.name}());"}.join("\n") + result += """ + return module; + } + """ + return result + } + + private static String getServiceIfcsInitialization(List providedServices) { + String generic = "Class" + + String result = """static { + java.util.Set<${generic}> serviceIfcs2 = new java.util.HashSet<${generic}>(); + """ + result += providedServices.collect{"serviceIfcs2.add(${it}.class);"}.join("\n") + result += """serviceIfcs = java.util.Collections.unmodifiableSet(serviceIfcs2); + } + """ + + // add isModuleImplementingServiceInterface and getImplementedServiceIntefaces methods + + result += """ + @Override + public final boolean isModuleImplementingServiceInterface(Class serviceInterface) { + for (Class ifc: serviceIfcs) { + if (serviceInterface.isAssignableFrom(ifc)){ + return true; + } + } + return false; + } + + @Override + public java.util.Set> getImplementedServiceIntefaces() { + return serviceIfcs; + } + """ + + return result + } + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.groovy b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.groovy new file mode 100644 index 0000000000..930acff7bc --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.groovy @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.gofactory +import com.google.common.base.Optional +import org.opendaylight.controller.config.api.DependencyResolver +import org.opendaylight.controller.config.api.ModuleIdentifier +import org.opendaylight.controller.config.api.annotations.Description +import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractModuleTemplate +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.IdentityRefModuleField +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.* +import org.opendaylight.yangtools.yang.common.QName +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +public class AbsModuleGeneratedObjectFactory { + + public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional copyright) { + FullyQualifiedName abstractFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractModuleName()) + Optional classJavaDoc = Optional.fromNullable(mbe.getNullableDescription()) + AbstractModuleTemplate abstractModuleTemplate = TemplateFactory.abstractModuleTemplateFromMbe(mbe) + Optional header = abstractModuleTemplate.headerString; + List implementedInterfaces = abstractModuleTemplate.getTypeDeclaration().getImplemented().collect { + FullyQualifiedName.fromString(it) + } + Optional maybeRegistratorType + if (abstractModuleTemplate.isRuntime()) { + maybeRegistratorType = Optional.of(FullyQualifiedName.fromString(abstractModuleTemplate.getRegistratorType())) + } else { + maybeRegistratorType = Optional.absent() + } + + return toGeneratedObject(abstractFQN, copyright, header, classJavaDoc, implementedInterfaces, + abstractModuleTemplate.getModuleFields(), maybeRegistratorType, abstractModuleTemplate.getMethods(), + mbe.yangModuleQName + ) + } + + public GeneratedObject toGeneratedObject(FullyQualifiedName abstractFQN, + Optional copyright, + Optional header, + Optional classJavaDoc, + List implementedInterfaces, + List moduleFields, + Optional maybeRegistratorType, + List methods, + QName yangModuleQName) { + JavaFileInputBuilder b = new JavaFileInputBuilder() + + Annotation moduleQNameAnnotation = Annotation.createModuleQNameANnotation(yangModuleQName) + b.addClassAnnotation(moduleQNameAnnotation) + + b.setFqn(abstractFQN) + b.setTypeName(TypeName.absClassType) + + b.setCopyright(copyright); + b.setHeader(header); + b.setClassJavaDoc(classJavaDoc); + implementedInterfaces.each { b.addImplementsFQN(it) } + if (classJavaDoc.isPresent()) { + b.addClassAnnotation("@${Description.canonicalName}(value=\"${classJavaDoc.get()}\")") + } + + // add logger: + b.addToBody(getLogger(abstractFQN)); + + b.addToBody("//attributes start"); + + b.addToBody(moduleFields.collect { it.toString() }.join("\n")) + + b.addToBody("//attributes end"); + + + b.addToBody(getCommonFields(abstractFQN)); + + + b.addToBody(getNewConstructor(abstractFQN)) + b.addToBody(getCopyFromOldConstructor(abstractFQN)) + + b.addToBody(getRuntimeRegistratorCode(maybeRegistratorType)) + b.addToBody(getValidationMethods(moduleFields)) + + b.addToBody(getCachesOfResolvedDependencies(moduleFields)) + b.addToBody(getCachesOfResolvedIdentityRefs(moduleFields)) + b.addToBody(getGetInstance(moduleFields)) + b.addToBody(getReuseLogic(moduleFields, abstractFQN)) + b.addToBody(getEqualsAndHashCode(abstractFQN)) + + b.addToBody(getMethods(methods)) + + return new GeneratedObjectBuilder(b.build()).toGeneratedObject() + } + + private static String getMethods(List methods) { + String result = """ + // getters and setters + """ + result += methods.collect{it.toString()}.join("\n") + return result + } + + private static String getEqualsAndHashCode(FullyQualifiedName abstractFQN) { + return """ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ${abstractFQN.typeName} that = (${abstractFQN.typeName}) o; + return identifier.equals(that.identifier); + } + + @Override + public int hashCode() { + return identifier.hashCode(); + } + """ + } + + private static String getReuseLogic(List moduleFields, FullyQualifiedName abstractFQN) { + String result = """ + public boolean canReuseInstance(${abstractFQN.typeName} oldModule){ + // allow reusing of old instance if no parameters was changed + return isSame(oldModule); + } + + public ${AutoCloseable.canonicalName} reuseInstance(${AutoCloseable.canonicalName} oldInstance){ + // implement if instance reuse should be supported. Override canReuseInstance to change the criteria. + return oldInstance; + } + """ + // isSame method that detects changed fields + result += """ + public boolean isSame(${abstractFQN.typeName} other) { + if (other == null) { + throw new IllegalArgumentException("Parameter 'other' is null"); + } + """ + // loop through fields, do deep equals on each field + result += moduleFields.collect { field -> + if (field.isListOfDependencies()) { + return """ + if (${field.name}Dependency.equals(other.${field.name}Dependency) == false) { + return false; + } + for (int idx = 0; idx < ${field.name}Dependency.size(); idx++) { + if (${field.name}Dependency.get(idx) != other.${field.name}Dependency.get(idx)) { + return false; + } + } + """ + } else if (field.isDependent()) { + return """ + if (${field.name}Dependency != other.${field.name}Dependency) { // reference to dependency must be same + return false; + } + """ + } else { + return """ + if (java.util.Objects.deepEquals(${field.name}, other.${field.name}) == false) { + return false; + } + """ + } + }.join("\n") + + + result += """ + return true; + } + """ + + return result + } + + private static String getGetInstance(List moduleFields) { + String result = """ + @Override + public final ${AutoCloseable.canonicalName} getInstance() { + if(instance==null) { + """ + // create instance start + + // loop through dependent fields, use dependency resolver to instantiate dependencies. Do it in loop in case field represents list of dependencies. + Map resolveDependenciesMap = moduleFields.findAll { + it.isDependent() + }.collectEntries { ModuleField field -> + [field, field.isList() ? + """ + ${field.name}Dependency = new java.util.ArrayList<${field.dependency.sie.exportedOsgiClassName}>(); + for(javax.management.ObjectName dep : ${field.name}) { + ${field.name}Dependency.add(dependencyResolver.resolveInstance(${ + field.dependency.sie.exportedOsgiClassName + }.class, dep, ${field.name}JmxAttribute)); + } + """ + : + """ + ${field.name}Dependency = dependencyResolver.resolveInstance(${ + field.dependency.sie.exportedOsgiClassName + }.class, ${field.name}, ${field.name}JmxAttribute); + """ + ] + } + // wrap each field resolvation statement with if !=null when dependency is not mandatory + def wrapWithNullCheckClosure = {Map map, predicate -> map.collect { ModuleField key, String value -> + predicate(key) ? """ + if(${key.name}!=null) { + ${value} + } + """ : value + }.join("\n") + } + + result += wrapWithNullCheckClosure(resolveDependenciesMap, {ModuleField key -> + key.getDependency().isMandatory() == false} ) + + // add code to inject dependency resolver to fields that support it + Map injectDepsMap = moduleFields.findAll { it.needsDepResolver }.collectEntries { field -> + if (field.isList()) { + return [field,""" + for(${field.genericInnerType} candidate : ${field.name}) { + candidate.injectDependencyResolver(dependencyResolver); + } + """] + } else { + return [field, "${field.name}.injectDependencyResolver(dependencyResolver);"] + } + } + + result += wrapWithNullCheckClosure(injectDepsMap, {true}) + + // identity refs need to be injected with dependencyResolver and base class + Map resolveIdentityMap = moduleFields.findAll { it.isIdentityRef() }.collectEntries { IdentityRefModuleField field -> + [field, + "set${field.attributeName}(${field.name}.resolveIdentity(dependencyResolver, ${field.identityBaseClass}.class));"] + } + + result += wrapWithNullCheckClosure(resolveIdentityMap, {true}) + + // create instance end: reuse and recreate logic + result += """ + if(oldInstance!=null && canReuseInstance(oldModule)) { + instance = reuseInstance(oldInstance); + } else { + if(oldInstance!=null) { + try { + oldInstance.close(); + } catch(Exception e) { + logger.error("An error occurred while closing old instance " + oldInstance, e); + } + } + instance = createInstance(); + if (instance == null) { + throw new IllegalStateException("Error in createInstance - null is not allowed as return value"); + } + } + } + return instance; + } + public abstract ${AutoCloseable.canonicalName} createInstance(); + """ + return result + } + + private static String getCommonFields(FullyQualifiedName abstractFQN) { + return """ + private final ${abstractFQN.typeName} oldModule; + private final ${AutoCloseable.canonicalName} oldInstance; + private ${AutoCloseable.canonicalName} instance; + private final ${DependencyResolver.canonicalName} dependencyResolver; + private final ${ModuleIdentifier.canonicalName} identifier; + @Override + public ${ModuleIdentifier.canonicalName} getIdentifier() { + return identifier; + } + """ + } + + private static String getCachesOfResolvedIdentityRefs(List moduleFields) { + return moduleFields.findAll { it.isIdentityRef() }.collect { IdentityRefModuleField field -> + "private ${field.identityClassType} ${field.identityClassName};" + }.join("\n") + } + + private static String getCachesOfResolvedDependencies(List moduleFields) { + return moduleFields.findAll { it.dependent }.collect { field -> + if (field.isList()) { + return """ + private java.util.List<${field.dependency.sie.exportedOsgiClassName}> ${ + field.name + }Dependency = new java.util.ArrayList<${field.dependency.sie.exportedOsgiClassName}>(); + protected final java.util.List<${field.dependency.sie.exportedOsgiClassName}> get${ + field.attributeName + }Dependency(){ + return ${field.name}Dependency; + } + """ + } else { + return """ + private ${field.dependency.sie.exportedOsgiClassName} ${field.name}Dependency; + protected final ${field.dependency.sie.exportedOsgiClassName} get${field.attributeName}Dependency(){ + return ${field.name}Dependency; + } + """ + } + }.join("\n") + } + + private static String getRuntimeRegistratorCode(Optional maybeRegistratorType) { + if (maybeRegistratorType.isPresent()) { + String registratorType = maybeRegistratorType.get() + + return """ + private ${registratorType} rootRuntimeBeanRegistratorWrapper; + + public ${registratorType} getRootRuntimeBeanRegistratorWrapper(){ + return rootRuntimeBeanRegistratorWrapper; + } + + @Override + public void setRuntimeBeanRegistrator(${RootRuntimeBeanRegistrator.canonicalName} rootRuntimeRegistrator){ + this.rootRuntimeBeanRegistratorWrapper = new ${registratorType}(rootRuntimeRegistrator); + } + """ + } else { + return "" + } + } + + private static String getValidationMethods(List moduleFields) { + String result = """ + @Override + public void validate() { + """ + // validate each mandatory dependency + List lines = moduleFields.findAll{(it.dependent && it.dependency.mandatory)}.collect { field -> + if (field.isList()) { + return "" + + "for(javax.management.ObjectName dep : ${field.name}) {\n" + + " dependencyResolver.validateDependency(${field.dependency.sie.fullyQualifiedName}.class, dep, ${field.name}JmxAttribute);\n" + + "}\n" + } else { + return "dependencyResolver.validateDependency(${field.dependency.sie.fullyQualifiedName}.class, ${field.name}, ${field.name}JmxAttribute);" + } + } + result += lines.findAll { it.isEmpty() == false }.join("\n") + result += """ + customValidation(); + } + + protected void customValidation(){ + } + """ + return result + } + + private static String getLogger(FullyQualifiedName fqn) { + return "private static final ${Logger.canonicalName} logger = ${LoggerFactory.canonicalName}.getLogger(${fqn.toString()}.class);" + } + + // assumes that each parameter name corresponds to an field in this class, constructs lines setting this.field = field; + private static String getConstructorStart(FullyQualifiedName fqn, + LinkedHashMap parameters, String after) { + return "public ${fqn.typeName}(" + + parameters.collect { it.key + " " + it.value }.join(",") + + ") {\n" + + parameters.values().collect { "this.${it}=${it};\n" }.join() + + after + + "}\n" + } + + private static String getNewConstructor(FullyQualifiedName abstractFQN) { + LinkedHashMap parameters = [ + (ModuleIdentifier.canonicalName): "identifier", + (DependencyResolver.canonicalName): "dependencyResolver" + ] + String setToNulls = ["oldInstance", "oldModule"].collect { "this.${it}=null;\n" }.join() + return getConstructorStart(abstractFQN, parameters, setToNulls) + } + + private static String getCopyFromOldConstructor(FullyQualifiedName abstractFQN) { + LinkedHashMap parameters = [ + (ModuleIdentifier.canonicalName): "identifier", + (DependencyResolver.canonicalName): "dependencyResolver", + (abstractFQN.typeName): "oldModule", + (AutoCloseable.canonicalName): "oldInstance" + ] + return getConstructorStart(abstractFQN, parameters, "") + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java new file mode 100644 index 0000000000..fbc507d0b4 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java @@ -0,0 +1,101 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory; + +import com.google.common.base.Joiner; +import com.google.common.base.Optional; +import org.opendaylight.controller.config.api.DependencyResolver; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObjectBuilder; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName; + +import java.util.LinkedHashMap; + +public class ConcreteModuleGeneratedObjectFactory { + + public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional copyright, Optional header) { + FullyQualifiedName concreteFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getStubModuleName()); + FullyQualifiedName abstractFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractModuleName()); + Optional classJavaDoc = Optional.fromNullable(mbe.getNullableDescription()); + return toGeneratedObject(concreteFQN, abstractFQN, copyright, header, classJavaDoc); + } + + GeneratedObject toGeneratedObject(FullyQualifiedName concreteFQN, + FullyQualifiedName abstractFQN, + Optional copyright, + Optional header, + Optional classJavaDoc) { + // there are two constructors and two methods + JavaFileInputBuilder builder = new JavaFileInputBuilder(); + builder.setTypeName(TypeName.classType); + builder.setFqn(concreteFQN); + builder.addExtendsFQN(abstractFQN); + + builder.setCopyright(copyright); + builder.setHeader(header); + builder.setClassJavaDoc(classJavaDoc); + + builder.addToBody(getNewCtor(concreteFQN)); + builder.addToBody(getCopyCtor(concreteFQN)); + builder.addToBody(getCustomValidationStub()); + builder.addToBody(getCreateInstanceStub()); + + return new GeneratedObjectBuilder(builder.build()).toGeneratedObject(); + } + + private static String getNewCtor(FullyQualifiedName fqn) { + LinkedHashMap parameters = new LinkedHashMap(){ + { + put(ModuleIdentifier.class.getCanonicalName(), "identifier"); + put(DependencyResolver.class.getCanonicalName(), "dependencyResolver"); + } + }; + StringBuilder stringBuilder = getCtor(fqn, parameters); + return stringBuilder.toString(); + } + + private static StringBuilder getCtor(FullyQualifiedName fqn , LinkedHashMap parameters) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("public ").append(fqn.getTypeName()).append("("); + // parameters + stringBuilder.append(Joiner.on(", ").withKeyValueSeparator(" ").join(parameters)); + stringBuilder.append(") {\n"); + if (parameters.isEmpty() == false) { + stringBuilder.append("super("); + stringBuilder.append(Joiner.on(", ").join(parameters.values())); + stringBuilder.append(");\n"); + } + stringBuilder.append("}"); + return stringBuilder; + } + + private static String getCopyCtor(final FullyQualifiedName fqn) { + LinkedHashMap parameters = new LinkedHashMap(){ + { + put(ModuleIdentifier.class.getCanonicalName(), "identifier"); + put(DependencyResolver.class.getCanonicalName(), "dependencyResolver"); + put(fqn.toString(), "oldModule"); + put(AutoCloseable.class.getCanonicalName(), "oldInstance"); + } + }; + StringBuilder stringBuilder = getCtor(fqn, parameters); + return stringBuilder.toString(); + } + + private static String getCustomValidationStub() { + return "@Override\n" + + "public void customValidation() {\n" + + "// add custom validation form module attributes here.\n" + + "}"; + } + + private static String getCreateInstanceStub() { + return "@Override\n" + + "public " + AutoCloseable.class.getCanonicalName() + " createInstance() {\n" + + "// TODO:implement\n" + + "throw new " + UnsupportedOperationException.class.getCanonicalName() + "();\n"+ + "}"; + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/GenericGeneratedObjectFactory.groovy b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/GenericGeneratedObjectFactory.groovy new file mode 100644 index 0000000000..6504aac7d4 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/GenericGeneratedObjectFactory.groovy @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.gofactory + +import com.google.common.base.Optional +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObjectBuilder +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder + +public class GenericGeneratedObjectFactory { + + public GeneratedObject toGeneratedObject(FtlTemplate template, Optional copyright) { + JavaFileInputBuilder b = new JavaFileInputBuilder(); + b.setHeader(template.headerString) + b.setFqn(new FullyQualifiedName(template.packageName, template.typeDeclaration.name)) + b.setClassJavaDoc(template.maybeJavadoc) + template.annotations.each { b.addClassAnnotation(it) } + // type declaration + template.typeDeclaration.extended.each { b.addExtendsFQN(FullyQualifiedName.fromString(it)) } + template.typeDeclaration.implemented.each { b.addImplementsFQN(FullyQualifiedName.fromString(it)) } + b.setCopyright(copyright); + b.setTypeName(template.typeDeclaration.toTypeName()) + // fields + template.fields.each { b.addToBody(it.toString()) } + // constructors + template.constructors.each { b.addToBody(it.toString()) } + // methods + template.methods.each { b.addToBody(it.toString()) } + + return new GeneratedObjectBuilder(b.build()).toGeneratedObject(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java new file mode 100644 index 0000000000..f72551a377 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java @@ -0,0 +1,81 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.java; + +import java.io.File; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class FullyQualifiedName { + + private final String packageName; + private final String typeName; + + public FullyQualifiedName(String packageName, String typeName) { + this.packageName = checkNotNull(packageName); + this.typeName = checkNotNull(typeName); + } + + public FullyQualifiedName(Class clazz) { + this(clazz.getPackage().getName(), clazz.getSimpleName()); + } + + public static FullyQualifiedName fromString(String fqn) { + Matcher m = Pattern.compile("(.*)\\.([^\\.]+)$").matcher(fqn); + if (m.matches()) { + return new FullyQualifiedName(m.group(1), m.group(2)); + } else { + return new FullyQualifiedName("", fqn); + } + } + + public String getPackageName() { + return packageName; + } + + public String getTypeName() { + return typeName; + } + + public File toFile(File srcDirectory) { + String directory = packageName.replace(".", File.separator); + return new File(srcDirectory, directory + File.separator + typeName + ".java"); + } + + + @Override + public String toString() { + if (packageName.isEmpty()){ + return typeName; + } + return packageName + "." + typeName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + FullyQualifiedName that = (FullyQualifiedName) o; + + if (!packageName.equals(that.packageName)) { + return false; + } + if (!typeName.equals(that.typeName)) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = packageName.hashCode(); + result = 31 * result + typeName.hashCode(); + return result; + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java new file mode 100644 index 0000000000..4ad080c6f5 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java @@ -0,0 +1,75 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.java; + +import com.google.common.base.Optional; +import com.google.common.collect.Maps; +import org.apache.commons.io.FileUtils; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil; + +import java.io.File; +import java.io.IOException; +import java.util.Map.Entry; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class GeneratedObject { + + private final FullyQualifiedName fqn; + private final String content; + + public GeneratedObject(FullyQualifiedName fqn, String content) { + this.fqn = checkNotNull(fqn); + this.content = StringUtil.formatJavaSource(checkNotNull(content)); + } + + public FullyQualifiedName getFQN(){ + return fqn; + } + + public String getContent() { + return content; + } + + public Optional> persist(File srcDirectory, boolean overwrite) throws IOException { + File dstFile = fqn.toFile(srcDirectory); + if (overwrite == true || dstFile.exists() == false) { + FileUtils.write(dstFile, content); + return Optional.of(Maps.immutableEntry(fqn, dstFile)); + } else { + return Optional.absent(); + } + } + + public Optional> persist(File srcDirectory) throws IOException { + return persist(srcDirectory, true); + } + + @Override + public String toString() { + return getClass().getSimpleName() + "{" + + "fqn=" + fqn + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + GeneratedObject that = (GeneratedObject) o; + + if (!fqn.equals(that.fqn)) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return fqn.hashCode(); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java new file mode 100644 index 0000000000..72819db9cf --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java @@ -0,0 +1,68 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.java; + +import com.google.common.base.Optional; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil; + +import static org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil.prefixAndJoin; + +public class GeneratedObjectBuilder { + private final JavaFileInput input; + + public GeneratedObjectBuilder(JavaFileInput input) { + this.input = input; + } + + + public GeneratedObject toGeneratedObject() { + FullyQualifiedName fqn = input.getFQN(); + StringBuilder content = new StringBuilder(); + + + content.append(maybeAddComment(input.getCopyright())); + content.append(maybeAddComment(input.getHeader())); + + if (input.getFQN().getPackageName().isEmpty() == false) { + content.append("package "); + content.append(input.getFQN().getPackageName()); + content.append(";\n"); + } + content.append(maybeAddComment(input.getClassJavaDoc(), true)); + + for (String classAnnotation : input.getClassAnnotations()) { + content.append(classAnnotation); + content.append("\n"); + } + + content.append("public "); + content.append(input.getType()); + content.append(" "); + content.append(input.getFQN().getTypeName()); + content.append(prefixAndJoin(input.getExtends(), "extends")); + content.append(prefixAndJoin(input.getImplements(), "implements")); + content.append(" {\n"); + + for (String method : input.getBodyElements()) { + content.append(method); + content.append("\n"); + } + + content.append("\n}\n"); + + return new GeneratedObject(fqn, content.toString()); + } + + private static String maybeAddComment(Optional comment) { + return maybeAddComment(comment, false); + } + + private static String maybeAddComment(Optional comment, boolean isJavadoc) { + + if (comment.isPresent()) { + String input = comment.get(); + return StringUtil.writeComment(input, isJavadoc); + } else { + return ""; + } + } + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java new file mode 100644 index 0000000000..ba8537bea0 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java @@ -0,0 +1,27 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.java; + +import com.google.common.base.Optional; + +import java.util.List; + +public interface JavaFileInput { + + FullyQualifiedName getFQN(); + + Optional getCopyright(); + + Optional getHeader(); + + TypeName getType(); + + Optional getClassJavaDoc(); + + List getClassAnnotations(); + + List getExtends(); + + List getImplements(); + + List getBodyElements(); + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java new file mode 100644 index 0000000000..c739f57730 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.java; + +import com.google.common.base.Optional; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class JavaFileInputBuilder { + + private Optional copyright = Optional.absent(), header = Optional.absent(), classJavaDoc = Optional.absent(); + + private TypeName typeName = TypeName.classType; + + private FullyQualifiedName fqn; + + private final List classAnnotations = new ArrayList<>(); + + private final List extendsFQNs = new ArrayList<>(); + + private final List implementsFQNs = new ArrayList<>(); + + private final List bodyElements = new ArrayList<>(); + + public void addToBody(String element) { + bodyElements.add(element + "\n"); + } + + public void addClassAnnotation(Annotation annotation) { + addClassAnnotation(annotation.toString()); + } + + public void addClassAnnotation(String annotation) { + classAnnotations.add(checkNotNull(annotation)); + } + + public void addExtendsFQN(FullyQualifiedName fqn) { + extendsFQNs.add(fqn); + } + + public void addImplementsFQN(FullyQualifiedName fqn) { + implementsFQNs.add(fqn); + } + + public Optional getCopyright() { + return copyright; + } + + public void setCopyright(Optional copyright) { + this.copyright = checkNotNull(copyright); + } + + public Optional getHeader() { + return header; + } + + public void setHeader(Optional header) { + this.header = checkNotNull(header); + } + + + public Optional getClassJavaDoc() { + return classJavaDoc; + } + + public void setClassJavaDoc(Optional classJavaDoc) { + this.classJavaDoc = checkNotNull(classJavaDoc); + } + + + public FullyQualifiedName getFqn() { + return fqn; + } + + public void setFqn(FullyQualifiedName fqn) { + this.fqn = fqn; + } + + public List getExtendsFQNs() { + return extendsFQNs; + } + + + public List getImplementsFQNs() { + return implementsFQNs; + } + + + public TypeName getTypeName() { + return typeName; + } + + public void setTypeName(TypeName typeName) { + this.typeName = typeName; + } + + + public JavaFileInput build() { + checkNotNull(copyright); + checkNotNull(header); + checkNotNull(classJavaDoc); + checkNotNull(typeName); + checkNotNull(fqn); + + return new JavaFileInput() { + + @Override + public FullyQualifiedName getFQN() { + return fqn; + } + + @Override + public Optional getCopyright() { + return copyright; + } + + @Override + public Optional getHeader() { + return header; + } + + @Override + public Optional getClassJavaDoc() { + return classJavaDoc; + } + + @Override + public TypeName getType() { + return typeName; + } + + @Override + public List getExtends() { + return Collections.unmodifiableList(extendsFQNs); + } + + @Override + public List getImplements() { + return Collections.unmodifiableList(implementsFQNs); + } + + @Override + public List getClassAnnotations() { + return Collections.unmodifiableList(classAnnotations); + } + + @Override + public List getBodyElements() { + return Collections.unmodifiableList(bodyElements); + } + }; + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/TypeName.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/TypeName.java new file mode 100644 index 0000000000..d6ed12dbfe --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/TypeName.java @@ -0,0 +1,17 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.java; + +public enum TypeName { + + classType("class"), interfaceType("interface"), enumType("enum"), absClassType("abstract class"), finalClassType("final class"); + + private final String value; + + TypeName(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java new file mode 100644 index 0000000000..265aea10c5 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java @@ -0,0 +1,101 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.util; + +import com.google.common.base.Joiner; +import com.google.common.base.Optional; +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.regex.Pattern; + +public class StringUtil { + private static final Logger logger = LoggerFactory.getLogger(StringUtils.class); + + /** + * @param list of strings to be joined by ',' + * @param prefix e.g. 'extends' or 'implements' + */ + public static String prefixAndJoin(List list, String prefix) { + if (list.isEmpty()) { + return ""; + } + Joiner joiner = Joiner.on(","); + return " " + prefix + " " + joiner.join(list); + } + + public static String addAsterixAtEachLineStart(String input) { + String s = Pattern.compile("^", Pattern.MULTILINE).matcher(input).replaceAll("* "); + // remove trailing spaces + s = Pattern.compile("\\s+$", Pattern.MULTILINE).matcher(s).replaceAll(""); + s = ensureEndsWithSingleNewLine(s); + return s; + } + + private static String ensureEndsWithSingleNewLine(String s) { + // .split Only trailing empty strings are skipped. + String[] split = s.split("\n"); + s = Joiner.on("\n").join(split); + s = s + "\n"; + return s; + } + + public static String writeComment(String input, boolean isJavadoc) { + StringBuilder content = new StringBuilder(); + content.append("/*"); + if (isJavadoc) { + content.append("*"); + } + content.append("\n"); + + content.append(addAsterixAtEachLineStart(input)); + content.append("*/\n"); + return content.toString(); + } + + + public static Optional loadCopyright() { + try (InputStream in = StringUtil.class.getResourceAsStream("/copyright.txt")) { + if (in != null) { + return Optional.of(IOUtils.toString(in)); + } + } catch (IOException e) { + logger.warn("Cannot load copyright.txt", e); + } + return Optional.absent(); + } + + public static String formatJavaSource(String input) { + Iterable split = Splitter.on("\n").trimResults().split(input); + + int basicIndent = 4; + StringBuilder sb = new StringBuilder(); + int intends = 0, empty = 0; + for (String line : split) { + intends -= StringUtils.countMatches(line, "}"); + if (intends < 0) { + intends = 0; + } + if (line.isEmpty() == false) { + sb.append(Strings.repeat(" ", basicIndent * intends)); + sb.append(line); + sb.append("\n"); + empty = 0; + } else { + empty++; // one empty line is allowed + if (empty < 2) { + sb.append("\n"); + } + } + intends += StringUtils.countMatches(line, "{"); + } + return ensureEndsWithSingleNewLine(sb.toString()); + } + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt new file mode 100644 index 0000000000..4a0c355685 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt @@ -0,0 +1,5 @@ +Copyright (c) 2013 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 diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/abstract_ftl_file.ftl b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/abstract_ftl_file.ftl deleted file mode 100644 index 0c6bf839fa..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/abstract_ftl_file.ftl +++ /dev/null @@ -1,15 +0,0 @@ -<@headerD header=header/> -package ${packageName}; - -<@javadocD object=javadoc/> -<@annotationsD object=annotations/> -<#-- class/interface --> -<@typeDeclarationD object=typeDeclaration/> -{ - -<@constructorsD object=constructors> - -<@fieldsD object=fields/> - -<@methodsD object=methods/> -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/factory_abs_template.ftl b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/factory_abs_template.ftl deleted file mode 100644 index b9bbf1f1b5..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/factory_abs_template.ftl +++ /dev/null @@ -1,82 +0,0 @@ -<@headerD header=header/> -package ${packageName}; - -<@javadocD object=javadoc/> -@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(namespace="${mbe.getYangModuleQName().getNamespace().toString()}",revision="${mbe.getYangModuleQName().getFormattedRevision()}",name="${mbe.getYangModuleQName().getLocalName()}") -<@typeDeclarationD object=typeDeclaration/> -{ - - public static final java.lang.String NAME = "${globallyUniqueName}"; - private static final java.util.Set> serviceIfcs; - <#if providedServices??> - static { - java.util.Set> serviceIfcs2 = new java.util.HashSet>(); - <#list providedServices as refId> - serviceIfcs2.add(${refId}); - - serviceIfcs = java.util.Collections.unmodifiableSet(serviceIfcs2); - } - - - @Override - public final boolean isModuleImplementingServiceInterface(Class serviceInterface) { - for (Class ifc: serviceIfcs) { - if (serviceInterface.isAssignableFrom(ifc)){ - return true; - } - } - return false; - } - - @Override - public java.util.Set> getImplementedServiceIntefaces() { - return serviceIfcs; - } - - - @Override - public ${moduleType} createModule(String instanceName, ${dependencyResolverType} dependencyResolver, ${bundleContextType} bundleContext) { - return instantiateModule(instanceName, dependencyResolver, bundleContext); - } - - @Override - public ${moduleType} createModule(String instanceName, ${dependencyResolverType} dependencyResolver, ${dynamicMBeanWithInstanceType} old, ${bundleContextType} bundleContext) throws Exception { - ${moduleInstanceType} oldModule = null; - try { - oldModule = (${moduleInstanceType}) old.getModule(); - } catch(Exception e) { - return handleChangedClass(old); - } - ${moduleInstanceType} module = instantiateModule(instanceName, dependencyResolver, oldModule, old.getInstance(), bundleContext); - - <#list fields as attr> - module.set${attr.name}(oldModule.get${attr.name}()); - - - return module; - } - - public ${moduleInstanceType} instantiateModule(String instanceName, ${dependencyResolverType} dependencyResolver, ${moduleInstanceType} oldModule, ${instanceType} oldInstance, ${bundleContextType} bundleContext) { - return new ${moduleInstanceType}(new ${moduleNameType}(NAME, instanceName), dependencyResolver, oldModule, oldInstance); - } - - public ${moduleInstanceType} instantiateModule(String instanceName, ${dependencyResolverType} dependencyResolver, ${bundleContextType} bundleContext) { - return new ${moduleInstanceType}(new ${moduleNameType}(NAME, instanceName), dependencyResolver); - } - - @Override - public final String getImplementationName() { - return NAME; - } - - - public ${moduleInstanceType} handleChangedClass(${dynamicMBeanWithInstanceType} old) throws Exception { - throw new UnsupportedOperationException("Class reloading is not supported"); - } - - @Override - public java.util.Set<${moduleInstanceType}> getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory dependencyResolverFactory, ${bundleContextType} bundleContext) { - return new java.util.HashSet<${moduleInstanceType}>(); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_abs_template_new.ftl b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_abs_template_new.ftl deleted file mode 100644 index 848fcfe5fc..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_abs_template_new.ftl +++ /dev/null @@ -1,223 +0,0 @@ -<@headerD header=header/> -package ${packageName}; - -<@javadocD object=javadoc/> -<@annotationsD object=annotations/> -<@typeDeclarationD object=typeDeclaration/> -{ - // attributes - <@moduleFieldsD moduleFields=moduleFields/> - //attributes end - - private static final ${loggerType} logger = ${loggerFactoryType}.getLogger(${typeDeclaration.name}.class); - - private final ${typeDeclaration.name} oldModule; - private final ${instanceType} oldInstance; - private ${instanceType} instance; - private final ${dependencyResolverType} dependencyResolver; - private final ${moduleNameType} identifier; - <#if runtime=true> - private ${registratorType} rootRuntimeBeanRegistratorWrapper; - - - public ${typeDeclaration.name}(${moduleNameType} identifier, ${dependencyResolverType} dependencyResolver) { - this.identifier = identifier; - this.dependencyResolver = dependencyResolver; - this.oldInstance = null; - this.oldModule = null; - } - - public ${typeDeclaration.name}(${moduleNameType} identifier, ${dependencyResolverType} dependencyResolver, ${typeDeclaration.name} oldModule, ${instanceType} oldInstance) { - this.identifier = identifier; - this.dependencyResolver = dependencyResolver; - this.oldInstance = oldInstance; - this.oldModule = oldModule; - } - - // getters and setters exported into MXBean - <@methodsD object=methods/> - - <#if runtime=true> - public ${registratorType} getRootRuntimeBeanRegistratorWrapper(){ - return rootRuntimeBeanRegistratorWrapper; - } - - @Override - public void setRuntimeBeanRegistrator(${rootRuntimeRegistratorType} rootRuntimeRegistrator){ - this.rootRuntimeBeanRegistratorWrapper = new ${registratorType}(rootRuntimeRegistrator); - } - - - @Override - public void validate(){ - <#list moduleFields as field> - <#if field.dependent==true && field.dependency.mandatory==true> - <#if field.type?starts_with("java.util.List")> - for(javax.management.ObjectName dep : ${field.name}) { - dependencyResolver.validateDependency(${field.dependency.sie.fullyQualifiedName}.class, dep, ${field.name}JmxAttribute); - } - <#else> - dependencyResolver.validateDependency(${field.dependency.sie.fullyQualifiedName}.class, ${field.name}, ${field.name}JmxAttribute); - - - - customValidation(); - } - - protected void customValidation(){ - - } - - // caches of resolved dependencies - <#list moduleFields as field> - <#if field.dependent==true> - <#if field.type?starts_with("java.util.List")> - private java.util.List<${field.dependency.sie.exportedOsgiClassName}> ${field.name}Dependency = new java.util.ArrayList<${field.dependency.sie.exportedOsgiClassName}>(); - protected final java.util.List<${field.dependency.sie.exportedOsgiClassName}> get${field.attributeName}Dependency(){ - return ${field.name}Dependency; - } - <#else> - private ${field.dependency.sie.exportedOsgiClassName} ${field.name}Dependency; - protected final ${field.dependency.sie.exportedOsgiClassName} get${field.attributeName}Dependency(){ - return ${field.name}Dependency; - } - - - - - // caches of resolved IdentityRefs - <#list moduleFields as field> - <#if field.identityRef==true> - private ${field.identityClassType} ${field.identityClassName}; - - - - @Override - public final ${instanceType} getInstance(){ - if(instance==null) { - - <#list moduleFields as field> - <#if field.dependent==true> - <#if field.dependency.mandatory==false> - if(${field.name}!=null) { - - - <#if field.type?starts_with("java.util.List")> - ${field.name}Dependency = new java.util.ArrayList<${field.dependency.sie.exportedOsgiClassName}>(); - for(javax.management.ObjectName dep : ${field.name}) { - ${field.name}Dependency.add(dependencyResolver.resolveInstance(${field.dependency.sie.exportedOsgiClassName}.class, dep, ${field.name}JmxAttribute)); - } - <#else> - ${field.name}Dependency = dependencyResolver.resolveInstance(${field.dependency.sie.exportedOsgiClassName}.class, ${field.name}, ${field.name}JmxAttribute); - - - <#if field.dependency.mandatory==false> - } - - - - <#if field.needsDepResolver==true> - if(${field.name} != null) { - <#if field.type?starts_with("java.util.List")> - for(${field.type?substring(field.type?index_of("<") + 1, field.type?index_of(">"))} candidate : ${field.name}) { - candidate.injectDependencyResolver(dependencyResolver); - } - <#else> - ${field.name}.injectDependencyResolver(dependencyResolver); - - } - - - <#if field.identityRef==true> - if(${field.name} != null) { - set${field.attributeName}(${field.name}.resolveIdentity(dependencyResolver, ${field.identityBaseClass}.class)); - } - - - - if(oldInstance!=null && canReuseInstance(oldModule)) { - instance = reuseInstance(oldInstance); - } else { - if(oldInstance!=null) { - try { - oldInstance.close(); - } catch(Exception e) { - logger.error("An error occurred while closing old instance " + oldInstance, e); - } - } - instance = createInstance(); - } - } - return instance; - } - - @Override - public ${moduleNameType} getIdentifier() { - return identifier; - } - - public boolean canReuseInstance(${typeDeclaration.name} oldModule){ - // allow reusing of old instance if no parameters was changed - return isSame(oldModule); - } - - public ${instanceType} reuseInstance(${instanceType} oldInstance){ - // implement if instance reuse should be supported. Override canReuseInstance to change the criteria. - return oldInstance; - } - - public abstract ${instanceType} createInstance(); - - public boolean isSame(${typeDeclaration.name} other) { - if (other == null) { - throw new IllegalArgumentException("Parameter 'other' is null"); - } - <#list moduleFields as field> - <#if field.dependent==true && field.listOfDependencies == false> - if (${field.name}Dependency != other.${field.name}Dependency) { // reference to dependency must be same - return false; - } - <#elseif field.listOfDependencies> - if (${field.name}Dependency.equals(other.${field.name}Dependency) == false) { - return false; - } - for (int idx = 0; idx < ${field.name}Dependency.size(); idx++) { - if (${field.name}Dependency.get(idx) != other.${field.name}Dependency.get(idx)) { - return false; - } - } - <#else> - if (${field.name} == null) { - if (other.${field.name} != null) { - return false; - } - } else if - <#if field.array == false> - (${field.name}.equals(other.${field.name}) == false) - <#else> - (java.util.Arrays.equals(${field.name},other.${field.name}) == false) - - { - return false; - } - - - - return true; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ${typeDeclaration.name} that = (${typeDeclaration.name}) o; - - return identifier.equals(that.identifier); - } - - @Override - public int hashCode() { - return identifier.hashCode(); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_stub_template.ftl b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_stub_template.ftl deleted file mode 100644 index 2db505e54e..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_stub_template.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<@headerD header=header/> -package ${packageName}; - -<@javadocD object=javadoc/> -<@typeDeclarationD object=typeDeclaration/> { - - public ${typeDeclaration.name}(${moduleNameType} identifier, ${dependencyResolverType} dependencyResolver) { - super(identifier, dependencyResolver); - } - - public ${typeDeclaration.name}(${moduleNameType} identifier, ${dependencyResolverType} dependencyResolver, - ${typeDeclaration.name} oldModule, ${instanceType} oldInstance) { - - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - protected void customValidation(){ - // Add custom validation for module attributes here. - } - - @Override - public ${instanceType} createInstance() { - //TODO:implement - <@unimplementedExceptionD/> - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java index 9e2f334dac..1dde94b482 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java @@ -7,12 +7,12 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin; -import java.io.File; - import org.apache.commons.io.FileUtils; import org.junit.Before; import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest; +import java.io.File; + public abstract class AbstractGeneratorTest extends AbstractYangTest { private static final File GENERATOR_OUTPUT_PATH_ROOT = new File( "target/testgen"); diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java index 3ef406694a..0fd9720f79 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java @@ -119,7 +119,7 @@ public class JMXGeneratorTest extends AbstractGeneratorTest { + JMXGenerator.NAMESPACE_TO_PACKAGE_DIVIDER + PackageTranslatorTest.EXPECTED_PACKAGE_PREFIX); map.put(JMXGenerator.MODULE_FACTORY_FILE_BOOLEAN, "false"); - jmxGenerator = new JMXGenerator(new FreeMarkerCodeWriterImpl()); + jmxGenerator = new JMXGenerator(new CodeWriter()); jmxGenerator.setAdditionalConfig(map); File targetDir = new File(generatorOutputPath, "target"); generatedResourcesDir = new File(targetDir, "generated-resources"); diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java index 48d5b30eb2..3c01cc00d4 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java @@ -34,7 +34,7 @@ public class ModuleMXBeanEntryTemplatesTest { assertNotNull(template); } - private ModuleMXBeanEntry mockMbe(String packageName) { + public static ModuleMXBeanEntry mockMbe(String packageName) { ModuleMXBeanEntry mbe = mock(ModuleMXBeanEntry.class); Map a = Maps.newHashMap(); JavaAttribute attr = mockJavaAttr(); @@ -52,7 +52,7 @@ public class ModuleMXBeanEntryTemplatesTest { return mbe; } - private JavaAttribute mockJavaAttr() { + public static JavaAttribute mockJavaAttr() { JavaAttribute attr = mock(JavaAttribute.class); Type typeA = mock(Type.class); doReturn("package").when(typeA).getName(); diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java index b12ee5023f..f21765e536 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java @@ -7,26 +7,21 @@ */ package org.opendaylight.controller.config.yangjmxgenerator.plugin; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.internal.matchers.StringContains.containsString; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Map; - import org.junit.Test; import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry; import org.opendaylight.controller.config.yangjmxgenerator.RuntimeRegistratorTest; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlFilePersister; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate; import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FormattingUtil; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; public class RuntimeRegistratorFtlFileTest extends RuntimeRegistratorTest { - private final FtlFilePersister ftlFilePersister = new FtlFilePersister(); @Test public void testRootWithoutAnything() { @@ -40,9 +35,7 @@ public class RuntimeRegistratorFtlFileTest extends RuntimeRegistratorTest { FtlTemplate rootFtlFile = createdFtls.get(rootRegistratorName); assertNotNull(rootFtlFile); - Map serializedFtls = ftlFilePersister - .serializeFtls(createdFtls.values()); - assertThat(serializedFtls.size(), is(2)); + assertThat(createdFtls.values().size(), is(2)); } @Test @@ -55,29 +48,6 @@ public class RuntimeRegistratorFtlFileTest extends RuntimeRegistratorTest { Map createdFtls = RuntimeRegistratorFtlTemplate .create(rootRB); - Map serializedFtls = ftlFilePersister - .serializeFtls(createdFtls.values()); - assertThat(serializedFtls.size(), is(4)); - - assertThat( - findRegistrationOutput(createdFtls, grandChildRB, - serializedFtls), not(containsString(" register("))); - - FtlTemplate registrator = createdFtls.get(RuntimeRegistratorFtlTemplate - .getJavaNameOfRuntimeRegistrator(rootRB)); - FormattingUtil.cleanUpEmptyLinesAndIndent(serializedFtls - .get(registrator)); - + assertThat(createdFtls.values().size(), is(4)); } - - private String findRegistrationOutput(Map createdFtls, - RuntimeBeanEntry rb, Map serializedFtls) { - RuntimeRegistratorFtlTemplate rbFtlFile = (RuntimeRegistratorFtlTemplate) createdFtls - .get(RuntimeRegistratorFtlTemplate.getJavaNameOfRuntimeRegistration(rb.getJavaNamePrefix())); - assertNotNull(rbFtlFile); - String unformatted = serializedFtls.get(rbFtlFile); - assertNotNull(unformatted); - return FormattingUtil.cleanUpEmptyLinesAndIndent(unformatted); - } - } diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java deleted file mode 100644 index 2582a602b3..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.ftl; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.MockitoAnnotations; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration; -import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FormattingUtil; - -import com.google.common.collect.Lists; - -public class FtlFilePersisterTest { - private final FtlFilePersister tested = new FtlFilePersister(); - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testGeneralInterface() { - String packageName = "pa.cka.ge"; - String name = "GeneralClassImpl"; - List extendedInterfaces = Arrays.asList("List", "Set"); - List methods = new ArrayList<>(); - methods.add(new MethodDeclaration("String", "executeOperation", - Collections. emptyList())); - - List mods = Lists.newArrayList(); - List mods2 = Lists.newArrayList("final"); - methods.add(new MethodDeclaration("String", "executeOperation", Arrays - .asList(new Field(mods, "int", "param1"), new Field(mods2, "long", "param2")))); - - GeneralInterfaceTemplate generalInterface = new GeneralInterfaceTemplate( - null, packageName, name, extendedInterfaces, methods); - - Map abstractFtlFileStringMap = tested - .serializeFtls(Arrays.asList(generalInterface)); - String content = FormattingUtil - .cleanUpEmptyLinesAndIndent(abstractFtlFileStringMap.get(generalInterface)); - - // skip header - content = content.substring(content.indexOf("package")); - - String expected = "package pa.cka.ge;\n" - + "/**\n" - + "*\n" - + "*/\n" - + "public interface GeneralClassImpl extends List, Set\n{\n" - + "public String executeOperation();\n" - + "public String executeOperation(int param1, final long param2);\n" - + "}\n"; - - assertEquals(expected, content); - } - -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java new file mode 100644 index 0000000000..957fbf5251 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.module; + +import net.sourceforge.pmd.lang.Parser; +import net.sourceforge.pmd.lang.ParserOptions; +import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.lang.java.Java17Parser; +import org.apache.commons.io.FileUtils; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.AbstractGeneratorTest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class AbstractGeneratedObjectTest extends AbstractGeneratorTest { + private static final Logger logger = LoggerFactory.getLogger(AbstractGeneratedObjectTest.class); + + protected void assertHasMethodNamed(Node c, String method) { + assertTrue(c.hasDescendantMatchingXPath("//MethodDeclaration[MethodDeclarator[@Image='" + + method + + "']]")); + } + + protected Node parse(File dstFile) throws IOException { + assertNotNull(dstFile); + logger.debug(FileUtils.readFileToString(dstFile)); + Parser parser = new Java17Parser(new ParserOptions()); + return parser.parse(dstFile.toString(), new FileReader(dstFile)); + } + + +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java new file mode 100644 index 0000000000..164d1a5f58 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.module.abs; + +import com.google.common.base.Optional; +import org.junit.Test; +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; +import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.AbsModuleGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest; +import org.opendaylight.yangtools.yang.common.QName; + +import java.io.File; +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class AbsModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest { + + @Test + public void test() throws IOException { + Map serviceInterfaceEntryMap = loadThreadsServiceInterfaceEntries("packages.sis"); + Map namesToMBEs = loadThreadsJava(serviceInterfaceEntryMap, "packages.pack2"); + ModuleMXBeanEntry dynamicThreadPool = namesToMBEs.get(THREADPOOL_DYNAMIC_MXB_NAME); + parseGeneratedFile(dynamicThreadPool); + + } + + private void parseGeneratedFile(ModuleMXBeanEntry moduleMXBeanEntry) throws IOException { + Optional copyright = Optional.absent(); + GeneratedObject generatedObject = new AbsModuleGeneratedObjectFactory().toGeneratedObject(moduleMXBeanEntry, copyright); + Entry entry = generatedObject.persist(generatorOutputPath).get(); + + File dstFile = entry.getValue(); + parse(dstFile); + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java new file mode 100644 index 0000000000..519b0edf42 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java @@ -0,0 +1,52 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.module.concrete; + +import com.google.common.base.Optional; +import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; +import org.junit.Test; +import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.ConcreteModuleGeneratedObjectFactory; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest; + +import java.io.File; +import java.util.Map.Entry; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +public class ConcreteModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest { + + @Test + public void test() throws Exception { + FullyQualifiedName fqn = new FullyQualifiedName("foo.bar", "Baz"); + FullyQualifiedName abstractFQN = new FullyQualifiedName("foo.bar", "AbstractBaz"); + String nullableDescription = null; + + ModuleMXBeanEntry moduleMXBeanEntry = mockModuleMXBeanEntry(fqn, abstractFQN, nullableDescription); + Optional copyright = Optional.absent(); + Optional header = Optional.absent(); + GeneratedObject go = new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(moduleMXBeanEntry, copyright, header); + Entry entry = go.persist(generatorOutputPath).get(); + + File dstFile = entry.getValue(); + Node c = parse(dstFile); + assertEquals(fqn.getPackageName(), ((ASTCompilationUnit) c).getPackageDeclaration().getPackageNameImage()); + assertEquals(fqn.getTypeName(), c.getFirstDescendantOfType(ASTClassOrInterfaceDeclaration.class).getImage()); + assertHasMethodNamed(c, "customValidation"); + assertHasMethodNamed(c, "createInstance"); + } + + static ModuleMXBeanEntry mockModuleMXBeanEntry(FullyQualifiedName fqn, FullyQualifiedName abstractFQN, String nullableDescription) { + ModuleMXBeanEntry mock = mock(ModuleMXBeanEntry.class); + assertEquals(fqn.getPackageName(), abstractFQN.getPackageName()); + doReturn(fqn.getPackageName()).when(mock).getPackageName(); + doReturn(fqn.getTypeName()).when(mock).getStubModuleName(); + doReturn(nullableDescription).when(mock).getNullableDescription(); + doReturn(abstractFQN.getTypeName()).when(mock).getAbstractModuleName(); + return mock; + } +} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FormattingUtil.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FormattingUtil.java deleted file mode 100644 index e62cb7c002..0000000000 --- a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FormattingUtil.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yangjmxgenerator.plugin.util; - -import java.util.Scanner; - -public class FormattingUtil { - - public static String cleanUpEmptyLinesAndIndent(String input) { - StringBuffer output = new StringBuffer(); - Scanner scanner = new Scanner(input); - while (scanner.hasNextLine()) { - String line = scanner.nextLine(); - line = line.replaceAll("\t", " "); - while (line.contains(" ")) { - line = line.replaceAll(" ", " "); - } - line = line.trim(); - if (line.length() > 0) { - output.append(line); - output.append("\n"); - } - } - - return output.toString(); - } -} diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java new file mode 100644 index 0000000000..b0217a4ba9 --- /dev/null +++ b/opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java @@ -0,0 +1,60 @@ +package org.opendaylight.controller.config.yangjmxgenerator.plugin.util; + +import org.junit.Test; +import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName; + +import java.io.IOException; + +import static java.util.Arrays.asList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class StringUtilTest { + @Test + public void testPrefixAndJoin() { + assertEquals(" extends p1.Foo,Bar", StringUtil.prefixAndJoin(asList( + new FullyQualifiedName("p1", "Foo"), new FullyQualifiedName("", "Bar")), "extends")); + } + + @Test + public void testAddAsterixAtEachLineStart() { + String input = "foo \nbar"; + String expectedOutput = "* foo\n* bar\n"; + assertEquals(expectedOutput, StringUtil.addAsterixAtEachLineStart(input)); + } + + @Test + public void testCopyright() throws IOException { + assertTrue(StringUtil.loadCopyright().isPresent()); + } + + @Test + public void testFormatting() { + { + String input = " \tpack;\n" + + "class Bar{ \n" + + " method() {\n" + + " body\n" + + "}\n" + + " }"; + String expected = "pack;\n" + + "class Bar{\n" + + " method() {\n" + + " body\n" + + " }\n" + + "}\n"; + assertEquals(expected, StringUtil.formatJavaSource(input)); + } + { + String input = "{\n" + + "bar\n" + + "}\n" + + "\n\nbaz\n\n\n\n"; + String expected = "{\n" + + " bar\n" + + "}\n\n" + + "baz\n"; + assertEquals(expected, StringUtil.formatJavaSource(input)); + } + } +} diff --git a/opendaylight/config/yang-jmx-generator/pom.xml b/opendaylight/config/yang-jmx-generator/pom.xml index 92ce0feccd..133b07ff86 100644 --- a/opendaylight/config/yang-jmx-generator/pom.xml +++ b/opendaylight/config/yang-jmx-generator/pom.xml @@ -1,86 +1,83 @@ - + - 4.0.0 - - config-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - + 4.0.0 + + org.opendaylight.controller + config-subsystem + 0.2.5-SNAPSHOT + ../ + - yang-jmx-generator - ${project.artifactId} - bundle + yang-jmx-generator + bundle + ${project.artifactId} - - - org.slf4j - slf4j-api - + + + ${project.groupId} + config-api + + + com.google.guava + guava + - - org.opendaylight.yangtools - binding-generator-spi - - - org.opendaylight.yangtools - binding-generator-util - - - com.google.guava - guava - + + org.opendaylight.yangtools + binding-generator-spi + + + org.opendaylight.yangtools + binding-generator-util + + + org.opendaylight.yangtools + binding-type-provider + - - org.opendaylight.yangtools - mockito-configuration - - - org.opendaylight.yangtools - yang-parser-impl - test - - - ${project.groupId} - config-api - - - org.opendaylight.yangtools - binding-generator-impl - test - - - org.apache.commons - commons-lang3 - test - - - org.opendaylight.yangtools - binding-type-provider - - + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + + + org.apache.commons + commons-lang3 + test + + + org.opendaylight.yangtools + binding-generator-impl + test + + + org.opendaylight.yangtools + yang-parser-impl + test + + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.util, - - - org.opendaylight.controller.config.yangjmxgenerator, - org.opendaylight.controller.config.yangjmxgenerator.attribute, - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.util, + org.opendaylight.controller.config.yangjmxgenerator, + org.opendaylight.controller.config.yangjmxgenerator.attribute, + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + diff --git a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java index 1100b35437..76d97703af 100644 --- a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java +++ b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java @@ -7,25 +7,29 @@ */ package org.opendaylight.controller.config.yangjmxgenerator; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.format; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; +import org.junit.Assert; import org.junit.Before; import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils; +import org.opendaylight.yangtools.sal.binding.yang.types.TypeProviderImpl; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl; -import com.google.common.base.Preconditions; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.format; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; public abstract class AbstractYangTest { protected SchemaContext context; @@ -35,6 +39,14 @@ public abstract class AbstractYangTest { threadsJavaModule, bgpListenerJavaModule, ietfInetTypesModule, jmxModule, jmxImplModule, testFilesModule, testFiles1Module; + public static final String EVENTBUS_MXB_NAME = "eventbus"; + public static final String ASYNC_EVENTBUS_MXB_NAME = "async-eventbus"; + public static final String THREADFACTORY_NAMING_MXB_NAME = "threadfactory-naming"; + public static final String THREADPOOL_DYNAMIC_MXB_NAME = "threadpool-dynamic"; + public static final String THREADPOOL_REGISTRY_IMPL_NAME = "threadpool-registry-impl"; + + public static final String BGP_LISTENER_IMPL_MXB_NAME = "bgp-listener-impl"; + @Before public void loadYangFiles() throws Exception { List yangISs = new ArrayList<>(); @@ -97,4 +109,22 @@ public abstract class AbstractYangTest { } return result; } + + protected Map loadThreadsServiceInterfaceEntries(String packageName) { + Map identitiesToSIs = new HashMap<>(); + return ServiceInterfaceEntry.create(threadsModule, packageName,identitiesToSIs); + } + + protected Map loadThreadsJava(Map modulesToSIEs, String packageName) { + Map namesToMBEs = ModuleMXBeanEntry + .create(threadsJavaModule, modulesToSIEs, context, new TypeProviderWrapper(new TypeProviderImpl + (context)), packageName); + Assert.assertNotNull(namesToMBEs); + Set expectedMXBeanNames = Sets.newHashSet(EVENTBUS_MXB_NAME, + ASYNC_EVENTBUS_MXB_NAME, THREADFACTORY_NAMING_MXB_NAME, + THREADPOOL_DYNAMIC_MXB_NAME, THREADPOOL_REGISTRY_IMPL_NAME); + assertThat(namesToMBEs.keySet(), is(expectedMXBeanNames)); + return namesToMBEs; + } + } diff --git a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java index 8ca2bb5bc9..dd44246867 100644 --- a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java +++ b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.config.yangjmxgenerator; import com.google.common.collect.Sets; -import java.util.HashMap; import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; @@ -36,6 +35,7 @@ import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Collections; import java.util.Date; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -52,13 +52,6 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; public class ModuleMXBeanEntryTest extends AbstractYangTest { - public static final String EVENTBUS_MXB_NAME = "eventbus"; - public static final String ASYNC_EVENTBUS_MXB_NAME = "async-eventbus"; - public static final String THREADFACTORY_NAMING_MXB_NAME = "threadfactory-naming"; - public static final String THREADPOOL_DYNAMIC_MXB_NAME = "threadpool-dynamic"; - public static final String THREADPOOL_REGISTRY_IMPL_NAME = "threadpool-registry-impl"; - - public static final String BGP_LISTENER_IMPL_MXB_NAME = "bgp-listener-impl"; public static final String PACKAGE_NAME = "pack2"; @@ -82,23 +75,15 @@ public class ModuleMXBeanEntryTest extends AbstractYangTest { protected Map modulesToSIEs; - protected Map loadThreadsJava() { - Map namesToMBEs = ModuleMXBeanEntry - .create(threadsJavaModule, modulesToSIEs, context, new TypeProviderWrapper(new TypeProviderImpl - (context)), PACKAGE_NAME); - assertNotNull(namesToMBEs); - Set expectedMXBeanNames = Sets.newHashSet(EVENTBUS_MXB_NAME, - ASYNC_EVENTBUS_MXB_NAME, THREADFACTORY_NAMING_MXB_NAME, - THREADPOOL_DYNAMIC_MXB_NAME, THREADPOOL_REGISTRY_IMPL_NAME); - assertThat(namesToMBEs.keySet(), is(expectedMXBeanNames)); - return namesToMBEs; - } @Before public void setUp() { - Map identitiesToSIs = new HashMap<>(); - modulesToSIEs = ServiceInterfaceEntry.create(threadsModule, - "packages.sis",identitiesToSIs); + modulesToSIEs = loadThreadsServiceInterfaceEntries("packages.sis"); + } + + + protected Map loadThreadsJava() { + return loadThreadsJava(modulesToSIEs, PACKAGE_NAME); } @Test diff --git a/opendaylight/config/yang-test-plugin/pom.xml b/opendaylight/config/yang-test-plugin/pom.xml index 0b4fc8b1b5..173227f0bc 100644 --- a/opendaylight/config/yang-test-plugin/pom.xml +++ b/opendaylight/config/yang-test-plugin/pom.xml @@ -1,26 +1,30 @@ - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - - 4.0.0 - maven-plugin - yang-test-plugin + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + yang-test-plugin + maven-plugin + ${project.artifactId} - Remove generated source files, after new files generation, implementation is inserted. - ${project.artifactId} - - 3.0.4 - + Remove generated source files, after new files generation, implementation is inserted. + + 3.0.4 + - - - org.apache.maven - maven-plugin-api - 3.0.5 - - - \ No newline at end of file + + + commons-io + commons-io + + + org.apache.maven + maven-plugin-api + 3.0.5 + + + diff --git a/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java b/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java index dbb9ddb363..f2a56f2b1b 100644 --- a/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java +++ b/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java @@ -7,18 +7,14 @@ */ package org.opendaylight.controller.config.yang.test.plugin; +import org.apache.commons.io.FileUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; +import java.util.regex.Pattern; /** * Add implementation code from stub.txt @@ -45,55 +41,25 @@ public class ProcessSources extends AbstractMojo{ if (!sourceDirectory.exists()) { super.getLog().error("Source directory does not exists " + sourceDirectory.getPath()); } - String header = ""; - try { - header = Util.loadHeader(); - } catch (IOException e) { - super.getLog().error("Header.txt not found."); - } + File[] sourceFiles = sourceDirectory.listFiles(); for (File sourceFile: sourceFiles) { if(sourceFile.getName().endsWith("Module.java") || sourceFile.getName().endsWith("ModuleFactory.java")) { File stubFile = new File(sourceFile.getPath().replace(".java", "Stub.txt")); - String stubLines = null; - try { - if (stubFile.exists()) { - stubLines = Util.loadStubFile(stubFile.getPath()); - } - - InputStream javaIn = new FileInputStream(sourceFile.getPath()); - BufferedReader javaBuf = new BufferedReader(new InputStreamReader(javaIn)); - StringBuffer output = new StringBuffer(); - String line = javaBuf.readLine(); - boolean writeLine = false; - while ((line = javaBuf.readLine()) != null) { - if(!writeLine && line.contains("*/")) { - line = header; - writeLine = true; - } else { - if (line.contains("TODO")) { - writeLine = false; - } else { - if (stubLines != null && line.contains("throw new")) { - line = stubLines.toString(); - writeLine = true; - } - } - } - if(writeLine) { - output.append(line).append(System.lineSeparator()); - } + if (stubFile.exists()) { + try { + rewrite(sourceFile, FileUtils.readFileToString(stubFile)); + } catch (IOException e) { + getLog().error("Error while reading/writing to files.", e); } - javaBuf.close(); - - OutputStream javaOut = new FileOutputStream(sourceFile.getPath()); - javaOut.write(output.toString().getBytes()); - javaOut.close(); - } catch (IOException e) { - getLog().error("Error while reading/writing to files.", e); } - } } } + + private static void rewrite(File sourceFile, String replaceTODOWith) throws IOException { + String source = FileUtils.readFileToString(sourceFile); + String target = Pattern.compile("^.*TODO.*\n.*throw new java.lang.UnsupportedOperationException.*$", Pattern.MULTILINE).matcher(source).replaceFirst(replaceTODOWith); + FileUtils.write(sourceFile, target); + } } diff --git a/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/Util.java b/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/Util.java index 16a41d9adb..136733cbff 100644 --- a/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/Util.java +++ b/opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/Util.java @@ -8,12 +8,7 @@ package org.opendaylight.controller.config.yang.test.plugin; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.util.regex.Matcher; public class Util { @@ -22,29 +17,4 @@ public class Util { path = path.replace(".", Matcher.quoteReplacement(File.separator)); return path; } - - public static String loadHeader() throws IOException { - StringBuffer header = new StringBuffer(); - InputStream headIn = Util.class.getClassLoader().getResourceAsStream("Header.txt"); - BufferedReader headBuf = new BufferedReader(new InputStreamReader(headIn)); - String line = null; - while ((line = headBuf.readLine()) != null) { - header.append(line).append(System.lineSeparator()); - } - headBuf.close(); - return header.toString(); - } - - public static String loadStubFile(String fileName) throws IOException { - InputStream stubIn = new FileInputStream(fileName); - BufferedReader stubBuf = new BufferedReader(new InputStreamReader(stubIn)); - - StringBuffer stubLines = new StringBuffer(); - String stubLine = null; - while ((stubLine = stubBuf.readLine()) != null) { - stubLines.append(stubLine).append(System.lineSeparator()); - } - stubBuf.close(); - return stubLines.toString(); - } } diff --git a/opendaylight/config/yang-test-plugin/src/main/resources/Header.txt b/opendaylight/config/yang-test-plugin/src/main/resources/Header.txt deleted file mode 100644 index 068fd26844..0000000000 --- a/opendaylight/config/yang-test-plugin/src/main/resources/Header.txt +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2013 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 - */ \ No newline at end of file diff --git a/opendaylight/config/yang-test/.gitignore b/opendaylight/config/yang-test/.gitignore new file mode 100644 index 0000000000..14393541b4 --- /dev/null +++ b/opendaylight/config/yang-test/.gitignore @@ -0,0 +1 @@ +src/main/java/org/opendaylight/controller/config/yang/test/impl/* diff --git a/opendaylight/config/yang-test/pom.xml b/opendaylight/config/yang-test/pom.xml index 3e75d00943..8c8065dd67 100644 --- a/opendaylight/config/yang-test/pom.xml +++ b/opendaylight/config/yang-test/pom.xml @@ -1,134 +1,122 @@ - 4.0.0 - - org.opendaylight.controller - config-plugin-parent - 0.2.5-SNAPSHOT - ../config-plugin-parent - + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + - yang-test - bundle + yang-test + bundle + ${project.artifactId} - Artifact that contains only generated code from yang files. Suitable for testing. - - ${project.artifactId} - - 3.0.4 - + Artifact that contains only generated code from yang files. Suitable for testing. + + 3.0.4 + - - - ${project.groupId} - config-api - - - org.slf4j - slf4j-api - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools - mockito-configuration - - - ${project.groupId} - config-manager - test - - - ${project.groupId} - config-manager - test-jar - test - - - org.opendaylight.controller - config-util - test - - - junit - junit - test - - + + + ${project.groupId} + config-api + + + org.opendaylight.yangtools + mockito-configuration + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.slf4j + slf4j-api + + + ${project.groupId} + config-manager + test + + + ${project.groupId} + config-manager + test-jar + test + + + junit + junit + test + + + org.opendaylight.controller + config-util + test + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.opendaylight.controller + yang-test-plugin + [0.2.3,) + + delete-sources + process-sources + + + + + + + + + + + + + - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.opendaylight.controller - - - yang-test-plugin - - - [0.2.3,) - - - - delete-sources - - - process-sources - - - - - - - - - - - - - + + org.apache.felix + maven-bundle-plugin + + + + - - - org.opendaylight.yangtools - yang-maven-plugin - - - org.opendaylight.controller - yang-test-plugin - ${config.version} - - - - delete-sources - process-sources - - - - + + org.opendaylight.controller + yang-test-plugin + ${config.version} + + + + delete-sources - - org.apache.felix - maven-bundle-plugin - - - - - - - + process-sources + + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModule.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModule.java index c64f824b15..07d7438a00 100644 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModule.java +++ b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModule.java @@ -1,32 +1,23 @@ /* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** +* Copyright (c) 2013 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 */ -public final class DepTestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractDepTestImplModule - { - +package org.opendaylight.controller.config.yang.test.impl; +public class DepTestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractDepTestImplModule { public DepTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public DepTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - DepTestImplModule oldModule, java.lang.AutoCloseable oldInstance) { - + public DepTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.test.impl.DepTestImplModule oldModule, java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } @Override - protected void customValidation(){ - // Add custom validation for module attributes here. + public void customValidation() { + // add custom validation form module attributes here. } @Override @@ -38,4 +29,5 @@ public final class DepTestImplModule extends org.opendaylight.controller.config. }; } + } diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModule.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModule.java index 398bba99bd..a5b7f55df3 100644 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModule.java +++ b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModule.java @@ -1,32 +1,23 @@ /* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** +* Copyright (c) 2013 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 */ -public final class IdentityTestModule extends org.opendaylight.controller.config.yang.test.impl.AbstractIdentityTestModule - { - +package org.opendaylight.controller.config.yang.test.impl; +public class IdentityTestModule extends org.opendaylight.controller.config.yang.test.impl.AbstractIdentityTestModule { public IdentityTestModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public IdentityTestModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - IdentityTestModule oldModule, java.lang.AutoCloseable oldInstance) { - + public IdentityTestModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.test.impl.IdentityTestModule oldModule, java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } @Override - protected void customValidation(){ - // Add custom validation for module attributes here. + public void customValidation() { + // add custom validation form module attributes here. } @Override @@ -49,4 +40,5 @@ public final class IdentityTestModule extends org.opendaylight.controller.config }; } + } diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModuleFactory.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModuleFactory.java deleted file mode 100644 index 9de3e0bb74..0000000000 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** -* -*/ -public class IdentityTestModuleFactory extends org.opendaylight.controller.config.yang.test.impl.AbstractIdentityTestModuleFactory -{ - - -} diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModule.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModule.java index 3594ee0353..ecbf4aba33 100644 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModule.java +++ b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModule.java @@ -1,32 +1,23 @@ /* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** +* Copyright (c) 2013 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 */ -public final class NetconfTestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractNetconfTestImplModule - { - +package org.opendaylight.controller.config.yang.test.impl; +public class NetconfTestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractNetconfTestImplModule { public NetconfTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public NetconfTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - NetconfTestImplModule oldModule, java.lang.AutoCloseable oldInstance) { - + public NetconfTestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModule oldModule, java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } @Override - protected void customValidation(){ - // Add custom validation for module attributes here. + public void customValidation() { + // add custom validation form module attributes here. } @Override @@ -34,4 +25,5 @@ public final class NetconfTestImplModule extends org.opendaylight.controller.con return NetconfTestImplModuleUtil.registerRuntimeBeans(this); } + } diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleFactory.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleFactory.java deleted file mode 100644 index accc1db76e..0000000000 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** -* -*/ -public class NetconfTestImplModuleFactory extends org.opendaylight.controller.config.yang.test.impl.AbstractNetconfTestImplModuleFactory -{ - - -} diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModule.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModule.java index 9ba1db4eed..9132407356 100644 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModule.java +++ b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModule.java @@ -1,32 +1,23 @@ /* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** +* Copyright (c) 2013 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 */ -public final class TestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractTestImplModule - { - +package org.opendaylight.controller.config.yang.test.impl; +public class TestImplModule extends org.opendaylight.controller.config.yang.test.impl.AbstractTestImplModule { public TestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public TestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - TestImplModule oldModule, java.lang.AutoCloseable oldInstance) { - + public TestImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.test.impl.TestImplModule oldModule, java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } @Override - protected void customValidation(){ - // Add custom validation for module attributes here. + public void customValidation() { + // add custom validation form module attributes here. } @Override @@ -38,4 +29,5 @@ public final class TestImplModule extends org.opendaylight.controller.config.yan }; } + } diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModuleFactory.java b/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModuleFactory.java deleted file mode 100644 index a6ce734f96..0000000000 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** -* -*/ -public class TestImplModuleFactory extends org.opendaylight.controller.config.yang.test.impl.AbstractTestImplModuleFactory -{ - - -} diff --git a/opendaylight/configuration/api/pom.xml b/opendaylight/configuration/api/pom.xml index 8a5cd99a10..992e4b08d1 100644 --- a/opendaylight/configuration/api/pom.xml +++ b/opendaylight/configuration/api/pom.xml @@ -7,16 +7,16 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - configuration 0.4.3-SNAPSHOT bundle + + + org.opendaylight.controller + sal + + @@ -27,22 +27,18 @@ true - - org.opendaylight.controller.sal.utils - - - org.opendaylight.controller.configuration - + org.opendaylight.controller.sal.utils + org.opendaylight.controller.configuration ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/configuration/implementation/pom.xml b/opendaylight/configuration/implementation/pom.xml index 0846dc58a3..b6d2229121 100644 --- a/opendaylight/configuration/implementation/pom.xml +++ b/opendaylight/configuration/implementation/pom.xml @@ -7,16 +7,28 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - configuration.implementation 0.4.3-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + @@ -27,42 +39,25 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.core, org.osgi.framework, org.slf4j, - org.apache.felix.dm - - - - - org.opendaylight.controller.configuration.internal.Activator - + org.apache.felix.dm + + org.opendaylight.controller.configuration.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/configuration/integrationtest/pom.xml b/opendaylight/configuration/integrationtest/pom.xml index 6f116e3576..31b9c07674 100644 --- a/opendaylight/configuration/integrationtest/pom.xml +++ b/opendaylight/configuration/integrationtest/pom.xml @@ -1,37 +1,27 @@ 4.0.0 - + org.opendaylight.controller commons.integrationtest 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - configuration.integrationtest 0.4.2-SNAPSHOT - + - org.opendaylight.controller - protocol_plugins.stub + ch.qos.logback + logback-classic - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.implementation + ch.qos.logback + logback-core - org.opendaylight.controller - forwardingrulesmanager + eclipselink + javax.resource org.opendaylight.controller @@ -45,6 +35,14 @@ org.opendaylight.controller clustering.stub + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + configuration.implementation + org.opendaylight.controller containermanager @@ -55,28 +53,40 @@ org.opendaylight.controller - switchmanager + forwardingrulesmanager org.opendaylight.controller - switchmanager.implementation + hosttracker org.opendaylight.controller - configuration + protocol_plugins.stub org.opendaylight.controller - configuration.implementation + sal - + org.opendaylight.controller - hosttracker + sal.implementation + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + switchmanager.implementation org.opendaylight.controller topologymanager + + org.slf4j + log4j-over-slf4j + junit junit @@ -103,21 +113,11 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - eclipselink - javax.resource - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/connectionmanager/api/pom.xml b/opendaylight/connectionmanager/api/pom.xml index 3a66ce3420..b3a427a8f7 100644 --- a/opendaylight/connectionmanager/api/pom.xml +++ b/opendaylight/connectionmanager/api/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - connectionmanager 0.1.2-SNAPSHOT bundle + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + @@ -27,28 +31,20 @@ true - - org.opendaylight.controller.sal.core, + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, - org.opendaylight.controller.sal.connection - - - org.opendaylight.controller.connectionmanager - + org.opendaylight.controller.sal.connection + org.opendaylight.controller.connectionmanager ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/connectionmanager/implementation/pom.xml b/opendaylight/connectionmanager/implementation/pom.xml index 3bd7ea1386..5adcc89ee8 100644 --- a/opendaylight/connectionmanager/implementation/pom.xml +++ b/opendaylight/connectionmanager/implementation/pom.xml @@ -7,16 +7,32 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - connectionmanager.implementation 0.1.2-SNAPSHOT bundle + + + equinoxSDK381 + org.eclipse.osgi + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + @@ -27,8 +43,7 @@ true - - org.opendaylight.controller.connectionmanager, + org.opendaylight.controller.connectionmanager, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.core, @@ -37,39 +52,19 @@ org.eclipse.osgi.framework.console, org.osgi.framework, org.slf4j, - org.apache.felix.dm - - - - - org.opendaylight.controller.connectionmanager.internal.Activator - + org.apache.felix.dm + + org.opendaylight.controller.connectionmanager.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - equinoxSDK381 - org.eclipse.osgi - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/containermanager/api/pom.xml b/opendaylight/containermanager/api/pom.xml index 566691f7cb..5bfededfe5 100644 --- a/opendaylight/containermanager/api/pom.xml +++ b/opendaylight/containermanager/api/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - containermanager 0.5.2-SNAPSHOT bundle + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + @@ -27,8 +31,7 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.core, @@ -38,25 +41,18 @@ org.opendaylight.controller.sal.reader, org.slf4j, javax.xml.bind.annotation, - javax.xml.bind - - - org.opendaylight.controller.containermanager - + javax.xml.bind + org.opendaylight.controller.containermanager ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - configuration - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/containermanager/implementation/pom.xml b/opendaylight/containermanager/implementation/pom.xml index 4cc44cb580..b7b9e0abda 100644 --- a/opendaylight/containermanager/implementation/pom.xml +++ b/opendaylight/containermanager/implementation/pom.xml @@ -7,16 +7,36 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - containermanager.implementation 0.5.2-SNAPSHOT bundle + + + org.opendaylight.controller + appauth + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + topologymanager + + @@ -27,8 +47,7 @@ true - - org.opendaylight.controller.containermanager, + org.opendaylight.controller.containermanager, org.opendaylight.controller.appauth.authorization, org.opendaylight.controller.configuration, org.opendaylight.controller.clustering.services, @@ -44,43 +63,19 @@ org.eclipse.osgi.framework.console, org.osgi.framework, org.slf4j, - org.apache.felix.dm - - - - - org.opendaylight.controller.containermanager.internal.Activator - + org.apache.felix.dm + + org.opendaylight.controller.containermanager.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - appauth - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/containermanager/it.implementation/pom.xml b/opendaylight/containermanager/it.implementation/pom.xml index 5fff7024fb..2727f77d90 100644 --- a/opendaylight/containermanager/it.implementation/pom.xml +++ b/opendaylight/containermanager/it.implementation/pom.xml @@ -7,16 +7,28 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - containermanager.it.implementation 0.5.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + @@ -27,8 +39,7 @@ true - - org.opendaylight.controller.containermanager, + org.opendaylight.controller.containermanager, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.packet, org.opendaylight.controller.sal.utils, @@ -40,35 +51,19 @@ org.eclipse.osgi.framework.console, org.osgi.framework, org.slf4j, - org.apache.felix.dm - - - - - org.opendaylight.controller.containermanager.internal.Activator - + org.apache.felix.dm + + org.opendaylight.controller.containermanager.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml index 776fb7a0f6..f9985cbcc1 100644 --- a/opendaylight/distribution/opendaylight/pom.xml +++ b/opendaylight/distribution/opendaylight/pom.xml @@ -1,1274 +1,1277 @@ - - 4.0.0 - - 3.0 - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../commons/opendaylight - - distribution.opendaylight - 0.1.2-SNAPSHOT - pom + + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + + distribution.opendaylight + 0.1.2-SNAPSHOT + pom + + 3.0 + + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + - - - notduringrelease - - - !DOINGRELEASE - - - - - - org.opendaylight.controller - sal-common - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-netconf-connector - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.controller - sal-broker-impl - - - org.opendaylight.controller - sal-remote - - - org.opendaylight.controller - sal-restconf-broker - - - org.opendaylight.controller - sal-core-spi - - - org.opendaylight.controller - sal-common-api - - - org.opendaylight.controller - sal-common-impl - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-binding-config - - - org.opendaylight.controller - sal-binding-broker-impl - - - org.opendaylight.controller - sal-compatibility - - - org.opendaylight.controller - sal-connector-api - - - org.opendaylight.controller - sal-rest-connector - - - org.opendaylight.controller.model - model-inventory - - - org.opendaylight.controller.model - model-flow-base - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.model - model-flow-statistics - - - org.opendaylight.controller.model - model-flow-management - - - org.opendaylight.controller.md - inventory-manager - - - org.opendaylight.controller.md - forwardingrules-manager - - - org.opendaylight.controller.md - topology-lldp-discovery - - - org.opendaylight.controller.md - topology-manager - - - org.opendaylight.controller.model - model-topology - 1.1-SNAPSHOT - - - org.opendaylight.yangtools.model - ietf-topology - - - org.opendaylight.controller - sal-binding-util - - - org.opendaylight.controller.md - statistics-manager - - - org.opendaylight.controller - concepts - - - org.opendaylight.controller - protocol-framework - - - org.opendaylight.yangtools - concepts - - - org.opendaylight.yangtools - restconf-client-api - - - org.opendaylight.yangtools - restconf-client-impl - + + com.fasterxml.jackson.core + jackson-annotations + - - - org.opendaylight.controller - remoterpc-routingtable.implementation - ${mdsal.version} - - - org.opendaylight.controller - sal-remoterpc-connector - + + com.fasterxml.jackson.core + jackson-core + - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - config-manager - - - org.opendaylight.controller - yang-jmx-generator - - - org.opendaylight.controller - logback-config - - - org.opendaylight.controller - config-persister-api - - - org.opendaylight.controller - config-persister-file-xml-adapter - - - org.opendaylight.controller - config-persister-directory-xml-adapter - + + com.fasterxml.jackson.core + jackson-databind + - - org.opendaylight.controller - shutdown-api - - - org.opendaylight.controller - shutdown-impl - + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-base + - - - org.opendaylight.controller - netconf-api - - - org.opendaylight.controller - netconf-impl - - - org.opendaylight.controller - netconf-util - - - org.opendaylight.controller - netconf-client - - - org.opendaylight.controller - netconf-mapping-api - - - org.opendaylight.controller - netconf-ssh - - - org.opendaylight.controller - config-netconf-connector - - - org.opendaylight.controller - netconf-monitoring - - - ${project.groupId} - ietf-netconf-monitoring - - - ${project.groupId} - ietf-netconf-monitoring-extension - - - org.opendaylight.controller - config-persister-impl - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.xerces - 2.11.0_1 - - - org.eclipse.birt.runtime.3_7_1 - org.apache.xml.resolver - 1.2.0 - - - org.bouncycastle - bcprov-jdk15on - - - org.bouncycastle - bcpkix-jdk15on - + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + - - - org.opendaylight.controller - threadpool-config-api - - - org.opendaylight.controller - netty-config-api - - - org.opendaylight.controller - threadpool-config-impl - - - org.opendaylight.controller - netty-threadgroup-config - - - org.opendaylight.controller - netty-event-executor-config - - - org.opendaylight.controller - netty-timer-config - + + com.fasterxml.jackson.module + jackson-module-jaxb-annotations + + + com.google.code.gson + gson + + + com.google.guava + guava + + + com.sun.jersey + jersey-client + + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-server + + + commons-codec + commons-codec + + + commons-fileupload + commons-fileupload + + + commons-io + commons-io + + + commons-net + commons-net + + + eclipselink + javax.persistence + + + eclipselink + javax.resource + + + equinoxSDK381 + javax.servlet + + + equinoxSDK381 + javax.servlet.jsp + + + equinoxSDK381 + org.apache.felix.gogo.command + + + equinoxSDK381 + org.apache.felix.gogo.runtime + + + equinoxSDK381 + org.apache.felix.gogo.shell + + + equinoxSDK381 + org.eclipse.equinox.cm + + + equinoxSDK381 + org.eclipse.equinox.console + + + equinoxSDK381 + org.eclipse.equinox.ds + + + equinoxSDK381 + org.eclipse.equinox.launcher + + + equinoxSDK381 + org.eclipse.equinox.util + + + equinoxSDK381 + org.eclipse.osgi + + + equinoxSDK381 + org.eclipse.osgi.services + + + + geminiweb + org.eclipse.gemini.web.core + + + geminiweb + org.eclipse.gemini.web.extender + + + geminiweb + org.eclipse.gemini.web.tomcat + + + geminiweb + org.eclipse.virgo.kernel.equinox.extensions + + + geminiweb + org.eclipse.virgo.util.common + + + geminiweb + org.eclipse.virgo.util.io + + + geminiweb + org.eclipse.virgo.util.math + + + geminiweb + org.eclipse.virgo.util.osgi + + + geminiweb + org.eclipse.virgo.util.osgi.manifest + + + geminiweb + org.eclipse.virgo.util.parser.manifest + + + io.netty + netty-buffer + + + io.netty + netty-codec + + + io.netty + netty-codec-http + + + io.netty + netty-common + - - - org.opendaylight.controller.samples - sample-toaster - ${mdsal.version} - - - org.opendaylight.controller.samples - sample-toaster-consumer - ${mdsal.version} - - - org.opendaylight.controller.samples - sample-toaster-provider - ${mdsal.version} - - - - org.opendaylight.yangtools - yang-binding - - - org.opendaylight.yangtools - binding-type-provider - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-spi - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-api - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-impl - ${yangtools.version} - - - org.opendaylight.yangtools - binding-generator-util - ${yangtools.version} - - - org.opendaylight.yangtools - binding-model-api - ${yangtools.version} - - - commons-lang - commons-lang - 2.4 - + + + io.netty + netty-handler + + + io.netty + netty-transport + + + orbit + javax.activation + + + orbit + javax.annotation + + + orbit + javax.ejb + + + orbit + javax.el + + + orbit + javax.mail.glassfish + + + orbit + javax.servlet.jsp.jstl + + + orbit + javax.servlet.jsp.jstl.impl + + + orbit + javax.xml.rpc + + + orbit + org.apache.catalina + + + orbit + org.apache.catalina.ha + + + orbit + org.apache.catalina.tribes + + + orbit + org.apache.coyote + + + orbit + org.apache.el + + + orbit + org.apache.jasper + + + orbit + org.apache.juli.extras + + + orbit + org.apache.tomcat.api + + + orbit + org.apache.tomcat.util + + + org.aopalliance + com.springsource.org.aopalliance + + + org.apache.commons + commons-lang3 + + + org.apache.felix + org.apache.felix.dependencymanager + + + org.apache.felix + org.apache.felix.dependencymanager.shell + + + org.apache.felix + org.apache.felix.fileinstall + + + + org.apache.felix + org.apache.felix.webconsole + all + - - org.opendaylight.yangtools.thirdparty - antlr4-runtime-osgi-nohead - 4.0 - - - org.opendaylight.yangtools.thirdparty - xtend-lib-osgi - 2.4.3 - - - org.opendaylight.yangtools - yang-parser-api - ${yangtools.version} - - - org.opendaylight.yangtools - yang-model-util - - - org.opendaylight.yangtools - yang-parser-impl - ${yangtools.version} - - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools - yang-data-api - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.yangtools - yang-data-util - - - org.opendaylight.yangtools - yang-model-api - - - org.opendaylight.yangtools.model - yang-ext - - - org.opendaylight.controller.thirdparty - ganymed - - - org.zeromq - jeromq - 0.3.1 - - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools.model - ietf-yang-types - - - org.opendaylight.yangtools.model - opendaylight-l2-types - - - - - integrationtests - - false - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.8 - - - org.opendaylight.controller - sanitytest - ${controller.version} - - - - - copy - package - - copy - - - - - - - org.opendaylight.controller - sanitytest - jar - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - sanity-test - package - - exec - - - - - ${java.home}/bin/java - - -cp - ./target/dependency/* - org.opendaylight.controller.distribution.Sanity - - - - ${java.home} - - - - - - - - - org.opendaylight.controller - sanitytest - - - - + + org.codehaus.jettison + jettison + + + org.eclipse.equinox.http + servlet + + + org.eclipse.persistence + org.eclipse.persistence.antlr + + + org.eclipse.persistence + org.eclipse.persistence.core + + + org.eclipse.persistence + org.eclipse.persistence.moxy + + + org.javassist + javassist + + + org.jboss.spec.javax.transaction + jboss-transaction-api_1.1_spec + + + org.jolokia + jolokia-osgi + + + org.opendaylight.controller + appauth + + + org.opendaylight.controller + arphandler + + + org.opendaylight.controller + bundlescanner + + + org.opendaylight.controller + bundlescanner.implementation + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + clustering.services-implementation + - - - org.opendaylight.controller - forwarding.staticrouting - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - clustering.services-implementation - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - configuration.implementation - - - org.opendaylight.controller - routing.dijkstra_implementation - - - org.opendaylight.controller - arphandler - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - hosttracker.implementation - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - containermanager.implementation - - - org.opendaylight.controller - appauth - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - switchmanager.implementation - - - org.opendaylight.controller - statisticsmanager - - - org.opendaylight.controller - statisticsmanager.implementation - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - usermanager.implementation - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - connectionmanager.implementation - - - org.opendaylight.controller - security - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - forwardingrulesmanager.implementation - + + + org.opendaylight.controller + clustering.test + + + org.opendaylight.controller + commons.httpclient + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.implementation - + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + configuration.implementation + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + connectionmanager.implementation + + + org.opendaylight.controller + connectionmanager.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + containermanager.implementation + + + org.opendaylight.controller + containermanager.northbound + + + org.opendaylight.controller + controllermanager.northbound + + + org.opendaylight.controller + devices.web + + + org.opendaylight.controller + flowprogrammer.northbound + + + org.opendaylight.controller + flows.web + + + org.opendaylight.controller + forwarding.staticrouting + + + org.opendaylight.controller + forwarding.staticrouting.northbound + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + forwardingrulesmanager.implementation + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + hosttracker.implementation + + + org.opendaylight.controller + hosttracker.northbound + + + org.opendaylight.controller + httpservice-bridge + + + org.opendaylight.controller + jolokia-bridge + + - + + org.opendaylight.controller + logging.bridge + + + org.opendaylight.controller + networkconfig.bridgedomain.northbound + - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - sal.connection.implementation - - - org.opendaylight.controller - sal.networkconfiguration - - - org.opendaylight.controller - sal.networkconfiguration.implementation - + + + org.opendaylight.controller + networkconfig.neutron + + + org.opendaylight.controller + networkconfig.neutron.implementation + + + org.opendaylight.controller + networkconfig.neutron.northbound + + + org.opendaylight.controller + osgi-brandfragment.web + - + + + org.opendaylight.controller + protocol_plugins.openflow + + + org.opendaylight.controller + routing.dijkstra_implementation + - - org.opendaylight.controller - web - - - org.opendaylight.controller - flows.web - - - org.opendaylight.controller - devices.web - - - org.opendaylight.controller - troubleshoot.web - - - org.opendaylight.controller - topology.web - - - org.opendaylight.controller - osgi-brandfragment.web - + + + org.opendaylight.controller + sal + - - - org.opendaylight.controller - networkconfig.neutron - - - org.opendaylight.controller - networkconfig.neutron.implementation - - - org.opendaylight.controller - networkconfig.neutron.northbound - + - - - org.opendaylight.controller - commons.northbound - - - org.opendaylight.controller - bundlescanner - - - org.opendaylight.controller - bundlescanner.implementation - - - org.opendaylight.controller - topology.northbound - - - org.opendaylight.controller - forwarding.staticrouting.northbound - - - org.opendaylight.controller - statistics.northbound - - - org.opendaylight.controller - flowprogrammer.northbound - - - org.opendaylight.controller - hosttracker.northbound - - - org.opendaylight.controller - subnets.northbound - - - org.opendaylight.controller - switchmanager.northbound - - - org.opendaylight.controller - containermanager.northbound - - - org.opendaylight.controller - networkconfig.bridgedomain.northbound - - - org.opendaylight.controller - httpservice-bridge - - - org.jolokia - jolokia-osgi - - - org.opendaylight.controller - jolokia-bridge - - - org.opendaylight.controller - connectionmanager.northbound - - - org.opendaylight.controller - usermanager.northbound - - - org.opendaylight.controller - controllermanager.northbound - - + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller + sal.connection.implementation + + + org.opendaylight.controller + sal.implementation + + + org.opendaylight.controller + sal.networkconfiguration + + + org.opendaylight.controller + sal.networkconfiguration.implementation + - - org.opendaylight.controller - logging.bridge - + + + org.opendaylight.controller + samples.loadbalancer + + + org.opendaylight.controller + samples.loadbalancer.northbound + + + org.opendaylight.controller + samples.simpleforwarding + + + org.opendaylight.controller + security + + + org.opendaylight.controller + statistics.northbound + + + org.opendaylight.controller + statisticsmanager + + + org.opendaylight.controller + statisticsmanager.implementation + + + org.opendaylight.controller + subnets.northbound + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + switchmanager.implementation + + + org.opendaylight.controller + switchmanager.northbound + + + org.opendaylight.controller + topology.northbound + + + org.opendaylight.controller + topology.web + + + org.opendaylight.controller + topologymanager + + + org.opendaylight.controller + troubleshoot.web + + + org.opendaylight.controller + usermanager + + + org.opendaylight.controller + usermanager.implementation + + + org.opendaylight.controller + usermanager.northbound + - - - org.opendaylight.controller - protocol_plugins.openflow - + - - - org.opendaylight.controller - samples.loadbalancer - - - org.opendaylight.controller - samples.loadbalancer.northbound - - - org.opendaylight.controller - samples.simpleforwarding - + + org.opendaylight.controller + web + + + org.opendaylight.controller.thirdparty + com.sun.jersey.jersey-servlet + - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - slf4j-api - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - + + + org.opendaylight.controller.thirdparty + net.sf.jung2 + + + org.opendaylight.controller.thirdparty + org.apache.catalina.filters.CorsFilter + + + org.opendaylight.controller.thirdparty + org.openflow.openflowj + - - com.fasterxml.jackson.core - jackson-databind - + + org.ow2.asm + asm-all + + + + org.ow2.chameleon.management + chameleon-mbeans + - - com.fasterxml.jackson.core - jackson-annotations - + + + org.slf4j + jcl-over-slf4j + + + org.slf4j + log4j-over-slf4j + + + org.slf4j + slf4j-api + + + org.springframework + org.springframework.aop + + + + org.springframework + org.springframework.asm + + + org.springframework + org.springframework.beans + + + org.springframework + org.springframework.context + + + org.springframework + org.springframework.context.support + + + org.springframework + org.springframework.core + + + org.springframework + org.springframework.expression + + + org.springframework + org.springframework.transaction + + + org.springframework + org.springframework.web + + + org.springframework + org.springframework.web.servlet + + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-core + + + org.springframework.security + spring-security-taglibs + + + org.springframework.security + spring-security-web + + + virgomirror + org.eclipse.jdt.core.compiler.batch + + + + + + + maven-assembly-plugin + 2.3 + + + distro-assembly + + single + + package + + + src/assemble/bin.xml + + ${project.artifactId} + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.version} + + **\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/ + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.2 + + false + false + VersionUnknown + + + + + create + + validate + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + notduringrelease + + + !DOINGRELEASE + + + - com.fasterxml.jackson.core - jackson-core + ${project.groupId} + ietf-netconf-monitoring - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider + ${project.groupId} + ietf-netconf-monitoring-extension - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base + commons-lang + commons-lang + 2.4 - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations + org.apache.servicemix.bundles + org.apache.servicemix.bundles.xerces + 2.11.0_1 - - org.codehaus.jettison - jettison + org.bouncycastle + bcpkix-jdk15on - com.google.guava - guava + org.bouncycastle + bcprov-jdk15on - org.javassist - javassist + org.eclipse.birt.runtime.3_7_1 + org.apache.xml.resolver + 1.2.0 - commons-io - commons-io + org.opendaylight.controller + concepts + + - commons-codec - commons-codec + org.opendaylight.controller + config-api - commons-fileupload - commons-fileupload + org.opendaylight.controller + config-manager - commons-net - commons-net + org.opendaylight.controller + config-netconf-connector - equinoxSDK381 - javax.servlet + org.opendaylight.controller + config-persister-api - equinoxSDK381 - javax.servlet.jsp + org.opendaylight.controller + config-persister-directory-xml-adapter - equinoxSDK381 - org.eclipse.equinox.ds + org.opendaylight.controller + config-persister-file-xml-adapter - equinoxSDK381 - org.eclipse.equinox.util + org.opendaylight.controller + config-persister-impl - equinoxSDK381 - org.eclipse.osgi.services + org.opendaylight.controller + logback-config + + - equinoxSDK381 - org.eclipse.osgi + org.opendaylight.controller + netconf-api - equinoxSDK381 - org.apache.felix.gogo.command + org.opendaylight.controller + netconf-client - equinoxSDK381 - org.apache.felix.gogo.runtime + org.opendaylight.controller + netconf-impl - equinoxSDK381 - org.apache.felix.gogo.shell + org.opendaylight.controller + netconf-mapping-api - equinoxSDK381 - org.eclipse.equinox.cm + org.opendaylight.controller + netconf-monitoring - equinoxSDK381 - org.eclipse.equinox.console + org.opendaylight.controller + netconf-ssh - equinoxSDK381 - org.eclipse.equinox.launcher + org.opendaylight.controller + netconf-util - - geminiweb - org.eclipse.gemini.web.core + org.opendaylight.controller + netty-config-api - geminiweb - org.eclipse.gemini.web.extender + org.opendaylight.controller + netty-event-executor-config - geminiweb - org.eclipse.gemini.web.tomcat + org.opendaylight.controller + netty-threadgroup-config - geminiweb - org.eclipse.virgo.kernel.equinox.extensions + org.opendaylight.controller + netty-timer-config - geminiweb - org.eclipse.virgo.util.common + org.opendaylight.controller + protocol-framework + + - geminiweb - org.eclipse.virgo.util.io + org.opendaylight.controller + remoterpc-routingtable.implementation + ${mdsal.version} - geminiweb - org.eclipse.virgo.util.math + org.opendaylight.controller + sal-binding-api - geminiweb - org.eclipse.virgo.util.osgi + org.opendaylight.controller + sal-binding-broker-impl - geminiweb - org.eclipse.virgo.util.osgi.manifest + org.opendaylight.controller + sal-binding-config - geminiweb - org.eclipse.virgo.util.parser.manifest + org.opendaylight.controller + sal-binding-util - org.apache.felix - org.apache.felix.dependencymanager + org.opendaylight.controller + sal-broker-impl + - org.apache.felix - org.apache.felix.dependencymanager.shell + org.opendaylight.controller + sal-common - com.google.code.gson - gson + org.opendaylight.controller + sal-common-api - org.jboss.spec.javax.transaction - jboss-transaction-api_1.1_spec + org.opendaylight.controller + sal-common-impl - org.apache.felix - org.apache.felix.fileinstall + org.opendaylight.controller + sal-common-util - org.apache.commons - commons-lang3 + org.opendaylight.controller + sal-compatibility - virgomirror - org.eclipse.jdt.core.compiler.batch + org.opendaylight.controller + sal-connector-api - eclipselink - javax.persistence + org.opendaylight.controller + sal-core-api - orbit - javax.activation + org.opendaylight.controller + sal-core-spi - orbit - javax.annotation + org.opendaylight.controller + sal-netconf-connector - orbit - javax.ejb + org.opendaylight.controller + sal-remote - orbit - javax.el + org.opendaylight.controller + sal-remoterpc-connector - orbit - javax.mail.glassfish + org.opendaylight.controller + sal-rest-connector - orbit - javax.xml.rpc + org.opendaylight.controller + sal-restconf-broker + - orbit - org.apache.catalina + org.opendaylight.controller + shutdown-api - orbit - org.apache.catalina.ha + org.opendaylight.controller + shutdown-impl + + - orbit - org.apache.catalina.tribes + org.opendaylight.controller + threadpool-config-api - orbit - org.apache.coyote + org.opendaylight.controller + threadpool-config-impl - orbit - org.apache.el + org.opendaylight.controller + yang-jmx-generator - orbit - org.apache.jasper + org.opendaylight.controller.md + forwardingrules-manager - orbit - org.apache.juli.extras + org.opendaylight.controller.md + inventory-manager - orbit - org.apache.tomcat.api + org.opendaylight.controller.md + statistics-manager - orbit - org.apache.tomcat.util + org.opendaylight.controller.md + topology-lldp-discovery - orbit - javax.servlet.jsp.jstl + org.opendaylight.controller.md + topology-manager - orbit - javax.servlet.jsp.jstl.impl + org.opendaylight.controller.model + model-flow-base - eclipselink - javax.resource + org.opendaylight.controller.model + model-flow-management - - org.springframework - org.springframework.asm + org.opendaylight.controller.model + model-flow-service - org.springframework - org.springframework.aop + org.opendaylight.controller.model + model-flow-statistics - org.springframework - org.springframework.context + org.opendaylight.controller.model + model-inventory - org.springframework - org.springframework.context.support + org.opendaylight.controller.model + model-topology + 1.1-SNAPSHOT + + - org.springframework - org.springframework.core + org.opendaylight.controller.samples + sample-toaster + ${mdsal.version} - org.springframework - org.springframework.beans + org.opendaylight.controller.samples + sample-toaster-consumer + ${mdsal.version} - org.springframework - org.springframework.expression + org.opendaylight.controller.samples + sample-toaster-provider + ${mdsal.version} - org.springframework - org.springframework.web + org.opendaylight.controller.thirdparty + ganymed - org.aopalliance - com.springsource.org.aopalliance + org.opendaylight.controller.thirdparty + nagasena - org.springframework - org.springframework.web.servlet + org.opendaylight.controller.thirdparty + nagasena-rta - - org.springframework.security - spring-security-config + org.opendaylight.yangtools + binding-generator-api + ${yangtools.version} - org.springframework.security - spring-security-core + org.opendaylight.yangtools + binding-generator-impl + ${yangtools.version} - org.springframework.security - spring-security-web + org.opendaylight.yangtools + binding-generator-spi + ${yangtools.version} - org.springframework.security - spring-security-taglibs + org.opendaylight.yangtools + binding-generator-util + ${yangtools.version} - org.springframework - org.springframework.transaction + org.opendaylight.yangtools + binding-model-api + ${yangtools.version} - - org.ow2.chameleon.management - chameleon-mbeans + org.opendaylight.yangtools + binding-type-provider + ${yangtools.version} - - com.sun.jersey - jersey-core + org.opendaylight.yangtools + concepts - com.sun.jersey - jersey-server + org.opendaylight.yangtools + restconf-client-api - com.sun.jersey - jersey-client + org.opendaylight.yangtools + restconf-client-impl - + - org.ow2.asm - asm-all + org.opendaylight.yangtools + yang-binding - org.eclipse.persistence - org.eclipse.persistence.moxy + org.opendaylight.yangtools + yang-common - org.eclipse.persistence - org.eclipse.persistence.core + org.opendaylight.yangtools + yang-data-api - org.eclipse.persistence - org.eclipse.persistence.antlr + org.opendaylight.yangtools + yang-data-impl - - org.eclipse.equinox.http - servlet + org.opendaylight.yangtools + yang-data-util - - org.apache.felix - org.apache.felix.webconsole - all + org.opendaylight.yangtools + yang-model-api - - - org.opendaylight.controller.thirdparty - net.sf.jung2 + org.opendaylight.yangtools + yang-model-util - org.opendaylight.controller.thirdparty - org.openflow.openflowj + org.opendaylight.yangtools + yang-parser-api + ${yangtools.version} - org.opendaylight.controller.thirdparty - com.sun.jersey.jersey-servlet + org.opendaylight.yangtools + yang-parser-impl + ${yangtools.version} + - org.opendaylight.controller.thirdparty - org.apache.catalina.filters.CorsFilter + org.opendaylight.yangtools.model + ietf-inet-types - - - io.netty - netty-handler + org.opendaylight.yangtools.model + ietf-topology - io.netty - netty-codec + org.opendaylight.yangtools.model + ietf-yang-types - io.netty - netty-buffer + org.opendaylight.yangtools.model + opendaylight-l2-types - io.netty - netty-transport + org.opendaylight.yangtools.model + yang-ext + - io.netty - netty-common + org.opendaylight.yangtools.thirdparty + antlr4-runtime-osgi-nohead + 4.0 - io.netty - netty-codec-http + org.opendaylight.yangtools.thirdparty + xtend-lib-osgi + 2.4.3 - - - org.opendaylight.controller - clustering.test + org.zeromq + jeromq + 0.3.1 + + + + integrationtests + + false + + - org.opendaylight.controller - commons.httpclient + org.opendaylight.controller + sanitytest - - - + + - - org.codehaus.mojo - buildnumber-maven-plugin - 1.2 - - - validate - - create - - - - - false - false - VersionUnknown - - - - maven-assembly-plugin - 2.3 - - - distro-assembly - package - - single - - - - src/assemble/bin.xml - - ${project.artifactId} - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.version} - - **\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/ - - + + org.apache.maven.plugins + maven-dependency-plugin + 2.8 + + + + org.opendaylight.controller + sanitytest + jar + + + + + + org.opendaylight.controller + sanitytest + ${sanitytest.version} + + + + + copy + + copy + + package + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + ${java.home}/bin/java + + -cp + ./target/dependency/* + org.opendaylight.controller.distribution.Sanity + + + ${java.home} + + + + + sanity-test + + exec + + package + + + - + + + diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini index e678ef726d..9d0d6c1888 100644 --- a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini +++ b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini @@ -8,7 +8,7 @@ osgi.bundles=\ reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\ reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\ reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\ - reference\:file\:../lib/logging.bridge-${controller.version}@1:start,\ + reference\:file\:../lib/logging.bridge-${logging.bridge.version}@1:start,\ reference\:file\:../lib/jersey-core-1.17.jar@2:start,\ reference\:file\:../lib/jersey-server-1.17.jar@2:start diff --git a/opendaylight/distribution/sanitytest/pom.xml b/opendaylight/distribution/sanitytest/pom.xml index a8d083ea6b..893776c567 100644 --- a/opendaylight/distribution/sanitytest/pom.xml +++ b/opendaylight/distribution/sanitytest/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sanitytest 0.4.2-SNAPSHOT @@ -33,26 +27,26 @@ true - - org.opendaylight.controller.sanitytest - - - javax.xml.bind.annotation, + org.opendaylight.controller.sanitytest + javax.xml.bind.annotation, org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, org.osgi.framework, org.eclipse.osgi.baseadaptor, org.eclipse.osgi.framework.adaptor, - org.osgi.framework.wiring - - - org.opendaylight.controller.sanitytest.internal.Activator - + org.osgi.framework.wiring + org.opendaylight.controller.sanitytest.internal.Activator ${project.basedir}/META-INF + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/forwarding/staticrouting/pom.xml b/opendaylight/forwarding/staticrouting/pom.xml index 2d6fc2ad6c..6a73a21e73 100644 --- a/opendaylight/forwarding/staticrouting/pom.xml +++ b/opendaylight/forwarding/staticrouting/pom.xml @@ -1,34 +1,49 @@ - 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../commons/opendaylight - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + - forwarding.staticrouting - 0.5.2-SNAPSHOT - bundle + forwarding.staticrouting + 0.5.2-SNAPSHOT + bundle + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.opendaylight.controller.sal.packet.address, + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.opendaylight.controller.sal.packet.address, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.core, org.opendaylight.controller.configuration, @@ -40,40 +55,19 @@ org.eclipse.osgi.framework.console, org.osgi.framework, org.slf4j, - org.apache.felix.dm - - - org.opendaylight.controller.forwarding.staticrouting - - - org.opendaylight.controller.forwarding.staticrouting.internal.Activator - - - ${project.basedir}/META-INF - - - - - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - configuration - - - junit - junit - - - org.opendaylight.controller - sal - - + org.apache.felix.dm + org.opendaylight.controller.forwarding.staticrouting + org.opendaylight.controller.forwarding.staticrouting.internal.Activator + + ${project.basedir}/META-INF + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/forwardingrulesmanager/api/pom.xml b/opendaylight/forwardingrulesmanager/api/pom.xml index 304a3151de..82f5f9b9e9 100644 --- a/opendaylight/forwardingrulesmanager/api/pom.xml +++ b/opendaylight/forwardingrulesmanager/api/pom.xml @@ -7,16 +7,28 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - forwardingrulesmanager 0.6.0-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + @@ -27,13 +39,9 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager - - - org.opendaylight.controller.configuration, + + org.opendaylight.controller.forwardingrulesmanager + org.opendaylight.controller.configuration, org.opendaylight.controller.switchmanager, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.core, @@ -48,35 +56,19 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.hosttracker - - - + org.osgi.framework + org.opendaylight.controller.hosttracker + ${project.basedir}/META-INF - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/forwardingrulesmanager/implementation/pom.xml b/opendaylight/forwardingrulesmanager/implementation/pom.xml index f7bbdc14aa..a5a15f685c 100644 --- a/opendaylight/forwardingrulesmanager/implementation/pom.xml +++ b/opendaylight/forwardingrulesmanager/implementation/pom.xml @@ -7,16 +7,48 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - forwardingrulesmanager.implementation 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.apache.felix.gogo.runtime + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller + switchmanager + + @@ -27,13 +59,9 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager.implementation.data - - - org.opendaylight.controller.clustering.services, + + org.opendaylight.controller.forwardingrulesmanager.implementation.data + org.opendaylight.controller.clustering.services, org.opendaylight.controller.configuration, org.opendaylight.controller.containermanager, org.opendaylight.controller.switchmanager, @@ -52,58 +80,20 @@ org.apache.felix.service.command, org.osgi.service.component, org.slf4j, - org.osgi.framework - - - org.opendaylight.controller.forwardingrulesmanager.internal.Activator - - - org.opendaylight.controller.hosttracker - - - + org.osgi.framework + org.opendaylight.controller.forwardingrulesmanager.internal.Activator + org.opendaylight.controller.hosttracker + ${project.basedir}/META-INF - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - forwardingrulesmanager - - - equinoxSDK381 - org.apache.felix.gogo.runtime - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - containermanager - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml index 3cc857098c..ff0bfcc1ef 100644 --- a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml +++ b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml @@ -7,100 +7,111 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - forwardingrulesmanager.integrationtest 0.4.2-SNAPSHOT + + ../implementation/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + junit + junit + org.opendaylight.controller - hosttracker + clustering.services org.opendaylight.controller - hosttracker.implementation + clustering.stub org.opendaylight.controller - connectionmanager + configuration org.opendaylight.controller - connectionmanager.implementation + configuration.implementation org.opendaylight.controller - configuration + connectionmanager org.opendaylight.controller - sal.connection + connectionmanager.implementation org.opendaylight.controller - sal.connection.implementation + containermanager org.opendaylight.controller - configuration.implementation + containermanager.it.implementation org.opendaylight.controller - clustering.services + forwardingrulesmanager org.opendaylight.controller - clustering.stub + forwardingrulesmanager.implementation org.opendaylight.controller - switchmanager + hosttracker org.opendaylight.controller - switchmanager.implementation + hosttracker.implementation org.opendaylight.controller - sal + protocol_plugins.stub org.opendaylight.controller - sal.implementation + sal org.opendaylight.controller - forwardingrulesmanager + sal.connection org.opendaylight.controller - forwardingrulesmanager.implementation + sal.connection.implementation org.opendaylight.controller - containermanager + sal.implementation org.opendaylight.controller - containermanager.it.implementation + switchmanager org.opendaylight.controller - protocol_plugins.stub + switchmanager.implementation org.opendaylight.controller topologymanager - junit - junit + org.slf4j + log4j-over-slf4j @@ -123,24 +134,7 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - - ../implementation/target/jacoco.exec - ../implementation/target/jacoco-it.exec - @@ -148,7 +142,9 @@ jacoco-maven-plugin ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -167,4 +163,10 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/hosttracker/api/pom.xml b/opendaylight/hosttracker/api/pom.xml index f4dfe6a099..d8f31ca65a 100644 --- a/opendaylight/hosttracker/api/pom.xml +++ b/opendaylight/hosttracker/api/pom.xml @@ -1,37 +1,38 @@ - 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../commons/opendaylight - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - hosttracker - 0.5.2-SNAPSHOT - bundle + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + + hosttracker + 0.5.2-SNAPSHOT + bundle + + + junit + junit + + + org.opendaylight.controller + sal + + - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.opendaylight.controller.hosttracker, - org.opendaylight.controller.hosttracker.hostAware - - - org.opendaylight.controller.sal.core, + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.opendaylight.controller.hosttracker, + org.opendaylight.controller.hosttracker.hostAware + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.packet.address, javax.xml.bind.annotation, @@ -40,23 +41,17 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - ${project.basedir}/META-INF - - - - - - - org.opendaylight.controller - sal - - - junit - junit - - + org.osgi.framework + + ${project.basedir}/META-INF + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + - diff --git a/opendaylight/hosttracker/implementation/pom.xml b/opendaylight/hosttracker/implementation/pom.xml index f19d4e83c4..9da62bdfe7 100644 --- a/opendaylight/hosttracker/implementation/pom.xml +++ b/opendaylight/hosttracker/implementation/pom.xml @@ -10,12 +10,6 @@ hosttracker.implementation 0.5.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - @@ -23,6 +17,32 @@ target/jacoco.exec target/jacoco-it.exec + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -42,10 +62,8 @@ true - - - - org.opendaylight.controller.sal.core, + + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.topology, org.opendaylight.controller.hosttracker, @@ -61,13 +79,9 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.hosttracker.internal.Activator - - - + org.osgi.framework + org.opendaylight.controller.hosttracker.internal.Activator + ${project.basedir}/META-INF @@ -76,7 +90,9 @@ org.jacoco jacoco-maven-plugin - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -87,39 +103,19 @@ post-test - test report + test - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - hosttracker - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/hosttracker/integrationtest/pom.xml b/opendaylight/hosttracker/integrationtest/pom.xml index e4e7790012..65fc23265a 100644 --- a/opendaylight/hosttracker/integrationtest/pom.xml +++ b/opendaylight/hosttracker/integrationtest/pom.xml @@ -7,40 +7,47 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - hosttracker.integrationtest 0.5.2-SNAPSHOT + + ../implementaiton/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + - org.opendaylight.controller - hosttracker + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + junit + junit org.opendaylight.controller - hosttracker.implementation + arphandler org.opendaylight.controller - sal + clustering.services org.opendaylight.controller - sal.implementation + clustering.stub org.opendaylight.controller - sal.connection + configuration org.opendaylight.controller - sal.connection.implementation + configuration.implementation org.opendaylight.controller @@ -60,39 +67,43 @@ org.opendaylight.controller - arphandler + hosttracker org.opendaylight.controller - clustering.services + hosttracker.implementation org.opendaylight.controller - clustering.stub + sal org.opendaylight.controller - switchmanager + sal.connection org.opendaylight.controller - switchmanager.implementation + sal.connection.implementation org.opendaylight.controller - configuration + sal.implementation org.opendaylight.controller - configuration.implementation + switchmanager + + + org.opendaylight.controller + switchmanager.implementation org.opendaylight.controller topologymanager - junit - junit + org.slf4j + log4j-over-slf4j @@ -115,24 +126,7 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - - ../implementation/target/jacoco.exec - ../implementaiton/target/jacoco-it.exec - @@ -141,7 +135,9 @@ jacoco-maven-plugin ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -160,4 +156,10 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/hosttracker_new/api/pom.xml b/opendaylight/hosttracker_new/api/pom.xml index b475efbf7a..1dec4e5574 100644 --- a/opendaylight/hosttracker_new/api/pom.xml +++ b/opendaylight/hosttracker_new/api/pom.xml @@ -10,12 +10,28 @@ hosttracker_new 0.4.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -26,12 +42,9 @@ true - - org.opendaylight.controller.hosttracker, - org.opendaylight.controller.hosttracker.hostAware - - - org.opendaylight.controller.sal.core, + org.opendaylight.controller.hosttracker, + org.opendaylight.controller.hosttracker.hostAware + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.topologymanager, org.opendaylight.controller.sal.packet.address, @@ -44,34 +57,17 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - + org.osgi.framework ${project.basedir}/META-INF - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/hosttracker_new/implementation/pom.xml b/opendaylight/hosttracker_new/implementation/pom.xml index 48e204bd4e..aaaf3abacf 100644 --- a/opendaylight/hosttracker_new/implementation/pom.xml +++ b/opendaylight/hosttracker_new/implementation/pom.xml @@ -10,19 +10,43 @@ hosttracker_new.implementation 0.4.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - reuseReports - target/jacoco.exec target/jacoco-it.exec + target/jacoco.exec + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + commons.logback_settings + + + org.opendaylight.controller + hosttracker_new + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -42,10 +66,8 @@ true - - - - org.opendaylight.controller.sal.core, + + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.topology, org.opendaylight.controller.sal.packet, @@ -62,13 +84,9 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.hosttracker.internal.Activator - - - + org.osgi.framework + org.opendaylight.controller.hosttracker.internal.Activator + ${project.basedir}/META-INF @@ -77,7 +95,9 @@ org.jacoco jacoco-maven-plugin - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -88,43 +108,19 @@ post-test - test report + test - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - hosttracker_new - - - junit - junit - - - org.opendaylight.controller - commons.logback_settings - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/logging/bridge/pom.xml b/opendaylight/logging/bridge/pom.xml index 3ceb5b1812..26fd11c5ef 100644 --- a/opendaylight/logging/bridge/pom.xml +++ b/opendaylight/logging/bridge/pom.xml @@ -1,71 +1,66 @@ - - 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../commons/opendaylight - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + - logging.bridge - 0.4.2-SNAPSHOT - bundle + logging.bridge + 0.4.2-SNAPSHOT + bundle - - - org.slf4j - slf4j-api - - - equinoxSDK381 - org.eclipse.osgi - - - junit - junit - test - - - org.opendaylight.yangtools - mockito-configuration - test - - - ch.qos.logback - logback-classic - test - - + + + equinoxSDK381 + org.eclipse.osgi + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + test + + + junit + junit + test + + + org.opendaylight.yangtools + mockito-configuration + test + + - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.slf4j, + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.slf4j, org.osgi.framework, - org.osgi.service.log - - - org.opendaylight.controller.logging.bridge.internal.Activator - - - ${project.basedir}/META-INF - - - - + org.osgi.service.log + org.opendaylight.controller.logging.bridge.internal.Activator + + ${project.basedir}/META-INF + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml b/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml index 01e5ae0372..2d68b47869 100644 --- a/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml +++ b/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml @@ -156,17 +156,14 @@ org.opendaylight.controller logback-config - ${config.version} org.opendaylight.controller config-persister-impl - ${config.version} org.opendaylight.controller config-persister-file-xml-adapter - ${config.version} org.opendaylight.controller @@ -262,12 +259,10 @@ org.opendaylight.controller logback-config - ${config.version} org.opendaylight.controller config-persister-impl - ${config.version} org.opendaylight.controller @@ -335,23 +330,13 @@ ../implementaiton/target/jacoco-it.exec - - - - org.jacoco - jacoco-maven-plugin - 0.5.3.201107060350 - - - org.jacoco jacoco-maven-plugin - 0.5.3.201107060350 ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + org.opendaylight.controller.* diff --git a/opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml b/opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml index f3fd230d5b..93ce0dd4f7 100644 --- a/opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml +++ b/opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml @@ -1,54 +1,46 @@ + 4.0.0 - org.opendaylight.controller + org.opendaylight.controller compatibility-parent 1.1-SNAPSHOT flow-management-compatibility bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - - - org.apache.felix - maven-bundle-plugin - true - - - Forwarding Rules Manager Adapter for MD-SAL - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + org.opendaylight.controller - sal-common-util + forwardingrulesmanager org.opendaylight.controller sal-binding-api - org.slf4j - slf4j-api + org.opendaylight.controller + sal-common-util - com.google.guava - guava + org.opendaylight.controller + sal-compatibility + + + org.opendaylight.controller.model + model-flow-management + + + org.slf4j + slf4j-api junit @@ -60,22 +52,31 @@ mockito-all test - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.controller.model - model-flow-management - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - sal-compatibility - + + + + + org.apache.felix + maven-bundle-plugin + true + + + Forwarding Rules Manager Adapter for MD-SAL + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml index aef489ec83..18fb785dd1 100644 --- a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml +++ b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml @@ -1,98 +1,99 @@ + - 4.0.0 - - org.opendaylight.controller - compatibility-parent - 1.1-SNAPSHOT - - inventory-topology-compatibility - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + compatibility-parent + 1.1-SNAPSHOT + + inventory-topology-compatibility + bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - Forwarding Rules Manager Adapter - for MD-SAL - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-util + + + org.opendaylight.controller + sal-common-util + + + org.opendaylight.controller + sal-compatibility + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + + org.opendaylight.controller.model + model-flow-management + + + org.opendaylight.controller.model + model-topology + 1.1-SNAPSHOT + + + org.slf4j + slf4j-api + + + junit + junit + test + + + org.mockito + mockito-all + test + + - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - topologymanager - - - org.slf4j - slf4j-api - - - com.google.guava - guava - - - junit - junit - test - - - org.mockito - mockito-all - test - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.controller.model - model-flow-management - - - org.opendaylight.controller - sal-binding-util - - - org.opendaylight.controller.model - model-topology - 1.1-SNAPSHOT - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - sal-compatibility - - + + + + org.apache.felix + maven-bundle-plugin + true + + + Forwarding Rules Manager Adapter + for MD-SAL + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/compatibility/pom.xml b/opendaylight/md-sal/compatibility/pom.xml index c5c5cd32c5..3ed1edf7d6 100644 --- a/opendaylight/md-sal/compatibility/pom.xml +++ b/opendaylight/md-sal/compatibility/pom.xml @@ -1,97 +1,99 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - compatibility-parent - pom - MD-SAL to AD-SAL Adaptation Parent - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - sal-compatibility - inventory-topology-compatibility - flow-management-compatibility - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + compatibility-parent + pom + MD-SAL to AD-SAL Adaptation Parent - - - org.opendaylight.controller - sal - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-binding-api - - - com.google.guava - guava - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - junit - junit - test - - + + sal-compatibility + inventory-topology-compatibility + flow-management-compatibility + - - - - org.eclipse.xtend - xtend-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - ${project.name} - org.opendaylight.controller.sal.compability.ComponentActivator - - - - - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - - - - + + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-common-util + + + org.opendaylight.controller.model + model-flow-service + + + junit + junit + test + + + + + + org.apache.felix + maven-bundle-plugin + + + ${project.name} + org.opendaylight.controller.sal.compability.ComponentActivator + + + + + org.eclipse.xtend + xtend-maven-plugin + + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml b/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml index 6914ef3c43..a145a3b4e1 100644 --- a/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml +++ b/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,15 +7,18 @@ 1.1-SNAPSHOT sal-compatibility + bundle MD-SAL to AD-SAL Adaptation - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + sal-binding-util + org.opendaylight.controller.model model-flow-statistics @@ -24,23 +28,10 @@ model-topology 1.1-SNAPSHOT - - org.opendaylight.controller - sal-binding-util - - - org.opendaylight.controller - clustering.services - - bundle - - org.eclipse.xtend - xtend-maven-plugin - org.apache.felix maven-bundle-plugin @@ -52,28 +43,40 @@ - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - + org.eclipse.xtend + xtend-maven-plugin + + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/forwardingrules-manager/pom.xml b/opendaylight/md-sal/forwardingrules-manager/pom.xml index 68eaa96871..919a53c364 100644 --- a/opendaylight/md-sal/forwardingrules-manager/pom.xml +++ b/opendaylight/md-sal/forwardingrules-manager/pom.xml @@ -1,48 +1,19 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - org.opendaylight.controller.md - forwardingrules-manager - bundle - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.frm.FRMActivator - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + org.opendaylight.controller.md + forwardingrules-manager + bundle - junit junit - - - org.opendaylight.controller - sal-binding-api org.opendaylight.controller @@ -50,13 +21,17 @@ 1.1-SNAPSHOT - org.opendaylight.controller.model - model-flow-service + org.opendaylight.controller + sal-binding-api org.opendaylight.controller.model model-flow-management + + org.opendaylight.controller.model + model-flow-service + org.opendaylight.yangtools yang-common @@ -67,4 +42,29 @@ provided + + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.frm.FRMActivator + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/inventory-manager/pom.xml b/opendaylight/md-sal/inventory-manager/pom.xml index 31621deeea..40a79033a7 100644 --- a/opendaylight/md-sal/inventory-manager/pom.xml +++ b/opendaylight/md-sal/inventory-manager/pom.xml @@ -1,64 +1,65 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - org.opendaylight.controller.md - inventory-manager - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + org.opendaylight.controller.md + inventory-manager + bundle - - - com.google.guava - guava - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.model - model-inventory - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.osgi - org.osgi.core - provided - - + + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller.model + model-flow-service + + + org.opendaylight.controller.model + model-inventory + + + org.osgi + org.osgi.core + provided + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.md.inventory.manager.InventoryActivator - org.opendaylight.controller.md.inventory.manager - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.md.inventory.manager.InventoryActivator + org.opendaylight.controller.md.inventory.manager + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller: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 d7d678d89a..eb8d6a8ddb 100644 --- a/opendaylight/md-sal/model/model-flow-base/pom.xml +++ b/opendaylight/md-sal/model/model-flow-base/pom.xml @@ -1,30 +1,31 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-flow-base + bundle - 4.0.0 - model-flow-base - - - - org.opendaylight.yangtools.model - opendaylight-l2-types - - - ${project.groupId} - model-inventory - ${project.version} - - - bundle + + + ${project.groupId} + model-inventory + ${project.version} + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/model-flow-management/pom.xml b/opendaylight/md-sal/model/model-flow-management/pom.xml index 39f5060a32..64f115816d 100644 --- a/opendaylight/md-sal/model/model-flow-management/pom.xml +++ b/opendaylight/md-sal/model/model-flow-management/pom.xml @@ -1,35 +1,36 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 - 4.0.0 - model-flow-management + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-flow-management + bundle - - - ${project.groupId} - model-flow-base - ${project.version} - - - ${project.groupId} - model-inventory - ${project.version} - - - org.opendaylight.yangtools.model - opendaylight-l2-types - - - bundle + + + ${project.groupId} + model-flow-base + ${project.version} + + + ${project.groupId} + model-inventory + ${project.version} + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/model-flow-service/pom.xml b/opendaylight/md-sal/model/model-flow-service/pom.xml index 5604ea98cf..0842bb4505 100644 --- a/opendaylight/md-sal/model/model-flow-service/pom.xml +++ b/opendaylight/md-sal/model/model-flow-service/pom.xml @@ -1,35 +1,36 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 - 4.0.0 - model-flow-service + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-flow-service + bundle - - - ${project.groupId} - model-flow-base - ${project.version} - - - ${project.groupId} - model-inventory - ${project.version} - - - org.opendaylight.yangtools.model - opendaylight-l2-types - - - bundle + + + ${project.groupId} + model-flow-base + ${project.version} + + + ${project.groupId} + model-inventory + ${project.version} + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/model-flow-statistics/pom.xml b/opendaylight/md-sal/model/model-flow-statistics/pom.xml index 54f232234b..cd26e32781 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/pom.xml +++ b/opendaylight/md-sal/model/model-flow-statistics/pom.xml @@ -1,35 +1,36 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 - 4.0.0 - model-flow-statistics + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-flow-statistics + bundle - - - ${project.groupId} - model-inventory - ${project.version} - - - ${project.groupId} - model-flow-service - ${project.version} - - - org.opendaylight.yangtools.model - opendaylight-l2-types - - - bundle + + + ${project.groupId} + model-flow-service + ${project.version} + + + ${project.groupId} + model-inventory + ${project.version} + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/model-inventory/pom.xml b/opendaylight/md-sal/model/model-inventory/pom.xml index 91400c261a..c2f4f70c40 100644 --- a/opendaylight/md-sal/model/model-inventory/pom.xml +++ b/opendaylight/md-sal/model/model-inventory/pom.xml @@ -1,18 +1,19 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 - 4.0.0 - model-inventory - bundle + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-inventory + bundle + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/model-topology/pom.xml b/opendaylight/md-sal/model/model-topology/pom.xml index 8e9f623efc..e87e4f180d 100644 --- a/opendaylight/md-sal/model/model-topology/pom.xml +++ b/opendaylight/md-sal/model/model-topology/pom.xml @@ -1,29 +1,30 @@ + - - model-parent - org.opendaylight.controller.model - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + + org.opendaylight.controller.model + model-parent + 1.1-SNAPSHOT + + model-topology + bundle - 4.0.0 - model-topology - bundle - - - - org.opendaylight.controller.model - model-inventory - - - org.opendaylight.yangtools.model - ietf-topology - - + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.yangtools.model + ietf-topology + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/model/pom.xml b/opendaylight/md-sal/model/pom.xml index a2a526426e..12b5f76625 100644 --- a/opendaylight/md-sal/model/pom.xml +++ b/opendaylight/md-sal/model/pom.xml @@ -1,120 +1,117 @@ + - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 - 4.0.0 - org.opendaylight.controller.model - model-parent - pom + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + org.opendaylight.controller.model + model-parent + pom - - UTF-8 - 2.4.0 - + + model-inventory + model-flow-base + model-flow-service + model-flow-statistics + model-flow-management + model-topology + - - model-inventory - model-flow-base - model-flow-service - model-flow-statistics - model-flow-management - model-topology - + + 2.4.0 + UTF-8 + - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - org.opendaylight.yangtools.yang.binding.annotations, * - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator - target/site/models - - - true - - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - org.opendaylight.yangtools - yang-binding - ${yangtools.version} - jar - - - - - + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.opendaylight.yangtools.model + ietf-yang-types + + + org.opendaylight.yangtools.model + yang-ext + + - - + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yangtools.yang.binding.annotations, * + + + + + org.opendaylight.yangtools + yang-maven-plugin + + org.opendaylight.yangtools - yang-binding - - + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools.model - ietf-yang-types - - - org.opendaylight.yangtools.model - yang-ext - - + yang-binding + ${yangtools.version} + jar + + + + + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index 631f1118c5..4e933c5bcf 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -1,313 +1,225 @@ + - 4.0.0 - - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../commons/opendaylight - - - sal-parent - 1.1-SNAPSHOT - pom - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - - sal-common - sal-common-api - sal-common-impl - sal-common-util - - - sal-dom-api - sal-dom-broker - sal-dom-spi - - - sal-binding-api - sal-binding-config - sal-binding-broker - - sal-binding-util - - - - samples - - - model - sal-remote - sal-restconf-broker - - - - sal-connector-api - sal-rest-connector - sal-netconf-connector - - - inventory-manager - statistics-manager - topology-manager - forwardingrules-manager - topology-lldp-discovery - - - compatibility - - - remoterpc-routingtable/implementation - sal-remoterpc-connector/implementation - + sal-common + sal-common-api + sal-common-impl + sal-common-util + + + sal-dom-api + sal-dom-broker + sal-dom-spi + + + sal-binding-api + sal-binding-config + sal-binding-broker + + sal-binding-util + + + samples + + + model + sal-remote + sal-restconf-broker + + + sal-connector-api + sal-rest-connector + sal-netconf-connector + + inventory-manager + statistics-manager + topology-manager + forwardingrules-manager + topology-lldp-discovery + + + compatibility + + + remoterpc-routingtable/implementation + sal-remoterpc-connector/implementation + - - - - - - - integrationtests - - false - - - sal-binding-it - sal-binding-dom-it - - - - - - - - - UTF-8 - - - 2.4.0 - 2.5 - - - 1.9.5 - - - - jacoco - reuseReports - target/jacoco.exec - target/jacoco-it.exec - https://sonar.opendaylight.org/ - ${user.name}-private-view - java - 3.0.0 - 0.8.1-SNAPSHOT - - - - - - xml-apis - xml-apis - 1.4.01 - - - - - ${project.groupId} - sal-connector-api - ${project.version} - - - org.opendaylight.controller - sal-binding-api - ${project.version} - - - org.opendaylight.controller - sal - ${sal.version} - - - org.osgi - org.osgi.compendium - - - - - org.opendaylight.controller - sal-remote - ${project.version} - - - org.opendaylight.controller - sal-binding-util - ${project.version} - - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - - org.osgi - org.osgi.core - ${osgi.core.version} - - - org.opendaylight.yangtools - binding-generator-impl - ${yangtools.version} - - - org.opendaylight.yangtools - yang-parser-impl - ${yangtools.version} - - - - - org.mockito - mockito-all - ${mockito.version} - test - - - - - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - ${project.groupId}.${project.artifactId} - - ${project.basedir}/META-INF - - - - org.eclipse.xtend - xtend-maven-plugin - ${xtend.version} - - + + + ${project.groupId}.${project.artifactId} + + ${project.basedir}/META-INF + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.opendaylight.yangtools + yang-maven-plugin + [0,) + + generate-sources + + + + + + + + + net.alchim31.maven + scala-maven-plugin + [0,) + + compile + testCompile + + + + + + + + org.jacoco jacoco-maven-plugin - ${jacoco.version} - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.opendaylight.yangtools - yang-maven-plugin - [0,) - - generate-sources - - - - - - - - - net.alchim31.maven - scala-maven-plugin - [0,) - - compile - testCompile - - - - - - - - - org.jacoco - jacoco-maven-plugin - [0,) - - prepare-agent - - - - - - - - - - - + [0,) + + prepare-agent + + + + + + + + + + + + org.eclipse.xtend + xtend-maven-plugin + ${xtend.version} + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + + + + org.apache.felix + maven-bundle-plugin + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.version} + + + none + + + + + org.apache.maven.plugins + maven-jar-plugin + + + org.opendaylight.yangtools + yang-maven-plugin + ${yangtools.version} + + + org.opendaylight.controller + yang-jmx-generator-plugin + ${config.version} + + + + + + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.4.0 + + Max + Low + site + + + + org.codehaus.mojo + jdepend-maven-plugin + 2.0-beta-2 + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + - - - - org.apache.felix - maven-bundle-plugin - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.version} - - - none - - - - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 2.4.0 - - Max - Low - site - - - - org.codehaus.mojo - jdepend-maven-plugin - 2.0-beta-2 - - - + + + integrationtests + + false + + + sal-binding-it + sal-binding-dom-it + + + + + + + diff --git a/opendaylight/md-sal/remoterpc-routingtable/implementation/pom.xml b/opendaylight/md-sal/remoterpc-routingtable/implementation/pom.xml index ccff37c41d..8cab0b546c 100644 --- a/opendaylight/md-sal/remoterpc-routingtable/implementation/pom.xml +++ b/opendaylight/md-sal/remoterpc-routingtable/implementation/pom.xml @@ -1,38 +1,69 @@ - - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - ../.. - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + ../.. + - remoterpc-routingtable.implementation - bundle + remoterpc-routingtable.implementation + bundle + - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - - org.opendaylight.controller.sal.connector.remoterpc.api, - org.opendaylight.controller.sal.connector.remoterpc.impl - - - javax.xml.bind.annotation, + + com.google.guava + guava + + + + org.opendaylight.controller + clustering.services + ${clustering.services.version} + + + + org.opendaylight.controller + sal + + + org.osgi + org.osgi.compendium + + + + + org.opendaylight.controller + sal-connector-api + ${project.version} + + + + junit + junit + test + + + org.mockito + mockito-all + test + + + + + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + + + org.opendaylight.controller.sal.connector.remoterpc.api, + org.opendaylight.controller.sal.connector.remoterpc.impl + javax.xml.bind.annotation, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.packet, @@ -49,59 +80,18 @@ org.osgi.framework, javax.transaction, com.google.common.base, - com.google.common.collect - - - org.opendaylight.controller.sal.connector.remoterpc.impl.Activator - - - ${project.basedir}/META-INF - - - - - - - - com.google.guava - guava - - - - org.opendaylight.controller - sal - - - org.osgi - org.osgi.compendium - - - - - org.opendaylight.controller - sal-connector-api - ${project.version} - - - - org.opendaylight.controller - clustering.services - ${clustering.services.version} - - - - - junit - junit - test - - - org.mockito - mockito-all - test - - - - - + com.google.common.collect + org.opendaylight.controller.sal.connector.remoterpc.impl.Activator + + ${project.basedir}/META-INF + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/md-sal/remoterpc-routingtable/integrationtest/pom.xml b/opendaylight/md-sal/remoterpc-routingtable/integrationtest/pom.xml index bdc4569f31..6db143ab3e 100644 --- a/opendaylight/md-sal/remoterpc-routingtable/integrationtest/pom.xml +++ b/opendaylight/md-sal/remoterpc-routingtable/integrationtest/pom.xml @@ -243,23 +243,13 @@ ../implementation/target/jacoco-it.exec - - - - org.jacoco - jacoco-maven-plugin - 0.5.3.201107060350 - - - org.jacoco jacoco-maven-plugin - ${jacoco.version} ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + org.opendaylight.controller.* diff --git a/opendaylight/md-sal/sal-binding-api/pom.xml b/opendaylight/md-sal/sal-binding-api/pom.xml index 00129b9841..7f45fb458b 100644 --- a/opendaylight/md-sal/sal-binding-api/pom.xml +++ b/opendaylight/md-sal/sal-binding-api/pom.xml @@ -1,44 +1,45 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-binding-api - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-api + bundle - - - org.opendaylight.yangtools - concepts - - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools - yang-binding - - - org.opendaylight.controller - sal-common-api - - - com.google.guava - guava - - - org.osgi - org.osgi.core - provided - - + + + com.google.guava + guava + + + org.opendaylight.controller + sal-common-api + + + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.osgi + org.osgi.core + provided + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-binding-broker/pom.xml b/opendaylight/md-sal/sal-binding-broker/pom.xml index 9976f48114..2470ba5133 100644 --- a/opendaylight/md-sal/sal-binding-broker/pom.xml +++ b/opendaylight/md-sal/sal-binding-broker/pom.xml @@ -1,253 +1,231 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-binding-broker-impl - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-broker-impl + bundle - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - + + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.javassist + javassist + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-config + + + org.opendaylight.controller + sal-binding-util + + + org.opendaylight.controller + sal-broker-impl + compile + + + org.opendaylight.controller + sal-common-impl + + + org.opendaylight.controller + sal-common-util + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.controller.model + model-flow-base + + + org.opendaylight.controller.model + model-flow-service + + + org.opendaylight.controller.model + model-flow-statistics + + + org.opendaylight.yangtools + binding-generator-impl + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-model-util + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.reflections + reflections + 0.9.9-RC1 + compile + + + org.slf4j + slf4j-api + + + org.osgi + org.osgi.core + provided + + + junit + junit + test + + + org.mockito + mockito-all + test + + + org.opendaylight.yangtools + yang-parser-impl + test + + + org.opendaylight.yangtools.model + ietf-topology-l3-unicast-igp + test + + + org.slf4j + slf4j-simple + ${slf4j.version} + test + + + + - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - org.opendaylight.controller.sal.binding.spi.*, - - - org.opendaylight.controller.config.yang.md.sal.binding.impl, + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.controller.sal.binding.spi.*, + + org.opendaylight.controller.config.yang.md.sal.binding.impl, org.opendaylight.controller.sal.binding.impl, org.opendaylight.controller.sal.binding.impl.*, org.opendaylight.controller.sal.binding.codegen, org.opendaylight.controller.sal.binding.codegen.*, org.opendaylight.controller.md.sal.binding.impl, - - org.opendaylight.controller.sal.binding.osgi.*, + + org.opendaylight.controller.sal.binding.osgi.*, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.impl.rev131028 - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - - + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-common-impl - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-binding-util - - - org.slf4j - slf4j-api - - - org.osgi - org.osgi.core - provided - - - com.google.guava - guava - - - org.reflections - reflections - 0.9.9-RC1 - compile - - - org.javassist - javassist - - - org.opendaylight.yangtools - binding-generator-impl - - - org.opendaylight.yangtools - yang-parser-impl - test - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.controller - sal-broker-impl - compile - - - junit - junit - test - - - org.mockito - mockito-all - test - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.controller - sal-binding-config - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.yangtools - yang-model-util - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools.model - ietf-topology-l3-unicast-igp - test - - - org.opendaylight.controller.model - model-flow-base - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.model - model-flow-statistics - - + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.java new file mode 100644 index 0000000000..ea8b6c0972 --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2013 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.binding.codegen; + +import com.google.common.base.Objects; +import java.lang.reflect.Field; +import java.util.Map; +import org.eclipse.xtext.xbase.lib.Exceptions; +import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeSpecification; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.RpcService; + +@SuppressWarnings("all") +public class RuntimeCodeHelper { + /** + * Helper method to return delegate from ManagedDirectedProxy with use of reflection. + * + * Note: This method uses reflection, but access to delegate field should be + * avoided and called only if neccessary. + */ + public static T getDelegate(final RpcService proxy) { + try { + Class _class = proxy.getClass(); + final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD); + boolean _equals = Objects.equal(field, null); + if (_equals) { + UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to get delegate from proxy"); + throw _unsupportedOperationException; + } + try { + Object _get = field.get(proxy); + return ((T) _get); + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } catch (Throwable _e_1) { + throw Exceptions.sneakyThrow(_e_1); + } + } + + /** + * Helper method to set delegate to ManagedDirectedProxy with use of reflection. + * + * Note: This method uses reflection, but setting delegate field should not occur too much + * to introduce any significant performance hits. + */ + public static void setDelegate(final RpcService proxy, final RpcService delegate) { + try { + Class _class = proxy.getClass(); + final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD); + boolean _equals = Objects.equal(field, null); + if (_equals) { + UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to set delegate to proxy"); + throw _unsupportedOperationException; + } + boolean _or = false; + boolean _equals_1 = Objects.equal(delegate, null); + if (_equals_1) { + _or = true; + } else { + Class _type = field.getType(); + Class _class_1 = delegate.getClass(); + boolean _isAssignableFrom = _type.isAssignableFrom(_class_1); + _or = (_equals_1 || _isAssignableFrom); + } + if (_or) { + field.set(proxy, delegate); + } else { + IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("delegate class is not assignable to proxy"); + throw _illegalArgumentException; + } + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } + + /** + * Helper method to set delegate to ManagedDirectedProxy with use of reflection. + * + * Note: This method uses reflection, but setting delegate field should not occur too much + * to introduce any significant performance hits. + */ + public static void setDelegate(final Object proxy, final Object delegate) { + try { + Class _class = proxy.getClass(); + final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD); + boolean _equals = Objects.equal(field, null); + if (_equals) { + UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to set delegate to proxy"); + throw _unsupportedOperationException; + } + boolean _or = false; + boolean _equals_1 = Objects.equal(delegate, null); + if (_equals_1) { + _or = true; + } else { + Class _type = field.getType(); + Class _class_1 = delegate.getClass(); + boolean _isAssignableFrom = _type.isAssignableFrom(_class_1); + _or = (_equals_1 || _isAssignableFrom); + } + if (_or) { + field.set(proxy, delegate); + } else { + IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("delegate class is not assignable to proxy"); + throw _illegalArgumentException; + } + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } + + public static Map,? extends RpcService> getRoutingTable(final RpcService target, final Class tableClass) { + try { + Class _class = target.getClass(); + String _routingTableField = RuntimeCodeSpecification.getRoutingTableField(tableClass); + final Field field = _class.getField(_routingTableField); + boolean _equals = Objects.equal(field, null); + if (_equals) { + UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException( + "Unable to get routing table. Table field does not exists"); + throw _unsupportedOperationException; + } + try { + Object _get = field.get(target); + return ((Map,? extends RpcService>) _get); + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } catch (Throwable _e_1) { + throw Exceptions.sneakyThrow(_e_1); + } + } + + public static void setRoutingTable(final RpcService target, final Class tableClass, final Map,? extends RpcService> routingTable) { + try { + Class _class = target.getClass(); + String _routingTableField = RuntimeCodeSpecification.getRoutingTableField(tableClass); + final Field field = _class.getField(_routingTableField); + boolean _equals = Objects.equal(field, null); + if (_equals) { + UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException( + "Unable to set routing table. Table field does not exists"); + throw _unsupportedOperationException; + } + field.set(target, routingTable); + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend deleted file mode 100644 index dff0d215b2..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2013 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.binding.codegen - -import java.util.Map - -import org.opendaylight.yangtools.yang.binding.BaseIdentity -import org.opendaylight.yangtools.yang.binding.RpcService -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier - -import static extension org.opendaylight.controller.sal.binding.codegen.RuntimeCodeSpecification.* - -class RuntimeCodeHelper { - /** - * Helper method to return delegate from ManagedDirectedProxy with use of reflection. - * - * Note: This method uses reflection, but access to delegate field should be - * avoided and called only if neccessary. - * - */ - public static def getDelegate(RpcService proxy) { - val field = proxy.class.getField(DELEGATE_FIELD) - if (field == null) throw new UnsupportedOperationException("Unable to get delegate from proxy"); - return field.get(proxy) as T - } - - /** - * Helper method to set delegate to ManagedDirectedProxy with use of reflection. - * - * Note: This method uses reflection, but setting delegate field should not occur too much - * to introduce any significant performance hits. - * - */ - public static def void setDelegate(RpcService proxy, RpcService delegate) { - val field = proxy.class.getField(DELEGATE_FIELD) - if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy"); - if (delegate == null || field.type.isAssignableFrom(delegate.class)) { - field.set(proxy, delegate) - } else - throw new IllegalArgumentException("delegate class is not assignable to proxy"); - } - - /** - * Helper method to set delegate to ManagedDirectedProxy with use of reflection. - * - * Note: This method uses reflection, but setting delegate field should not occur too much - * to introduce any significant performance hits. - * - */ - public static def void setDelegate(Object proxy, Object delegate) { - val field = proxy.class.getField(DELEGATE_FIELD) - if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy"); - if (delegate == null || field.type.isAssignableFrom(delegate.class)) { - field.set(proxy, delegate) - } else - throw new IllegalArgumentException("delegate class is not assignable to proxy"); - } - - - public static def Map, ? extends RpcService> getRoutingTable(RpcService target, - Class tableClass) { - val field = target.class.getField(tableClass.routingTableField) - if (field == null) throw new UnsupportedOperationException( - "Unable to get routing table. Table field does not exists"); - return field.get(target) as Map, ? extends RpcService>; - } - - public static def void setRoutingTable(RpcService target, Class tableClass, - Map, ? extends RpcService> routingTable) { - val field = target.class.getField(tableClass.routingTableField) - if (field == null) throw new UnsupportedOperationException( - "Unable to set routing table. Table field does not exists"); - field.set(target,routingTable); - } - -} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.java new file mode 100644 index 0000000000..0bc11d9b35 --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2013 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.binding.codegen; + +import java.lang.reflect.Method; +import org.opendaylight.yangtools.yang.binding.Notification; + +@SuppressWarnings("all") +public class YangtoolsMappingHelper { + public static boolean isNotificationCallback(final Method it) { + return it.getName().startsWith("on") && (it.getParameterTypes().length == 1) && + Notification.class.isAssignableFrom(it.getParameterTypes()[0]); + } + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.xtend deleted file mode 100644 index 18d3e26346..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.xtend +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2013 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.binding.codegen - -import java.lang.reflect.Method -import org.opendaylight.yangtools.yang.binding.Notification - -public static class YangtoolsMappingHelper { - - public static def boolean isNotificationCallback(Method it) { - return name.startsWith("on") && parameterTypes.size === 1 && - Notification.isAssignableFrom(parameterTypes.get(0)) - } -} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.java new file mode 100644 index 0000000000..cab4fe90e0 --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013 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.binding.codegen.impl; + +import org.eclipse.xtext.xbase.lib.Exceptions; + +@SuppressWarnings("all") +public class BrokerImplClassLoader extends ClassLoader { + private final ClassLoader spiClassLoader; + + public BrokerImplClassLoader(final ClassLoader model, final ClassLoader spi) { + super(model); + this.spiClassLoader = spi; + } + + public Class loadClass(final String name) throws ClassNotFoundException { + try { + return super.loadClass(name); + } catch (ClassNotFoundException e) { + return this.spiClassLoader.loadClass(name); + } + } +} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend deleted file mode 100644 index 6481c9d1b4..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013 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.binding.codegen.impl - -import java.lang.ClassLoader - -class BrokerImplClassLoader extends ClassLoader { - - val ClassLoader spiClassLoader - - public new(ClassLoader model, ClassLoader spi) { - super(model) - spiClassLoader = spi; - } - - override public loadClass(String name) throws ClassNotFoundException { - try { - return super.loadClass(name); - } catch (ClassNotFoundException e) { - return spiClassLoader.loadClass(name); - } - } - -} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.java new file mode 100644 index 0000000000..3b6a2539de --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013 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.binding.impl; + +import org.opendaylight.yangtools.yang.binding.RpcService; +import org.osgi.framework.ServiceRegistration; + +@SuppressWarnings("all") +public class RpcProxyContext { + public RpcProxyContext(final Class proxyClass) { + this.proxyClass = proxyClass; + } + + protected final Class proxyClass; + + protected RpcService _proxy; + + public RpcService getProxy() { + return this._proxy; + } + + public void setProxy(final RpcService proxy) { + this._proxy = proxy; + } + + protected ServiceRegistration _registration; + + public ServiceRegistration getRegistration() { + return this._registration; + } + + public void setRegistration(final ServiceRegistration registration) { + this._registration = registration; + } +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.xtend deleted file mode 100644 index 07494599f8..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.xtend +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2013 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.binding.impl - -import org.opendaylight.yangtools.yang.binding.RpcService -import org.osgi.framework.ServiceRegistration - -class RpcProxyContext { - - new(Class proxyClass) { - this.proxyClass = proxyClass - } - - protected val Class proxyClass; - - @Property - protected var RpcService proxy; - - @Property - protected var ServiceRegistration registration; -} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java index 9edea0c2fd..a398abc75a 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java @@ -91,6 +91,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; public class BindingIndependentConnector implements // RuntimeDataProvider, // @@ -324,7 +325,7 @@ public class BindingIndependentConnector implements // } public void startRpcForwarding() { - if (baRpcRegistry != null && biRpcRegistry != null && baRpcRegistry instanceof RouteChangePublisher) { + if (biRpcRegistry != null && baRpcRegistry instanceof RouteChangePublisher) { checkState(!rpcForwarding, "Connector is already forwarding RPCs"); domToBindingRpcManager = baRpcRegistry.registerRouteChangeListener(new DomToBindingRpcForwardingManager()); if (baRpcRegistry instanceof RpcProviderRegistryImpl) { @@ -699,8 +700,9 @@ public class BindingIndependentConnector implements // } } + @Override - public RpcResult invokeRpc(final QName rpc, final CompositeNode domInput) { + public ListenableFuture> invokeRpc(final QName rpc, final CompositeNode domInput) { checkArgument(rpc != null); checkArgument(domInput != null); @@ -709,10 +711,11 @@ public class BindingIndependentConnector implements // RpcService rpcService = baRpcRegistry.getRpcService(rpcType); checkState(rpcService != null); CompositeNode domUnwrappedInput = domInput.getFirstCompositeByName(QName.create(rpc, "input")); + try { - return resolveInvocationStrategy(rpc).invokeOn(rpcService, domUnwrappedInput); + return Futures.immediateFuture(resolveInvocationStrategy(rpc).invokeOn(rpcService, domUnwrappedInput)); } catch (Exception e) { - throw new IllegalStateException(e); + return Futures.immediateFailedFuture(e); } } @@ -813,21 +816,25 @@ public class BindingIndependentConnector implements // } @Override - public Future> forwardToDomBroker(final DataObject input) { - if(biRpcRegistry != null) { - CompositeNode xml = mappingService.toDataDom(input); - CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc, ImmutableList.> of(xml)); - RpcResult result = biRpcRegistry.invokeRpc(rpc, wrappedXml); - Object baResultValue = null; - if (result.getResult() != null) { - baResultValue = mappingService.dataObjectFromDataDom(outputClass.get(), result.getResult()); - } - RpcResult baResult = Rpcs.getRpcResult(result.isSuccessful(), baResultValue, result.getErrors()); - return Futures.> immediateFuture(baResult); + public ListenableFuture> forwardToDomBroker(final DataObject input) { + if(biRpcRegistry == null) { + return Futures.> immediateFuture(Rpcs.getRpcResult(false)); } - return Futures.> immediateFuture(Rpcs.getRpcResult(false)); - } + CompositeNode xml = mappingService.toDataDom(input); + CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc, ImmutableList.> of(xml)); + + return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml), new Function, RpcResult>() { + @Override + public RpcResult apply(RpcResult input) { + Object baResultValue = null; + if (input.getResult() != null) { + baResultValue = mappingService.dataObjectFromDataDom(outputClass.get(), input.getResult()); + } + return Rpcs.getRpcResult(input.isSuccessful(), baResultValue, input.getErrors()); + } + }); + } } private class NoInputNoOutputInvocationStrategy extends RpcInvocationStrategy { @@ -876,18 +883,21 @@ public class BindingIndependentConnector implements // } @Override - public Future> forwardToDomBroker(final DataObject input) { - if(biRpcRegistry != null) { - CompositeNode xml = mappingService.toDataDom(input); - CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc,ImmutableList.>of(xml)); - RpcResult result = biRpcRegistry.invokeRpc(rpc, wrappedXml); - Object baResultValue = null; - RpcResult baResult = Rpcs.getRpcResult(result.isSuccessful(), null, result.getErrors()); - return Futures.>immediateFuture(baResult); + public ListenableFuture> forwardToDomBroker(final DataObject input) { + if(biRpcRegistry == null) { + return Futures.> immediateFuture(Rpcs.getRpcResult(false)); } - return Futures.>immediateFuture(Rpcs.getRpcResult(false)); - } + CompositeNode xml = mappingService.toDataDom(input); + CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc,ImmutableList.>of(xml)); + + return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml), new Function, RpcResult>() { + @Override + public RpcResult apply(RpcResult input) { + return Rpcs.getRpcResult(input.isSuccessful(), null, input.getErrors()); + } + }); + } } public boolean isRpcForwarding() { diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.java new file mode 100644 index 0000000000..b0316635e2 --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.java @@ -0,0 +1,20 @@ +/* + * 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.binding.impl.util; + +import java.util.Iterator; +import org.opendaylight.controller.md.sal.common.impl.routing.AbstractDataReadRouter; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +@SuppressWarnings("all") +public class BindingAwareDataReaderRouter extends AbstractDataReadRouter,DataObject> { + protected DataObject merge(final InstanceIdentifier path, final Iterable data) { + return data.iterator().next(); + } +} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.xtend deleted file mode 100644 index 5b775806d5..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.xtend +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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.binding.impl.util - -import org.opendaylight.controller.md.sal.common.impl.routing.AbstractDataReadRouter -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier -import org.opendaylight.yangtools.yang.binding.DataObject - -class BindingAwareDataReaderRouter extends AbstractDataReadRouter, DataObject> { - - override protected merge(InstanceIdentifier path, Iterable data) { - return data.iterator.next; - } - -} diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.java new file mode 100644 index 0000000000..aa6a9a21e5 --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.java @@ -0,0 +1,36 @@ +/* + * 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.binding.impl.util; + +import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map.Entry; +import org.opendaylight.yangtools.concepts.Path; + +@SuppressWarnings("all") +public class MapUtils { + public static

, V extends Object> Collection> getAllChildren(final Multimap map, final P path) { + HashSet> _hashSet = new HashSet>(); + final HashSet> ret = _hashSet; + final Collection> entries = map.entries(); + for (final Entry entry : entries) { + { + final P currentPath = entry.getKey(); + if (path.contains(currentPath)) { + ret.add(entry); + } else if (currentPath.contains(path)){ + ret.add(entry); + } + } + } + return ret; + } +} + diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.xtend deleted file mode 100644 index c60686d209..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.binding.impl.util - -import com.google.common.collect.Multimap -import java.util.Collection -import java.util.HashSet -import java.util.Map.Entry -import org.opendaylight.yangtools.concepts.Path - -class MapUtils { - - public static def

, V> Collection> getAllChildren( - Multimap map, P path) { - val ret = new HashSet(); - val entries = map.entries; - - for (entry : entries) { - val currentPath = entry.key; - // If the registered reader processes nested elements - if (path.contains(currentPath)) { - ret.add(entry); - } else if(currentPath.contains(path)) { - // If the registered reader is parent of entry - ret.add(entry); - } - } - - return ret; - } -} diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java index 4bad2bbb86..d6d87bac84 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java @@ -351,7 +351,6 @@ public class BindingTestContext implements AutoCloseable, SchemaContextProvider private void startDomBroker() { checkState(executor != null); biBrokerImpl = new BrokerImpl(); - biBrokerImpl.setExecutor(executor); biBrokerImpl.setRouter(new SchemaAwareRpcBroker("/", this)); } diff --git a/opendaylight/md-sal/sal-binding-config/pom.xml b/opendaylight/md-sal/sal-binding-config/pom.xml index f75995dc22..2342745f92 100644 --- a/opendaylight/md-sal/sal-binding-config/pom.xml +++ b/opendaylight/md-sal/sal-binding-config/pom.xml @@ -1,89 +1,69 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-binding-config - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-config + bundle - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + sal-binding-api + + - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - sal-binding-api - - + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-binding-dom-it/pom.xml b/opendaylight/md-sal/sal-binding-dom-it/pom.xml index 94832c14b6..099b77c956 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/pom.xml +++ b/opendaylight/md-sal/sal-binding-dom-it/pom.xml @@ -1,86 +1,89 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-binding-dom-it - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - - org.eclipse.xtend - xtend-maven-plugin - - - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - - - - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-dom-it + jar - - - org.ops4j.pax.exam - pax-exam-container-native - test - - - org.opendaylight.controller - sal-binding-broker-impl - test - - - org.opendaylight.controller - sal-binding-broker-impl - test-jar - test - - - org.opendaylight.controller.model - model-flow-service - test - - - org.opendaylight.controller.model - model-flow-management - test - - - junit - junit - + + + junit + junit + + + org.opendaylight.controller + sal-binding-broker-impl + test + + + org.opendaylight.controller + sal-binding-broker-impl + test-jar + test + + + org.opendaylight.controller.model + model-flow-management + test + + + org.opendaylight.controller.model + model-flow-service + test + + + org.ops4j.pax.exam + pax-exam-container-native + test + - - org.slf4j - slf4j-simple - test - 1.7.2 - - + + org.slf4j + slf4j-simple + 1.7.2 + test + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java index fc303e07eb..450ca1cb3b 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java @@ -1,3 +1,10 @@ +/* + * 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.md.sal.binding.data; import static org.junit.Assert.assertFalse; diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java index b1547b66a7..ca38ed0797 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java @@ -50,6 +50,7 @@ import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; public class CrossBrokerRpcTest { @@ -64,7 +65,7 @@ public class CrossBrokerRpcTest { public static final NodeId NODE_B = new NodeId("b"); public static final NodeId NODE_C = new NodeId("c"); public static final NodeId NODE_D = new NodeId("d"); - + private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id"); private static final QName ADD_FLOW_QNAME = QName.create(NodeFlowRemoved.QNAME, "add-flow"); @@ -78,7 +79,7 @@ public class CrossBrokerRpcTest { public static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier BI_NODE_C_ID = createBINodeIdentifier(NODE_C); public static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier BI_NODE_D_ID = createBINodeIdentifier(NODE_D); - + @Before public void setup() { @@ -99,7 +100,7 @@ public class CrossBrokerRpcTest { } @Test - public void bindingRoutedRpcProvider_DomInvokerTest() { + public void bindingRoutedRpcProvider_DomInvokerTest() throws Exception { flowService// .registerPath(NodeContext.class, BA_NODE_A_ID) // @@ -114,7 +115,7 @@ public class CrossBrokerRpcTest { CompositeNode addFlowDom = toDomRpc(ADD_FLOW_QNAME, addFlowA); assertNotNull(addFlowDom); - RpcResult domResult = biRpcInvoker.invokeRpc(ADD_FLOW_QNAME, addFlowDom); + RpcResult domResult = biRpcInvoker.invokeRpc(ADD_FLOW_QNAME, addFlowDom).get(); assertNotNull(domResult); assertTrue("DOM result is successful.", domResult.isSuccessful()); assertTrue("Bidning Add Flow RPC was captured.", flowService.getReceivedAddFlows().containsKey(BA_NODE_A_ID)); @@ -128,18 +129,18 @@ public class CrossBrokerRpcTest { final AddFlowOutput output = builder.build(); org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration registration = biRpcRegistry.addRoutedRpcImplementation(ADD_FLOW_QNAME, new RpcImplementation() { @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { - CompositeNode result = testContext.getBindingToDomMappingService().toDataDom(output); - return Rpcs.getRpcResult(true, result, ImmutableList.of()); + public Set getSupportedRpcs() { + return ImmutableSet.of(ADD_FLOW_QNAME); } @Override - public Set getSupportedRpcs() { - return ImmutableSet.of(ADD_FLOW_QNAME); + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { + CompositeNode result = testContext.getBindingToDomMappingService().toDataDom(output); + return Futures.immediateFuture(Rpcs.getRpcResult(true, result, ImmutableList.of())); } }); registration.registerPath(NodeContext.QNAME, BI_NODE_C_ID); - + SalFlowService baFlowInvoker = baRpcRegistry.getRpcService(SalFlowService.class); Future> baResult = baFlowInvoker.addFlow(addFlow(BA_NODE_C_ID).setPriority(500).build()); assertNotNull(baResult); diff --git a/opendaylight/md-sal/sal-binding-it/pom.xml b/opendaylight/md-sal/sal-binding-it/pom.xml index 520935ca90..0d20a07ad5 100644 --- a/opendaylight/md-sal/sal-binding-it/pom.xml +++ b/opendaylight/md-sal/sal-binding-it/pom.xml @@ -1,249 +1,253 @@ + - 4.0.0 - - sal-parent - org.opendaylight.controller - 1.1-SNAPSHOT - - sal-binding-it - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - - - 3.0.0 - 1.5.0 - - ../sal-binding-broker/target/jacoco.exec - ../sal-binding-broker/target/jacoco-it.exec - - - - - - org.ops4j.pax.exam - maven-paxexam-plugin - 1.2.4 - - - generate-config - - generate-depends-file - - - - - - org.jacoco - jacoco-maven-plugin - - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - test - - report - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.14.1 - - false - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.ops4j.pax.exam - - - maven-paxexam-plugin - - - [1.2.4,) - - - - generate-depends-file - - - - - - - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - ../sal-binding-broker/target/jacoco-it.exec - org.opendaylight.controller.* - - - - pre-test - - prepare-agent - - - - post-test - - true - - - - - - - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-it + + 3.0.0 + ../sal-binding-broker/target/jacoco-it.exec + + ../sal-binding-broker/target/jacoco.exec + 1.5.0 + - - - - + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + equinoxSDK381 + org.eclipse.osgi + + + org.eclipse.persistence + org.eclipse.persistence.core + + + org.eclipse.persistence + org.eclipse.persistence.moxy + + + org.mockito + mockito-all + + + org.opendaylight.controller + config-manager + + + org.opendaylight.controller + config-netconf-connector + + + org.opendaylight.controller + config-persister-file-xml-adapter + + + org.opendaylight.controller + config-persister-impl + + + org.opendaylight.controller + logback-config + + + org.opendaylight.controller + netconf-client + + + org.opendaylight.controller + netconf-impl + + + org.opendaylight.controller + netconf-monitoring + + + org.opendaylight.controller + sal-binding-broker-impl + + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + + + org.opendaylight.yangtools.thirdparty + antlr4-runtime-osgi-nohead + 4.0 + + + + - - - org.opendaylight.yangtools.thirdparty - xtend-lib-osgi - 2.4.3 - - - org.opendaylight.controller - sal-binding-broker-impl - - - org.ops4j.pax.exam - pax-exam-container-native - compile - - - org.ops4j.pax.exam - pax-exam-junit4 - compile - - - org.opendaylight.controller - config-netconf-connector - - - org.opendaylight.controller - logback-config - - - org.opendaylight.controller - config-persister-impl - - - org.opendaylight.controller - config-persister-file-xml-adapter - - - org.eclipse.persistence - org.eclipse.persistence.moxy - - - org.eclipse.persistence - org.eclipse.persistence.core - - - org.opendaylight.controller - netconf-impl - - - org.opendaylight.controller - netconf-monitoring - - - org.opendaylight.controller - netconf-client - - - org.ops4j.pax.exam - pax-exam - ${exam.version} - + + org.opendaylight.yangtools.thirdparty + xtend-lib-osgi + 2.4.3 + + + org.ops4j.pax.exam + pax-exam + ${exam.version} + - compile - - - org.ops4j.pax.exam - pax-exam-link-mvn - compile - - - equinoxSDK381 - org.eclipse.osgi - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - org.mockito - mockito-all - - - org.opendaylight.controller.model - model-flow-service - provided - - - org.opendaylight.controller - config-manager - - - org.opendaylight.controller.model - model-flow-management - provided - - - org.opendaylight.yangtools.thirdparty - antlr4-runtime-osgi-nohead - 4.0 - - + compile + + + org.ops4j.pax.exam + pax-exam-container-native + compile + + + org.ops4j.pax.exam + pax-exam-junit4 + compile + + + org.ops4j.pax.exam + pax-exam-link-mvn + compile + + + org.slf4j + log4j-over-slf4j + + + org.opendaylight.controller.model + model-flow-management + provided + + + org.opendaylight.controller.model + model-flow-service + provided + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.ops4j.pax.exam + maven-paxexam-plugin + [1.2.4,) + + generate-depends-file + + + + + + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + ../sal-binding-broker/target/jacoco-it.exec + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + true + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.14.1 + + false + + + + org.jacoco + jacoco-maven-plugin + + + org.opendaylight.controller.* + + + + + pre-test + + prepare-agent + + + + post-test + + report + + test + + + + + org.ops4j.pax.exam + maven-paxexam-plugin + 1.2.4 + + + generate-config + + generate-depends-file + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java b/opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java index 5b97da368e..166216b226 100644 --- a/opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java +++ b/opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java @@ -68,6 +68,8 @@ public class TestHelper { mavenBundle(CONTROLLER, "netconf-client").versionAsInProject(), // mavenBundle(CONTROLLER, "netconf-util").versionAsInProject(), // + mavenBundle(CONTROLLER + ".thirdparty", "nagasena").versionAsInProject(), // + mavenBundle(CONTROLLER + ".thirdparty", "nagasena-rta").versionAsInProject(), // mavenBundle(CONTROLLER + ".thirdparty", "ganymed").versionAsInProject(), // mavenBundle(CONTROLLER, "netconf-mapping-api").versionAsInProject(), // diff --git a/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java b/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java index 019fc0eb73..3d78f94861 100644 --- a/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java +++ b/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java @@ -69,7 +69,10 @@ public abstract class AbstractTest { // + "/src/test/resources/logback.xml"), mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), // mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), // - mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), // + mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject(), + // systemProperty("osgi.bundles.defaultStartLevel").value("4"), systemPackages("sun.nio.ch"), diff --git a/opendaylight/md-sal/sal-binding-util/pom.xml b/opendaylight/md-sal/sal-binding-util/pom.xml index 4842d8cf28..229c54f557 100644 --- a/opendaylight/md-sal/sal-binding-util/pom.xml +++ b/opendaylight/md-sal/sal-binding-util/pom.xml @@ -1,27 +1,28 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-binding-util - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-binding-util + bundle - - - com.google.guava - guava - - - org.opendaylight.controller - sal-binding-api - - + + + com.google.guava + guava + + + org.opendaylight.controller + sal-binding-api + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-common-api/pom.xml b/opendaylight/md-sal/sal-common-api/pom.xml index 8798897a1d..3449c5488e 100644 --- a/opendaylight/md-sal/sal-common-api/pom.xml +++ b/opendaylight/md-sal/sal-common-api/pom.xml @@ -1,34 +1,34 @@ - - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - + + + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + - sal-common-api - bundle + sal-common-api + bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + + + com.google.guava + guava + + + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-common + + - - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools - concepts - - - com.google.guava - guava - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-common-impl/pom.xml b/opendaylight/md-sal/sal-common-impl/pom.xml index 03b7020a1c..9fd9bc8042 100644 --- a/opendaylight/md-sal/sal-common-impl/pom.xml +++ b/opendaylight/md-sal/sal-common-impl/pom.xml @@ -1,75 +1,74 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-common-impl - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-common-impl + bundle - - - org.opendaylight.controller - sal-common-api - - - org.opendaylight.controller - sal-common-util - - - com.google.guava - guava - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.yangtools - yang-model-api - - - junit - junit - test - - - org.mockito - mockito-all - test - - + + + com.google.guava + guava + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + sal-common-api + + + org.opendaylight.controller + sal-common-util + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-model-api + + + junit + junit + test + + + org.mockito + mockito-all + test + + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.md.sal.common.impl, - org.opendaylight.controller.md.sal.common.impl.* - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.md.sal.common.impl, + org.opendaylight.controller.md.sal.common.impl.* + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-common-util/pom.xml b/opendaylight/md-sal/sal-common-util/pom.xml index d3514ecc69..9108f8603b 100644 --- a/opendaylight/md-sal/sal-common-util/pom.xml +++ b/opendaylight/md-sal/sal-common-util/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,22 +7,10 @@ 1.1-SNAPSHOT sal-common-util - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + + bundle - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools - concepts - com.google.guava guava @@ -30,8 +19,20 @@ org.opendaylight.controller sal-common-api - - + + org.opendaylight.yangtools + concepts + + + org.opendaylight.yangtools + yang-common + - bundle + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-common/pom.xml b/opendaylight/md-sal/sal-common/pom.xml index cb7f70a16b..f200b5551f 100644 --- a/opendaylight/md-sal/sal-common/pom.xml +++ b/opendaylight/md-sal/sal-common/pom.xml @@ -1,20 +1,20 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-common - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-common - - + bundle - bundle + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-connector-api/pom.xml b/opendaylight/md-sal/sal-connector-api/pom.xml index 14733bc6b5..4e7d82dad3 100644 --- a/opendaylight/md-sal/sal-connector-api/pom.xml +++ b/opendaylight/md-sal/sal-connector-api/pom.xml @@ -1,36 +1,37 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-connector-api - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-connector-api - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.yangtools - yang-data-api - - - org.opendaylight.yangtools - yang-model-api - - - org.opendaylight.yangtools - yang-binding - - + bundle - bundle + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-model-api + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-dom-api/pom.xml b/opendaylight/md-sal/sal-dom-api/pom.xml index 181fc5c0c5..ab392a06f8 100644 --- a/opendaylight/md-sal/sal-dom-api/pom.xml +++ b/opendaylight/md-sal/sal-dom-api/pom.xml @@ -1,111 +1,87 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-core-api - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-core-api + bundle + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + sal-common + + + org.opendaylight.controller + sal-common-api + + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-model-api + + + org.osgi + org.osgi.core + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - - - - org.opendaylight.controller - sal-common - - - org.opendaylight.controller - config-api - - - org.opendaylight.yangtools - yang-data-api - - - org.opendaylight.controller - sal-common-api - - - org.opendaylight.yangtools - yang-model-api - - - org.osgi - org.osgi.core - - - bundle diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RoutedRpcDefaultImplementation.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RoutedRpcDefaultImplementation.java index c8eb7fd56f..4f11ba0661 100644 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RoutedRpcDefaultImplementation.java +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RoutedRpcDefaultImplementation.java @@ -1,3 +1,10 @@ +/* + * 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.core.api; import org.opendaylight.yangtools.yang.common.QName; @@ -5,8 +12,10 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import com.google.common.util.concurrent.ListenableFuture; + public interface RoutedRpcDefaultImplementation { - public RpcResult invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input); + ListenableFuture> invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input); } diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RpcImplementation.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RpcImplementation.java index 6b1030a815..38b33d5d2a 100644 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RpcImplementation.java +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RpcImplementation.java @@ -15,6 +15,8 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; +import com.google.common.util.concurrent.ListenableFuture; + /** * {@link Provider}'s implementation of an RPC. * @@ -42,8 +44,6 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode; * {@link RpcResult} *

  • {@link Broker} returns the {@link RpcResult} to {@link Consumer} * - * - * */ public interface RpcImplementation extends Provider.ProviderFunctionality { @@ -59,13 +59,12 @@ public interface RpcImplementation extends Provider.ProviderFunctionality { Set getSupportedRpcs(); /** - * Invokes a implementation of specified rpc. - * + * Invokes a implementation of specified RPC asynchronously. * * @param rpc - * Rpc to be invoked + * RPC to be invoked * @param input - * Input data for rpc. + * Input data for the RPC. * * @throws IllegalArgumentException *
      @@ -73,9 +72,9 @@ public interface RpcImplementation extends Provider.ProviderFunctionality { *
    • If input is not null and * false == rpc.equals(input.getNodeType) *
    - * @return RpcResult containing the output of rpc if was executed - * successfully, the list of errors otherwise. + * @return Future promising an RpcResult containing the output of + * the RPC if was executed successfully, the list of errors + * otherwise. */ - RpcResult invokeRpc(QName rpc, CompositeNode input); - + ListenableFuture> invokeRpc(QName rpc, CompositeNode input); } diff --git a/opendaylight/md-sal/sal-dom-broker/pom.xml b/opendaylight/md-sal/sal-dom-broker/pom.xml index 360988fbb2..162b66bda1 100644 --- a/opendaylight/md-sal/sal-dom-broker/pom.xml +++ b/opendaylight/md-sal/sal-dom-broker/pom.xml @@ -1,142 +1,80 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-broker-impl - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-broker-impl + bundle - + + + com.google.guava + guava + + + junit + junit + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + sal-common-impl + + + org.opendaylight.controller + sal-common-util + - junit - junit + org.opendaylight.controller + sal-core-api - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-common-impl - - - org.opendaylight.controller - sal-core-spi - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - com.google.guava - guava - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.controller - config-api - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.yangtools - yang-parser-impl - - + + org.opendaylight.controller + sal-core-spi + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-parser-impl + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-simple + ${slf4j.version} + test + + + + + - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - org.opendaylight.controller.sal.dom.broker.osgi.SchemaServiceActivator - - org.opendaylight.controller.sal.dom.broker.spi - - - org.opendaylight.controller.sal.dom.broker, + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.controller.sal.dom.broker.osgi.SchemaServiceActivator + org.opendaylight.controller.sal.dom.broker.spi + org.opendaylight.controller.sal.dom.broker, org.opendaylight.controller.sal.dom.broker.impl, org.opendaylight.controller.sal.dom.broker.impl.*, org.opendaylight.controller.sal.dom.broker.osgi, @@ -148,18 +86,53 @@ org.opendaylight.controller.md.sal.dom.store.impl, org.opendaylight.controller.md.sal.dom.store.impl.*, org.opendaylight.yangtools.yang.util, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.* - - - * - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.* + * + + + + + org.eclipse.xtend + xtend-maven-plugin + + + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java index 696c10eb19..ad0de54bc0 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java @@ -1,11 +1,9 @@ -/** - * Generated file - - * Generated from: yang module name: opendaylight-sal-dom-broker-impl yang module local name: dom-inmemory-data-broker - * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - * Generated at: Fri Mar 28 17:32:48 CET 2014 +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * - * Do not modify this file unless it is present under src/main directory + * 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.config.yang.md.sal.dom.impl; @@ -57,7 +55,7 @@ public final class DomInmemoryDataBrokerModule extends . builder().put(LogicalDatastoreType.OPERATIONAL, operStore) .put(LogicalDatastoreType.CONFIGURATION, configStore).build(); - DOMDataBrokerImpl newDataBroker = new DOMDataBrokerImpl(datastores, MoreExecutors.sameThreadExecutor()); + DOMDataBrokerImpl newDataBroker = new DOMDataBrokerImpl(datastores, MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor())); getBundleContext().registerService(DOMDataBroker.class, newDataBroker, new Hashtable()); diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModuleFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModuleFactory.java index 92d159cec6..91d42c48c1 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModuleFactory.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModuleFactory.java @@ -1,12 +1,10 @@ -/** -* Generated file - -* Generated from: yang module name: opendaylight-sal-dom-broker-impl yang module local name: dom-inmemory-data-broker -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Fri Mar 28 17:32:48 CET 2014 -* -* Do not modify this file unless it is present under src/main directory -*/ +/* + * 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.config.yang.md.sal.dom.impl; import org.opendaylight.controller.config.api.DependencyResolver; diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java index befeaf4e1e..520bd1ba1d 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java @@ -1,3 +1,10 @@ +/* + * 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.md.sal.dom.store.impl; import static org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.builder; diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend index 64de8683d1..0ed14c1027 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend @@ -7,13 +7,11 @@ */ package org.opendaylight.controller.sal.dom.broker; +import com.google.common.util.concurrent.ListenableFuture import java.util.Collections import java.util.HashSet import java.util.Set -import java.util.concurrent.Callable -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.Future +import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener import org.opendaylight.controller.sal.core.api.Broker import org.opendaylight.controller.sal.core.api.Consumer import org.opendaylight.controller.sal.core.api.Provider @@ -26,7 +24,6 @@ import org.opendaylight.controller.sal.dom.broker.spi.RpcRouter import org.opendaylight.controller.sal.core.api.RpcRegistrationListener import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry import org.opendaylight.controller.sal.core.api.RpcImplementation -import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener import org.opendaylight.controller.sal.core.api.RpcRoutingContext import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier import org.opendaylight.controller.sal.core.api.RoutedRpcDefaultImplementation @@ -39,12 +36,9 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { private val Set providerSessions = Collections.synchronizedSet( new HashSet()); - // Implementation specific - @Property - private var ExecutorService executor = Executors.newFixedThreadPool(5); @Property private var BundleContext bundleContext; - + @Property private var AutoCloseable deactivator; @@ -69,9 +63,8 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { return session; } - protected def Future> invokeRpcAsync(QName rpc, CompositeNode input) { - val result = executor.submit([|router.invokeRpc(rpc, input)] as Callable>); - return result; + protected def ListenableFuture> invokeRpcAsync(QName rpc, CompositeNode input) { + return router.invokeRpc(rpc, input); } // Validation @@ -111,15 +104,15 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { sessions.remove(consumerContextImpl); providerSessions.remove(consumerContextImpl); } - + override close() throws Exception { deactivator?.close(); } - + override addRpcImplementation(QName rpcType, RpcImplementation implementation) throws IllegalArgumentException { router.addRpcImplementation(rpcType,implementation); } - + override addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) { router.addRoutedRpcImplementation(rpcType,implementation); } @@ -131,17 +124,17 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { override addRpcRegistrationListener(RpcRegistrationListener listener) { return router.addRpcRegistrationListener(listener); } - + override > registerRouteChangeListener(L listener) { return router.registerRouteChangeListener(listener); } - override invokeRpc(QName rpc,CompositeNode input){ - return router.invokeRpc(rpc,input) - } - override getSupportedRpcs() { return router.getSupportedRpcs(); } - + + override invokeRpc(QName rpc, CompositeNode input) { + return router.invokeRpc(rpc,input) + } + } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java index f9f977e3c2..263f0500fd 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java @@ -123,9 +123,8 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv return rpcs.getSupportedRpcs(); } - @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { return rpcs.invokeRpc(rpc, input); } @@ -134,7 +133,6 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv return rpcs.addRpcRegistrationListener(listener); } - @Override public ListenableFuture> rpc(QName type, CompositeNode input) { return null; @@ -228,6 +226,4 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv L listener) { return rpcs.registerRouteChangeListener(listener); } - - } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java index 598361c3ae..3e7b115f11 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java @@ -46,6 +46,7 @@ import com.google.common.base.Optional; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.common.util.concurrent.ListenableFuture; public class SchemaAwareRpcBroker implements RpcRouter, Identifiable, RoutedRpcDefaultImplementation { @@ -85,16 +86,16 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable, Ro this.schemaProvider = schemaProvider; } - public RoutedRpcDefaultImplementation getRoutedRpcDefaultDelegate() { - return defaultDelegate; - } + public RoutedRpcDefaultImplementation getRoutedRpcDefaultDelegate() { + return defaultDelegate; + } @Override - public void setRoutedRpcDefaultDelegate(RoutedRpcDefaultImplementation defaultDelegate) { - this.defaultDelegate = defaultDelegate; - } + public void setRoutedRpcDefaultDelegate(RoutedRpcDefaultImplementation defaultDelegate) { + this.defaultDelegate = defaultDelegate; + } - @Override + @Override public RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) { checkArgument(rpcType != null, "RPC Type should not be null"); checkArgument(implementation != null, "RPC Implementatoin should not be null"); @@ -163,7 +164,7 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable, Ro } @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { return findRpcImplemention(rpc).invokeRpc(rpc, input); } @@ -235,7 +236,7 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable, Ro } @Override - public RpcResult invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { checkState(defaultDelegate != null); return defaultDelegate.invokeRpc(rpc, identifier, input); } @@ -319,7 +320,7 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable, Ro } @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { CompositeNode inputContainer = input.getFirstCompositeByName(QName.create(rpc,"input")); checkArgument(inputContainer != null, "Rpc payload must contain input element"); SimpleNode routeContainer = inputContainer.getFirstSimpleByName(strategy.getLeaf()); diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java index 40842c004a..6e44cba494 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java @@ -8,6 +8,8 @@ package org.opendaylight.controller.sal.dom.broker.osgi; +import java.util.Set; + import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; import org.opendaylight.controller.sal.core.api.*; import org.opendaylight.yangtools.concepts.ListenerRegistration; @@ -17,7 +19,7 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.osgi.framework.ServiceReference; -import java.util.Set; +import com.google.common.util.concurrent.ListenableFuture; public class RpcProvisionRegistryProxy extends AbstractBrokerServiceProxy implements RpcProvisionRegistry { @@ -41,24 +43,23 @@ public class RpcProvisionRegistryProxy extends AbstractBrokerServiceProxy> ListenerRegistration registerRouteChangeListener(L listener) { return getDelegate().registerRouteChangeListener(listener); } + @Override + public Set getSupportedRpcs() { + return getDelegate().getSupportedRpcs(); + } - @Override - public Set getSupportedRpcs() { - return getDelegate().getSupportedRpcs(); - } - - @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { - return getDelegate().invokeRpc(rpc,input); - } + @Override + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { + return getDelegate().invokeRpc(rpc, input); + } } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RoutedRpcProcessor.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RoutedRpcProcessor.java index 02419ff529..2976c76ffa 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RoutedRpcProcessor.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RoutedRpcProcessor.java @@ -8,27 +8,20 @@ package org.opendaylight.controller.sal.dom.broker.spi; import java.util.Map; -import java.util.Set; import org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration; import org.opendaylight.controller.sal.core.api.RpcImplementation; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; public interface RoutedRpcProcessor extends RpcImplementation { - public RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation); + RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation); - public Set getSupportedRpcs(); - - public QName getRpcType(); - - public RpcResult invokeRpc(QName rpc, CompositeNode input); + QName getRpcType(); Map getRoutes(); - + RpcImplementation getDefaultRoute(); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java index d1523a01d6..b19dac5535 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java @@ -14,8 +14,6 @@ import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration; import org.opendaylight.controller.sal.core.api.RpcImplementation; import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.data.api.CompositeNode; public interface RpcRouter extends RpcProvisionRegistry, RpcImplementation { @@ -28,7 +26,4 @@ public interface RpcRouter extends RpcProvisionRegistry, RpcImplementation { @Override public Set getSupportedRpcs(); - - @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input); } diff --git a/opendaylight/md-sal/sal-dom-spi/pom.xml b/opendaylight/md-sal/sal-dom-spi/pom.xml index e007ee7429..660a67923f 100644 --- a/opendaylight/md-sal/sal-dom-spi/pom.xml +++ b/opendaylight/md-sal/sal-dom-spi/pom.xml @@ -1,23 +1,24 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-core-spi - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-core-spi + bundle - - - org.opendaylight.controller - sal-core-api - - - bundle + + + org.opendaylight.controller + sal-core-api + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-netconf-connector/pom.xml b/opendaylight/md-sal/sal-netconf-connector/pom.xml index ae819b0f78..9b701203ce 100644 --- a/opendaylight/md-sal/sal-netconf-connector/pom.xml +++ b/opendaylight/md-sal/sal-netconf-connector/pom.xml @@ -1,244 +1,222 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + - sal-netconf-connector - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + sal-netconf-connector - - - ${project.groupId} - sal-connector-api - - - ${project.groupId} - sal-common-util - 1.1-SNAPSHOT - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.opendaylight.controller - netty-threadgroup-config - - - org.opendaylight.controller - netconf-client - ${netconf.version} - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.yangtools - yang-parser-impl - - - org.opendaylight.controller - sal-broker-impl - test - jar - - - junit - junit - test - - - ${project.groupId} - yang-test - ${netconf.version} - test - - - ${project.groupId} - config-api - ${netconf.version} - provided - - - ${project.groupId} - config-util - ${netconf.version} - test - - - ${project.groupId} - netconf-client - ${netconf.version} - - - ${project.groupId} - config-netconf-connector - test - ${netconf.version} - - - ${project.groupId} - config-manager - test - ${netconf.version} - - - ${project.groupId} - config-persister-impl - test - ${netconf.version} - - - ${project.groupId} - config-manager - test - test-jar - ${netconf.version} - - - ${project.groupId} - netconf-impl - test - ${netconf.version} - - - ${project.groupId} - netconf-mapping-api - test - ${netconf.version} - - - ${project.groupId} - netconf-util - test - test-jar - ${netconf.version} - - - org.opendaylight.controller - logback-config - test - - - org.mockito - mockito-all - test - - - org.slf4j - slf4j-api - - - org.opendaylight.controller - sal-binding-broker-impl - test - - - org.opendaylight.controller - sal-binding-broker-impl - test-jar - test - - - org.opendaylight.controller - ietf-netconf-monitoring - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.controller - threadpool-config-api - - - org.opendaylight.controller - netty-config-api - - + bundle - bundle + + + ${project.groupId} + netconf-client + ${netconf.version} + + + ${project.groupId} + sal-common-util + 1.1-SNAPSHOT + + + ${project.groupId} + sal-connector-api + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + ietf-netconf-monitoring + + + org.opendaylight.controller + netconf-client + ${netconf.version} + + + org.opendaylight.controller + netty-config-api + + + org.opendaylight.controller + netty-threadgroup-config + + + org.opendaylight.controller + threadpool-config-api + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-parser-impl + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.slf4j + slf4j-api + + + ${project.groupId} + config-api + ${netconf.version} + provided + + + ${project.groupId} + config-manager + ${netconf.version} + test + + + ${project.groupId} + config-manager + ${netconf.version} + test-jar + test + + + ${project.groupId} + config-netconf-connector + ${netconf.version} + test + + + ${project.groupId} + config-persister-impl + ${netconf.version} + test + + + ${project.groupId} + config-util + ${netconf.version} + test + + + ${project.groupId} + netconf-impl + ${netconf.version} + test + + + ${project.groupId} + netconf-mapping-api + ${netconf.version} + test + + + ${project.groupId} + netconf-util + ${netconf.version} + test-jar + test + + + ${project.groupId} + yang-test + ${netconf.version} + test + + + junit + junit + test + + + org.mockito + mockito-all + test + + + org.opendaylight.controller + logback-config + test + + + org.opendaylight.controller + sal-binding-broker-impl + test + + + org.opendaylight.controller + sal-binding-broker-impl + test-jar + test + + + org.opendaylight.controller + sal-broker-impl + jar + test + + - - - - org.apache.felix - maven-bundle-plugin - - - - * - - - - + + + + org.apache.felix + maven-bundle-plugin + + + * + + + - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - + + org.eclipse.xtend + xtend-maven-plugin + - - org.eclipse.xtend - xtend-maven-plugin - - - + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/InventoryUtils.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/InventoryUtils.java index 5c6702ae64..e6dc59cc10 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/InventoryUtils.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/InventoryUtils.java @@ -14,9 +14,11 @@ import java.util.Date; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class InventoryUtils { - + private static final Logger LOG = LoggerFactory.getLogger(InventoryUtils.class); private static final URI INVENTORY_NAMESPACE = URI.create("urn:opendaylight:inventory"); private static final URI NETCONF_INVENTORY_NAMESPACE = URI.create("urn:opendaylight:netconf-node-inventory"); private static final Date INVENTORY_REVISION = dateFromString("2013-08-19"); @@ -33,18 +35,23 @@ public class InventoryUtils { .toInstance(); public static final QName NETCONF_INVENTORY_MOUNT = null; + private InventoryUtils() { + throw new UnsupportedOperationException("Utility class cannot be instantiated"); + } + /** * Converts date in string format yyyy-MM-dd to java.util.Date. - * + * * @return java.util.Date conformant to string formatted date yyyy-MM-dd. */ private static Date dateFromString(final String date) { + // We do not reuse the formatter because it's not thread-safe SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try { return formatter.parse(date); } catch (ParseException e) { - e.printStackTrace(); + LOG.error("Failed to parse date {}", date, e); + return null; } - return null; } } diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.xtend b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.xtend index 4ae84c7d31..12e8b5587c 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.xtend +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.xtend @@ -13,19 +13,18 @@ import io.netty.util.concurrent.EventExecutor import java.io.InputStream import java.net.InetSocketAddress import java.net.URI +import java.util.ArrayList +import java.util.Collection import java.util.Collections import java.util.List import java.util.Set import java.util.concurrent.ExecutorService -import java.util.concurrent.Future import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler import org.opendaylight.controller.md.sal.common.api.data.DataModification import org.opendaylight.controller.md.sal.common.api.data.DataReader -import org.opendaylight.controller.netconf.api.NetconfMessage -import org.opendaylight.controller.netconf.client.NetconfClient import org.opendaylight.controller.netconf.client.NetconfClientDispatcher -import org.opendaylight.controller.netconf.util.xml.XmlUtil import org.opendaylight.controller.sal.core.api.Broker.ProviderSession +import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration import org.opendaylight.controller.sal.core.api.Provider import org.opendaylight.controller.sal.core.api.RpcImplementation import org.opendaylight.controller.sal.core.api.data.DataBrokerService @@ -45,7 +44,6 @@ import org.opendaylight.yangtools.yang.data.impl.SimpleNodeTOImpl import org.opendaylight.yangtools.yang.model.api.SchemaContext import org.opendaylight.yangtools.yang.model.util.repo.AbstractCachingSchemaSourceProvider import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider -import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProviders import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl import org.opendaylight.yangtools.yang.parser.impl.util.YangSourceContext import org.slf4j.Logger @@ -56,14 +54,12 @@ import static org.opendaylight.controller.sal.connect.netconf.InventoryUtils.* import static extension org.opendaylight.controller.sal.connect.netconf.NetconfMapping.* -class NetconfDevice implements Provider, // +class NetconfDevice implements Provider, // DataReader, // DataCommitHandler, // RpcImplementation, // AutoCloseable { - var NetconfClient client; - @Property var InetSocketAddress socketAddress; @@ -93,15 +89,12 @@ AutoCloseable { Registration> operReaderReg Registration> confReaderReg Registration> commitHandlerReg + List rpcReg + @Property val String name - MountProvisionService mountService - int messegeRetryCount = 5; - - int messageTimeoutCount = 5 * 1000; - - Set cachedCapabilities + MountProvisionService mountService @Property var NetconfClientDispatcher dispatcher @@ -110,11 +103,13 @@ AutoCloseable { @Property var SchemaSourceProvider remoteSourceProvider - + DataBrokerService dataBroker + var NetconfDeviceListener listener; + public new(String name) { - this.name = name; + this._name = name; this.logger = LoggerFactory.getLogger(NetconfDevice.name + "#" + name); this.path = InstanceIdentifier.builder(INVENTORY_PATH).nodeWithKey(INVENTORY_NODE, Collections.singletonMap(INVENTORY_ID, name)).toInstance; @@ -125,10 +120,11 @@ AutoCloseable { checkState(schemaSourceProvider != null, "Schema Source Provider must be set.") checkState(eventExecutor != null, "Event executor must be set."); - val listener = new NetconfDeviceListener(this); - val task = startClientTask(dispatcher, listener) - return processingExecutor.submit(task) as Future; + listener = new NetconfDeviceListener(this); + + logger.info("Starting NETCONF Client {} for address {}", name, socketAddress); + dispatcher.createClient(socketAddress, listener, reconnectStrategy); } def Optional getSchemaContext() { @@ -138,59 +134,65 @@ AutoCloseable { return deviceContextProvider.currentContext; } - private def Runnable startClientTask(NetconfClientDispatcher dispatcher, NetconfDeviceListener listener) { - return [ | - try { - logger.info("Starting Netconf Client on: {}", socketAddress); - client = NetconfClient.clientFor(name, socketAddress, reconnectStrategy, dispatcher, listener); - logger.debug("Initial capabilities {}", initialCapabilities); - var SchemaSourceProvider delegate; - if (NetconfRemoteSchemaSourceProvider.isSupportedFor(initialCapabilities)) { - delegate = new NetconfRemoteSchemaSourceProvider(this); - } else if(client.capabilities.contains(NetconfRemoteSchemaSourceProvider.IETF_NETCONF_MONITORING.namespace.toString)) { - delegate = new NetconfRemoteSchemaSourceProvider(this); - } else { - logger.info("Netconf server {} does not support IETF Netconf Monitoring", socketAddress); - delegate = SchemaSourceProviders.noopProvider(); - } - remoteSourceProvider = schemaSourceProvider.createInstanceFor(delegate); - deviceContextProvider = new NetconfDeviceSchemaContextProvider(this, remoteSourceProvider); - deviceContextProvider.createContextFromCapabilities(initialCapabilities); - if (mountInstance != null && schemaContext.isPresent) { - mountInstance.schemaContext = schemaContext.get(); - val operations = schemaContext.get().operations; - for (rpc : operations) { - mountInstance.addRpcImplementation(rpc.QName, this); - } - } - updateDeviceState() - if (mountInstance != null && confReaderReg == null && operReaderReg == null) { - confReaderReg = mountInstance.registerConfigurationReader(ROOT_PATH, this); - operReaderReg = mountInstance.registerOperationalReader(ROOT_PATH, this); - commitHandlerReg = mountInstance.registerCommitHandler(ROOT_PATH, this); - } - } catch (Exception e) { - logger.error("Netconf client NOT started. ", e) + def bringDown() { + if (rpcReg != null) { + for (reg : rpcReg) { + reg.close() } - ] + rpcReg = null + } + confReaderReg?.close() + confReaderReg = null + operReaderReg?.close() + operReaderReg = null + commitHandlerReg?.close() + commitHandlerReg = null + + updateDeviceState(false, Collections.emptySet()) } - private def updateDeviceState() { + def bringUp(SchemaSourceProvider delegate, Set capabilities) { + remoteSourceProvider = schemaSourceProvider.createInstanceFor(delegate); + deviceContextProvider = new NetconfDeviceSchemaContextProvider(this, remoteSourceProvider); + deviceContextProvider.createContextFromCapabilities(capabilities); + if (mountInstance != null && schemaContext.isPresent) { + mountInstance.schemaContext = schemaContext.get(); + } + + updateDeviceState(true, capabilities) + + if (mountInstance != null) { + confReaderReg = mountInstance.registerConfigurationReader(ROOT_PATH, this); + operReaderReg = mountInstance.registerOperationalReader(ROOT_PATH, this); + commitHandlerReg = mountInstance.registerCommitHandler(ROOT_PATH, this); + + val rpcs = new ArrayList(); + for (rpc : mountInstance.schemaContext.operations) { + rpcs.add(mountInstance.addRpcImplementation(rpc.QName, this)); + } + rpcReg = rpcs + } + } + + private def updateDeviceState(boolean up, Set capabilities) { val transaction = dataBroker.beginTransaction val it = ImmutableCompositeNode.builder setQName(INVENTORY_NODE) addLeaf(INVENTORY_ID, name) - addLeaf(INVENTORY_CONNECTED, client.clientSession.up) + addLeaf(INVENTORY_CONNECTED, up) - logger.debug("Client capabilities {}", client.capabilities) - for (capability : client.capabilities) { + logger.debug("Client capabilities {}", capabilities) + for (capability : capabilities) { addLeaf(NETCONF_INVENTORY_INITIAL_CAPABILITY, capability) } logger.debug("Update device state transaction " + transaction.identifier + " putting operational data started.") + transaction.removeOperationalData(path) transaction.putOperationalData(path, it.toInstance) logger.debug("Update device state transaction " + transaction.identifier + " putting operational data ended.") + + // FIXME: this has to be asynchronous val transactionStatus = transaction.commit.get; if (transactionStatus.successful) { @@ -203,13 +205,13 @@ AutoCloseable { override readConfigurationData(InstanceIdentifier path) { val result = invokeRpc(NETCONF_GET_CONFIG_QNAME, - wrap(NETCONF_GET_CONFIG_QNAME, CONFIG_SOURCE_RUNNING, path.toFilterStructure())); + wrap(NETCONF_GET_CONFIG_QNAME, CONFIG_SOURCE_RUNNING, path.toFilterStructure())).get(); val data = result.result.getFirstCompositeByName(NETCONF_DATA_QNAME); return data?.findNode(path) as CompositeNode; } override readOperationalData(InstanceIdentifier path) { - val result = invokeRpc(NETCONF_GET_QNAME, wrap(NETCONF_GET_QNAME, path.toFilterStructure())); + val result = invokeRpc(NETCONF_GET_QNAME, wrap(NETCONF_GET_QNAME, path.toFilterStructure())).get(); val data = result.result.getFirstCompositeByName(NETCONF_DATA_QNAME); return data?.findNode(path) as CompositeNode; } @@ -218,30 +220,8 @@ AutoCloseable { Collections.emptySet; } - def createSubscription(String streamName) { - val it = ImmutableCompositeNode.builder() - QName = NETCONF_CREATE_SUBSCRIPTION_QNAME - addLeaf("stream", streamName); - invokeRpc(QName, toInstance()) - } - override invokeRpc(QName rpc, CompositeNode input) { - try { - val message = rpc.toRpcMessage(input,schemaContext); - val result = sendMessageImpl(message, messegeRetryCount, messageTimeoutCount); - return result.toRpcResult(rpc, schemaContext); - - } catch (Exception e) { - logger.error("Rpc was not processed correctly.", e) - throw e; - } - } - - def NetconfMessage sendMessageImpl(NetconfMessage message, int retryCount, int timeout) { - logger.debug("Send message {}",XmlUtil.toString(message.document)) - val result = client.sendMessage(message, retryCount, timeout); - NetconfMapping.checkValidReply(message, result) - return result; + return listener.sendRequest(rpc.toRpcMessage(input,schemaContext)); } override getProviderFunctionality() { @@ -284,7 +264,7 @@ AutoCloseable { return null; } else if (current instanceof CompositeNode) { val currentComposite = (current as CompositeNode); - + current = currentComposite.getFirstCompositeByName(arg.nodeType); if(current == null) { current = currentComposite.getFirstCompositeByName(arg.nodeType.withoutRevision()); @@ -303,18 +283,13 @@ AutoCloseable { } override requestCommit(DataModification modification) { - val twoPhaseCommit = new NetconfDeviceTwoPhaseCommitTransaction(this, modification); + val twoPhaseCommit = new NetconfDeviceTwoPhaseCommitTransaction(this, modification, true); twoPhaseCommit.prepare() return twoPhaseCommit; } - def getInitialCapabilities() { - val capabilities = client?.capabilities; - if (capabilities == null) { - return null; - } - if (cachedCapabilities == null) { - cachedCapabilities = FluentIterable.from(capabilities).filter[ + def getCapabilities(Collection capabilities) { + return FluentIterable.from(capabilities).filter[ contains("?") && contains("module=") && contains("revision=")].transform [ val parts = split("\\?"); val namespace = parts.get(0); @@ -333,16 +308,11 @@ AutoCloseable { } return QName.create(namespace, revision, moduleName); ].toSet(); - } - return cachedCapabilities; } override close() { - confReaderReg?.close() - operReaderReg?.close() - client?.close() + bringDown() } - } package class NetconfDeviceSchemaContextProvider { diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceListener.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceListener.java index 13cd5dbcf0..d5e1d35d7d 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceListener.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceListener.java @@ -7,48 +7,206 @@ */ package org.opendaylight.controller.sal.connect.netconf; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; + +import java.util.ArrayDeque; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.Queue; +import java.util.Set; + import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.client.AbstractNetconfClientNotifySessionListener; +import org.opendaylight.controller.netconf.api.NetconfTerminationReason; import org.opendaylight.controller.netconf.client.NetconfClientSession; +import org.opendaylight.controller.netconf.client.NetconfClientSessionListener; +import org.opendaylight.controller.netconf.util.xml.XmlElement; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.sal.common.util.Rpcs; import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.RpcError; +import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; +import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider; +import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProviders; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; + +class NetconfDeviceListener implements NetconfClientSessionListener { + private static final class Request { + final UncancellableFuture> future; + final NetconfMessage request; + + private Request(UncancellableFuture> future, NetconfMessage request) { + this.future = future; + this.request = request; + } + } -class NetconfDeviceListener extends AbstractNetconfClientNotifySessionListener { + private static final Logger LOG = LoggerFactory.getLogger(NetconfDeviceListener.class); + private final Queue requests = new ArrayDeque<>(); private final NetconfDevice device; + private NetconfClientSession session; public NetconfDeviceListener(final NetconfDevice device) { this.device = Preconditions.checkNotNull(device); } - /** - * Method intended to customize notification processing. - * - * @param session - * {@see - * NetconfClientSessionListener#onMessage(NetconfClientSession, - * NetconfMessage)} - * @param message - * {@see - * NetconfClientSessionListener#onMessage(NetconfClientSession, - * NetconfMessage)} - */ @Override - public void onNotification(final NetconfClientSession session, final NetconfMessage message) { - this.device.logger.debug("Received NETCONF notification.", message); - CompositeNode domNotification = null; - if (message != null) { - domNotification = NetconfMapping.toNotificationNode(message, device.getSchemaContext()); - } - if (domNotification != null) { - MountProvisionInstance _mountInstance = null; - if (this.device != null) { - _mountInstance = this.device.getMountInstance(); + public synchronized void onSessionUp(final NetconfClientSession session) { + LOG.debug("Session with {} established as address {} session-id {}", + device.getName(), device.getSocketAddress(), session.getSessionId()); + + final Set caps = device.getCapabilities(session.getServerCapabilities()); + LOG.trace("Server {} advertized capabilities {}", device.getName(), caps); + + // Select the appropriate provider + final SchemaSourceProvider delegate; + if (NetconfRemoteSchemaSourceProvider.isSupportedFor(caps)) { + delegate = new NetconfRemoteSchemaSourceProvider(device); + } else if(caps.contains(NetconfRemoteSchemaSourceProvider.IETF_NETCONF_MONITORING.getNamespace().toString())) { + delegate = new NetconfRemoteSchemaSourceProvider(device); + } else { + LOG.info("Netconf server {} does not support IETF Netconf Monitoring", device.getName()); + delegate = SchemaSourceProviders.noopProvider(); + } + + device.bringUp(delegate, caps); + + this.session = session; + } + + private synchronized void tearDown(final Exception e) { + session = null; + + /* + * Walk all requests, check if they have been executing + * or cancelled and remove them from the queue. + */ + final Iterator it = requests.iterator(); + while (it.hasNext()) { + final Request r = it.next(); + if (r.future.isUncancellable()) { + // FIXME: add a RpcResult instead? + r.future.setException(e); + it.remove(); + } else if (r.future.isCancelled()) { + // This just does some house-cleaning + it.remove(); } - if (_mountInstance != null) { - _mountInstance.publish(domNotification); + } + + device.bringDown(); + } + + @Override + public void onSessionDown(final NetconfClientSession session, final Exception e) { + LOG.debug("Session with {} went down", device.getName(), e); + tearDown(e); + } + + @Override + public void onSessionTerminated(final NetconfClientSession session, final NetconfTerminationReason reason) { + LOG.debug("Session with {} terminated {}", session, reason); + tearDown(new RuntimeException(reason.getErrorMessage())); + } + + @Override + public void onMessage(final NetconfClientSession session, final NetconfMessage message) { + /* + * Dispatch between notifications and messages. Messages need to be processed + * with lock held, notifications do not. + */ + if (isNotification(message)) { + processNotification(message); + } else { + processMessage(message); + } + } + + private synchronized void processMessage(final NetconfMessage message) { + final Request r = requests.peek(); + if (r.future.isUncancellable()) { + requests.poll(); + LOG.debug("Matched {} to {}", r.request, message); + + // FIXME: this can throw exceptions, which should result + // in the future failing + NetconfMapping.checkValidReply(r.request, message); + r.future.set(Rpcs.getRpcResult(true, NetconfMapping.toNotificationNode(message, device.getSchemaContext()), + Collections.emptyList())); + } else { + LOG.warn("Ignoring unsolicited message", message); + } + } + + synchronized ListenableFuture> sendRequest(final NetconfMessage message) { + if (session == null) { + LOG.debug("Session to {} is disconnected, failing RPC request {}", device.getName(), message); + return Futures.>immediateFuture(new RpcResult() { + @Override + public boolean isSuccessful() { + return false; + } + + @Override + public CompositeNode getResult() { + return null; + } + + @Override + public Collection getErrors() { + // FIXME: indicate that the session is down + return Collections.emptySet(); + } + }); + } + + final Request req = new Request(new UncancellableFuture>(true), message); + requests.add(req); + + session.sendMessage(req.request).addListener(new FutureListener() { + @Override + public void operationComplete(final Future future) throws Exception { + if (!future.isSuccess()) { + // We expect that a session down will occur at this point + LOG.debug("Failed to send request {}", req.request, future.cause()); + req.future.setException(future.cause()); + } else { + LOG.trace("Finished sending request {}", req.request); + } } + }); + + return req.future; + } + + /** + * Process an incoming notification. + * + * @param notification Notification message + */ + private void processNotification(final NetconfMessage notification) { + this.device.logger.debug("Received NETCONF notification.", notification); + CompositeNode domNotification = NetconfMapping.toNotificationNode(notification, device.getSchemaContext()); + if (domNotification == null) { + return; + } + + MountProvisionInstance mountInstance = this.device.getMountInstance(); + if (mountInstance != null) { + mountInstance.publish(domNotification); } } + + private static boolean isNotification(final NetconfMessage message) { + final XmlElement xmle = XmlElement.fromDomDocument(message.getDocument()); + return XmlNetconfConstants.NOTIFICATION_ELEMENT_NAME.equals(xmle.getName()) ; + } } diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java index c5390e5409..5f14c264ed 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java @@ -15,14 +15,17 @@ import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NET import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_RUNNING_QNAME; import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_TARGET_QNAME; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ExecutionException; import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction; import org.opendaylight.controller.md.sal.common.api.data.DataModification; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; @@ -31,51 +34,52 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode; import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransaction { - - private final NetconfDevice device; +class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransaction { + private static final Logger LOG = LoggerFactory.getLogger(NetconfDeviceTwoPhaseCommitTransaction.class); private final DataModification modification; - private final boolean candidateSupported = true; + private final NetconfDevice device; + private final boolean candidateSupported; public NetconfDeviceTwoPhaseCommitTransaction(NetconfDevice device, - DataModification modification) { - super(); - this.device = device; - this.modification = modification; + DataModification modification, + boolean candidateSupported) { + this.device = Preconditions.checkNotNull(device); + this.modification = Preconditions.checkNotNull(modification); + this.candidateSupported = candidateSupported; } - public void prepare() { + void prepare() throws InterruptedException, ExecutionException { for (InstanceIdentifier toRemove : modification.getRemovedConfigurationData()) { sendDelete(toRemove); } for(Entry toUpdate : modification.getUpdatedConfigurationData().entrySet()) { sendMerge(toUpdate.getKey(),toUpdate.getValue()); } - } - private void sendMerge(InstanceIdentifier key, CompositeNode value) { + private void sendMerge(InstanceIdentifier key, CompositeNode value) throws InterruptedException, ExecutionException { sendEditRpc(createEditStructure(key, Optional.absent(), Optional.of(value))); } - private void sendDelete(InstanceIdentifier toDelete) { + private void sendDelete(InstanceIdentifier toDelete) throws InterruptedException, ExecutionException { sendEditRpc(createEditStructure(toDelete, Optional.of("delete"), Optional. absent())); } - private void sendEditRpc(CompositeNode editStructure) { + private void sendEditRpc(CompositeNode editStructure) throws InterruptedException, ExecutionException { CompositeNodeBuilder builder = configurationRpcBuilder(); builder.setQName(NETCONF_EDIT_CONFIG_QNAME); builder.add(editStructure); - RpcResult rpcResult = device.invokeRpc(NETCONF_EDIT_CONFIG_QNAME, builder.toInstance()); + RpcResult rpcResult = device.invokeRpc(NETCONF_EDIT_CONFIG_QNAME, builder.toInstance()).get(); Preconditions.checkState(rpcResult.isSuccessful(),"Rpc Result was unsuccessful"); - } private CompositeNodeBuilder configurationRpcBuilder() { @@ -135,8 +139,45 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac public RpcResult finish() { CompositeNodeBuilder commitInput = ImmutableCompositeNode.builder(); commitInput.setQName(NETCONF_COMMIT_QNAME); - RpcResult rpcResult = device.invokeRpc(NetconfMapping.NETCONF_COMMIT_QNAME, commitInput.toInstance()); - return (RpcResult) rpcResult; + try { + final RpcResult rpcResult = device.invokeRpc(NetconfMapping.NETCONF_COMMIT_QNAME, commitInput.toInstance()).get(); + return new RpcResult() { + + @Override + public boolean isSuccessful() { + return rpcResult.isSuccessful(); + } + + @Override + public Void getResult() { + return null; + } + + @Override + public Collection getErrors() { + return rpcResult.getErrors(); + } + }; + } catch (final InterruptedException | ExecutionException e) { + LOG.warn("Failed to finish operation", e); + return new RpcResult() { + @Override + public boolean isSuccessful() { + return false; + } + + @Override + public Void getResult() { + return null; + } + + @Override + public Collection getErrors() { + // FIXME: wrap the exception + return Collections.emptySet(); + } + }; + } } @Override diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfInventoryUtils.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfInventoryUtils.java index bae0f08947..b68f18f52e 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfInventoryUtils.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfInventoryUtils.java @@ -11,18 +11,19 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; public class NetconfInventoryUtils { - - public static final QName NETCONF_MOUNT = null; public static final QName NETCONF_ENDPOINT = null; public static final QName NETCONF_ENDPOINT_ADDRESS = null; public static final QName NETCONF_ENDPOINT_PORT = null; + private NetconfInventoryUtils() { + throw new UnsupportedOperationException("Utility class cannot be instantiated"); + } public static String getEndpointAddress(CompositeNode node) { return node.getCompositesByName(NETCONF_ENDPOINT).get(0).getFirstSimpleByName(NETCONF_ENDPOINT_ADDRESS).getValue().toString(); } - + public static String getEndpointPort(CompositeNode node) { return node.getCompositesByName(NETCONF_ENDPOINT).get(0).getFirstSimpleByName(NETCONF_ENDPOINT_PORT).getValue().toString(); } diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.xtend b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.xtend index e5a24fcf63..228a01eb4c 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.xtend +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.xtend @@ -39,8 +39,8 @@ class NetconfMapping { public static val NETCONF_URI = URI.create("urn:ietf:params:xml:ns:netconf:base:1.0") public static val NETCONF_MONITORING_URI = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring" public static val NETCONF_NOTIFICATION_URI = URI.create("urn:ietf:params:xml:ns:netconf:notification:1.0") - - + + public static val NETCONF_QNAME = QName.create(NETCONF_URI, null, "netconf"); public static val NETCONF_RPC_QNAME = QName.create(NETCONF_QNAME, "rpc"); public static val NETCONF_GET_QNAME = QName.create(NETCONF_QNAME, "get"); @@ -51,15 +51,15 @@ class NetconfMapping { public static val NETCONF_DELETE_CONFIG_QNAME = QName.create(NETCONF_QNAME, "delete-config"); public static val NETCONF_OPERATION_QNAME = QName.create(NETCONF_QNAME, "operation"); public static val NETCONF_COMMIT_QNAME = QName.create(NETCONF_QNAME, "commit"); - + public static val NETCONF_CONFIG_QNAME = QName.create(NETCONF_QNAME, "config"); public static val NETCONF_SOURCE_QNAME = QName.create(NETCONF_QNAME, "source"); public static val NETCONF_TARGET_QNAME = QName.create(NETCONF_QNAME, "target"); - + public static val NETCONF_CANDIDATE_QNAME = QName.create(NETCONF_QNAME, "candidate"); public static val NETCONF_RUNNING_QNAME = QName.create(NETCONF_QNAME, "running"); - - + + public static val NETCONF_RPC_REPLY_QNAME = QName.create(NETCONF_QNAME, "rpc-reply"); public static val NETCONF_OK_QNAME = QName.create(NETCONF_QNAME, "ok"); public static val NETCONF_DATA_QNAME = QName.create(NETCONF_QNAME, "data"); @@ -78,7 +78,7 @@ class NetconfMapping { if(identifier.path.empty) { return null; } - + for (component : identifier.path.reverseView) { val Node current = component.toNode(previous); previous = current; @@ -106,11 +106,11 @@ class NetconfMapping { } static def CompositeNode toCompositeNode(NetconfMessage message,Optional ctx) { - //TODO: implement general normalization to normalize incoming Netconf Message + //TODO: implement general normalization to normalize incoming Netconf Message // for Schema Context counterpart return null } - + static def CompositeNode toNotificationNode(NetconfMessage message,Optional ctx) { if (ctx.present) { val schemaContext = ctx.get @@ -127,56 +127,53 @@ class NetconfMapping { w3cPayload.documentElement.setAttribute("message-id", "m-" + messageId.andIncrement) return new NetconfMessage(w3cPayload); } - + def static flattenInput(CompositeNode node) { val inputQName = QName.create(node.nodeType,"input"); val input = node.getFirstCompositeByName(inputQName); if(input == null) return node; if(input instanceof CompositeNode) { - + val nodes = ImmutableList.builder() // .addAll(input.children) // .addAll(node.children.filter[nodeType != inputQName]) // .build() return ImmutableCompositeNode.create(node.nodeType,nodes); - } - + } + } static def RpcResult toRpcResult(NetconfMessage message,QName rpc,Optional context) { var CompositeNode rawRpc; if(context.present) { if(isDataRetrievalReply(rpc)) { - + val xmlData = message.document.dataSubtree val dataNodes = XmlDocumentUtils.toDomNodes(xmlData, Optional.of(context.get.dataDefinitions)) - + val it = ImmutableCompositeNode.builder() setQName(NETCONF_RPC_REPLY_QNAME) add(ImmutableCompositeNode.create(NETCONF_DATA_QNAME, dataNodes)); - + rawRpc = it.toInstance; //sys(xmlData) } else { val rpcSchema = context.get.operations.findFirst[QName == rpc] rawRpc = message.document.toCompositeNode() as CompositeNode; } - - - } else { rawRpc = message.document.toCompositeNode() as CompositeNode; } //rawRpc. return Rpcs.getRpcResult(true, rawRpc, Collections.emptySet()); } - + def static Element getDataSubtree(Document doc) { doc.getElementsByTagNameNS(NETCONF_URI.toString,"data").item(0) as Element } - + def static boolean isDataRetrievalReply(QName it) { - return NETCONF_URI == namespace && ( localName == NETCONF_GET_CONFIG_QNAME.localName || localName == NETCONF_GET_QNAME.localName) + return NETCONF_URI == namespace && ( localName == NETCONF_GET_CONFIG_QNAME.localName || localName == NETCONF_GET_QNAME.localName) } static def wrap(QName name, Node node) { @@ -209,12 +206,12 @@ class NetconfMapping { public static def Node toCompositeNode(Document document) { return XmlDocumentUtils.toDomNode(document) as Node } - + public static def checkValidReply(NetconfMessage input, NetconfMessage output) { val inputMsgId = input.document.documentElement.getAttribute("message-id") val outputMsgId = output.document.documentElement.getAttribute("message-id") Preconditions.checkState(inputMsgId == outputMsgId,"Rpc request and reply message IDs must be same."); - + } - + } diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java index fa6b6f7ca5..c734e80d9a 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java @@ -7,7 +7,8 @@ */ package org.opendaylight.controller.sal.connect.netconf; -import java.util.Set; +import java.util.Collection; +import java.util.concurrent.ExecutionException; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -18,6 +19,7 @@ import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder; import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider; import com.google.common.base.Optional; +import com.google.common.base.Preconditions; class NetconfRemoteSchemaSourceProvider implements SchemaSourceProvider { @@ -26,11 +28,10 @@ class NetconfRemoteSchemaSourceProvider implements SchemaSourceProvider public static final QName GET_SCHEMA_QNAME = QName.create(IETF_NETCONF_MONITORING, "get-schema"); public static final QName GET_DATA_QNAME = QName.create(IETF_NETCONF_MONITORING, "data"); - NetconfDevice device; + private final NetconfDevice device; public NetconfRemoteSchemaSourceProvider(NetconfDevice device) { - super(); - this.device = device; + this.device = Preconditions.checkNotNull(device); } @Override @@ -44,15 +45,19 @@ class NetconfRemoteSchemaSourceProvider implements SchemaSourceProvider } device.logger.trace("Loading YANG schema source for {}:{}", moduleName, revision); - RpcResult schemaReply = device.invokeRpc(GET_SCHEMA_QNAME, request.toInstance()); - if (schemaReply.isSuccessful()) { - String schemaBody = getSchemaFromRpc(schemaReply.getResult()); - if (schemaBody != null) { - device.logger.trace("YANG Schema successfully retrieved from remote for {}:{}", moduleName, revision); - return Optional.of(schemaBody); + try { + RpcResult schemaReply = device.invokeRpc(GET_SCHEMA_QNAME, request.toInstance()).get(); + if (schemaReply.isSuccessful()) { + String schemaBody = getSchemaFromRpc(schemaReply.getResult()); + if (schemaBody != null) { + device.logger.trace("YANG Schema successfully retrieved from remote for {}:{}", moduleName, revision); + return Optional.of(schemaBody); + } } + device.logger.warn("YANG shcema was not successfully retrieved."); + } catch (InterruptedException | ExecutionException e) { + device.logger.warn("YANG shcema was not successfully retrieved.", e); } - device.logger.warn("YANG shcema was not successfully retrieved."); return Optional.absent(); } @@ -68,7 +73,7 @@ class NetconfRemoteSchemaSourceProvider implements SchemaSourceProvider return null; } - public static final boolean isSupportedFor(Set capabilities) { + public static final boolean isSupportedFor(Collection capabilities) { return capabilities.contains(IETF_NETCONF_MONITORING); } } diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/UncancellableFuture.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/UncancellableFuture.java new file mode 100644 index 0000000000..c353f86eb6 --- /dev/null +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/UncancellableFuture.java @@ -0,0 +1,57 @@ +/* + * 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.connect.netconf; + +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.AbstractFuture; + +final class UncancellableFuture extends AbstractFuture { + @GuardedBy("this") + private boolean uncancellable = false; + + public UncancellableFuture(boolean uncancellable) { + this.uncancellable = uncancellable; + } + + public synchronized boolean setUncancellable() { + if (isCancelled()) { + return false; + } + + uncancellable = true; + return true; + } + + public synchronized boolean isUncancellable() { + return uncancellable; + } + + @Override + public synchronized boolean cancel(boolean mayInterruptIfRunning) { + if (uncancellable) { + return false; + } + + return super.cancel(mayInterruptIfRunning); + } + + @Override + public synchronized boolean set(@Nullable V value) { + Preconditions.checkState(uncancellable == true); + return super.set(value); + } + + @Override + protected boolean setException(Throwable throwable) { + Preconditions.checkState(uncancellable == true); + return super.setException(throwable); + } +} diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/YangModelInputStreamAdapter.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/YangModelInputStreamAdapter.java deleted file mode 100644 index 23892e18bd..0000000000 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/YangModelInputStreamAdapter.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.connect.netconf; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.opendaylight.yangtools.concepts.Delegator; -import org.opendaylight.yangtools.yang.common.QName; - -import com.google.common.base.Charsets; - -/** - * - * - */ -public class YangModelInputStreamAdapter extends InputStream implements Delegator { - - final String source; - final QName moduleIdentifier; - final InputStream delegate; - - private YangModelInputStreamAdapter(String source, QName moduleIdentifier, InputStream delegate) { - super(); - this.source = source; - this.moduleIdentifier = moduleIdentifier; - this.delegate = delegate; - } - - @Override - public int read() throws IOException { - return delegate.read(); - } - - @Override - public int hashCode() { - return delegate.hashCode(); - } - - @Override - public int read(byte[] b) throws IOException { - return delegate.read(b); - } - - @Override - public boolean equals(Object obj) { - return delegate.equals(obj); - } - - @Override - public int read(byte[] b, int off, int len) throws IOException { - return delegate.read(b, off, len); - } - - @Override - public long skip(long n) throws IOException { - return delegate.skip(n); - } - - @Override - public int available() throws IOException { - return delegate.available(); - } - - @Override - public void close() throws IOException { - delegate.close(); - } - - @Override - public void mark(int readlimit) { - delegate.mark(readlimit); - } - - @Override - public void reset() throws IOException { - delegate.reset(); - } - - @Override - public boolean markSupported() { - return delegate.markSupported(); - } - - @Override - public InputStream getDelegate() { - return delegate; - } - - @Override - public String toString() { - return "YangModelInputStreamAdapter [moduleIdentifier=" + moduleIdentifier + ", delegate=" + delegate + "]"; - } - - public static YangModelInputStreamAdapter create(QName name, String module) { - return new YangModelInputStreamAdapter(null, name, new ByteArrayInputStream(module.getBytes(Charsets.UTF_8))); - } -} diff --git a/opendaylight/md-sal/sal-remote/pom.xml b/opendaylight/md-sal/sal-remote/pom.xml index 0c06b4490d..31f1f02693 100644 --- a/opendaylight/md-sal/sal-remote/pom.xml +++ b/opendaylight/md-sal/sal-remote/pom.xml @@ -1,69 +1,66 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-remote - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-remote + bundle + + + org.opendaylight.controller + sal-binding-api + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.yangtools + yang-maven-plugin + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + + + sal-remote + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - - - org.opendaylight.controller - sal-binding-api - - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.yangtools - yang-maven-plugin - - - sal-remote - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/implementation/pom.xml index 0c817d26f6..63b80e9181 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/pom.xml @@ -1,28 +1,25 @@ - - 4.0.0 - - org.opendaylight.controller - sal-parent - ../.. - 1.1-SNAPSHOT - + + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + ../.. + - sal-remoterpc-connector - bundle + sal-remoterpc-connector + bundle - 0.3.1 1.0.1 - 0.2.4-SNAPSHOT + 0.3.1 - ${project.groupId} - sal-core-api + sal-common-util ${project.version} @@ -30,11 +27,40 @@ sal-connector-api ${project.version} + ${project.groupId} - sal-common-util + sal-core-api ${project.version} + + com.fasterxml.jackson.core + jackson-annotations + + + + com.fasterxml.jackson.core + jackson-core + + + + com.fasterxml.jackson.core + jackson-databind + + + com.google.guava + guava + + + + + junit + junit + + + org.mockito + mockito-all + org.opendaylight.controller remoterpc-routingtable.implementation @@ -67,36 +93,13 @@ org.osgi.core - org.zeromq - jeromq - ${zeromq.version} - - - com.google.guava - guava - - - org.slf4j + org.slf4j slf4j-api - ch.qos.logback - logback-classic - test - - - com.fasterxml.jackson.core - jackson-annotations - - - - com.fasterxml.jackson.core - jackson-core - - - - com.fasterxml.jackson.core - jackson-databind + org.zeromq + jeromq + ${zeromq.version} @@ -104,104 +107,70 @@ stax-api ${stax.version} - - - - junit - junit - - org.mockito - mockito-all + ch.qos.logback + logback-classic + test - - - - - org.apache.felix - maven-bundle-plugin - true - - - - *, - !org.codehaus.enunciate.jaxrs - - - org.opendaylight.controller.config.yang.md.sal.remote.rpc, + + + + org.apache.felix + maven-bundle-plugin + true + + + *, + !org.codehaus.enunciate.jaxrs + org.opendaylight.controller.config.yang.md.sal.remote.rpc, org.opendaylight.controller.sal.connector.remoterpc.util, org.opendaylight.controller.sal.connector.remoterpc.dto, org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcClient, org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcServer, - org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcProvider - - ${project.groupId}.${project.artifactId} - - - - + org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcProvider + ${project.groupId}.${project.artifactId} + + + - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - - target/site/models - + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${yang.jmx.plugin} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java index 84df2e43f0..8f95e73b15 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java @@ -7,7 +7,16 @@ package org.opendaylight.controller.sal.connector.remoterpc; -import com.google.common.base.Optional; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; + import org.opendaylight.controller.sal.common.util.RpcErrors; import org.opendaylight.controller.sal.common.util.Rpcs; import org.opendaylight.controller.sal.connector.api.RpcRouter; @@ -27,16 +36,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.zeromq.ZMQ; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.FutureTask; -import java.util.concurrent.TimeUnit; - -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; +import com.google.common.base.Optional; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; /** * An implementation of {@link RpcImplementation} that makes @@ -46,8 +48,8 @@ public class ClientImpl implements RemoteRpcClient { private final Logger _logger = LoggerFactory.getLogger(ClientImpl.class); - private ZMQ.Context context = ZMQ.context(1); - private ClientRequestHandler handler; + private final ZMQ.Context context = ZMQ.context(1); + private final ClientRequestHandler handler; private RoutingTableProvider routingTableProvider; public ClientImpl(){ @@ -64,6 +66,7 @@ public class ClientImpl implements RemoteRpcClient { return routingTableProvider; } + @Override public void setRoutingTableProvider(RoutingTableProvider routingTableProvider) { this.routingTableProvider = routingTableProvider; } @@ -93,7 +96,7 @@ public class ClientImpl implements RemoteRpcClient { * @param input payload for the remote service * @return */ - public RpcResult invokeRpc(QName rpc, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { RouteIdentifierImpl routeId = new RouteIdentifierImpl(); routeId.setType(rpc); @@ -115,7 +118,7 @@ public class ClientImpl implements RemoteRpcClient { * payload * @return */ - public RpcResult invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { RouteIdentifierImpl routeId = new RouteIdentifierImpl(); routeId.setType(rpc); @@ -126,7 +129,7 @@ public class ClientImpl implements RemoteRpcClient { return sendMessage(input, routeId, address); } - private RpcResult sendMessage(CompositeNode input, RouteIdentifierImpl routeId, String address) { + private ListenableFuture> sendMessage(CompositeNode input, RouteIdentifierImpl routeId, String address) { Message request = new Message.MessageBuilder() .type(Message.MessageType.REQUEST) .sender(Context.getInstance().getLocalUri()) @@ -164,11 +167,11 @@ public class ClientImpl implements RemoteRpcClient { } } - return Rpcs.getRpcResult(true, payload, errors); + return Futures.immediateFuture(Rpcs.getRpcResult(true, payload, errors)); } catch (Exception e){ collectErrors(e, errors); - return Rpcs.getRpcResult(false, null, errors); + return Futures.immediateFuture(Rpcs.getRpcResult(false, null, errors)); } } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java index 16e7200247..edcef83574 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java @@ -8,7 +8,14 @@ package org.opendaylight.controller.sal.connector.remoterpc; -import com.google.common.base.Optional; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import org.opendaylight.controller.md.sal.common.api.routing.RouteChange; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; import org.opendaylight.controller.sal.connector.api.RpcRouter; @@ -32,13 +39,8 @@ import org.osgi.util.tracker.ServiceTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.Optional; +import com.google.common.util.concurrent.ListenableFuture; public class RemoteRpcProvider implements RpcImplementation, @@ -46,7 +48,7 @@ public class RemoteRpcProvider implements AutoCloseable, Provider { - private Logger _logger = LoggerFactory.getLogger(RemoteRpcProvider.class); + private final Logger _logger = LoggerFactory.getLogger(RemoteRpcProvider.class); private final ServerImpl server; private final ClientImpl client; @@ -96,12 +98,12 @@ public class RemoteRpcProvider implements } @Override - public RpcResult invokeRpc(QName rpc, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, CompositeNode input) { return client.invokeRpc(rpc, input); } @Override - public RpcResult invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { + public ListenableFuture> invokeRpc(QName rpc, InstanceIdentifier identifier, CompositeNode input) { return client.invokeRpc(rpc, identifier, input); } @@ -289,8 +291,5 @@ public class RemoteRpcProvider implements return routeIdSet; } - - } - } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java index 722ca06879..d256b998d4 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java @@ -254,7 +254,6 @@ public class ServerImpl implements RemoteRpcServer { e = NetworkInterface.getNetworkInterfaces(); } catch (SocketException e1) { _logger.error("Failed to get list of interfaces", e1); - //throw new RuntimeException("Failed to acquire list of interfaces", e1); return null; } while (e.hasMoreElements()) { @@ -265,7 +264,7 @@ public class ServerImpl implements RemoteRpcServer { while (ee.hasMoreElements()) { InetAddress i = (InetAddress) ee.nextElement(); _logger.debug("Trying address {}", i); - if ((i instanceof Inet4Address) && (i.isSiteLocalAddress())) { + if ((i instanceof Inet4Address) && (!i.isLoopbackAddress())) { String hostAddress = i.getHostAddress(); _logger.debug("Settled on host address {}", hostAddress); return hostAddress; diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java index c0aae2dfb5..0fa12e351c 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java @@ -7,29 +7,25 @@ */ package org.opendaylight.controller.sal.connector.remoterpc; -import com.google.common.base.Optional; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; + import junit.framework.Assert; + import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.sal.common.util.Rpcs; import org.opendaylight.controller.sal.connector.api.RpcRouter; -import org.opendaylight.controller.sal.connector.remoterpc.api.RouteChangeListener; import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTable; -import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTableException; -import org.opendaylight.controller.sal.connector.remoterpc.api.SystemException; import org.opendaylight.controller.sal.connector.remoterpc.dto.Message; import org.opendaylight.controller.sal.connector.remoterpc.utils.MessagingUtil; -import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import java.io.IOException; -import java.util.*; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import com.google.common.base.Optional; /** * @@ -88,7 +84,7 @@ public class ClientImplTest { when(mockHandler.handle(any(Message.class))). thenReturn(MessagingUtil.createEmptyMessage()); - RpcResult result = client.invokeRpc(null, null); + RpcResult result = client.invokeRpc(null, null).get(); Assert.assertTrue(result.isSuccessful()); Assert.assertTrue(result.getErrors().isEmpty()); @@ -101,7 +97,7 @@ public class ClientImplTest { when(mockHandler.handle(any(Message.class))). thenThrow(new IOException()); - RpcResult result = client.invokeRpc(null, null); + RpcResult result = client.invokeRpc(null, null).get(); Assert.assertFalse(result.isSuccessful()); Assert.assertFalse(result.getErrors().isEmpty()); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml index ffdcda31eb..4c7e15dbb0 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml @@ -17,8 +17,6 @@ 2.3.0 3.0.0 1.5.0 - 0.2.3-SNAPSHOT - 0.2.3-SNAPSHOT @@ -318,9 +316,8 @@ 0.5.1-SNAPSHOT - org.opendaylight.controller - ietf-netconf-monitoring - ${netconf.version} + org.opendaylight.controller + ietf-netconf-monitoring org.opendaylight.yangtools @@ -440,33 +437,27 @@ org.opendaylight.controller config-netconf-connector - ${netconf.version} test org.opendaylight.controller logback-config - ${config.version} org.opendaylight.controller config-persister-impl - ${config.version} org.opendaylight.controller config-persister-file-xml-adapter - ${config.version} org.opendaylight.controller netconf-impl - ${netconf.version} org.opendaylight.controller netconf-client - ${netconf.version} org.ops4j.pax.exam diff --git a/opendaylight/md-sal/sal-rest-connector/pom.xml b/opendaylight/md-sal/sal-rest-connector/pom.xml index 4aa3824e61..d6ec2fd74d 100644 --- a/opendaylight/md-sal/sal-rest-connector/pom.xml +++ b/opendaylight/md-sal/sal-rest-connector/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,36 +7,33 @@ 1.1-SNAPSHOT sal-rest-connector - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + bundle + + ${project.groupId} + sal-connector-api + ${project.groupId} sal-core-api 1.1-SNAPSHOT - ${project.groupId} - sal-connector-api + com.google.code.gson + gson - org.eclipse.xtend - org.eclipse.xtend.lib + io.netty + netty-codec-http - org.slf4j - slf4j-api + org.eclipse.xtend + org.eclipse.xtend.lib - org.jboss.resteasy - jaxrs-api - 3.0.4.Final - provided + org.opendaylight.controller + sal-remote org.opendaylight.yangtools @@ -45,37 +43,30 @@ org.opendaylight.yangtools yang-model-util - - com.google.code.gson - gson - org.opendaylight.yangtools yang-parser-impl - io.netty - netty-codec-http + org.slf4j + slf4j-api - org.opendaylight.controller - sal-remote - - - - - junit - junit - test + org.jboss.resteasy + jaxrs-api + 3.0.4.Final + provided - org.mockito - mockito-all + ch.qos.logback + logback-classic test + + - ch.qos.logback - logback-classic + junit + junit test @@ -84,14 +75,15 @@ 2.4 test + + org.mockito + mockito-all + test + - - org.eclipse.xtend - xtend-maven-plugin - org.apache.felix maven-bundle-plugin @@ -99,23 +91,28 @@ MD SAL Restconf Connector - - org.opendaylight.controller.sal.rest.*, + org.opendaylight.controller.sal.rest.*, org.opendaylight.controller.sal.restconf.impl, org.eclipse.xtend2.lib, org.eclipse.xtend.lib, - org.eclipse.xtext.xbase.*, - - - *, - com.sun.jersey.spi.container.servlet - + org.eclipse.xtext.xbase.*, + *, + com.sun.jersey.spi.container.servlet org.opendaylight.controller.sal.rest.impl.RestconfProvider /restconf + + org.eclipse.xtend + xtend-maven-plugin + - bundle + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend index 837d7ae5b7..cb02fc89bf 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend @@ -483,7 +483,7 @@ class ControllerContext implements SchemaContextListener { + "\" cannot contain \"null\" value as a key." ) } - keyValues.addKeyValue(listNode.getDataChildByName(key), uriKeyValue); + keyValues.addKeyValue(listNode.getDataChildByName(key), uriKeyValue, mountPoint); i = i + 1; } consumed = consumed + i; @@ -541,13 +541,13 @@ class ControllerContext implements SchemaContextListener { } } - private def void addKeyValue(HashMap map, DataSchemaNode node, String uriValue) { + private def void addKeyValue(HashMap map, DataSchemaNode node, String uriValue, MountInstance mountPoint) { checkNotNull(uriValue); checkArgument(node instanceof LeafSchemaNode); val urlDecoded = URLDecoder.decode(uriValue); val typedef = (node as LeafSchemaNode).type; - var decoded = TypeDefinitionAwareCodec.from(typedef)?.deserialize(urlDecoded) + var decoded = RestCodec.from(typedef, mountPoint)?.deserialize(urlDecoded) var additionalInfo = "" if(decoded === null) { var baseType = RestUtil.resolveBaseTypeFrom(typedef) diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java index 5fd76de98b..f2a0d48e0a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java @@ -1,3 +1,10 @@ +/* + * 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.streams.listeners; import io.netty.channel.Channel; @@ -519,7 +526,7 @@ public class ListenerAdapter implements DataChangeListener { } } - element.setAttribute("xmlns:" + prefix, namespace.toString()); + element.setAttribute("xmlns:" + prefix, namespace); textContent.append(prefix); prefixes.put(namespace, prefix); diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/Notificator.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/Notificator.java index 9c8351aa99..6f154f8aff 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/Notificator.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/Notificator.java @@ -1,3 +1,10 @@ +/* + * 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.streams.listeners; import java.util.Map; @@ -176,4 +183,4 @@ public class Notificator { } } -} \ No newline at end of file +} diff --git a/opendaylight/md-sal/sal-restconf-broker/pom.xml b/opendaylight/md-sal/sal-restconf-broker/pom.xml index c086db7ba4..9e64c3aed6 100644 --- a/opendaylight/md-sal/sal-restconf-broker/pom.xml +++ b/opendaylight/md-sal/sal-restconf-broker/pom.xml @@ -1,71 +1,70 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - sal-restconf-broker - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + sal-restconf-broker + bundle + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-config + + + org.opendaylight.controller + sal-binding-util + + + org.opendaylight.controller + sal-broker-impl + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.controller + sal-remote + + + org.opendaylight.yangtools + restconf-client-api + + + org.opendaylight.yangtools + restconf-client-impl + + + org.slf4j + slf4j-api + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + * + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-binding-util - - - org.opendaylight.controller - sal-remote - - - org.opendaylight.controller - sal-broker-impl - - - org.opendaylight.controller - sal-binding-config - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.yangtools - restconf-client-api - - - org.opendaylight.yangtools - restconf-client-impl - - - org.slf4j - slf4j-api - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - - * - - - - - - diff --git a/opendaylight/md-sal/samples/l2switch/implementation/pom.xml b/opendaylight/md-sal/samples/l2switch/implementation/pom.xml index c095eee6bc..10a9d6ddad 100644 --- a/opendaylight/md-sal/samples/l2switch/implementation/pom.xml +++ b/opendaylight/md-sal/samples/l2switch/implementation/pom.xml @@ -1,64 +1,55 @@ - + 4.0.0 - sal-samples org.opendaylight.controller.samples + sal-samples 1.1-SNAPSHOT ../.. org.opendaylight.controller.samples.l2switch.md l2switch-impl bundle - - - - - org.apache.felix - maven-bundle-plugin - true - - - - org.opendaylight.controller.sample.l2switch.md.L2SwitchProvider - - ${project.build.directory}/META-INF - - - - - junit - junit - ${junit.version} - test + org.opendaylight.controller + sal + - org.opendaylight.controller.samples.l2switch.md - l2switch-model - ${project.version} + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller.model + model-flow-service org.opendaylight.controller.model model-inventory - - org.opendaylight.controller - sal-binding-api + org.opendaylight.controller.model + model-topology + 1.1-SNAPSHOT - org.opendaylight.yangtools - yang-common - ${yangtools.version} + org.opendaylight.controller.samples.l2switch.md + l2switch-model + ${project.version} + + + org.opendaylight.controller.thirdparty + net.sf.jung2 org.opendaylight.yangtools yang-binding - ${yangtools.version} + + + org.opendaylight.yangtools + yang-common junit @@ -68,25 +59,24 @@ org.mockito mockito-all - ${mockito.version} test - - org.opendaylight.controller - sal - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.thirdparty - net.sf.jung2 - - - org.opendaylight.controller.model - model-topology - 1.1-SNAPSHOT - + + + + + org.apache.felix + maven-bundle-plugin + true + + + + org.opendaylight.controller.sample.l2switch.md.L2SwitchProvider + + ${project.build.directory}/META-INF + + + + diff --git a/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java b/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java index 753de4aa85..ecf116b171 100644 --- a/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java +++ b/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java @@ -86,8 +86,8 @@ public class PacketHandler implements PacketProcessingListener { handleEthernetPacket(packet, ingress); - } catch(Throwable _e) { - _e.printStackTrace(); + } catch(Exception e) { + _logger.error("Failed to handle packet {}", packetReceived, e); } } diff --git a/opendaylight/md-sal/samples/l2switch/model/pom.xml b/opendaylight/md-sal/samples/l2switch/model/pom.xml index 7c54309fa1..0ccc74d952 100644 --- a/opendaylight/md-sal/samples/l2switch/model/pom.xml +++ b/opendaylight/md-sal/samples/l2switch/model/pom.xml @@ -1,8 +1,9 @@ + 4.0.0 - sal-samples org.opendaylight.controller.samples + sal-samples 1.1-SNAPSHOT ../.. @@ -10,88 +11,84 @@ l2switch-model bundle + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools.model + ietf-yang-types + + + - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.groupId}.${project.artifactId} - org.opendaylight.yangtools.yang.binding.annotations, * - ${project.basedir}/META-INF - - - - + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yangtools.yang.binding.annotations, * + ${project.basedir}/META-INF + + + + org.opendaylight.yangtools yang-maven-plugin ${yangtools.version} - - - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator - target/site/models - - - true - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - org.opendaylight.yangtools - yang-binding - ${yangtools.version} - jar - + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + org.opendaylight.yangtools + yang-binding + ${yangtools.version} + jar + - - - - - - - - org.opendaylight.yangtools - yang-binding - - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools.model - ietf-yang-types - - - org.opendaylight.controller.model - model-inventory - - + + + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator + target/site/models + + + true + + + + + + + diff --git a/opendaylight/md-sal/samples/pom.xml b/opendaylight/md-sal/samples/pom.xml index 9f9d9d35c7..c601647a2e 100644 --- a/opendaylight/md-sal/samples/pom.xml +++ b/opendaylight/md-sal/samples/pom.xml @@ -1,38 +1,38 @@ - 4.0.0 - - sal-parent - 1.1-SNAPSHOT - org.opendaylight.controller - - pom - sal-samples - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + + org.opendaylight.controller.samples + sal-samples + pom - - toaster - toaster-consumer - toaster-provider + + toaster + toaster-consumer + toaster-provider l2switch + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + - - - integrationtests - - false - - - toaster-it - - - - - org.opendaylight.controller.samples - \ No newline at end of file + + + integrationtests + + false + + + toaster-it + + + + diff --git a/opendaylight/md-sal/samples/toaster-consumer/pom.xml b/opendaylight/md-sal/samples/toaster-consumer/pom.xml index 0c16a92586..79a9ea3f0e 100644 --- a/opendaylight/md-sal/samples/toaster-consumer/pom.xml +++ b/opendaylight/md-sal/samples/toaster-consumer/pom.xml @@ -1,107 +1,90 @@ + - 4.0.0 - - sal-samples - org.opendaylight.controller.samples - 1.1-SNAPSHOT - - sample-toaster-consumer - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller.samples + sal-samples + 1.1-SNAPSHOT + + sample-toaster-consumer + bundle - - 1.1-SNAPSHOT - + + 1.1-SNAPSHOT + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.sample.toaster.provider.api, - org.opendaylight.controller.config.yang.toaster-consumer, - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - config - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - - - + + + ${project.groupId} + sample-toaster + ${project.version} + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-config + + + org.osgi + org.osgi.core + + - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.sample.toaster.provider.api, + org.opendaylight.controller.config.yang.toaster-consumer, + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + config + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + - - - ${project.groupId} - sample-toaster - ${project.version} - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - sal-binding-config - - + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/samples/toaster-it/pom.xml b/opendaylight/md-sal/samples/toaster-it/pom.xml index d61393c225..60db8f9ba6 100644 --- a/opendaylight/md-sal/samples/toaster-it/pom.xml +++ b/opendaylight/md-sal/samples/toaster-it/pom.xml @@ -1,85 +1,93 @@ - - 4.0.0 - - sal-samples - org.opendaylight.controller.samples - 1.1-SNAPSHOT - - sample-toaster-it - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - + + + 4.0.0 + + org.opendaylight.controller.samples + sal-samples + 1.1-SNAPSHOT + + sample-toaster-it + - - - - org.ops4j.pax.exam - maven-paxexam-plugin - 1.2.4 - - - generate-config - - generate-depends-file - - - - - - + + junit + junit + + + org.opendaylight.controller + sal-binding-it + 1.1-SNAPSHOT + + + org.opendaylight.controller.samples + sample-toaster + 1.1-SNAPSHOT + + + org.opendaylight.controller.samples + sample-toaster-consumer + 1.1-SNAPSHOT + - - - org.opendaylight.controller - sal-binding-it - 1.1-SNAPSHOT - - - org.opendaylight.controller.samples - sample-toaster-consumer - 1.1-SNAPSHOT - - - org.opendaylight.controller.samples - sample-toaster-provider - 1.1-SNAPSHOT - - - org.opendaylight.controller.samples - sample-toaster - 1.1-SNAPSHOT - + + org.opendaylight.controller.samples + sample-toaster-provider + 1.1-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + + + org.ops4j.pax.exam + pax-exam-junit4 + ${exam.version} + + + equinoxSDK381 + org.eclipse.osgi + 3.8.1.v20120830-144521 + test + + + org.ops4j.pax.exam + pax-exam-container-native + ${exam.version} + test + + + org.ops4j.pax.exam + pax-exam-link-mvn + ${exam.version} + test + + - - junit - junit - - - org.ops4j.pax.exam - pax-exam-junit4 - ${exam.version} - - - org.ops4j.pax.exam - pax-exam-link-mvn - ${exam.version} - test - - - org.ops4j.pax.exam - pax-exam-container-native - ${exam.version} - test - - - equinoxSDK381 - org.eclipse.osgi - 3.8.1.v20120830-144521 - test - - + + + + org.ops4j.pax.exam + maven-paxexam-plugin + 1.2.4 + + + generate-config + + generate-depends-file + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java index 000783bd07..add523157f 100644 --- a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java +++ b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java @@ -7,20 +7,9 @@ */ package org.opendaylight.controller.sample.toaster.it; -import static org.junit.Assert.assertEquals; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.*; -import static org.ops4j.pax.exam.CoreOptions.*; - -import javax.inject.Inject; -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.ObjectName; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.opendaylight.controller.config.yang.config.toaster_consumer.impl.ToasterConsumerRuntimeMXBean; -import org.opendaylight.controller.config.yang.config.toaster_provider.impl.ToasterProviderRuntimeMXBean; import org.opendaylight.controller.sample.toaster.provider.api.ToastConsumer; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.HashBrown; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.WhiteBread; @@ -31,8 +20,23 @@ import org.ops4j.pax.exam.options.DefaultCompositeOption; import org.ops4j.pax.exam.util.Filter; import org.ops4j.pax.exam.util.PathUtils; +import javax.inject.Inject; +import javax.management.MBeanServer; +import javax.management.ObjectName; import java.lang.management.ManagementFactory; +import static org.junit.Assert.assertEquals; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.CoreOptions.systemPackages; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; + @RunWith(PaxExam.class) public class ToasterTest { @@ -72,7 +76,9 @@ public class ToasterTest { return new DefaultCompositeOption( mavenBundle("org.opendaylight.controller.samples", "sample-toaster-provider").versionAsInProject(), mavenBundle("org.opendaylight.controller.samples", "sample-toaster-consumer").versionAsInProject(), - mavenBundle("org.opendaylight.controller.samples", "sample-toaster").versionAsInProject() + mavenBundle("org.opendaylight.controller.samples", "sample-toaster").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject() ); } diff --git a/opendaylight/md-sal/samples/toaster-provider/pom.xml b/opendaylight/md-sal/samples/toaster-provider/pom.xml index 11ee47b8c7..4d6b9ebd6f 100644 --- a/opendaylight/md-sal/samples/toaster-provider/pom.xml +++ b/opendaylight/md-sal/samples/toaster-provider/pom.xml @@ -1,110 +1,92 @@ + - 4.0.0 - - sal-samples - org.opendaylight.controller.samples - 1.1-SNAPSHOT - - sample-toaster-provider - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - - + 4.0.0 + + org.opendaylight.controller.samples + sal-samples + 1.1-SNAPSHOT + + sample-toaster-provider + bundle - - 1.1-SNAPSHOT - + + 1.1-SNAPSHOT + - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.config.yang.toaster_provider, - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - config - - generate-sources - - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - true - - - - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${config.version} - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - - - - - + + + ${project.groupId} + sample-toaster + ${project.version} + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-config + + + org.opendaylight.controller + sal-common-util + + + org.osgi + org.osgi.core + + - - - ${project.groupId} - sample-toaster - ${project.version} - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-binding-config - - - org.opendaylight.controller - config-api - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.config.yang.toaster_provider, + * + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + config + + generate-sources + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + ${jmxGeneratorPath} + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/samples/toaster/pom.xml b/opendaylight/md-sal/samples/toaster/pom.xml index eb13e64adc..4222daae13 100644 --- a/opendaylight/md-sal/samples/toaster/pom.xml +++ b/opendaylight/md-sal/samples/toaster/pom.xml @@ -1,102 +1,91 @@ + - 4.0.0 - - sal-samples - org.opendaylight.controller.samples - 1.1-SNAPSHOT - - sample-toaster - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller.samples + sal-samples + 1.1-SNAPSHOT + + sample-toaster + bundle + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - true - - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - jar - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.opendaylight.yangtools - - - yang-maven-plugin - - - [0.5,) - - - - generate-sources - - - - - - - - - - - - - - - - - org.opendaylight.yangtools - yang-binding - - + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.opendaylight.yangtools + yang-maven-plugin + [0.5,) + + generate-sources + + + + + + + + + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + + org.opendaylight.yangtools - yang-common - - + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + + + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + true + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/statistics-manager/pom.xml b/opendaylight/md-sal/statistics-manager/pom.xml index 9ace8a119f..399d53b67f 100644 --- a/opendaylight/md-sal/statistics-manager/pom.xml +++ b/opendaylight/md-sal/statistics-manager/pom.xml @@ -1,71 +1,72 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - org.opendaylight.controller.md - statistics-manager - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + org.opendaylight.controller.md + statistics-manager + bundle + + + + com.google.guava + guava + - - - com.google.guava - guava - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller.model - model-flow-statistics - - - org.opendaylight.controller.model - model-flow-base - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.osgi - org.osgi.core - provided - - - - junit - junit - - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - test - - + + junit + junit + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller.model + model-flow-base + + + org.opendaylight.controller.model + model-flow-statistics + + + org.osgi + org.osgi.core + provided + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + test + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.md.statistics.manager.StatisticsManagerActivator - org.opendaylight.controller.md.statistics.manager - - - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.md.statistics.manager.StatisticsManagerActivator + org.opendaylight.controller.md.statistics.manager + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml b/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml index f0a8584730..4a0a02561f 100644 --- a/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml +++ b/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml @@ -13,18 +13,6 @@ https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - - 3.0.0 - 1.5.0 - 2.2.0.RELEASE - 3.6.0.RELEASE - 3.1.3.RELEASE - 1.17 - 3.1.3.RELEASE - 0.2.2-SNAPSHOT - 0.2.3-SNAPSHOT - - @@ -638,72 +626,58 @@ org.opendaylight.controller config-api - ${config.version} org.opendaylight.controller config-manager - ${config.version} org.opendaylight.controller config-util - ${config.version} org.opendaylight.controller yang-jmx-generator - ${config.version} org.opendaylight.controller logback-config - ${config.version} org.opendaylight.controller config-persister-api - ${config.version} org.opendaylight.controller config-persister-file-xml-adapter - ${config.version} org.opendaylight.controller netconf-api - ${netconf.version} org.opendaylight.controller netconf-impl - ${netconf.version} org.opendaylight.controller netconf-util - ${netconf.version} org.opendaylight.controller netconf-client - ${netconf.version} org.opendaylight.controller netconf-mapping-api - ${netconf.version} org.opendaylight.controller config-netconf-connector - ${netconf.version} org.opendaylight.controller config-persister-impl - ${netconf.version} diff --git a/opendaylight/md-sal/topology-lldp-discovery/pom.xml b/opendaylight/md-sal/topology-lldp-discovery/pom.xml index 627934eb67..2d003f8079 100644 --- a/opendaylight/md-sal/topology-lldp-discovery/pom.xml +++ b/opendaylight/md-sal/topology-lldp-discovery/pom.xml @@ -1,98 +1,96 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - ../ - - org.opendaylight.controller.md - topology-lldp-discovery - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - HEAD - - - 14.0.1 - 2.4.3 - 2.4.0 - 2.5 - - - - com.google.guava - guava - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.model - model-flow-base - - - org.opendaylight.controller.model - model-flow-management - - - org.opendaylight.controller.model - model-inventory - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - equinoxSDK381 - org.eclipse.osgi - - - commons-lang - commons-lang - 2.4 - - - com.google.guava - guava - - - commons-codec - commons-codec - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + ../ + + org.opendaylight.controller.md + topology-lldp-discovery + bundle + + 2.4.0 + 14.0.1 + 2.5 + 2.4.3 + + + + com.google.guava + guava + + + commons-codec + commons-codec + + + commons-lang + commons-lang + 2.4 + + + equinoxSDK381 + org.eclipse.osgi + + + org.eclipse.xtend + org.eclipse.xtend.lib + + + org.opendaylight.controller + sal + - org.opendaylight.controller - sal - - - + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller.model + model-flow-base + + + org.opendaylight.controller.model + model-flow-management + + + org.opendaylight.controller.model + model-flow-service + + + org.opendaylight.controller.model + model-inventory + + + - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.md.controller.topology.lldp.LLDPActivator - org.opendaylight.md.controller.topology.lldp.utils - commons-lang> - ${project.groupId}.${project.artifactId} - - ${project.basedir}/META-INF - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.md.controller.topology.lldp.LLDPActivator + org.opendaylight.md.controller.topology.lldp.utils + commons-lang + > + ${project.groupId}.${project.artifactId} + + ${project.basedir}/META-INF + + + + org.eclipse.xtend + xtend-maven-plugin + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + diff --git a/opendaylight/md-sal/topology-manager/pom.xml b/opendaylight/md-sal/topology-manager/pom.xml index 8503864f62..55244d3c90 100644 --- a/opendaylight/md-sal/topology-manager/pom.xml +++ b/opendaylight/md-sal/topology-manager/pom.xml @@ -1,73 +1,66 @@ + - 4.0.0 - - org.opendaylight.controller - sal-parent - 1.1-SNAPSHOT - - org.opendaylight.controller.md - topology-manager - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - HEAD - + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.1-SNAPSHOT + + org.opendaylight.controller.md + topology-manager + bundle - - - com.google.guava - guava - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-binding-util - - - org.opendaylight.controller.model - model-flow-service - - - org.opendaylight.controller.model - model-inventory - - - org.opendaylight.controller.model - model-topology - 1.1-SNAPSHOT - - - org.eclipse.xtend - org.eclipse.xtend.lib - - - org.osgi - org.osgi.core - provided - - + + + com.google.guava + guava + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-binding-util + + + org.opendaylight.controller.model + model-flow-service + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.controller.model + model-topology + 1.1-SNAPSHOT + + + org.osgi + org.osgi.core + provided + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.md.controller.topology.manager.FlowCapableTopologyProvider - org.opendaylight.md.controller.topology.manager - - - - - org.eclipse.xtend - xtend-maven-plugin - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.md.controller.topology.manager.FlowCapableTopologyProvider + org.opendaylight.md.controller.topology.manager + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java new file mode 100644 index 0000000000..bb406bbf1a --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java @@ -0,0 +1,100 @@ +/* + * 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.md.controller.topology.manager; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnectorBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder; + +public final class FlowCapableNodeMapping { + + private FlowCapableNodeMapping() { + throw new UnsupportedOperationException("Utility class."); + } + + public static NodeKey getNodeKey(final NodeRef ref) { + return ref.getValue().firstKeyOf(Node.class, NodeKey.class); + } + + public static NodeKey getNodeKey(final NodeConnectorRef ref) { + return ref.getValue().firstKeyOf(Node.class, NodeKey.class); + } + + public static NodeConnectorKey getNodeConnectorKey(final NodeConnectorRef ref) { + return ref.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class); + } + + public static NodeId toTopologyNodeId( + final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) { + return new NodeId(nodeId); + } + + private static NodeId toTopologyNodeId(final NodeConnectorRef source) { + return toTopologyNodeId(getNodeKey(source).getId()); + } + + public static TpId toTerminationPointId(final NodeConnectorId id) { + return new TpId(id); + } + + private static TpId toTerminationPointId(final NodeConnectorRef source) { + return toTerminationPointId(getNodeConnectorKey(source).getId()); + } + + public static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node toTopologyNode( + final NodeId nodeId, final NodeRef invNodeRef) { + return new NodeBuilder() // + .setNodeId(nodeId) // + .addAugmentation(InventoryNode.class, new InventoryNodeBuilder() // + .setInventoryNodeRef(invNodeRef) // + .build()) // + .build(); + } + + public static TerminationPoint toTerminationPoint(final TpId id, final NodeConnectorRef invNodeConnectorRef) { + return new TerminationPointBuilder() // + .setTpId(id) // + .addAugmentation(InventoryNodeConnector.class, new InventoryNodeConnectorBuilder() // + .setInventoryNodeConnectorRef(invNodeConnectorRef) // + .build()) // + .build(); + } + + public static Link toTopologyLink( + final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link link) { + return new LinkBuilder() // + .setSource(new SourceBuilder() // + .setSourceNode(toTopologyNodeId(link.getSource())) // + .setSourceTp(toTerminationPointId(link.getSource())) // + .build()) // + .setDestination(new DestinationBuilder() // + .setDestNode(toTopologyNodeId(link.getDestination())) // + .setDestTp(toTerminationPointId(link.getDestination())) // + .build()) // + .setLinkId(new LinkId(getNodeConnectorKey(link.getSource()).getId())) // + .build(); + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend deleted file mode 100644 index 017e2b877e..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.md.controller.topology.manager - -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeBuilder -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnectorBuilder -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode - -class FlowCapableNodeMapping { - - static def NodeKey getNodeKey(NodeRef ref) { - (ref?.value?.path?.get(1) as IdentifiableItem).key - } - - static def NodeKey getNodeKey(NodeConnectorRef ref) { - (ref?.value?.path?.get(1) as IdentifiableItem).key - } - - static def NodeConnectorKey getNodeConnectorKey(NodeConnectorRef ref) { - (ref?.value?.path?.get(2) as IdentifiableItem).key - } - - static def NodeId toToplogyNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) { - return new NodeId(nodeId); - } - - static def toTerminationPointId(NodeConnectorId id) { - return new TpId(id); - } - - static def toTopologyNode(NodeId nodeId,NodeRef invNodeRef) { - val nb = new NodeBuilder(); - nb.setNodeId(nodeId) - val inb = new InventoryNodeBuilder - inb.setInventoryNodeRef(invNodeRef) - nb.addAugmentation(InventoryNode,inb.build) - return nb.build(); - } - - static def toTerminationPoint(TpId id, NodeConnectorRef invNodeConnectorRef) { - val tpb = new TerminationPointBuilder - tpb.setTpId(id); - val incb = new InventoryNodeConnectorBuilder - incb.setInventoryNodeConnectorRef(invNodeConnectorRef) - tpb.addAugmentation(InventoryNodeConnector,incb.build()) - return tpb.build(); - } - - static def toTopologyLink(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link link) { - val sb = new SourceBuilder(); - sb.setSourceNode(link.source.nodeKey.id.toToplogyNodeId) - sb.setSourceTp(link.source.nodeConnectorKey.id.toTerminationPointId) - val db = new DestinationBuilder(); - db.setDestNode(link.destination.nodeKey.id.toToplogyNodeId) - db.setDestTp(link.destination.nodeConnectorKey.id.toTerminationPointId) - val lb = new LinkBuilder(); - lb.setSource(sb.build()) - lb.setDestination(db.build()); - lb.setLinkId(new LinkId(lb.source.sourceTp.value)) - return lb.build(); - } -} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java new file mode 100644 index 0000000000..54f1fc0bb4 --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java @@ -0,0 +1,249 @@ +/* + * 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.md.controller.topology.manager; + +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeConnectorKey; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeKey; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPoint; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPointId; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyLink; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNode; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNodeId; + +import java.util.concurrent.ExecutionException; + +import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader; +import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction; +import org.opendaylight.controller.sal.binding.api.data.DataProviderService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated; +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.OpendaylightInventoryListener; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class FlowCapableTopologyExporter implements // + FlowTopologyDiscoveryListener, // + OpendaylightInventoryListener // +{ + + private final static Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyExporter.class); + public static TopologyKey topology = new TopologyKey(new TopologyId("flow:1")); + + // FIXME: Flow capable topology exporter should use transaction chaining API + private DataProviderService dataService; + + public DataProviderService getDataService() { + return dataService; + } + + public void setDataService(final DataProviderService dataService) { + this.dataService = dataService; + } + + private InstanceIdentifier topologyPath; + + public void start() { + TopologyBuilder tb = new TopologyBuilder(); + tb.setKey(topology); + topologyPath = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology).build(); + Topology top = tb.build(); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(topologyPath, top); + tx.commit(); + } + + @Override + public synchronized void onNodeRemoved(final NodeRemoved notification) { + NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeRef()).getId()); + InstanceIdentifier nodeInstance = toNodeIdentifier(notification.getNodeRef()); + + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(nodeInstance); + removeAffectedLinks(tx, nodeId); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + + @Override + public synchronized void onNodeUpdated(final NodeUpdated notification) { + FlowCapableNodeUpdated fcnu = notification.getAugmentation(FlowCapableNodeUpdated.class); + if (fcnu != null) { + Node node = toTopologyNode(toTopologyNodeId(notification.getId()), notification.getNodeRef()); + InstanceIdentifier path = getNodePath(toTopologyNodeId(notification.getId())); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, node); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + } + + @Override + public synchronized void onNodeConnectorRemoved(final NodeConnectorRemoved notification) { + InstanceIdentifier tpInstance = toTerminationPointIdentifier(notification + .getNodeConnectorRef()); + TpId tpId = toTerminationPointId(getNodeConnectorKey(notification.getNodeConnectorRef()).getId()); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(tpInstance); + removeAffectedLinks(tx, tpId); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + + } + + @Override + public synchronized void onNodeConnectorUpdated(final NodeConnectorUpdated notification) { + FlowCapableNodeConnectorUpdated fcncu = notification.getAugmentation(FlowCapableNodeConnectorUpdated.class); + if (fcncu != null) { + NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeConnectorRef()).getId()); + TerminationPoint point = toTerminationPoint(toTerminationPointId(notification.getId()), + notification.getNodeConnectorRef()); + InstanceIdentifier path = tpPath(nodeId, point.getKey().getTpId()); + + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, point); + if ((fcncu.getState() != null && fcncu.getState().isLinkDown()) + || (fcncu.getConfiguration() != null && fcncu.getConfiguration().isPORTDOWN())) { + removeAffectedLinks(tx, point.getTpId()); + } + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + } + + @Override + public synchronized void onLinkDiscovered(final LinkDiscovered notification) { + Link link = toTopologyLink(notification); + InstanceIdentifier path = linkPath(link); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, link); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + + @Override + public synchronized void onLinkOverutilized(final LinkOverutilized notification) { + // NOOP + } + + @Override + public synchronized void onLinkRemoved(final LinkRemoved notification) { + InstanceIdentifier path = linkPath(toTopologyLink(notification)); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(path); + ; + } + + @Override + public synchronized void onLinkUtilizationNormal(final LinkUtilizationNormal notification) { + // NOOP + } + + private static InstanceIdentifier toNodeIdentifier(final NodeRef ref) { + org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref); + + NodeKey nodeKey = new NodeKey(toTopologyNodeId(invNodeKey.getId())); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).build(); + } + + private InstanceIdentifier toTerminationPointIdentifier(final NodeConnectorRef ref) { + org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref); + NodeConnectorKey invNodeConnectorKey = getNodeConnectorKey(ref); + return tpPath(toTopologyNodeId(invNodeKey.getId()), toTerminationPointId(invNodeConnectorKey.getId())); + } + + private void removeAffectedLinks(final DataModificationTransaction transaction, final NodeId id) { + TypeSafeDataReader reader = TypeSafeDataReader.forReader(transaction); + + Topology topologyData = reader.readOperationalData(topologyPath); + if (topologyData == null) { + return; + } + for (Link link : topologyData.getLink()) { + if (id.equals(link.getSource().getSourceNode()) || id.equals(link.getDestination().getDestNode())) { + InstanceIdentifier path = InstanceIdentifier.builder(topologyPath) + .child(Link.class, link.getKey()).build(); + transaction.removeOperationalData(path); + } + } + } + + private void removeAffectedLinks(final DataModificationTransaction transaction, final TpId id) { + TypeSafeDataReader reader = TypeSafeDataReader.forReader(transaction); + Topology topologyData = reader.readOperationalData(topologyPath); + if (topologyData == null) { + return; + } + for (Link link : topologyData.getLink()) { + if (id.equals(link.getSource().getSourceTp()) || id.equals(link.getDestination().getDestTp())) { + InstanceIdentifier path = InstanceIdentifier.builder(topologyPath) + .child(Link.class, link.getKey()).build(); + transaction.removeOperationalData(path); + } + } + } + + private InstanceIdentifier getNodePath(final NodeId nodeId) { + NodeKey nodeKey = new NodeKey(nodeId); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).build(); + } + + private InstanceIdentifier tpPath(final NodeId nodeId, final TpId tpId) { + NodeKey nodeKey = new NodeKey(nodeId); + TerminationPointKey tpKey = new TerminationPointKey(tpId); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).child(TerminationPoint.class, tpKey).build(); + } + + private InstanceIdentifier linkPath(final Link link) { + InstanceIdentifier linkInstanceId = InstanceIdentifier.builder(NetworkTopology.class) + .child(Topology.class, topology).child(Link.class, link.getKey()).build(); + return linkInstanceId; + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend deleted file mode 100644 index 666a8bf57a..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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.md.controller.topology.manager - -import com.google.common.collect.FluentIterable -import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader -import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction -import org.opendaylight.controller.sal.binding.api.data.DataProviderService -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated -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.OpendaylightInventoryListener -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier - -import static extension org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.* - -class FlowCapableTopologyExporter implements // -FlowTopologyDiscoveryListener, // -OpendaylightInventoryListener // -{ - - var TopologyKey topology = new TopologyKey(new TopologyId("flow:1")); - - @Property - var DataProviderService dataService; - - def start() { - val tb = new TopologyBuilder(); - tb.setKey(topology); - val path = InstanceIdentifier.builder(NetworkTopology).child(Topology,topology).toInstance; - val top = tb.build(); - val it = dataService.beginTransaction - putOperationalData(path,top); - commit() - } - - override onNodeRemoved(NodeRemoved notification) { - val nodeId = notification.nodeRef.nodeKey.id.toToplogyNodeId() - val nodeInstance = notification.nodeRef.toNodeIdentifier() - - val it = dataService.beginTransaction - removeOperationalData(nodeInstance); - removeAffectedLinks(it,nodeId) - commit() - - } - - override onNodeUpdated(NodeUpdated notification) { - val fcnu = notification.getAugmentation(FlowCapableNodeUpdated) - if(fcnu != null) { - val node = notification.id.toToplogyNodeId.toTopologyNode(notification.nodeRef) - val path = notification.id.toToplogyNodeId.nodePath; - val it = dataService.beginTransaction - putOperationalData(path, node); - commit() - } - } - - override onNodeConnectorRemoved(NodeConnectorRemoved notification) { - val tpInstance = notification.nodeConnectorRef.toTerminationPointIdentifier; - val tpId = notification.nodeConnectorRef.nodeConnectorKey.id.toTerminationPointId; - val it = dataService.beginTransaction - removeOperationalData(tpInstance); - removeAffectedLinks(it,tpId) - commit() - - } - - override onNodeConnectorUpdated(NodeConnectorUpdated notification) { - val fcncu = notification.getAugmentation(FlowCapableNodeConnectorUpdated) - if(fcncu != null) { - val nodeId = notification.nodeConnectorRef.nodeKey.id.toToplogyNodeId; - val TerminationPoint point = notification.id.toTerminationPointId.toTerminationPoint(notification.nodeConnectorRef); - val path = tpPath(nodeId, point.key.tpId); - - val it = dataService.beginTransaction - putOperationalData(path, point); - if((fcncu.state != null && fcncu.state.linkDown) || (fcncu.configuration != null && fcncu.configuration.PORTDOWN)) { - removeAffectedLinks(it,point.tpId) - } - commit() - } - } - - override onLinkDiscovered(LinkDiscovered notification) { - val link = notification.toTopologyLink; - val path = link.linkPath; - val it = dataService.beginTransaction - putOperationalData(path, link); - commit() - } - - override onLinkOverutilized(LinkOverutilized notification) { - // NOOP - } - - override onLinkRemoved(LinkRemoved notification) { - val path = notification.toTopologyLink.linkPath - val it = dataService.beginTransaction - removeOperationalData(path); - commit() - } - - override onLinkUtilizationNormal(LinkUtilizationNormal notification) { - // NOOP - } - - def InstanceIdentifier toNodeIdentifier(NodeRef ref) { - val invNodeKey = ref.nodeKey - - val nodeKey = new NodeKey(invNodeKey.id.toToplogyNodeId); - return InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Node, nodeKey). - toInstance; - } - - def InstanceIdentifier toTerminationPointIdentifier(NodeConnectorRef ref) { - val invNodeKey = ref.nodeKey - val invNodeConnectorKey = ref.nodeConnectorKey - return tpPath(invNodeKey.id.toToplogyNodeId(), invNodeConnectorKey.id.toTerminationPointId()) - } - - private def void removeAffectedLinks(DataModificationTransaction transaction, NodeId id) { - val reader = TypeSafeDataReader.forReader(transaction) - val topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).toInstance; - val topologyData = reader.readOperationalData(topologyPath); - if (topologyData === null) { - return; - } - val affectedLinkInstances = FluentIterable.from(topologyData.link).filter[ - source.sourceNode == id || destination.destNode == id].transform [ - // - InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Link, key).toInstance - // - ] - for(affectedLink : affectedLinkInstances) { - transaction.removeOperationalData(affectedLink); - } - } - - private def void removeAffectedLinks(DataModificationTransaction transaction, TpId id) { - val reader = TypeSafeDataReader.forReader(transaction) - val topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).toInstance; - val topologyData = reader.readOperationalData(topologyPath); - if (topologyData === null) { - return; - } - val affectedLinkInstances = FluentIterable.from(topologyData.link).filter[ - source.sourceTp == id || destination.destTp == id].transform [ - // - InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Link, key).toInstance - // - ] - for(affectedLink : affectedLinkInstances) { - transaction.removeOperationalData(affectedLink); - } - } - - private def InstanceIdentifier nodePath(NodeId nodeId) { - val nodeKey = new NodeKey(nodeId); - return InstanceIdentifier.builder(NetworkTopology) - .child(Topology, topology) - .child(Node, nodeKey) - .toInstance; - } - - private def InstanceIdentifier tpPath(NodeId nodeId, TpId tpId) { - val nodeKey = new NodeKey(nodeId); - val tpKey = new TerminationPointKey(tpId) - return InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Node, nodeKey). - child(TerminationPoint, tpKey).toInstance; - } - - private def InstanceIdentifier linkPath(Link link) { - val linkInstanceId = InstanceIdentifier.builder(NetworkTopology) - .child(Topology, topology) - .child(Link, link.key) - .toInstance; - return linkInstanceId; - } -} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java new file mode 100644 index 0000000000..e77ba8769c --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2013 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.md.controller.topology.manager; + +import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.data.DataProviderService; +import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.yang.binding.NotificationListener; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable { + private final static Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider.class); + + private DataProviderService dataService; + + public DataProviderService getDataService() { + return this.dataService; + } + + public void setDataService(final DataProviderService dataService) { + this.dataService = dataService; + } + + private NotificationProviderService notificationService; + + public NotificationProviderService getNotificationService() { + return this.notificationService; + } + + public void setNotificationService(final NotificationProviderService notificationService) { + this.notificationService = notificationService; + } + + private final FlowCapableTopologyExporter exporter = new FlowCapableTopologyExporter(); + private Registration listenerRegistration; + + @Override + public void close() { + + FlowCapableTopologyProvider.LOG.info("FlowCapableTopologyProvider stopped."); + dataService = null; + notificationService = null; + if (this.listenerRegistration != null) { + try { + this.listenerRegistration.close(); + } catch (Exception e) { + throw new IllegalStateException("Exception during close of listener registration.",e); + } + } + } + + /** + * Gets called on start of a bundle. + * + * @param session + */ + @Override + public void onSessionInitiated(final ProviderContext session) { + dataService = session.getSALService(DataProviderService.class); + notificationService = session.getSALService(NotificationProviderService.class); + this.exporter.setDataService(dataService); + this.exporter.start(); + this.listenerRegistration = notificationService.registerNotificationListener(this.exporter); + ; + } + + /** + * Gets called during stop bundle + * + * @param context + * The execution context of the bundle being stopped. + */ + @Override + public void stopImpl(final BundleContext context) { + this.close(); + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend deleted file mode 100644 index 73e03d1e7d..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013 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.md.controller.topology.manager - -import org.opendaylight.controller.sal.binding.api.NotificationProviderService -import org.opendaylight.controller.sal.binding.api.data.DataProviderService -import org.opendaylight.yangtools.concepts.Registration -import org.opendaylight.yangtools.yang.binding.NotificationListener -import org.slf4j.LoggerFactory -import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext -import org.osgi.framework.BundleContext; - -class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable { - - - - static val LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider); - - @Property - DataProviderService dataService; - - @Property - NotificationProviderService notificationService; - - val FlowCapableTopologyExporter exporter = new FlowCapableTopologyExporter(); - - Registration listenerRegistration - - override close() { - LOG.info("FlowCapableTopologyProvider stopped."); - listenerRegistration?.close(); - } - - /** - * Gets called on start of a bundle. - * @param session - */ - override onSessionInitiated(ProviderContext session) { - dataService = session.getSALService(DataProviderService) - notificationService = session.getSALService(NotificationProviderService) - exporter.setDataService(dataService); - exporter.start(); - listenerRegistration = notificationService.registerNotificationListener(exporter); - } - - /** - * Gets called during stop bundle - * @param context The execution context of the bundle being stopped. - */ - override stopImpl(BundleContext context) { - close(); - } - -} - - diff --git a/opendaylight/netconf/config-netconf-connector/pom.xml b/opendaylight/netconf/config-netconf-connector/pom.xml index b37b5babdd..2a0f0a97f7 100644 --- a/opendaylight/netconf/config-netconf-connector/pom.xml +++ b/opendaylight/netconf/config-netconf-connector/pom.xml @@ -1,111 +1,112 @@ + - 4.0.0 + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - config-netconf-connector - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + config-netconf-connector + bundle + ${project.artifactId} - - - - ${project.groupId} - config-api - - - ${project.groupId} - netconf-api - - - org.slf4j - slf4j-api - - - com.google.guava - guava - - - ${project.groupId} - yang-jmx-generator - - - ${project.groupId} - config-util - - - ${project.groupId} - netconf-util - - - ${project.groupId} - netconf-mapping-api - - - org.osgi - org.osgi.core - + + + + ${project.groupId} + config-api + + + ${project.groupId} + config-util + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-mapping-api + + + ${project.groupId} + netconf-util + + + ${project.groupId} + yang-jmx-generator + + + com.google.guava + guava + + + org.opendaylight.controller + commons.logback_settings + + + org.opendaylight.yangtools + mockito-configuration + + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + + xmlunit + xmlunit + + + ${project.groupId} + config-manager + test-jar + test + + + ${project.groupId} + config-manager + test + + + ${project.groupId} + netconf-impl + test + - - ${project.groupId} - netconf-util - test - test-jar - + + ${project.groupId} + netconf-util + test-jar + test + - - ${project.groupId} - yang-test - test - - - ${project.groupId} - config-manager - test - test-jar - - - ${project.groupId} - config-manager - test - - - ${project.groupId} - netconf-impl - test - - - org.opendaylight.yangtools - mockito-configuration - - - org.opendaylight.controller - commons.logback_settings - - + + ${project.groupId} + yang-test + test + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.netconf.confignetconfconnector.osgi.Activator - - - org.opendaylight.controller.netconf.confignetconfconnector.mapping.*, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.confignetconfconnector.osgi.Activator + org.opendaylight.controller.netconf.confignetconfconnector.mapping.*, org.opendaylight.controller.netconf.confignetconfconnector.operations.*, org.opendaylight.controller.netconf.confignetconfconnector.transactions, org.opendaylight.controller.netconf.confignetconfconnector.util, org.opendaylight.controller.netconf.confignetconfconnector.osgi, - org.opendaylight.controller.config.util, - - - com.google.common.base, + org.opendaylight.controller.config.util, + com.google.common.base, com.google.common.collect, javax.annotation, javax.management, @@ -127,14 +128,12 @@ com.google.common.io, org.opendaylight.yangtools.yang.model.api.type, org.opendaylight.yangtools.sal.binding.generator.spi, - org.opendaylight.yangtools.sal.binding.yang.types - - - - - - - - + org.opendaylight.yangtools.sal.binding.yang.types + + + + + + diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java index d1326bde8e..051f365086 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java @@ -16,6 +16,8 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class CompositeAttributeWritingStrategy implements AttributeWritingStrategy { protected final String key; @@ -33,8 +35,7 @@ public class CompositeAttributeWritingStrategy implements AttributeWritingStrate public void writeElement(Element parentElement, String namespace, Object value) { Util.checkType(value, Map.class); - Element innerNode = document.createElement(key); - XmlUtil.addNamespaceAttr(innerNode, namespace); + Element innerNode = XmlUtil.createElement(document, key, Optional.of(namespace)); Map map = (Map) value; diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java index 8563b781e3..66b945d14b 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java @@ -15,6 +15,8 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class ObjectNameAttributeWritingStrategy implements AttributeWritingStrategy { private final Document document; @@ -32,19 +34,17 @@ public class ObjectNameAttributeWritingStrategy implements AttributeWritingStrat @Override public void writeElement(Element parentElement, String namespace, Object value) { Util.checkType(value, ObjectNameAttributeMappingStrategy.MappedDependency.class); - Element innerNode = document.createElement(key); - XmlUtil.addNamespaceAttr(innerNode, namespace); + Element innerNode = XmlUtil.createElement(document, key, Optional.of(namespace)); String moduleName = ((ObjectNameAttributeMappingStrategy.MappedDependency) value).getServiceName(); String refName = ((ObjectNameAttributeMappingStrategy.MappedDependency) value).getRefName(); String namespaceForType = ((ObjectNameAttributeMappingStrategy.MappedDependency) value).getNamespace(); - Element typeElement = XmlUtil.createPrefixedTextElement(document, XmlNetconfConstants.TYPE_KEY, XmlNetconfConstants.PREFIX, - moduleName); - XmlUtil.addPrefixedNamespaceAttr(typeElement, XmlNetconfConstants.PREFIX, namespaceForType); + Element typeElement = XmlUtil.createPrefixedTextElement(document, XmlUtil.createPrefixedValue(XmlNetconfConstants.PREFIX, XmlNetconfConstants.TYPE_KEY), XmlNetconfConstants.PREFIX, + moduleName, Optional.of(namespaceForType)); innerNode.appendChild(typeElement); - final Element nameElement = XmlUtil.createTextElement(document, XmlNetconfConstants.NAME_KEY, refName); + final Element nameElement = XmlUtil.createTextElement(document, XmlNetconfConstants.NAME_KEY, refName, Optional.absent()); innerNode.appendChild(nameElement); parentElement.appendChild(innerNode); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java index a67b348f9f..b2555f712a 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java @@ -12,9 +12,12 @@ import java.util.Map; import java.util.Map.Entry; import org.opendaylight.controller.netconf.confignetconfconnector.util.Util; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class RuntimeBeanEntryWritingStrategy extends CompositeAttributeWritingStrategy { public RuntimeBeanEntryWritingStrategy(Document document, String key, @@ -33,7 +36,7 @@ public class RuntimeBeanEntryWritingStrategy extends CompositeAttributeWritingSt public void writeElement(Element parentElement, String namespace, Object value) { Util.checkType(value, Map.class); - Element innerNode = document.createElement(key); + Element innerNode = XmlUtil.createElement(document, key, Optional.absent()); Map map = (Map) value; @@ -43,8 +46,8 @@ public class RuntimeBeanEntryWritingStrategy extends CompositeAttributeWritingSt // bean Util.checkType(runtimeBeanInstanceMappingEntry.getValue(), Map.class); Map innerMap = (Map) runtimeBeanInstanceMappingEntry.getValue(); - Element runtimeInstanceNode = document.createElement("_" - + (String) runtimeBeanInstanceMappingEntry.getKey()); + Element runtimeInstanceNode = XmlUtil.createElement(document, "_" + + (String) runtimeBeanInstanceMappingEntry.getKey(), Optional.absent()); innerNode.appendChild(runtimeInstanceNode); for (Entry innerObjectEntry : innerMap.entrySet()) { diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java index b327f8ebef..1b15171ca0 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java @@ -13,6 +13,8 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class SimpleAttributeWritingStrategy implements AttributeWritingStrategy { private final Document document; @@ -31,13 +33,15 @@ public class SimpleAttributeWritingStrategy implements AttributeWritingStrategy public void writeElement(Element parentElement, String namespace, Object value) { value = preprocess(value); Util.checkType(value, String.class); - Element innerNode = createElement(document, key, (String) value); - XmlUtil.addNamespaceAttr(innerNode, namespace); + Element innerNode = createElement(document, key, (String) value, Optional.of(namespace)); parentElement.appendChild(innerNode); } - protected Element createElement(Document document, String key, String value) { - return XmlUtil.createTextElement(document, key, (String) value); + protected Element createElement(Document document, String key, String value, Optional namespace) { + Element typeElement = XmlUtil.createElement(document, key, namespace); + + typeElement.appendChild(document.createTextNode(value)); + return typeElement; } protected Object preprocess(Object value) { diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java index 7c90355051..68d31ae207 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java @@ -14,9 +14,10 @@ import org.opendaylight.controller.netconf.confignetconfconnector.util.Util; import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.opendaylight.yangtools.yang.common.QName; import org.w3c.dom.Document; +import org.w3c.dom.Element; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import org.w3c.dom.Element; public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWritingStrategy { @@ -41,13 +42,11 @@ public class SimpleIdentityRefAttributeWritingStrategy extends SimpleAttributeWr } @Override - protected Element createElement(Document doc, String key, String value) { + protected Element createElement(Document doc, String key, String value, Optional namespace) { QName qName = QName.create(value); String identity = qName.getLocalName(); - Element element = XmlUtil.createPrefixedTextElement(doc, key, PREFIX, identity); - String identityNamespace = qName.getNamespace().toString(); - XmlUtil.addPrefixedNamespaceAttr(element, PREFIX, identityNamespace); + Element element = XmlUtil.createPrefixedTextElement(doc, XmlUtil.createPrefixedValue(PREFIX, key), PREFIX, identity, Optional.of(identityNamespace)); return element; } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Config.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Config.java index 449cfbb4cd..decb091f86 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Config.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Config.java @@ -8,12 +8,20 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.config; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Multimap; +import static com.google.common.base.Preconditions.checkState; +import static java.lang.String.format; + +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.management.ObjectName; + import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditStrategyType; @@ -25,18 +33,12 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.management.ObjectName; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkState; -import static java.lang.String.format; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; public class Config { private final Logger logger = LoggerFactory.getLogger(Config.class); @@ -114,12 +116,10 @@ public class Config { Element root = dataElement; if (maybeNamespace.isPresent()) { - XmlUtil.addNamespaceAttr(root, maybeNamespace.get()); + root.setAttributeNS(maybeNamespace.get(), dataElement.getNodeName(), "xmlns"); } - Element modulesElement = document.createElement(XmlNetconfConstants.MODULES_KEY); - XmlUtil.addNamespaceAttr(modulesElement, - XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); + Element modulesElement = XmlUtil.createElement(document, XmlNetconfConstants.MODULES_KEY, Optional.of(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG)); root.appendChild(modulesElement); for (String moduleNamespace : moduleToInstances.keySet()) { for (Entry> moduleMappingEntry : moduleToInstances.get(moduleNamespace) diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/ModuleConfig.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/ModuleConfig.java index bf625ea0e2..dbaa7895d3 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/ModuleConfig.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/ModuleConfig.java @@ -8,8 +8,12 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.config; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.Date; +import java.util.Map; + +import javax.management.ObjectName; + import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditStrategyType; @@ -20,10 +24,9 @@ import org.opendaylight.yangtools.yang.common.QName; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.management.ObjectName; -import java.util.Collection; -import java.util.Date; -import java.util.Map; +import com.google.common.base.Optional; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; public class ModuleConfig { @@ -57,19 +60,18 @@ public class ModuleConfig { } public Element toXml(ObjectName instanceON, ServiceRegistryWrapper depTracker, Document document, String namespace) { - Element root = document.createElement(XmlNetconfConstants.MODULE_KEY); + Element root = XmlUtil.createElement(document, XmlNetconfConstants.MODULE_KEY, Optional.absent()); // Xml.addNamespaceAttr(document, root, namespace); final String prefix = getPrefix(namespace); - Element typeElement = XmlUtil.createPrefixedTextElement(document, XmlNetconfConstants.TYPE_KEY, prefix, - moduleName); - XmlUtil.addPrefixedNamespaceAttr(typeElement, prefix, namespace); + Element typeElement = XmlUtil.createPrefixedTextElement(document, XmlUtil.createPrefixedValue(prefix, XmlNetconfConstants.TYPE_KEY), prefix, + moduleName, Optional.of(namespace)); // Xml.addNamespaceAttr(document, typeElement, // XMLUtil.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); root.appendChild(typeElement); - Element nameElement = XmlUtil.createTextElement(document, XmlNetconfConstants.NAME_KEY, - ObjectNameUtil.getInstanceName(instanceON)); + Element nameElement = XmlUtil.createTextElement(document, XmlUtil.createPrefixedValue(prefix, XmlNetconfConstants.NAME_KEY), + ObjectNameUtil.getInstanceName(instanceON), Optional.of(namespace)); // Xml.addNamespaceAttr(document, nameElement, // XMLUtil.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); root.appendChild(nameElement); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Services.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Services.java index 7de7ea8c71..9767b3f056 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Services.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Services.java @@ -8,8 +8,14 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.config; -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.management.ObjectName; + import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml.ObjectNameAttributeReadingStrategy; import org.opendaylight.controller.netconf.util.xml.XmlElement; @@ -20,12 +26,9 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.management.ObjectName; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; public final class Services { @@ -127,29 +130,27 @@ public final class Services { } public static Element toXml(ServiceRegistryWrapper serviceRegistryWrapper, Document document) { - Element root = document.createElement(XmlNetconfConstants.SERVICES_KEY); - XmlUtil.addNamespaceAttr(root, XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); + Element root = XmlUtil.createElement(document, XmlNetconfConstants.SERVICES_KEY, Optional.of(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG)); Map>> mappedServices = serviceRegistryWrapper.getMappedServices(); for (String namespace : mappedServices.keySet()) { for (Entry> serviceEntry : mappedServices.get(namespace).entrySet()) { - Element serviceElement = document.createElement(SERVICE_KEY); + Element serviceElement = XmlUtil.createElement(document, SERVICE_KEY, Optional.absent()); root.appendChild(serviceElement); - Element typeElement = XmlUtil.createPrefixedTextElement(document, TYPE_KEY, XmlNetconfConstants.PREFIX, - serviceEntry.getKey()); - XmlUtil.addPrefixedNamespaceAttr(typeElement, XmlNetconfConstants.PREFIX, namespace); + Element typeElement = XmlUtil.createPrefixedTextElement(document, XmlUtil.createPrefixedValue(XmlNetconfConstants.PREFIX, TYPE_KEY), XmlNetconfConstants.PREFIX, + serviceEntry.getKey(), Optional.of(namespace)); serviceElement.appendChild(typeElement); for (Entry instanceEntry : serviceEntry.getValue().entrySet()) { - Element instanceElement = document.createElement(XmlNetconfConstants.INSTANCE_KEY); + Element instanceElement = XmlUtil.createElement(document, XmlNetconfConstants.INSTANCE_KEY, Optional.absent()); serviceElement.appendChild(instanceElement); - Element nameElement = XmlUtil.createTextElement(document, NAME_KEY, instanceEntry.getKey()); + Element nameElement = XmlUtil.createTextElement(document, NAME_KEY, instanceEntry.getKey(), Optional.absent()); instanceElement.appendChild(nameElement); - Element providerElement = XmlUtil.createTextElement(document, PROVIDER_KEY, instanceEntry.getValue()); + Element providerElement = XmlUtil.createTextElement(document, PROVIDER_KEY, instanceEntry.getValue(), Optional.absent()); instanceElement.appendChild(providerElement); } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/InstanceRuntime.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/InstanceRuntime.java index 6a0d7508c8..8c3b35122c 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/InstanceRuntime.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/InstanceRuntime.java @@ -8,19 +8,23 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.runtime; -import com.google.common.base.Predicate; -import com.google.common.collect.Collections2; -import com.google.common.collect.Sets; -import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.InstanceConfig; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import javax.management.ObjectName; import java.util.Hashtable; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import javax.management.ObjectName; + +import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.InstanceConfig; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; +import com.google.common.collect.Sets; + public class InstanceRuntime { /** @@ -104,7 +108,7 @@ public class InstanceRuntime { String elementName = jmxToYangChildRbeMapping.get(childMappingEntry.getKey()); - Element innerXml = document.createElement(elementName); + Element innerXml = XmlUtil.createElement(document, elementName, Optional.absent()); childMappingEntry.getValue().toXml(objectName, innerChildRbeOns, document, runtimeInstanceIndex, innerXml, namespace); xml.appendChild(innerXml); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/Runtime.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/Runtime.java index 129143835f..8fc3ee1423 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/Runtime.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/Runtime.java @@ -8,9 +8,12 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.runtime; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Maps; -import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import javax.management.ObjectName; + import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.Config; import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.ModuleConfig; @@ -20,10 +23,10 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.management.ObjectName; -import java.util.Collection; -import java.util.Map; -import java.util.Set; +import com.google.common.base.Optional; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; public class Runtime { @@ -61,11 +64,9 @@ public class Runtime { } public Element toXml(Set instancesToMap, Set configBeans, Document document, ServiceRegistryWrapper serviceRegistry) { - Element root = document.createElement(XmlNetconfConstants.DATA_KEY); + Element root = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent()); - Element modulesElement = document.createElement(XmlNetconfConstants.MODULES_KEY); - XmlUtil.addNamespaceAttr(modulesElement, - XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); + Element modulesElement = XmlUtil.createElement(document, XmlNetconfConstants.MODULES_KEY, Optional.of(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG)); root.appendChild(modulesElement); Map> moduleToRuntimeInstance = mapInstancesToModules(instancesToMap); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Commit.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Commit.java index 57e356704f..561aab9052 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Commit.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Commit.java @@ -22,11 +22,14 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorT import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class Commit extends AbstractConfigNetconfOperation { private static final Logger logger = LoggerFactory.getLogger(Commit.class); @@ -73,7 +76,7 @@ public class Commit extends AbstractConfigNetconfOperation { } logger.trace("Datastore {} committed successfully: {}", Datastore.candidate, status); - return document.createElement(XmlNetconfConstants.OK); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/DiscardChanges.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/DiscardChanges.java index 2f72612beb..639d4dac72 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/DiscardChanges.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/DiscardChanges.java @@ -19,11 +19,14 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorT import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + public class DiscardChanges extends AbstractConfigNetconfOperation { public static final String DISCARD = "discard-changes"; @@ -75,6 +78,6 @@ public class DiscardChanges extends AbstractConfigNetconfOperation { } logger.trace("Changes discarded successfully from datastore {}", Datastore.candidate); - return document.createElement(XmlNetconfConstants.OK); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Validate.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Validate.java index 33432e45df..642c4456a8 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Validate.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Validate.java @@ -20,11 +20,13 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorT import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; public class Validate extends AbstractConfigNetconfOperation { @@ -100,6 +102,6 @@ public class Validate extends AbstractConfigNetconfOperation { logger.trace("Datastore {} validated successfully", Datastore.candidate); - return document.createElement(XmlNetconfConstants.OK); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/editconfig/EditConfig.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/editconfig/EditConfig.java index 01ced4cb9a..0cc9d1153f 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/editconfig/EditConfig.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/editconfig/EditConfig.java @@ -20,7 +20,6 @@ import javax.management.ObjectName; import org.opendaylight.controller.config.api.ValidationException; import org.opendaylight.controller.config.util.ConfigRegistryClient; import org.opendaylight.controller.config.util.ConfigTransactionClient; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity; @@ -35,9 +34,11 @@ import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.Services; import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfigXmlParser.EditConfigExecution; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.slf4j.Logger; @@ -46,6 +47,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; @@ -81,7 +83,7 @@ public class EditConfig extends AbstractConfigNetconfOperation { logger.trace("Operation {} successful", EditConfigXmlParser.EDIT_CONFIG); - return document.createElement(XmlNetconfConstants.OK); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } private void executeSet(ConfigRegistryClient configRegistryClient, diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java index bf7f9f0f24..05bba56611 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java @@ -16,7 +16,6 @@ import javax.management.ObjectName; import org.opendaylight.controller.config.util.ConfigRegistryClient; import org.opendaylight.controller.config.util.ConfigTransactionClient; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity; import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag; @@ -26,9 +25,11 @@ import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation; import org.opendaylight.controller.netconf.confignetconfconnector.operations.Datastore; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -78,7 +79,7 @@ public class GetConfig extends AbstractConfigNetconfOperation { private Element getResponseInternal(final Document document, final ConfigRegistryClient configRegistryClient, final Datastore source) throws NetconfDocumentedException { - Element dataElement = document.createElement(XmlNetconfConstants.DATA_KEY); + Element dataElement = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent()); final Set instances = Datastore.getInstanceQueryStrategy(source, this.transactionProvider) .queryInstances(configRegistryClient); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java index a7b42889b6..8accbd591f 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java @@ -14,7 +14,6 @@ import javax.management.ObjectName; import javax.management.openmbean.OpenType; import org.opendaylight.controller.config.util.ConfigRegistryClient; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry; import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry.Rpc; @@ -30,9 +29,11 @@ import org.opendaylight.controller.netconf.confignetconfconnector.mapping.rpc.Mo import org.opendaylight.controller.netconf.confignetconfconnector.mapping.rpc.Rpcs; import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation; import org.opendaylight.controller.netconf.confignetconfconnector.operations.Commit; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -66,7 +67,7 @@ public class RuntimeRpc extends AbstractConfigNetconfOperation { // Either allow List of Elements to be returned from NetconfOperation or // pass reference to parent output xml element for netconf operations to // append result(s) on their own - Element tempParent = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, "output"); + Element tempParent = XmlUtil.createElement(doc, "output", Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); new ObjectXmlWriter().prepareWritingStrategy(elementName, returnType, doc).writeElement(tempParent, namespace, mappedAttributeOpt.get()); XmlElement xmlElement = XmlElement.fromDomElement(tempParent); @@ -179,7 +180,7 @@ public class RuntimeRpc extends AbstractConfigNetconfOperation { execution.on, execution.attributes, result); if (execution.isVoid()) { - return document.createElement("ok"); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } else { return toXml(document, result, execution.returnType, execution.namespace, execution.returnType.getAttributeYangName()); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java index 95659ddf91..c6248df41b 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java @@ -8,10 +8,11 @@ package org.opendaylight.controller.netconf.confignetconfconnector.osgi; -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.opendaylight.controller.config.api.LookupRegistry; import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; @@ -22,10 +23,10 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.yangtools.yang.model.api.Module; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; /** * Manages life cycle of {@link YangStoreSnapshot}. @@ -141,6 +142,11 @@ public class NetconfOperationServiceImpl implements NetconfOperationService { public Optional> getLocation() { return Optional.absent(); } + + @Override + public String toString() { + return capability; + } } private static class YangStoreCapability extends BasicCapability { diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java index 8b6b1aefc1..cd38d3babe 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java @@ -8,12 +8,45 @@ package org.opendaylight.controller.netconf.confignetconfconnector; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import org.apache.commons.lang3.StringUtils; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElement; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithText; +import static org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToElement; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.ObjectName; +import javax.xml.parsers.ParserConfigurationException; + +import org.custommonkey.xmlunit.AbstractNodeTester; +import org.custommonkey.xmlunit.NodeTest; +import org.custommonkey.xmlunit.NodeTestException; +import org.custommonkey.xmlunit.NodeTester; +import org.custommonkey.xmlunit.XMLAssert; +import org.custommonkey.xmlunit.XMLUnit; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -41,7 +74,7 @@ import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMX import org.opendaylight.controller.config.yang.test.impl.Peers; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter; import org.opendaylight.controller.netconf.confignetconfconnector.operations.Commit; import org.opendaylight.controller.netconf.confignetconfconnector.operations.DiscardChanges; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig; @@ -52,7 +85,7 @@ import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStore import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreSnapshot; import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshotImpl; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution; @@ -72,35 +105,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.w3c.dom.traversal.DocumentTraversal; import org.xml.sax.SAXException; -import javax.management.InstanceAlreadyExistsException; -import javax.management.InstanceNotFoundException; -import javax.management.ObjectName; -import javax.xml.parsers.ParserConfigurationException; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigInteger; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; public class NetconfMappingTest extends AbstractConfigTest { @@ -108,6 +123,7 @@ public class NetconfMappingTest extends AbstractConfigTest { private static final String INSTANCE_NAME = "instance-from-code"; private static final String NETCONF_SESSION_ID = "foo"; + private static final String TEST_NAMESPACE= "urn:opendaylight:params:xml:ns:yang:controller:test:impl"; private NetconfTestImplModuleFactory factory; private DepTestImplModuleFactory factory2; private IdentityTestModuleFactory factory3; @@ -117,7 +133,7 @@ public class NetconfMappingTest extends AbstractConfigTest { @Mock NetconfOperationRouter netconfOperationRouter; @Mock - NetconfOperationServiceSnapshot netconfOperationServiceSnapshot; + NetconfOperationServiceSnapshotImpl netconfOperationServiceSnapshot; private TransactionProvider transactionProvider; @@ -180,72 +196,101 @@ public class NetconfMappingTest extends AbstractConfigTest { createModule(INSTANCE_NAME); edit("netconfMessages/editConfig.xml"); - Element config = getConfigCandidate(); - assertCorrectServiceNames(config, 6, "ref_test2", "user_to_instance_from_code", "ref_dep_user", + Document config = getConfigCandidate(); + assertCorrectServiceNames(config, Sets.newHashSet("ref_test2", "user_to_instance_from_code", "ref_dep_user", "ref_dep_user_two", "ref_from_code_to_instance-from-code_dep_1", - "ref_from_code_to_instance-from-code_1"); + "ref_from_code_to_instance-from-code_1")); edit("netconfMessages/editConfig_addServiceName.xml"); config = getConfigCandidate(); - assertCorrectServiceNames(config, 7, "ref_test2", "user_to_instance_from_code", "ref_dep_user", + assertCorrectServiceNames(config, Sets.newHashSet("ref_test2", "user_to_instance_from_code", "ref_dep_user", "ref_dep_user_two", "ref_from_code_to_instance-from-code_dep_1", - "ref_from_code_to_instance-from-code_1", "ref_dep_user_another"); + "ref_from_code_to_instance-from-code_1", "ref_dep_user_another")); edit("netconfMessages/editConfig_addServiceNameOnTest.xml"); config = getConfigCandidate(); - assertCorrectServiceNames(config, 7, "ref_test2", "user_to_instance_from_code", "ref_dep_user", + assertCorrectServiceNames(config, Sets.newHashSet("ref_test2", "user_to_instance_from_code", "ref_dep_user", "ref_dep_user_two", "ref_from_code_to_instance-from-code_dep_1", - "ref_from_code_to_instance-from-code_1", "ref_dep_user_another"); + "ref_from_code_to_instance-from-code_1", "ref_dep_user_another")); commit(); config = getConfigRunning(); assertCorrectRefNamesForDependencies(config); - assertCorrectServiceNames(config, 7, "ref_test2", "user_to_instance_from_code", "ref_dep_user", + assertCorrectServiceNames(config, Sets.newHashSet("ref_test2", "user_to_instance_from_code", "ref_dep_user", "ref_dep_user_two", "ref_from_code_to_instance-from-code_dep_1", - "ref_from_code_to_instance-from-code_1", "ref_dep_user_another"); + "ref_from_code_to_instance-from-code_1", "ref_dep_user_another")); edit("netconfMessages/editConfig_replace_default.xml"); config = getConfigCandidate(); - assertCorrectServiceNames(config, 2, "ref_dep", "ref_dep2"); + assertCorrectServiceNames(config, Sets.newHashSet("ref_dep", "ref_dep2")); edit("netconfMessages/editConfig_remove.xml"); config = getConfigCandidate(); - assertCorrectServiceNames(config, 0); + assertCorrectServiceNames(config, Collections.emptySet()); commit(); config = getConfigCandidate(); - assertCorrectServiceNames(config, 0); + assertCorrectServiceNames(config, Collections.emptySet()); } - private void assertCorrectRefNamesForDependencies(Element config) { + private void assertCorrectRefNamesForDependencies(Document config) throws NodeTestException { NodeList modulesList = config.getElementsByTagName("modules"); assertEquals(1, modulesList.getLength()); - Element modules = (Element) modulesList.item(0); + NodeTest nt = new NodeTest((DocumentTraversal) config, modulesList.item(0)); + NodeTester tester = new AbstractNodeTester() { + private int defaultRefNameCount = 0; + private int userRefNameCount = 0; - String trimmedModules = XmlUtil.toString(modules).replaceAll("\\s", ""); - int defaultRefNameCount = StringUtils.countMatches(trimmedModules, "ref_dep2"); - int userRefNameCount = StringUtils.countMatches(trimmedModules, "ref_dep_user_two"); + @Override + public void testText(Text text) throws NodeTestException { + if(text.getData().equals("ref_dep2")) { + defaultRefNameCount++; + } else if(text.getData().equals("ref_dep_user_two")) { + userRefNameCount++; + } + } - assertEquals(0, defaultRefNameCount); - assertEquals(2, userRefNameCount); + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertEquals(0, defaultRefNameCount); + assertEquals(2, userRefNameCount); + } + }; + nt.performTest(tester, Node.TEXT_NODE); } - private void assertCorrectServiceNames(Element configCandidate, int servicesSize, String... refNames) { - NodeList elements = configCandidate.getElementsByTagName("provider"); - assertEquals(servicesSize, elements.getLength()); + private void assertCorrectServiceNames(Document configCandidate, final Set refNames) throws NodeTestException { - NodeList servicesList = configCandidate.getElementsByTagName("services"); - assertEquals(1, servicesList.getLength()); + NodeList servicesNodes = configCandidate.getElementsByTagName("services"); + assertEquals(1, servicesNodes.getLength()); - Element services = (Element) servicesList.item(0); - String trimmedServices = XmlUtil.toString(services).replaceAll("\\s", ""); + NodeTest nt = new NodeTest((DocumentTraversal) configCandidate, servicesNodes.item(0)); + NodeTester tester = new AbstractNodeTester() { - for (String s : refNames) { - assertThat(trimmedServices, JUnitMatchers.containsString(s)); - } + @Override + public void testElement(Element element) throws NodeTestException { + if(element.getNodeName() != null) { + if(element.getNodeName().equals("name")) { + String elmText = element.getTextContent(); + if(refNames.contains(elmText)) { + refNames.remove(elmText); + return; + } else { + throw new NodeTestException("Unexpected services defined: " + elmText); + } + } + } + } + + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertTrue(refNames.isEmpty()); + } + }; + nt.performTest(tester, Node.ELEMENT_NODE); } @Test @@ -255,19 +300,18 @@ public class NetconfMappingTest extends AbstractConfigTest { edit("netconfMessages/editConfig.xml"); commit(); - Element response = getConfigRunning(); - String trimmedResponse = XmlUtil.toString(response).replaceAll("\\s", ""); - assertContainsString(trimmedResponse, "0:0:0:0:0:0:0:1"); - assertContainsString(trimmedResponse, "456"); + Document response = getConfigRunning(); + Element ipElement = readXmlToElement("0:0:0:0:0:0:0:1"); + assertContainsElement(response, readXmlToElement("0:0:0:0:0:0:0:1")); + + assertContainsElement(response, readXmlToElement("456")); edit("netconfMessages/editConfig_setUnions.xml"); commit(); response = getConfigRunning(); - - trimmedResponse = XmlUtil.toString(response).replaceAll("\\s", ""); - assertContainsString(trimmedResponse, "127.1.2.3"); - assertContainsString(trimmedResponse, "randomStringForUnion"); + assertContainsElement(response, readXmlToElement("127.1.2.3")); + assertContainsElement(response, readXmlToElement("randomStringForUnion")); } @@ -277,7 +321,7 @@ public class NetconfMappingTest extends AbstractConfigTest { createModule(INSTANCE_NAME); edit("netconfMessages/editConfig.xml"); - Element configCandidate = getConfigCandidate(); + Document configCandidate = getConfigCandidate(); checkBinaryLeafEdited(configCandidate); @@ -287,7 +331,7 @@ public class NetconfMappingTest extends AbstractConfigTest { // check after edit commit(); - Element response = getConfigRunning(); + Document response = getConfigRunning(); checkBinaryLeafEdited(response); checkTypeConfigAttribute(response); @@ -299,17 +343,12 @@ public class NetconfMappingTest extends AbstractConfigTest { edit("netconfMessages/editConfig_remove.xml"); commit(); - response = getConfigCandidate(); - final String responseFromCandidate = XmlUtil.toString(response).replaceAll("\\s+", ""); - response = getConfigRunning(); - final String responseFromRunning = XmlUtil.toString(response).replaceAll("\\s+", ""); - assertEquals(responseFromCandidate, responseFromRunning); - - final String expectedResult = XmlFileLoader.fileToString("netconfMessages/editConfig_expectedResult.xml") - .replaceAll("\\s+", ""); + assertXMLEqual(getConfigCandidate(), getConfigRunning()); - assertEquals(expectedResult, responseFromRunning); - assertEquals(expectedResult, responseFromCandidate); + final Document expectedResult = XmlFileLoader.xmlFileToDocument("netconfMessages/editConfig_expectedResult.xml"); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(expectedResult, getConfigRunning()); + assertXMLEqual(expectedResult, getConfigCandidate()); edit("netconfMessages/editConfig_none.xml"); closeSession(); @@ -318,12 +357,10 @@ public class NetconfMappingTest extends AbstractConfigTest { verifyNoMoreInteractions(netconfOperationServiceSnapshot); } - private void checkBigDecimal(Element response) { - String responseTrimmed = XmlUtil.toString(response).replaceAll("\\s", ""); - - assertContainsString(responseTrimmed, "2.58"); + private void checkBigDecimal(Document response) throws NodeTestException, SAXException, IOException { + assertContainsElement(response, readXmlToElement("2.58")); // Default - assertContainsString(responseTrimmed, "2.00"); + assertContainsElement(response, readXmlToElement("2.00")); } @@ -345,14 +382,14 @@ public class NetconfMappingTest extends AbstractConfigTest { executeOp(commitOp, "netconfMessages/commit.xml"); } - private Element getConfigCandidate() throws ParserConfigurationException, SAXException, IOException, + private Document getConfigCandidate() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException { GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional. absent(), transactionProvider, configRegistryClient, NETCONF_SESSION_ID); return executeOp(getConfigOp, "netconfMessages/getConfig_candidate.xml"); } - private Element getConfigRunning() throws ParserConfigurationException, SAXException, IOException, + private Document getConfigRunning() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException { GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional. absent(), transactionProvider, configRegistryClient, NETCONF_SESSION_ID); @@ -376,7 +413,7 @@ public class NetconfMappingTest extends AbstractConfigTest { edit("netconfMessages/editConfig.xml"); commit(); - Element response = getConfigRunning(); + Document response = getConfigRunning(); final int allInstances = response.getElementsByTagName("module").getLength(); edit("netconfMessages/editConfig_replace_default.xml"); @@ -396,7 +433,7 @@ public class NetconfMappingTest extends AbstractConfigTest { } catch (NetconfDocumentedException e) { String message = e.getMessage(); assertContainsString(message, "Element simple-long-2 present multiple times with different namespaces"); - assertContainsString(message, "urn:opendaylight:params:xml:ns:yang:controller:test:impl"); + assertContainsString(message, TEST_NAMESPACE); assertContainsString(message, XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); throw e; } @@ -422,7 +459,7 @@ public class NetconfMappingTest extends AbstractConfigTest { } catch (NetconfDocumentedException e) { String message = e.getMessage(); assertContainsString(message, "Element binaryLeaf present multiple times with different namespaces"); - assertContainsString(message, "urn:opendaylight:params:xml:ns:yang:controller:test:impl"); + assertContainsString(message, TEST_NAMESPACE); assertContainsString(message, XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG); throw e; } @@ -435,7 +472,7 @@ public class NetconfMappingTest extends AbstractConfigTest { edit("netconfMessages/namespaces/editConfig_typeNameConfigAttributeMatching.xml"); commit(); - Element response = getConfigRunning(); + Document response = getConfigRunning(); checkTypeConfigAttribute(response); } @@ -477,7 +514,7 @@ public class NetconfMappingTest extends AbstractConfigTest { edit("netconfMessages/editConfig.xml"); commit(); - Element response = getConfigRunning(); + Document response = getConfigRunning(); final int allInstances = response.getElementsByTagName("instance").getLength(); edit("netconfMessages/editConfig_replace_module.xml"); @@ -506,53 +543,42 @@ public class NetconfMappingTest extends AbstractConfigTest { executeOp(discardOp, "netconfMessages/discardChanges.xml"); } - private void checkBinaryLeafEdited(final Element response) { - String responseTrimmed = XmlUtil.toString(response).replaceAll("\\s", ""); - String substring = "YmluYXJ5"; - assertContainsString(responseTrimmed, substring); - substring = "ZGVmYXVsdEJpbg=="; - assertContainsString(responseTrimmed, substring); + private void checkBinaryLeafEdited(final Document response) throws NodeTestException, SAXException, IOException { + assertContainsElement(response, readXmlToElement("YmluYXJ5")); + assertContainsElement(response, readXmlToElement("ZGVmYXVsdEJpbg==")); } - private void checkTypedefs(final Element response) { - String responseTrimmed = XmlUtil.toString(response).replaceAll("\\s", ""); + private void checkTypedefs(final Document response) throws NodeTestException, SAXException, IOException { - String substring = "10"; - assertContainsString(responseTrimmed, substring); + assertContainsElement(response, readXmlToElement("10")); // Default - assertContainsString(responseTrimmed, - "1"); + assertContainsElement(response, readXmlToElement("1")); - assertContainsString(responseTrimmed, - "20"); + assertContainsElement(response, readXmlToElement("20")); // Default - assertContainsString(responseTrimmed, - "2"); + assertContainsElement(response, readXmlToElement("2")); - assertContainsString(responseTrimmed, - "TWO"); + assertContainsElement(response, readXmlToElement("TWO")); // Default - assertContainsString(responseTrimmed, - "ONE"); + assertContainsElement(response, readXmlToElement("ONE")); } private void assertContainsString(String string, String substring) { assertThat(string, JUnitMatchers.containsString(substring)); } - private void checkEnum(final Element response) { - XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data") + private void checkEnum(final Document response) { + XmlElement modulesElement = XmlElement.fromDomElement(response.getDocumentElement()).getOnlyChildElement("data") .getOnlyChildElement("modules"); String enumName = "extended-enum"; String enumContent = "TWO"; for (XmlElement moduleElement : modulesElement.getChildElements("module")) { - String name = moduleElement.getOnlyChildElement("name").getTextContent(); + String name = moduleElement.getOnlyChildElement("prefix:name").getTextContent(); if(name.equals(INSTANCE_NAME)) { XmlElement enumAttr = moduleElement.getOnlyChildElement(enumName); assertEquals(enumContent, enumAttr.getTextContent()); - return; } } @@ -560,14 +586,14 @@ public class NetconfMappingTest extends AbstractConfigTest { fail("Enum attribute " + enumName + ":" + enumContent + " not present in " + XmlUtil.toString(response)); } - private void checkTestingDeps(Element response) { + private void checkTestingDeps(Document response) { int testingDepsSize = response.getElementsByTagName("testing-deps").getLength(); assertEquals(2, testingDepsSize); } - private void checkTypeConfigAttribute(Element response) { + private void checkTypeConfigAttribute(Document response) { - XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data") + XmlElement modulesElement = XmlElement.fromDomElement(response.getDocumentElement()).getOnlyChildElement("data") .getOnlyChildElement("modules"); List expectedValues = Lists.newArrayList("default-string", "configAttributeType"); @@ -575,7 +601,7 @@ public class NetconfMappingTest extends AbstractConfigTest { for (XmlElement moduleElement : modulesElement.getChildElements("module")) { for (XmlElement type : moduleElement.getChildElements("type")) { - if (type.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY).equals("") == false) { + if (type.getNamespace() != null) { configAttributeType.add(type.getTextContent()); } } @@ -629,7 +655,7 @@ public class NetconfMappingTest extends AbstractConfigTest { // check after edit commit(); - Element response = get(); + Document response = get(); assertEquals(2/*With runtime beans*/ + 2 /*Without runtime beans*/, getElementsSize(response, "module")); // data from state @@ -649,29 +675,31 @@ public class NetconfMappingTest extends AbstractConfigTest { RuntimeRpc netconf = new RuntimeRpc(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID); response = executeOp(netconf, "netconfMessages/rpc.xml"); - assertContainsString(XmlUtil.toString(response), "testarg1".toUpperCase()); + assertContainsElementWithText(response, "testarg1"); response = executeOp(netconf, "netconfMessages/rpcInner.xml"); - assertContainsString(XmlUtil.toString(response), "ok"); + Document expectedReplyOk = XmlFileLoader.xmlFileToDocument("netconfMessages/rpc-reply_ok.xml"); + XMLUnit.setIgnoreWhitespace(true); + XMLAssert.assertXMLEqual(expectedReplyOk, response); response = executeOp(netconf, "netconfMessages/rpcInnerInner.xml"); - assertContainsString(XmlUtil.toString(response), "true"); + assertContainsElementWithText(response, "true"); response = executeOp(netconf, "netconfMessages/rpcInnerInner_complex_output.xml"); - assertContainsString(XmlUtil.toString(response), "1"); - assertContainsString(XmlUtil.toString(response), "2"); + assertContainsElementWithText(response, "1"); + assertContainsElementWithText(response, "2"); } - private Element get() throws NetconfDocumentedException, ParserConfigurationException, SAXException, IOException { + private Document get() throws NetconfDocumentedException, ParserConfigurationException, SAXException, IOException { Get getOp = new Get(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID, transactionProvider); return executeOp(getOp, "netconfMessages/get.xml"); } - private int getElementsSize(Element response, String elementName) { + private int getElementsSize(Document response, String elementName) { return response.getElementsByTagName(elementName).getLength(); } - private Element executeOp(final NetconfOperation op, final String filename) throws ParserConfigurationException, + private Document executeOp(final NetconfOperation op, final String filename) throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException { final Document request = XmlFileLoader.xmlFileToDocument(filename); @@ -683,7 +711,7 @@ public class NetconfMappingTest extends AbstractConfigTest { final Document response = op.handle(request, NetconfOperationChainedExecution.EXECUTION_TERMINATION_POINT); logger.debug("Got response\n{}", XmlUtil.toString(response)); - return response.getDocumentElement(); + return response; } private List getYangs() throws FileNotFoundException { diff --git a/opendaylight/netconf/config-persister-impl/pom.xml b/opendaylight/netconf/config-persister-impl/pom.xml index 7b4511e1f9..2e2b622bd2 100644 --- a/opendaylight/netconf/config-persister-impl/pom.xml +++ b/opendaylight/netconf/config-persister-impl/pom.xml @@ -1,91 +1,91 @@ + - 4.0.0 + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - config-persister-impl - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + ../ + + config-persister-impl + bundle + ${project.artifactId} - - - - org.opendaylight.controller - config-persister-api - - - ${project.groupId} - netconf-api - - - ${project.groupId} - netconf-util - - - org.slf4j - slf4j-api - - - com.google.guava - guava - - - org.osgi - org.osgi.core - - - org.opendaylight.controller - config-persister-file-xml-adapter - test - + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-util + + + com.google.guava + guava + + + + org.opendaylight.controller + config-persister-api + + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + - - - ${project.groupId} - netconf-impl - test - - - ${project.groupId} - netconf-util - test - test-jar - - - org.opendaylight.yangtools - mockito-configuration - test - - - commons-io - commons-io - test - - - org.opendaylight.controller - config-persister-directory-xml-adapter - test - - + + + ${project.groupId} + netconf-impl + test + + + ${project.groupId} + netconf-util + test-jar + test + + + commons-io + commons-io + test + + + org.opendaylight.controller + config-persister-directory-xml-adapter + test + + + org.opendaylight.controller + config-persister-file-xml-adapter + test + + + org.opendaylight.yangtools + mockito-configuration + test + + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator - - org.opendaylight.controller.config.persister.storage.adapter - - - - - - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator + org.opendaylight.controller.config.persister.storage.adapter + + + + + + diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java index eb6fd2722a..1616857949 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java @@ -90,10 +90,10 @@ class ConfigPersisterNotificationListener implements NotificationListener { if (notification instanceof CommitJMXNotification) { try { handleAfterCommitNotification((CommitJMXNotification) notification); - } catch (Throwable e) { + } catch (Exception e) { // log exceptions from notification Handler here since // notificationBroadcastSupport logs only DEBUG level - logger.warn("Exception occured during notification handling: ", e); + logger.warn("Failed to handle notification {}", notification, e); throw e; } } else { @@ -110,4 +110,4 @@ class ConfigPersisterNotificationListener implements NotificationListener { throw new RuntimeException("Unable to persist configuration snapshot", e); } } -} \ No newline at end of file +} diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java index 76afe8eb39..0cc55719e1 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java @@ -10,14 +10,17 @@ package org.opendaylight.controller.netconf.persist.impl.osgi; import com.google.common.annotations.VisibleForTesting; import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; import org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler; import org.opendaylight.controller.netconf.persist.impl.ConfigPusher; import org.opendaylight.controller.netconf.persist.impl.PersisterAggregator; +import org.opendaylight.controller.netconf.util.CloseableUtil; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.framework.Filter; +import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; import org.osgi.util.tracker.ServiceTrackerCustomizer; @@ -33,6 +36,7 @@ import java.util.concurrent.TimeUnit; public class ConfigPersisterActivator implements BundleActivator { private static final Logger logger = LoggerFactory.getLogger(ConfigPersisterActivator.class); + private static final MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); public static final String MAX_WAIT_FOR_CAPABILITIES_MILLIS_PROPERTY = "maxWaitForCapabilitiesMillis"; private static final long MAX_WAIT_FOR_CAPABILITIES_MILLIS_DEFAULT = TimeUnit.MINUTES.toMillis(2); @@ -43,9 +47,6 @@ public class ConfigPersisterActivator implements BundleActivator { public static final String STORAGE_ADAPTER_CLASS_PROP_SUFFIX = "storageAdapterClass"; - - private static final MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); - private List autoCloseables; @@ -55,56 +56,32 @@ public class ConfigPersisterActivator implements BundleActivator { autoCloseables = new ArrayList<>(); PropertiesProviderBaseImpl propertiesProvider = new PropertiesProviderBaseImpl(context); - final PersisterAggregator persisterAggregator = PersisterAggregator.createFromProperties(propertiesProvider); autoCloseables.add(persisterAggregator); - final long maxWaitForCapabilitiesMillis = getMaxWaitForCapabilitiesMillis(propertiesProvider); - final List configs = persisterAggregator.loadLastConfigs(); - final long conflictingVersionTimeoutMillis = getConflictingVersionTimeoutMillis(propertiesProvider); + long maxWaitForCapabilitiesMillis = getMaxWaitForCapabilitiesMillis(propertiesProvider); + List configs = persisterAggregator.loadLastConfigs(); + long conflictingVersionTimeoutMillis = getConflictingVersionTimeoutMillis(propertiesProvider); logger.trace("Following configs will be pushed: {}", configs); - ServiceTrackerCustomizer configNetconfCustomizer = new ServiceTrackerCustomizer() { - @Override - public NetconfOperationServiceFactory addingService(ServiceReference reference) { - NetconfOperationServiceFactory service = reference.getBundle().getBundleContext().getService(reference); - final ConfigPusher configPusher = new ConfigPusher(service, maxWaitForCapabilitiesMillis, conflictingVersionTimeoutMillis); - logger.debug("Configuration Persister got %s", service); - final Thread pushingThread = new Thread(new Runnable() { - @Override - public void run() { - configPusher.pushConfigs(configs); - logger.info("Configuration Persister initialization completed."); - ConfigPersisterNotificationHandler jmxNotificationHandler = new ConfigPersisterNotificationHandler(platformMBeanServer, persisterAggregator); - synchronized (ConfigPersisterActivator.this) { - autoCloseables.add(jmxNotificationHandler); - } - } - }, "config-pusher"); - synchronized (ConfigPersisterActivator.this){ - autoCloseables.add(new AutoCloseable() { - @Override - public void close() throws Exception { - pushingThread.interrupt(); - } - }); - } - pushingThread.start(); - return service; - } - @Override - public void modifiedService(ServiceReference reference, NetconfOperationServiceFactory service) { - } + InnerCustomizer innerCustomizer = new InnerCustomizer(configs, maxWaitForCapabilitiesMillis, + conflictingVersionTimeoutMillis, persisterAggregator); + OuterCustomizer outerCustomizer = new OuterCustomizer(context, innerCustomizer); + new ServiceTracker<>(context, NetconfOperationProvider.class, outerCustomizer).open(); + } - @Override - public void removedService(ServiceReference reference, NetconfOperationServiceFactory service) { - } - }; + private long getConflictingVersionTimeoutMillis(PropertiesProviderBaseImpl propertiesProvider) { + String timeoutProperty = propertiesProvider.getProperty(CONFLICTING_VERSION_TIMEOUT_MILLIS_PROPERTY); + return timeoutProperty == null ? CONFLICTING_VERSION_TIMEOUT_MILLIS_DEFAULT : Long.valueOf(timeoutProperty); + } - Filter filter = context.createFilter(getFilterString()); + private long getMaxWaitForCapabilitiesMillis(PropertiesProviderBaseImpl propertiesProvider) { + String timeoutProperty = propertiesProvider.getProperty(MAX_WAIT_FOR_CAPABILITIES_MILLIS_PROPERTY); + return timeoutProperty == null ? MAX_WAIT_FOR_CAPABILITIES_MILLIS_DEFAULT : Long.valueOf(timeoutProperty); + } - ServiceTracker tracker = - new ServiceTracker<>(context, filter, configNetconfCustomizer); - tracker.open(); + @Override + public synchronized void stop(BundleContext context) throws Exception { + CloseableUtil.closeAll(autoCloseables); } @@ -116,32 +93,92 @@ public class ConfigPersisterActivator implements BundleActivator { ")"; } - private long getConflictingVersionTimeoutMillis(PropertiesProviderBaseImpl propertiesProvider) { - String timeoutProperty = propertiesProvider.getProperty(CONFLICTING_VERSION_TIMEOUT_MILLIS_PROPERTY); - return timeoutProperty == null ? CONFLICTING_VERSION_TIMEOUT_MILLIS_DEFAULT : Long.valueOf(timeoutProperty); - } + class OuterCustomizer implements ServiceTrackerCustomizer { + private final BundleContext context; + private final InnerCustomizer innerCustomizer; - private long getMaxWaitForCapabilitiesMillis(PropertiesProviderBaseImpl propertiesProvider) { - String timeoutProperty = propertiesProvider.getProperty(MAX_WAIT_FOR_CAPABILITIES_MILLIS_PROPERTY); - return timeoutProperty == null ? MAX_WAIT_FOR_CAPABILITIES_MILLIS_DEFAULT : Long.valueOf(timeoutProperty); - } + OuterCustomizer(BundleContext context, InnerCustomizer innerCustomizer) { + this.context = context; + this.innerCustomizer = innerCustomizer; + } - @Override - public synchronized void stop(BundleContext context) throws Exception { - Exception lastException = null; - for (AutoCloseable autoCloseable : autoCloseables) { + @Override + public NetconfOperationProvider addingService(ServiceReference reference) { + logger.trace("Got OuterCustomizer.addingService {}", reference); + // JMX was registered, track config-netconf-connector + Filter filter; try { - autoCloseable.close(); - } catch (Exception e) { - if (lastException == null) { - lastException = e; - } else { - lastException.addSuppressed(e); + filter = context.createFilter(getFilterString()); + } catch (InvalidSyntaxException e) { + throw new IllegalStateException(e); + } + new ServiceTracker<>(context, filter, innerCustomizer).open(); + return null; + } + + @Override + public void modifiedService(ServiceReference reference, NetconfOperationProvider service) { + + } + + @Override + public void removedService(ServiceReference reference, NetconfOperationProvider service) { + + } + } + + class InnerCustomizer implements ServiceTrackerCustomizer { + private final List configs; + private final PersisterAggregator persisterAggregator; + private final long maxWaitForCapabilitiesMillis, conflictingVersionTimeoutMillis; + + + InnerCustomizer(List configs, long maxWaitForCapabilitiesMillis, long conflictingVersionTimeoutMillis, + PersisterAggregator persisterAggregator) { + this.configs = configs; + this.maxWaitForCapabilitiesMillis = maxWaitForCapabilitiesMillis; + this.conflictingVersionTimeoutMillis = conflictingVersionTimeoutMillis; + this.persisterAggregator = persisterAggregator; + } + + @Override + public NetconfOperationServiceFactory addingService(ServiceReference reference) { + logger.trace("Got InnerCustomizer.addingService {}", reference); + NetconfOperationServiceFactory service = reference.getBundle().getBundleContext().getService(reference); + + final ConfigPusher configPusher = new ConfigPusher(service, maxWaitForCapabilitiesMillis, conflictingVersionTimeoutMillis); + logger.debug("Configuration Persister got {}", service); + final Thread pushingThread = new Thread(new Runnable() { + @Override + public void run() { + configPusher.pushConfigs(configs); + logger.info("Configuration Persister initialization completed."); + ConfigPersisterNotificationHandler jmxNotificationHandler = new ConfigPersisterNotificationHandler(platformMBeanServer, persisterAggregator); + synchronized (ConfigPersisterActivator.this) { + autoCloseables.add(jmxNotificationHandler); + } } + }, "config-pusher"); + synchronized (ConfigPersisterActivator.this) { + autoCloseables.add(new AutoCloseable() { + @Override + public void close() throws Exception { + pushingThread.interrupt(); + } + }); } + pushingThread.start(); + return service; + } + + @Override + public void modifiedService(ServiceReference reference, NetconfOperationServiceFactory service) { } - if (lastException != null) { - throw lastException; + + @Override + public void removedService(ServiceReference reference, NetconfOperationServiceFactory service) { } + } } + diff --git a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java index 493ecd9250..b1bf232928 100644 --- a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java +++ b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java @@ -25,9 +25,7 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.xml.sax.SAXException; -import javax.management.MBeanServer; import java.io.IOException; -import java.lang.management.ManagementFactory; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; @@ -41,7 +39,6 @@ public class ConfigPersisterTest { private MockedBundleContext ctx; private ConfigPersisterActivator configPersisterActivator; - private static final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); private TestingExceptionHandler handler; diff --git a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/MockedBundleContext.java b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/MockedBundleContext.java index 8bc787bdef..95fd5f6549 100644 --- a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/MockedBundleContext.java +++ b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/MockedBundleContext.java @@ -14,6 +14,7 @@ import org.mockito.MockitoAnnotations; import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder; import org.opendaylight.controller.config.persist.api.Persister; import org.opendaylight.controller.config.persist.api.PropertiesProvider; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; import org.opendaylight.controller.netconf.persist.impl.DummyAdapter; @@ -39,7 +40,7 @@ final class MockedBundleContext { @Mock private BundleContext context; @Mock - private Filter filter; + private Filter outerFilter, innerFilter; @Mock private ServiceReference serviceReference; @Mock @@ -53,12 +54,21 @@ final class MockedBundleContext { MockitoAnnotations.initMocks(this); doReturn(null).when(context).getProperty(anyString()); initContext(maxWaitForCapabilitiesMillis, conflictingVersionTimeoutMillis); - doReturn(filter).when(context).createFilter(ConfigPersisterActivator.getFilterString()); - String filterString = "filter"; - doReturn(filterString).when(filter).toString(); - doNothing().when(context).addServiceListener(any(ServiceListener.class), eq(filterString)); + + String outerFilterString = "(objectClass=org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider)"; + doReturn(outerFilter).when(context).createFilter(outerFilterString); + doNothing().when(context).addServiceListener(any(ServiceListener.class), eq(outerFilterString)); ServiceReference[] toBeReturned = {serviceReference}; - doReturn(toBeReturned).when(context).getServiceReferences((String) null, filterString); + doReturn(toBeReturned).when(context).getServiceReferences(NetconfOperationProvider.class.getName(), null); + + String innerFilterString = "innerfilter"; + doReturn(innerFilterString).when(outerFilter).toString(); + + doReturn(innerFilter).when(context).createFilter(ConfigPersisterActivator.getFilterString()); + doReturn(innerFilterString).when(innerFilter).toString(); + doNothing().when(context).addServiceListener(any(ServiceListener.class), eq(innerFilterString)); + + doReturn(toBeReturned).when(context).getServiceReferences((String) null, innerFilterString); doReturn(bundle).when(serviceReference).getBundle(); doReturn(context).when(bundle).getBundleContext(); doReturn("").when(serviceReference).toString(); @@ -66,6 +76,7 @@ final class MockedBundleContext { doReturn(service).when(serviceFactory).createService(anyString()); doReturn(Collections.emptySet()).when(service).getCapabilities(); doNothing().when(service).close(); + doReturn("serviceFactoryMock").when(serviceFactory).toString(); } public BundleContext getBundleContext() { diff --git a/opendaylight/netconf/ietf-netconf-monitoring-extension/pom.xml b/opendaylight/netconf/ietf-netconf-monitoring-extension/pom.xml index 2590ad8b11..330bcc8796 100644 --- a/opendaylight/netconf/ietf-netconf-monitoring-extension/pom.xml +++ b/opendaylight/netconf/ietf-netconf-monitoring-extension/pom.xml @@ -1,54 +1,50 @@ + - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - ietf-netconf-monitoring-extension - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + ietf-netconf-monitoring-extension + bundle + ${project.artifactId} - - - org.opendaylight.controller - ietf-netconf-monitoring - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - + + + com.google.guava + guava + + + org.opendaylight.controller + ietf-netconf-monitoring + + + org.slf4j + slf4j-api + + + + - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - org.apache.felix - maven-bundle-plugin - - - - com.google.common.collect, + + org.apache.felix + maven-bundle-plugin + + + com.google.common.collect, org.opendaylight.yangtools.yang.binding, org.opendaylight.yangtools.yang.common, - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004, - - - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210, - - - - - - - \ No newline at end of file + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004, + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210, + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + + diff --git a/opendaylight/netconf/ietf-netconf-monitoring/pom.xml b/opendaylight/netconf/ietf-netconf-monitoring/pom.xml index bd2f1cc807..8d4b99bf03 100644 --- a/opendaylight/netconf/ietf-netconf-monitoring/pom.xml +++ b/opendaylight/netconf/ietf-netconf-monitoring/pom.xml @@ -1,63 +1,57 @@ - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - ietf-netconf-monitoring - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + ietf-netconf-monitoring + bundle + ${project.artifactId} + - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools.model - ietf-yang-types - + + com.google.guava + guava + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.opendaylight.yangtools.model + ietf-yang-types + + + org.slf4j + slf4j-api + + - - com.google.guava - guava - - - org.slf4j - slf4j-api - - + + - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - org.apache.felix - maven-bundle-plugin - - - - com.google.common.collect, + + org.apache.felix + maven-bundle-plugin + + + com.google.common.collect, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924, org.opendaylight.yangtools.yang.binding, - org.opendaylight.yangtools.yang.common, - - - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.* - - - - - - + org.opendaylight.yangtools.yang.common, + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.* + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + - \ No newline at end of file + diff --git a/opendaylight/netconf/netconf-api/pom.xml b/opendaylight/netconf/netconf-api/pom.xml index 3b5ed82518..061fbd7c8c 100644 --- a/opendaylight/netconf/netconf-api/pom.xml +++ b/opendaylight/netconf/netconf-api/pom.xml @@ -1,55 +1,53 @@ + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - netconf-api - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-api + bundle + ${project.artifactId} - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - protocol-framework - - - org.opendaylight.yangtools.model - ietf-inet-types - - - org.opendaylight.yangtools.model - ietf-yang-types - - - ${project.groupId} - ietf-netconf-monitoring - - - ${project.groupId} - ietf-netconf-monitoring-extension - ${project.version} - - + + + ${project.groupId} + ietf-netconf-monitoring + + + ${project.groupId} + ietf-netconf-monitoring-extension + ${project.version} + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + protocol-framework + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.opendaylight.yangtools.model + ietf-yang-types + + - - - - org.apache.felix - maven-bundle-plugin - - - - - - javax.management, + + + + org.apache.felix + maven-bundle-plugin + + + + javax.management, org.opendaylight.controller.config.api, org.opendaylight.controller.config.api.jmx, org.opendaylight.protocol.framework, @@ -61,18 +59,14 @@ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions, - com.google.common.base, - - - org.opendaylight.controller.netconf.api, + com.google.common.base, + org.opendaylight.controller.netconf.api, org.opendaylight.controller.netconf.api.jmx, - org.opendaylight.controller.netconf.api.monitoring, - - - - - - - + org.opendaylight.controller.netconf.api.monitoring, + + + + + diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java deleted file mode 100644 index f85d9b9f30..0000000000 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2013 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.netconf.api; - -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; - -import java.io.IOException; - -import org.opendaylight.protocol.framework.AbstractProtocolSession; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractNetconfSession> extends AbstractProtocolSession implements NetconfSession { - private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSession.class); - private final L sessionListener; - private final long sessionId; - private boolean up = false; - - private final Channel channel; - - protected AbstractNetconfSession(L sessionListener, Channel channel, long sessionId) { - this.sessionListener = sessionListener; - this.channel = channel; - this.sessionId = sessionId; - logger.debug("Session {} created", sessionId); - } - - protected abstract S thisInstance(); - - @Override - public void close() { - channel.close(); - up = false; - sessionListener.onSessionTerminated(thisInstance(), new NetconfTerminationReason("Session closed")); - } - - @Override - protected void handleMessage(NetconfMessage netconfMessage) { - logger.debug("handling incoming message"); - sessionListener.onMessage(thisInstance(), netconfMessage); - } - - @Override - public ChannelFuture sendMessage(NetconfMessage netconfMessage) { - return channel.writeAndFlush(netconfMessage); - } - - @Override - protected void endOfInput() { - logger.debug("Session {} end of input detected while session was in state {}", toString(), isUp() ? "up" - : "initialized"); - if (isUp()) { - this.sessionListener.onSessionDown(thisInstance(), new IOException("End of input detected. Close the session.")); - } - } - - @Override - protected void sessionUp() { - logger.debug("Session {} up", toString()); - sessionListener.onSessionUp(thisInstance()); - this.up = true; - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("ServerNetconfSession{"); - sb.append("sessionId=").append(sessionId); - sb.append('}'); - return sb.toString(); - } - - public final boolean isUp() { - return up; - } - - public final long getSessionId() { - return sessionId; - } -} - diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java new file mode 100644 index 0000000000..58242c725f --- /dev/null +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013 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.netconf.api; + +/** + * The only input for the start of a NETCONF session is hello-message. + */ +public final class NetconfClientSessionPreferences extends NetconfSessionPreferences { + + private final NetconfMessage startExiMessage; + + public NetconfClientSessionPreferences(final NetconfMessage helloMessage, + final NetconfMessage startExiMessage) { + super(helloMessage); + this.startExiMessage = startExiMessage; + } + + /** + * @return the startExiMessage + */ + public NetconfMessage getStartExiMessage() { + return startExiMessage; + } +} diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java index d56213cf16..d63a43e7eb 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java @@ -15,7 +15,8 @@ public final class NetconfServerSessionPreferences extends NetconfSessionPrefere private final long sessionId; - public NetconfServerSessionPreferences(final NetconfMessage helloMessage, long sessionId) { + public NetconfServerSessionPreferences(final NetconfMessage helloMessage, + long sessionId) { super(helloMessage); this.sessionId = sessionId; } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java index e52e71ceea..0bd54979f8 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java @@ -12,5 +12,7 @@ import io.netty.channel.ChannelFuture; import org.opendaylight.protocol.framework.ProtocolSession; public interface NetconfSession extends ProtocolSession { + ChannelFuture sendMessage(NetconfMessage message); + } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java index be3040802c..0f3717abec 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.netconf.api; public class NetconfSessionPreferences { + private final NetconfMessage helloMessage; public NetconfSessionPreferences(final NetconfMessage helloMessage) { @@ -21,4 +22,5 @@ public class NetconfSessionPreferences { public NetconfMessage getHelloMessage() { return this.helloMessage; } + } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfTerminationReason.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfTerminationReason.java index 9de3071060..a15f9e0925 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfTerminationReason.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfTerminationReason.java @@ -22,4 +22,9 @@ public class NetconfTerminationReason implements TerminationReason { public String getErrorMessage() { return reason; } + + @Override + public String toString() { + return reason; + } } diff --git a/opendaylight/netconf/netconf-client/pom.xml b/opendaylight/netconf/netconf-client/pom.xml index b0f5f74810..fd44315499 100644 --- a/opendaylight/netconf/netconf-client/pom.xml +++ b/opendaylight/netconf/netconf-client/pom.xml @@ -1,51 +1,48 @@ + - 4.0.0 + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - netconf-client - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-client + bundle + ${project.artifactId} + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-util + + + com.google.guava + guava + + + org.opendaylight.controller + protocol-framework + + + org.slf4j + slf4j-api + + - - - ${project.groupId} - netconf-util - - - ${project.groupId} - netconf-api - - - org.opendaylight.controller - protocol-framework - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - - - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.netconf.client, - - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.client, + com.google.common.base, com.google.common.collect, io.netty.channel, io.netty.channel.socket, @@ -60,15 +57,28 @@ org.opendaylight.controller.netconf.util, org.opendaylight.controller.netconf.util.*, org.opendaylight.protocol.framework, + org.openexi.*, org.slf4j, org.w3c.dom, org.xml.sax, - io.netty.handler.codec - - - - - - + io.netty.handler.codec + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + test-jar + + package + + + + + diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/AbstractNetconfClientNotifySessionListener.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/AbstractNetconfClientNotifySessionListener.java deleted file mode 100644 index 6ae966d1f7..0000000000 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/AbstractNetconfClientNotifySessionListener.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013 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.netconf.client; - -import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; - -/** - * Class extending {@link NetconfClientSessionListener} to provide notification capability. - */ -public abstract class AbstractNetconfClientNotifySessionListener extends SimpleNetconfClientSessionListener { - /* - * Maybe some capabilities could be expressed as internal NetconfClientSessionListener handlers. - * It would enable NetconfClient functionality to be extended by using namespace handlers. - * So far let just enable notification capability by extending and let parent class intact. - */ - - /** - * As class purpose is to provide notification capability to session listener - * onMessage method is not allowed to be further overridden. - * {@see #onNotification(NetconfClientSession, NetconfMessage)} - * - * @param session {@see NetconfClientSessionListener#onMessage(NetconfClientSession, NetconfMessage)} - * @param message {@see NetconfClientSessionListener#onMessage(NetconfClientSession, NetconfMessage)} - */ - @Override - public final void onMessage(NetconfClientSession session, NetconfMessage message) { - if (isNotification(message)) { - onNotification(session, message); - } else { - super.onMessage(session, message); - } - } - - /** - * Method intended to customize notification processing. - * - * @param session {@see NetconfClientSessionListener#onMessage(NetconfClientSession, NetconfMessage)} - * @param message {@see NetconfClientSessionListener#onMessage(NetconfClientSession, NetconfMessage)} - */ - public abstract void onNotification(NetconfClientSession session, NetconfMessage message); - - private boolean isNotification(NetconfMessage message) { - XmlElement xmle = XmlElement.fromDomDocument(message.getDocument()); - return XmlNetconfConstants.NOTIFICATION_ELEMENT_NAME.equals(xmle.getName()) ; - } -} diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClient.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClient.java deleted file mode 100644 index 4cdca208bc..0000000000 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClient.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2013 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.netconf.client; - -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.GlobalEventExecutor; - -import java.io.Closeable; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.util.Set; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.protocol.framework.NeverReconnectStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategy; -import org.opendaylight.protocol.framework.TimedReconnectStrategy; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.base.Preconditions; -import com.google.common.base.Stopwatch; -import com.google.common.collect.Sets; - -/** - * @deprecated Use {@link NetconfClientDispatcher.createClient()} or {@link NetconfClientDispatcher.createReconnectingClient()} instead. - */ -@Deprecated -public class NetconfClient implements Closeable { - - private static final Logger logger = LoggerFactory.getLogger(NetconfClient.class); - - public static final int DEFAULT_CONNECT_TIMEOUT = 5000; - private final NetconfClientDispatcher dispatch; - private final String label; - private final NetconfClientSession clientSession; - private final NetconfClientSessionListener sessionListener; - private final long sessionId; - private final InetSocketAddress address; - - // TODO test reconnecting constructor - public NetconfClient(String clientLabelForLogging, InetSocketAddress address, int connectionAttempts, - int attemptMsTimeout, NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { - this(clientLabelForLogging, address, getReconnectStrategy(connectionAttempts, attemptMsTimeout), - netconfClientDispatcher); - } - - private NetconfClient(String clientLabelForLogging, InetSocketAddress address, ReconnectStrategy strat, NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { - this.label = clientLabelForLogging; - dispatch = netconfClientDispatcher; - sessionListener = new SimpleNetconfClientSessionListener(); - Future clientFuture = dispatch.createClient(address, sessionListener, strat); - this.address = address; - clientSession = get(clientFuture); - this.sessionId = clientSession.getSessionId(); - } - - private NetconfClientSession get(Future clientFuture) throws InterruptedException { - try { - return clientFuture.get(); - } catch (CancellationException e) { - throw new RuntimeException("Cancelling " + this, e); - } catch (ExecutionException e) { - throw new IllegalStateException("Unable to create " + this, e); - } - } - - public static NetconfClient clientFor(String clientLabelForLogging, InetSocketAddress address, ReconnectStrategy strategy, NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { - return new NetconfClient(clientLabelForLogging,address,strategy,netconfClientDispatcher); - } - - public static NetconfClient clientFor(String clientLabelForLogging, InetSocketAddress address, - ReconnectStrategy strategy, NetconfClientDispatcher netconfClientDispatcher, NetconfClientSessionListener listener) throws InterruptedException { - return new NetconfClient(clientLabelForLogging,address,strategy,netconfClientDispatcher,listener); - } - - public NetconfClient(String clientLabelForLogging, InetSocketAddress address, int connectTimeoutMs, - NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { - this(clientLabelForLogging, address, - new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, connectTimeoutMs), netconfClientDispatcher); - } - - public NetconfClient(String clientLabelForLogging, InetSocketAddress address, - NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { - this(clientLabelForLogging, address, new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, - DEFAULT_CONNECT_TIMEOUT), netconfClientDispatcher); - } - - public NetconfClient(String clientLabelForLogging, InetSocketAddress address, ReconnectStrategy strategy, - NetconfClientDispatcher netconfClientDispatcher, NetconfClientSessionListener listener) throws InterruptedException{ - this.label = clientLabelForLogging; - dispatch = netconfClientDispatcher; - sessionListener = listener; - Future clientFuture = dispatch.createClient(address, sessionListener, strategy); - this.address = address; - clientSession = get(clientFuture); - this.sessionId = clientSession.getSessionId(); - } - - public Future sendRequest(NetconfMessage message) { - return ((SimpleNetconfClientSessionListener)sessionListener).sendRequest(message); - } - - /** - * @deprecated Use {@link sendRequest} instead - */ - @Deprecated - public NetconfMessage sendMessage(NetconfMessage message) throws ExecutionException, InterruptedException, TimeoutException { - return sendMessage(message, 5, 1000); - } - - /** - * @deprecated Use {@link sendRequest} instead - */ - @Deprecated - public NetconfMessage sendMessage(NetconfMessage message, int attempts, int attemptMsDelay) throws ExecutionException, InterruptedException, TimeoutException { - //logger.debug("Sending message: {}",XmlUtil.toString(message.getDocument())); - final Stopwatch stopwatch = new Stopwatch().start(); - - try { - return sendRequest(message).get(attempts * attemptMsDelay, TimeUnit.MILLISECONDS); - } finally { - stopwatch.stop(); - logger.debug("Total time spent waiting for response from {}: {} ms", address, stopwatch.elapsed(TimeUnit.MILLISECONDS)); - } - } - - @Override - public void close() throws IOException { - clientSession.close(); - } - - public NetconfClientDispatcher getNetconfClientDispatcher() { - return dispatch; - } - - private static ReconnectStrategy getReconnectStrategy(int connectionAttempts, int attemptMsTimeout) { - return new TimedReconnectStrategy(GlobalEventExecutor.INSTANCE, attemptMsTimeout, 1000, 1.0, null, - Long.valueOf(connectionAttempts), null); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("NetconfClient{"); - sb.append("label=").append(label); - sb.append(", sessionId=").append(sessionId); - sb.append('}'); - return sb.toString(); - } - - public long getSessionId() { - return sessionId; - } - - public Set getCapabilities() { - Preconditions.checkState(clientSession != null, "Client was not initialized successfully"); - return Sets.newHashSet(clientSession.getServerCapabilities()); - } - - public NetconfClientSession getClientSession() { - return clientSession; - } -} diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java index 43664b3233..20da6aa869 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java @@ -8,15 +8,12 @@ package org.opendaylight.controller.netconf.client; +import com.google.common.base.Optional; import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.util.HashedWheelTimer; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Promise; - -import java.io.Closeable; -import java.net.InetSocketAddress; - import org.opendaylight.controller.netconf.util.AbstractChannelInitializer; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; import org.opendaylight.protocol.framework.AbstractDispatcher; @@ -26,7 +23,8 @@ import org.opendaylight.protocol.framework.SessionListenerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Optional; +import java.io.Closeable; +import java.net.InetSocketAddress; public class NetconfClientDispatcher extends AbstractDispatcher implements Closeable { diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java index 2d07dd5833..ad50fedf6b 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java @@ -9,13 +9,17 @@ package org.opendaylight.controller.netconf.client; import io.netty.channel.Channel; - -import java.util.Collection; - -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +import org.opendaylight.controller.netconf.util.handler.NetconfEXIToMessageDecoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToEXIEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToXMLEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collection; + public final class NetconfClientSession extends AbstractNetconfSession { private static final Logger logger = LoggerFactory.getLogger(NetconfClientSession.class); @@ -23,7 +27,7 @@ public final class NetconfClientSession extends AbstractNetconfSession capabilities) { - super(sessionListener,channel,sessionId); + super(sessionListener, channel, sessionId); this.capabilities = capabilities; logger.debug("Client Session {} created", toString()); } @@ -32,8 +36,23 @@ public final class NetconfClientSession extends AbstractNetconfSession { + AbstractNetconfSessionNegotiator +{ + private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class); + + private static final XPathExpression sessionIdXPath = XMLNetconfUtil + .compileXPath("/netconf:hello/netconf:session-id"); + + private static final String EXI_1_0_CAPABILITY_MARKER = "exi:1.0"; - protected NetconfClientSessionNegotiator(NetconfSessionPreferences sessionPreferences, - Promise promise, Channel channel, Timer timer, NetconfClientSessionListener sessionListener, - long connectionTimeoutMillis) { + protected NetconfClientSessionNegotiator(NetconfClientSessionPreferences sessionPreferences, + Promise promise, + Channel channel, + Timer timer, + NetconfClientSessionListener sessionListener, + long connectionTimeoutMillis) { super(sessionPreferences, promise, channel, timer, sessionListener, connectionTimeoutMillis); } - private static Collection getCapabilities(Document doc) { - XmlElement responseElement = XmlElement.fromDomDocument(doc); - XmlElement capabilitiesElement = responseElement - .getOnlyChildElementWithSameNamespace(XmlNetconfConstants.CAPABILITIES); - List caps = capabilitiesElement.getChildElements(XmlNetconfConstants.CAPABILITY); - return Collections2.transform(caps, new Function() { + @Override + protected void handleMessage(NetconfHelloMessage netconfMessage) { + NetconfClientSession session = super.getSessionForHelloMessage(netconfMessage); + + if (shouldUseExi(netconfMessage.getDocument())){ + logger.info("Netconf session: {} should use exi.", session); + tryToStartExi(session); + } else { + logger.info("Netconf session {} isn't capable using exi.", session); + negotiationSuccessful(session); + } + } + + private boolean shouldUseExi(Document doc) { + return containsExi10Capability(doc) + && containsExi10Capability(sessionPreferences.getHelloMessage().getDocument()); + } + + private boolean containsExi10Capability(final Document doc) { + final NodeList nList = doc.getElementsByTagName(XmlNetconfConstants.CAPABILITY); + for (int i = 0; i < nList.getLength(); i++) { + if (nList.item(i).getTextContent().contains(EXI_1_0_CAPABILITY_MARKER)) { + return true; + } + } + return false; + } - @Nullable + private void tryToStartExi(final NetconfClientSession session) { + final NetconfMessage startExi = sessionPreferences.getStartExiMessage(); + session.sendMessage(startExi).addListener(new ChannelFutureListener() { @Override - public String apply(@Nullable XmlElement input) { - // Trim possible leading/tailing whitespace - return input.getTextContent().trim(); + public void operationComplete(final ChannelFuture f) { + if (!f.isSuccess()) { + logger.warn("Failed to send start-exi message {} on session {}", startExi, session, f.cause()); + } else { + logger.trace("Start-exi message {} sent to socket on session {}", startExi, session); + NetconfClientSessionNegotiator.this.channel.pipeline().addAfter( + AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER, + new ExiConfirmationInboundHandler(session)); + } } }); } - private static final XPathExpression sessionIdXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:session-id"); - private long extractSessionId(Document doc) { final Node sessionIdNode = (Node) XmlUtil.evaluateXPath(sessionIdXPath, doc, XPathConstants.NODE); String textContent = sessionIdNode.getTextContent(); @@ -73,6 +111,52 @@ public class NetconfClientSessionNegotiator extends @Override protected NetconfClientSession getSession(NetconfClientSessionListener sessionListener, Channel channel, NetconfHelloMessage message) { return new NetconfClientSession(sessionListener, channel, extractSessionId(message.getDocument()), - getCapabilities(message.getDocument())); + NetconfMessageUtil.extractCapabilitiesFromHello(message.getDocument())); + } + + /** + * Handler to process response for start-exi message + */ + private final class ExiConfirmationInboundHandler extends ChannelInboundHandlerAdapter { + private static final String EXI_CONFIRMED_HANDLER = "exiConfirmedHandler"; + + private final NetconfClientSession session; + + ExiConfirmationInboundHandler(NetconfClientSession session) { + this.session = session; + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + ctx.pipeline().remove(ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER); + + NetconfMessage netconfMessage = (NetconfMessage) msg; + + // Ok response to start-exi, try to add exi handlers + if (NetconfMessageUtil.isOKMessage(netconfMessage)) { + logger.trace("Positive response on start-exi call received on session {}", session); + try { + session.startExiCommunication(sessionPreferences.getStartExiMessage()); + } catch (RuntimeException e) { + // Unable to add exi, continue without exi + logger.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e); + } + + // Error response + } else if(NetconfMessageUtil.isErrorMessage(netconfMessage)) { + logger.warn( + "Error response to start-exi message {}, Communication will continue without exi on session {}", + XmlUtil.toString(netconfMessage.getDocument()), session); + + // Unexpected response to start-exi, throwing message away, continue without exi + } else { + logger.warn( + "Unexpected response to start-exi message, should be ok, was {}, " + + "Communication will continue without exi and response message will be thrown away on session {}", + XmlUtil.toString(netconfMessage.getDocument()), session); + } + + negotiationSuccessful(session); + } } } diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java index bb372b3aff..07e088e117 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java @@ -8,61 +8,79 @@ package org.opendaylight.controller.netconf.client; -import io.netty.channel.Channel; -import io.netty.util.Timer; -import io.netty.util.concurrent.Promise; - -import java.io.IOException; -import java.io.InputStream; - +import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.api.NetconfSessionPreferences; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.opendaylight.controller.netconf.util.messages.NetconfStartExiMessage; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; import org.opendaylight.protocol.framework.SessionListenerFactory; import org.opendaylight.protocol.framework.SessionNegotiator; import org.opendaylight.protocol.framework.SessionNegotiatorFactory; -import org.xml.sax.SAXException; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; import com.google.common.base.Optional; import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; + +import io.netty.channel.Channel; +import io.netty.util.Timer; +import io.netty.util.concurrent.Promise; public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorFactory { + public static final java.util.Set CLIENT_CAPABILITIES = Sets.newHashSet( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_1, + XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0); + + private static final String START_EXI_MESSAGE_ID = "default-start-exi"; + private final Optional additionalHeader; private final long connectionTimeoutMillis; private final Timer timer; + private final EXIOptions options; + + public NetconfClientSessionNegotiatorFactory(Timer timer, + Optional additionalHeader, + long connectionTimeoutMillis) { + this(timer, additionalHeader, connectionTimeoutMillis, DEFAULT_OPTIONS); + } - public NetconfClientSessionNegotiatorFactory(Timer timer, Optional additionalHeader, long connectionTimeoutMillis) { + public NetconfClientSessionNegotiatorFactory(Timer timer, + Optional additionalHeader, + long connectionTimeoutMillis, EXIOptions exiOptions) { this.timer = Preconditions.checkNotNull(timer); this.additionalHeader = additionalHeader; this.connectionTimeoutMillis = connectionTimeoutMillis; - } - - private static NetconfMessage loadHelloMessageTemplate() { - final String helloMessagePath = "/client_hello.xml"; - try (InputStream is = NetconfClientSessionNegotiatorFactory.class.getResourceAsStream(helloMessagePath)) { - Preconditions.checkState(is != null, "Input stream from %s was null", helloMessagePath); - return new NetconfMessage(XmlUtil.readXmlToDocument(is)); - } catch (SAXException | IOException e) { - throw new RuntimeException("Unable to load hello message", e); - } + this.options = exiOptions; } @Override - public SessionNegotiator getSessionNegotiator(SessionListenerFactory sessionListenerFactory, Channel channel, + public SessionNegotiator getSessionNegotiator(SessionListenerFactory sessionListenerFactory, + Channel channel, Promise promise) { - // Hello message needs to be recreated every time - NetconfMessage helloMessage = loadHelloMessageTemplate(); - if(this.additionalHeader.isPresent()) { - helloMessage = new NetconfHelloMessage(helloMessage.getDocument(), additionalHeader.get()); - } else - helloMessage = new NetconfHelloMessage(helloMessage.getDocument()); + NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID); + NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(CLIENT_CAPABILITIES, additionalHeader); - NetconfSessionPreferences proposal = new NetconfSessionPreferences(helloMessage); + NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage,startExiMessage); return new NetconfClientSessionNegotiator(proposal, promise, channel, timer, - sessionListenerFactory.getSessionListener(), connectionTimeoutMillis); + sessionListenerFactory.getSessionListener(),connectionTimeoutMillis); + } + + private static final EXIOptions DEFAULT_OPTIONS = new EXIOptions(); + static { + try { + DEFAULT_OPTIONS.setPreserveDTD(true); + DEFAULT_OPTIONS.setPreserveNS(true); + DEFAULT_OPTIONS.setPreserveLexicalValues(true); + DEFAULT_OPTIONS.setAlignmentType(AlignmentType.preCompress); + } catch (EXIOptionsException e) { + // Should not happen since DEFAULT_OPTIONS are still the same + throw new IllegalStateException("Unable to create EXI DEFAULT_OPTIONS"); + } } } diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java index e96161c29a..504e4c9949 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java @@ -101,7 +101,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL } } - final synchronized Future sendRequest(NetconfMessage message) { + public final synchronized Future sendRequest(NetconfMessage message) { final RequestEntry req = new RequestEntry(GlobalEventExecutor.INSTANCE.newPromise(), message); requests.add(req); diff --git a/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml b/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml deleted file mode 100644 index 46f6f76412..0000000000 --- a/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - urn:ietf:params:netconf:base:1.0 - urn:ietf:params:netconf:base:1.1 - - diff --git a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SSHNetconfClientLiveTest.java b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SSHNetconfClientLiveTest.java deleted file mode 100644 index 1357201f57..0000000000 --- a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SSHNetconfClientLiveTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2013 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.netconf.client; - -import io.netty.channel.nio.NioEventLoopGroup; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.opendaylight.controller.netconf.util.handler.ssh.authentication.LoginPassword; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -@Ignore -public class SSHNetconfClientLiveTest { - private static final Logger logger = LoggerFactory.getLogger(SSHNetconfClientLiveTest.class); - - NioEventLoopGroup nettyThreadgroup; - NetconfSshClientDispatcher netconfClientDispatcher; - InetSocketAddress address; - final int connectionAttempts = 10, attemptMsTimeout = 1000; - final int connectionTimeoutMillis = 20000; - - @Before - public void setUp() { - nettyThreadgroup = new NioEventLoopGroup(); - - netconfClientDispatcher = new NetconfSshClientDispatcher(new LoginPassword( - System.getProperty("username"), System.getProperty("password")), - nettyThreadgroup, nettyThreadgroup, connectionTimeoutMillis); - - address = new InetSocketAddress(System.getProperty("host"), Integer.parseInt(System.getProperty("port"))); - } - - @Ignore - @Test - public void test() throws Exception { - //runnable.run(); - } - - @Test - public void testInExecutor() throws Exception { - int threads = 4; - ExecutorService executorService = Executors.newFixedThreadPool(threads); - try { - for (int i= 0;i< threads;i++) { - InetSocketAddress address = new InetSocketAddress(System.getProperty("host"), - Integer.parseInt(System.getProperty("port"))); - NetconfRunnable runnable = new NetconfRunnable(address); - executorService.execute(runnable); - } - executorService.shutdown(); - executorService.awaitTermination(1, TimeUnit.MINUTES); - - - } finally { - executorService.shutdownNow(); - } - } - - class NetconfRunnable implements Runnable { - private final InetSocketAddress address; - - NetconfRunnable(InetSocketAddress address) { - this.address = address; - } - - @Override - public void run() { - try (NetconfClient netconfClient = new NetconfClient(address.toString(), address, connectionAttempts, - attemptMsTimeout, netconfClientDispatcher);) { - logger.info("OK {}", address); - } catch (InterruptedException | IOException e) { - logger.error("Failed {}", address, e); - } - } - }; -} diff --git a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/test/TestingNetconfClient.java b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/test/TestingNetconfClient.java new file mode 100644 index 0000000000..32c6ea85d6 --- /dev/null +++ b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/test/TestingNetconfClient.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2013 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.netconf.client.test; + +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GlobalEventExecutor; + +import java.io.Closeable; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.util.Set; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; +import org.opendaylight.controller.netconf.client.NetconfClientSession; +import org.opendaylight.controller.netconf.client.NetconfClientSessionListener; +import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener; +import org.opendaylight.protocol.framework.NeverReconnectStrategy; +import org.opendaylight.protocol.framework.ReconnectStrategy; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; + + +/** + * Synchronous netconf client suitable for testing + */ +public class TestingNetconfClient implements Closeable { + + public static final int DEFAULT_CONNECT_TIMEOUT = 5000; + + private final String label; + private final NetconfClientSession clientSession; + private final NetconfClientSessionListener sessionListener; + private final long sessionId; + + private TestingNetconfClient(String clientLabel, InetSocketAddress address, ReconnectStrategy strat, + NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { + this.label = clientLabel; + sessionListener = new SimpleNetconfClientSessionListener(); + Future clientFuture = netconfClientDispatcher.createClient(address, sessionListener, strat); + clientSession = get(clientFuture); + this.sessionId = clientSession.getSessionId(); + } + + private NetconfClientSession get(Future clientFuture) throws InterruptedException { + try { + return clientFuture.get(); + } catch (CancellationException e) { + throw new RuntimeException("Cancelling " + this, e); + } catch (ExecutionException e) { + throw new IllegalStateException("Unable to create " + this, e); + } + } + + public TestingNetconfClient(String clientLabelForLogging, InetSocketAddress address, int connectTimeoutMs, + NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { + this(clientLabelForLogging, address, + new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, connectTimeoutMs), netconfClientDispatcher); + } + + public TestingNetconfClient(String clientLabelForLogging, InetSocketAddress address, + NetconfClientDispatcher netconfClientDispatcher) throws InterruptedException { + this(clientLabelForLogging, address, new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, + DEFAULT_CONNECT_TIMEOUT), netconfClientDispatcher); + } + + public Future sendRequest(NetconfMessage message) { + return ((SimpleNetconfClientSessionListener)sessionListener).sendRequest(message); + } + + public NetconfMessage sendMessage(NetconfMessage message, int attemptMsDelay) throws ExecutionException, + InterruptedException, TimeoutException { + return sendRequest(message).get(attemptMsDelay, TimeUnit.MILLISECONDS); + } + + public NetconfMessage sendMessage(NetconfMessage message) throws ExecutionException, + InterruptedException, TimeoutException { + return sendMessage(message, DEFAULT_CONNECT_TIMEOUT); + } + + @Override + public void close() throws IOException { + clientSession.close(); + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("TestingNetconfClient{"); + sb.append("label=").append(label); + sb.append(", sessionId=").append(sessionId); + sb.append('}'); + return sb.toString(); + } + + public long getSessionId() { + return sessionId; + } + + public Set getCapabilities() { + Preconditions.checkState(clientSession != null, "Client was not initialized successfully"); + return Sets.newHashSet(clientSession.getServerCapabilities()); + } +} \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/pom.xml b/opendaylight/netconf/netconf-impl/pom.xml index 76a0bd9908..9694a90c49 100644 --- a/opendaylight/netconf/netconf-impl/pom.xml +++ b/opendaylight/netconf/netconf-impl/pom.xml @@ -1,109 +1,114 @@ + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - netconf-impl - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-impl + bundle + ${project.artifactId} + + + ${project.groupId} + ietf-netconf-monitoring + + + ${project.groupId} + ietf-netconf-monitoring-extension + ${project.version} + + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-mapping-api + + + ${project.groupId} + netconf-util + + + com.google.guava + guava + + + org.opendaylight.controller + commons.logback_settings + + + org.opendaylight.controller + config-util + + + org.opendaylight.controller + protocol-framework + + + + org.opendaylight.yangtools + mockito-configuration + - - - - ${project.groupId} - netconf-api - - - ${project.groupId} - ietf-netconf-monitoring - - - ${project.groupId} - ietf-netconf-monitoring-extension - ${project.version} - - - ${project.groupId} - netconf-util - - - org.opendaylight.controller - config-util - - - org.opendaylight.controller - protocol-framework - - - ${project.groupId} - netconf-mapping-api - + + org.opendaylight.yangtools.model + ietf-inet-types + - - org.opendaylight.yangtools.model - ietf-inet-types - + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + + ${project.groupId} + netconf-client + test + + + ${project.groupId} + netconf-client + ${project.version} + test-jar + test + + + ${project.groupId} + netconf-util + test-jar + test + + + commons-io + commons-io + test + - - org.osgi - org.osgi.core - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - - - org.opendaylight.yangtools - mockito-configuration - - - commons-io - commons-io - test - + + xmlunit + xmlunit + test + + - - xmlunit - xmlunit - test - - - ${project.groupId} - netconf-util - test - test-jar - - - ${project.groupId} - netconf-client - test - - - org.opendaylight.controller - commons.logback_settings - - - - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.netconf.impl.osgi.NetconfImplActivator - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.impl.osgi.NetconfImplActivator + com.google.common.base, com.google.common.collect, io.netty.channel, io.netty.channel.socket, @@ -142,17 +147,24 @@ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210, org.opendaylight.yangtools.yang.binding, - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - + org.openexi.*, + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + test-jar + + package + + + + + diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java index e0d7e319be..6a86ecd21f 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java @@ -12,9 +12,9 @@ import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot; import org.opendaylight.controller.netconf.mapping.api.Capability; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerDispatcher.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerDispatcher.java index ee9009762e..130818b12a 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerDispatcher.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerDispatcher.java @@ -12,13 +12,12 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.util.concurrent.Promise; - -import java.net.InetSocketAddress; - import org.opendaylight.controller.netconf.impl.util.DeserializerExceptionHandler; import org.opendaylight.controller.netconf.util.AbstractChannelInitializer; import org.opendaylight.protocol.framework.AbstractDispatcher; +import java.net.InetSocketAddress; + public class NetconfServerDispatcher extends AbstractDispatcher { private final ServerChannelInitializer initializer; @@ -44,12 +43,11 @@ public class NetconfServerDispatcher extends AbstractDispatcher promise) { - ch.pipeline().addAfter(DESERIALIZER_EX_HANDLER_KEY, AbstractChannelInitializer.NETCONF_SESSION_NEGOTIATOR, negotiatorFactory.getSessionNegotiator(listenerFactory, ch, promise)); + ch.pipeline().addAfter(DESERIALIZER_EX_HANDLER_KEY, AbstractChannelInitializer.NETCONF_SESSION_NEGOTIATOR, + negotiatorFactory.getSessionNegotiator(null, ch, promise)); } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java index 9ddc64f1a1..280375d918 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java @@ -8,15 +8,18 @@ package org.opendaylight.controller.netconf.impl; -import io.netty.channel.Channel; - import java.text.SimpleDateFormat; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; +import org.opendaylight.controller.netconf.util.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +import org.opendaylight.controller.netconf.util.handler.NetconfEXIToMessageDecoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToEXIEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToXMLEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.DomainName; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Host; @@ -34,6 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; +import io.netty.channel.Channel; public final class NetconfServerSession extends AbstractNetconfSession implements NetconfManagementSession { @@ -124,4 +128,16 @@ public final class NetconfServerSession extends AbstractNetconfSession { - public static final String MESSAGE_ID = "message-id"; static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionListener.class); private final SessionMonitoringService monitoringService; private final NetconfOperationRouter operationRouter; + private final AutoCloseable onSessionDownCloseable; - public NetconfServerSessionListener(NetconfOperationRouter operationRouter, SessionMonitoringService monitoringService) { + public NetconfServerSessionListener(NetconfOperationRouter operationRouter, SessionMonitoringService monitoringService, + AutoCloseable onSessionDownCloseable) { this.operationRouter = operationRouter; this.monitoringService = monitoringService; + this.onSessionDownCloseable = onSessionDownCloseable; } @Override @@ -46,11 +49,24 @@ public class NetconfServerSessionListener implements NetconfSessionListener { - private final NetconfOperationServiceFactoryListener factoriesListener; - private final DefaultCommitNotificationProducer commitNotifier; - - private final SessionIdProvider idProvider; - private final SessionMonitoringService monitor; + private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot; + private final CapabilityProvider capabilityProvider; + + public NetconfServerSessionListenerFactory(DefaultCommitNotificationProducer commitNotifier, + SessionMonitoringService monitor, + NetconfOperationServiceSnapshot netconfOperationServiceSnapshot, + CapabilityProvider capabilityProvider) { - public NetconfServerSessionListenerFactory(NetconfOperationServiceFactoryListener factoriesListener, - DefaultCommitNotificationProducer commitNotifier, - SessionIdProvider idProvider, SessionMonitoringService monitor) { - this.factoriesListener = factoriesListener; this.commitNotifier = commitNotifier; - this.idProvider = idProvider; this.monitor = monitor; + this.netconfOperationServiceSnapshot = netconfOperationServiceSnapshot; + this.capabilityProvider = capabilityProvider; } @Override public NetconfServerSessionListener getSessionListener() { - NetconfOperationServiceSnapshot netconfOperationServiceSnapshot = factoriesListener.getSnapshot(idProvider - .getCurrentSessionId()); - - CapabilityProvider capabilityProvider = new CapabilityProviderImpl(netconfOperationServiceSnapshot); - NetconfOperationRouter operationRouter = NetconfOperationRouterImpl.createOperationRouter( - netconfOperationServiceSnapshot, capabilityProvider, - commitNotifier); - - return new NetconfServerSessionListener(operationRouter, monitor); + netconfOperationServiceSnapshot, capabilityProvider, commitNotifier); + return new NetconfServerSessionListener(operationRouter, monitor, netconfOperationServiceSnapshot); } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java index f8024922cf..5c389fa966 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java @@ -8,8 +8,10 @@ package org.opendaylight.controller.netconf.impl; -import java.net.InetSocketAddress; - +import com.google.common.base.Optional; +import io.netty.channel.Channel; +import io.netty.util.Timer; +import io.netty.util.concurrent.Promise; import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences; import org.opendaylight.controller.netconf.util.AbstractNetconfSessionNegotiator; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage; @@ -17,11 +19,7 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Optional; - -import io.netty.channel.Channel; -import io.netty.util.Timer; -import io.netty.util.concurrent.Promise; +import java.net.InetSocketAddress; public class NetconfServerSessionNegotiator extends AbstractNetconfSessionNegotiator { @@ -52,4 +50,4 @@ public class NetconfServerSessionNegotiator extends return new NetconfServerSession(sessionListener, channel, getSessionPreferences().getSessionId(), parsedHeader); } - } +} diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java index e052f61cc9..9106b6ad85 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java @@ -8,95 +8,82 @@ package org.opendaylight.controller.netconf.impl; -import com.google.common.base.Preconditions; -import io.netty.channel.Channel; -import io.netty.util.Timer; -import io.netty.util.concurrent.Promise; +import static org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider.NetconfOperationProviderUtil.getNetconfSessionIdForReporting; + +import java.util.Set; + import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener; -import org.opendaylight.controller.netconf.util.NetconfUtil; +import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage; -import org.opendaylight.controller.netconf.util.xml.XMLNetconfUtil; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.opendaylight.protocol.framework.SessionListenerFactory; import org.opendaylight.protocol.framework.SessionNegotiator; import org.opendaylight.protocol.framework.SessionNegotiatorFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpression; -import java.io.InputStream; +import com.google.common.collect.Sets; + +import io.netty.channel.Channel; +import io.netty.util.Timer; +import io.netty.util.concurrent.Promise; public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorFactory { - public static final String SERVER_HELLO_XML_LOCATION = "/server_hello.xml"; + private static final Set DEFAULT_CAPABILITIES = Sets.newHashSet( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0); private final Timer timer; - private static final Document helloMessageTemplate = loadHelloMessageTemplate(); private final SessionIdProvider idProvider; - private final NetconfOperationServiceFactoryListener factoriesListener; + private final NetconfOperationProvider netconfOperationProvider; private final long connectionTimeoutMillis; + private final DefaultCommitNotificationProducer commitNotificationProducer; + private final SessionMonitoringService monitoringService; - public NetconfServerSessionNegotiatorFactory(Timer timer, NetconfOperationServiceFactoryListener factoriesListener, - SessionIdProvider idProvider, long connectionTimeoutMillis) { + public NetconfServerSessionNegotiatorFactory(Timer timer, NetconfOperationProvider netconfOperationProvider, + SessionIdProvider idProvider, long connectionTimeoutMillis, + DefaultCommitNotificationProducer commitNot, SessionMonitoringService monitoringService) { this.timer = timer; - this.factoriesListener = factoriesListener; + this.netconfOperationProvider = netconfOperationProvider; this.idProvider = idProvider; this.connectionTimeoutMillis = connectionTimeoutMillis; + this.commitNotificationProducer = commitNot; + this.monitoringService = monitoringService; } - private static Document loadHelloMessageTemplate() { - InputStream resourceAsStream = NetconfServerSessionNegotiatorFactory.class - .getResourceAsStream(SERVER_HELLO_XML_LOCATION); - Preconditions.checkNotNull(resourceAsStream, "Unable to load server hello message blueprint from %s", - SERVER_HELLO_XML_LOCATION); - return NetconfUtil.createMessage(resourceAsStream).getDocument(); - } - + /** + * + * @param defunctSessionListenerFactory will not be taken into account as session listener factory can + * only be created after snapshot is opened, thus this method constructs + * proper session listener factory. + * @param channel Underlying channel + * @param promise Promise to be notified + * @return session negotiator + */ @Override - public SessionNegotiator getSessionNegotiator(SessionListenerFactory sessionListenerFactory, Channel channel, - Promise promise) { + public SessionNegotiator getSessionNegotiator(SessionListenerFactory defunctSessionListenerFactory, + Channel channel, Promise promise) { long sessionId = idProvider.getNextSessionId(); + NetconfOperationServiceSnapshot netconfOperationServiceSnapshot = netconfOperationProvider.openSnapshot( + getNetconfSessionIdForReporting(sessionId)); + CapabilityProvider capabilityProvider = new CapabilityProviderImpl(netconfOperationServiceSnapshot); + + NetconfServerSessionPreferences proposal = new NetconfServerSessionPreferences( + createHelloMessage(sessionId, capabilityProvider), sessionId); + + NetconfServerSessionListenerFactory sessionListenerFactory = new NetconfServerSessionListenerFactory( + commitNotificationProducer, monitoringService, + netconfOperationServiceSnapshot, capabilityProvider); - NetconfServerSessionPreferences proposal = new NetconfServerSessionPreferences(createHelloMessage(sessionId), - sessionId); return new NetconfServerSessionNegotiator(proposal, promise, channel, timer, sessionListenerFactory.getSessionListener(), connectionTimeoutMillis); } - private static final XPathExpression sessionIdXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:session-id"); - private static final XPathExpression capabilitiesXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:capabilities"); - - private NetconfHelloMessage createHelloMessage(long sessionId) { - Document helloMessageTemplate = getHelloTemplateClone(); - - // change session ID - final Node sessionIdNode = (Node) XmlUtil.evaluateXPath(sessionIdXPath, helloMessageTemplate, - XPathConstants.NODE); - sessionIdNode.setTextContent(String.valueOf(sessionId)); - - // add capabilities from yang store - final Element capabilitiesElement = (Element) XmlUtil.evaluateXPath(capabilitiesXPath, helloMessageTemplate, - XPathConstants.NODE); - - CapabilityProvider capabilityProvider = new CapabilityProviderImpl(factoriesListener.getSnapshot(sessionId)); - - for (String capability : capabilityProvider.getCapabilities()) { - final Element capabilityElement = helloMessageTemplate.createElement(XmlNetconfConstants.CAPABILITY); - capabilityElement.setTextContent(capability); - capabilitiesElement.appendChild(capabilityElement); - } - return new NetconfHelloMessage(helloMessageTemplate); + private NetconfHelloMessage createHelloMessage(long sessionId, CapabilityProvider capabilityProvider) { + return NetconfHelloMessage.createServerHello(Sets.union(capabilityProvider.getCapabilities(), DEFAULT_CAPABILITIES), sessionId); } - private synchronized Document getHelloTemplateClone() { - return (Document) helloMessageTemplate.cloneNode(true); - } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java index 8bc93e0512..f31233987e 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java @@ -8,15 +8,18 @@ package org.opendaylight.controller.netconf.impl.mapping.operations; -import java.util.Collections; - import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.google.common.base.Optional; + +import java.util.Collections; + public class DefaultCloseSession extends AbstractSingletonNetconfOperation { public static final String CLOSE_SESSION = "close-session"; private final AutoCloseable sessionResources; @@ -48,6 +51,6 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation { NetconfDocumentedException.ErrorSeverity.error, Collections.singletonMap( NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage())); } - return document.createElement(XmlNetconfConstants.OK); + return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java index ee0c6ce3ef..1a9f5d7393 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java @@ -12,7 +12,7 @@ import java.io.InputStream; import java.util.Map; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java index 7134f5c580..f50dd3e706 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java @@ -8,8 +8,9 @@ package org.opendaylight.controller.netconf.impl.mapping.operations; -import com.google.common.base.Optional; -import com.google.common.collect.Maps; +import java.util.HashMap; +import java.util.Map; + import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; import org.opendaylight.controller.netconf.util.mapping.AbstractLastNetconfOperation; @@ -21,8 +22,8 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; -import java.util.HashMap; -import java.util.Map; +import com.google.common.base.Optional; +import com.google.common.collect.Maps; public final class DefaultGetSchema extends AbstractLastNetconfOperation { public static final String GET_SCHEMA = "get-schema"; @@ -82,10 +83,8 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation { } Element getSchemaResult; - getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema); - XmlUtil.addNamespaceAttr(getSchemaResult, - XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING); - + getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema, + Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING)); logger.trace("{} operation successful", GET_SCHEMA); return getSchemaResult; diff --git a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModuleFactory.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java similarity index 55% rename from opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModuleFactory.java rename to opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java index c26c29ed60..13d4ab290b 100644 --- a/opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModuleFactory.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java @@ -1,18 +1,14 @@ -/* - * Copyright (c) 2013 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.config.yang.test.impl; - -/** -* -*/ -public class DepTestImplModuleFactory extends org.opendaylight.controller.config.yang.test.impl.AbstractDepTestImplModuleFactory -{ - - -} +/* + * Copyright (c) 2013 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.netconf.impl.mapping.operations; + +import org.opendaylight.controller.netconf.impl.NetconfServerSession; + +public interface DefaultNetconfOperation { + void setNetconfSession(NetconfServerSession s); +} diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java index 31a7d320ea..b9b30a5eaa 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java @@ -8,8 +8,12 @@ package org.opendaylight.controller.netconf.impl.mapping.operations; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfSession; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType; +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution; import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; @@ -18,63 +22,50 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; - public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { - public static final String START_EXI = "start-exi"; - private NetconfSession netconfSession; - private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class); + private NetconfServerSession netconfSession; public DefaultStartExi(String netconfSessionIdForReporting) { super(netconfSessionIdForReporting); } @Override - protected String getOperationName() { - return START_EXI; - } - - @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { - - - Element getSchemaResult = document - .createElement(XmlNetconfConstants.OK); - XmlUtil.addNamespaceAttr(getSchemaResult, - XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0); + public Document handle(Document message, + NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException { + logger.debug("Received start-exi message {} ", XmlUtil.toString(message)); - - throw new UnsupportedOperationException("Not implemented"); - - /* try { - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(operationElement); - - netconfSession.addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); - netconfSession.addExiEncoderAfterMessageSent(ExiEncoderHandler.HANDLER_NAME,new ExiEncoderHandler(exiParams)); - - } catch (EXIException e) { - getSchemaResult = document - .createElement(XmlNetconfConstants.RPC_ERROR); + netconfSession.startExiCommunication(new NetconfMessage(message)); + } catch (IllegalArgumentException e) { + throw new NetconfDocumentedException("Failed to parse EXI parameters", ErrorType.protocol, + ErrorTag.operation_failed, ErrorSeverity.error); } + return super.handle(message, subsequentOperation); + } + + @Override + protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { + Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK); logger.trace("{} operation successful", START_EXI); - logger.debug("received start-exi message {} ", XmlUtil.toString(document)); return getSchemaResult; - */ } @Override - public void setNetconfSession(NetconfSession s) { - netconfSession = s; + protected String getOperationName() { + return START_EXI; } - public NetconfSession getNetconfSession() { - return netconfSession; + @Override + protected String getOperationNamespace() { + return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0; } - + @Override + public void setNetconfSession(NetconfServerSession s) { + netconfSession = s; + } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java index ae3b00b11a..22caeff071 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java @@ -8,10 +8,11 @@ package org.opendaylight.controller.netconf.impl.mapping.operations; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfSession; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; import org.opendaylight.controller.netconf.util.xml.XmlElement; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -20,7 +21,7 @@ import org.w3c.dom.Element; public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { public static final String STOP_EXI = "stop-exi"; - private NetconfSession netconfSession; + private NetconfServerSession netconfSession; private static final Logger logger = LoggerFactory .getLogger(DefaultStartExi.class); @@ -29,34 +30,29 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements super(netconfSessionIdForReporting); } + @Override + protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { + logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement)); + + netconfSession.stopExiCommunication(); + + Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK); + logger.trace("{} operation successful", STOP_EXI); + return getSchemaResult; + } + @Override protected String getOperationName() { return STOP_EXI; } @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) - throws NetconfDocumentedException { - throw new UnsupportedOperationException("Not implemented"); - /* - netconfSession.remove(ExiDecoderHandler.class); - netconfSession.removeAfterMessageSent(ExiEncoderHandler.HANDLER_NAME); - - Element getSchemaResult = document.createElement(XmlNetconfConstants.OK); - XmlUtil.addNamespaceAttr(getSchemaResult, - XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0); - logger.trace("{} operation successful", STOP_EXI); - logger.debug("received stop-exi message {} ", XmlUtil.toString(document)); - return getSchemaResult; - */ + protected String getOperationNamespace() { + return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0; } @Override - public void setNetconfSession(NetconfSession s) { + public void setNetconfSession(NetconfServerSession s) { this.netconfSession = s; } - - public NetconfSession getNetconfSession() { - return netconfSession; - } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java index b8dc9550c7..bbd07e42bf 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java @@ -12,9 +12,9 @@ import io.netty.util.HashedWheelTimer; import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; -import org.opendaylight.controller.netconf.impl.NetconfServerSessionListenerFactory; import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory; import org.opendaylight.controller.netconf.impl.SessionIdProvider; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.util.osgi.NetconfConfigUtil; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -34,7 +34,6 @@ public class NetconfImplActivator implements BundleActivator { private NetconfOperationServiceFactoryTracker factoriesTracker; private DefaultCommitNotificationProducer commitNot; - private NetconfServerDispatcher dispatch; private NioEventLoopGroup eventLoopGroup; private HashedWheelTimer timer; private ServiceRegistration regMonitoring; @@ -50,25 +49,26 @@ public class NetconfImplActivator implements BundleActivator { SessionIdProvider idProvider = new SessionIdProvider(); timer = new HashedWheelTimer(); long connectionTimeoutMillis = NetconfConfigUtil.extractTimeoutMillis(context); - NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory( - timer, factoriesListener, idProvider, connectionTimeoutMillis); + commitNot = new DefaultCommitNotificationProducer(ManagementFactory.getPlatformMBeanServer()); - NetconfMonitoringServiceImpl monitoringService = startMonitoringService(context, factoriesListener); + SessionMonitoringService monitoringService = startMonitoringService(context, factoriesListener); - NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory( - factoriesListener, commitNot, idProvider, monitoringService); + NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory( + timer, factoriesListener, idProvider, connectionTimeoutMillis, commitNot, monitoringService); eventLoopGroup = new NioEventLoopGroup(); NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer( - serverNegotiatorFactory, listenerFactory); - dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup); + serverNegotiatorFactory); + NetconfServerDispatcher dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup); logger.info("Starting TCP netconf server at {}", address); dispatch.createServer(address); + context.registerService(NetconfOperationProvider.class, factoriesListener, null); + } private void startOperationServiceFactoryTracker(BundleContext context, NetconfOperationServiceFactoryListenerImpl factoriesListener) { diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java index 505c74714a..a7560fadb6 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java @@ -16,7 +16,9 @@ import io.netty.util.internal.ConcurrentSet; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService; import org.opendaylight.controller.netconf.mapping.api.Capability; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas; @@ -40,10 +42,10 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class); private final Set sessions = new ConcurrentSet<>(); - private final NetconfOperationServiceFactoryListener factoriesListener; + private final NetconfOperationProvider netconfOperationProvider; - public NetconfMonitoringServiceImpl(NetconfOperationServiceFactoryListener factoriesListener) { - this.factoriesListener = factoriesListener; + public NetconfMonitoringServiceImpl(NetconfOperationProvider netconfOperationProvider) { + this.netconfOperationProvider = netconfOperationProvider; } @Override @@ -56,7 +58,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S @Override public void onSessionDown(NetconfManagementSession session) { logger.debug("Session {} down", session); - Preconditions.checkState(sessions.contains(session) == true, "Session %s not present", session); + Preconditions.checkState(sessions.contains(session), "Session %s not present", session); sessions.remove(session); } @@ -67,17 +69,23 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S @Override public Schemas getSchemas() { - // FIXME, session ID // capabilities should be split from operations (it will allow to move getSchema operation to monitoring module) - return transformSchemas(factoriesListener.getSnapshot(0)); + try (NetconfOperationServiceSnapshot snapshot = netconfOperationProvider.openSnapshot("netconf-monitoring")) { + return transformSchemas(snapshot.getServices()); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Exception while closing", e); + } } - private Schemas transformSchemas(NetconfOperationServiceSnapshot snapshot) { + private Schemas transformSchemas(Set services) { Set caps = Sets.newHashSet(); List schemas = Lists.newArrayList(); - for (NetconfOperationService netconfOperationService : snapshot.getServices()) { + + for (NetconfOperationService netconfOperationService : services) { // TODO check for duplicates ? move capability merging to snapshot // Split capabilities from operations first and delete this duplicate code caps.addAll(netconfOperationService.getCapabilities()); @@ -86,8 +94,9 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S for (Capability cap : caps) { SchemaBuilder builder = new SchemaBuilder(); - if(cap.getCapabilitySchema().isPresent() == false) + if (cap.getCapabilitySchema().isPresent() == false) { continue; + } Preconditions.checkState(cap.getModuleNamespace().isPresent()); builder.setNamespace(new Uri(cap.getModuleNamespace().get())); @@ -102,7 +111,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S builder.setFormat(Yang.class); - builder.setLocation(transformLocations(cap.getLocation().or(Collections. emptyList()))); + builder.setLocation(transformLocations(cap.getLocation().or(Collections.emptyList()))); builder.setKey(new SchemaKey(Yang.class, identifier, version)); diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java similarity index 62% rename from opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java rename to opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java index e2a2d832c7..16cca1fee7 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java @@ -6,16 +6,16 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.controller.netconf.api; +package org.opendaylight.controller.netconf.impl.osgi; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.w3c.dom.Document; public interface NetconfOperationRouter extends AutoCloseable { - Document onNetconfMessage(Document message, NetconfSession session) + Document onNetconfMessage(Document message, NetconfServerSession session) throws NetconfDocumentedException; - @Override - void close(); } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java index a358514453..bb4c76a4b8 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java @@ -11,20 +11,20 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; -import org.opendaylight.controller.netconf.api.NetconfSession; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCommit; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultGetSchema; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultStartExi; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultStopExi; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; +import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultNetconfOperation; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot; import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,7 +93,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { @Override public synchronized Document onNetconfMessage(Document message, - NetconfSession session) throws NetconfDocumentedException { + NetconfServerSession session) throws NetconfDocumentedException { Preconditions.checkNotNull(allNetconfOperations, "Operation router was not initialized properly"); NetconfOperationExecution netconfOperationExecution; @@ -107,11 +107,11 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { String errorMessage = String.format("Unable to handle rpc %s on session %s", messageAsString, session); Map errorInfo = Maps.newHashMap(); - NetconfDocumentedException.ErrorTag tag = null; + NetconfDocumentedException.ErrorTag tag; if (e instanceof IllegalArgumentException) { errorInfo.put(NetconfDocumentedException.ErrorTag.operation_not_supported.toString(), e.getMessage()); tag = NetconfDocumentedException.ErrorTag.operation_not_supported; - } else if (e instanceof IllegalStateException) { + } else { errorInfo.put(NetconfDocumentedException.ErrorTag.operation_failed.toString(), e.getMessage()); tag = NetconfDocumentedException.ErrorTag.operation_failed; } @@ -130,7 +130,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { } @Override - public void close() { + public void close() throws Exception { netconfOperationServiceSnapshot.close(); } @@ -153,20 +153,20 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { } private NetconfOperationExecution getNetconfOperationWithHighestPriority( - Document message, NetconfSession session) { + Document message, NetconfServerSession session) { TreeMap sortedByPriority = getSortedNetconfOperationsWithCanHandle( message, session); Preconditions.checkArgument(sortedByPriority.isEmpty() == false, - "No %s available to handleWithNoSubsequentOperations message %s", NetconfOperation.class.getName(), + "No %s available to handle message %s", NetconfOperation.class.getName(), XmlUtil.toString(message)); return NetconfOperationExecution.createExecutionChain(sortedByPriority, sortedByPriority.lastKey()); } private TreeMap getSortedNetconfOperationsWithCanHandle(Document message, - NetconfSession session) { + NetconfServerSession session) { TreeMap sortedPriority = Maps.newTreeMap(); for (NetconfOperation netconfOperation : allNetconfOperations) { diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListener.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListener.java index 385ad09754..8e1052cfeb 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListener.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListener.java @@ -16,5 +16,5 @@ public interface NetconfOperationServiceFactoryListener { void onRemoveNetconfOperationServiceFactory(NetconfOperationServiceFactory service); - NetconfOperationServiceSnapshot getSnapshot(long sessionId); + } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java index 134c38ba97..63cd0baf34 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java @@ -7,12 +7,14 @@ */ package org.opendaylight.controller.netconf.impl.osgi; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; + import java.util.HashSet; import java.util.Set; -import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; - -public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperationServiceFactoryListener { +public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperationServiceFactoryListener, + NetconfOperationProvider { private final Set allFactories = new HashSet<>(); @Override @@ -26,8 +28,8 @@ public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperat } @Override - public synchronized NetconfOperationServiceSnapshot getSnapshot(long sessionId) { - return new NetconfOperationServiceSnapshot(allFactories, sessionId); + public synchronized NetconfOperationServiceSnapshotImpl openSnapshot(String sessionIdForReporting) { + return new NetconfOperationServiceSnapshotImpl(allFactories, sessionIdForReporting); } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshot.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java similarity index 51% rename from opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshot.java rename to opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java index 5c08505091..ce312548b2 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshot.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java @@ -10,62 +10,46 @@ package org.opendaylight.controller.netconf.impl.osgi; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot; +import org.opendaylight.controller.netconf.util.CloseableUtil; import java.util.Collections; import java.util.HashSet; import java.util.Set; -public class NetconfOperationServiceSnapshot implements AutoCloseable { - private static final Logger logger = LoggerFactory.getLogger(NetconfOperationServiceSnapshot.class); +public class NetconfOperationServiceSnapshotImpl implements NetconfOperationServiceSnapshot { private final Set services; private final String netconfSessionIdForReporting; - public NetconfOperationServiceSnapshot(Set factories, long sessionId) { + public NetconfOperationServiceSnapshotImpl(Set factories, String sessionIdForReporting) { Set services = new HashSet<>(); - netconfSessionIdForReporting = getNetconfSessionIdForReporting(sessionId); + netconfSessionIdForReporting = sessionIdForReporting; for (NetconfOperationServiceFactory factory : factories) { services.add(factory.createService(netconfSessionIdForReporting)); } this.services = Collections.unmodifiableSet(services); } - private static String getNetconfSessionIdForReporting(long sessionId) { - return "netconf session id " + sessionId; - } + + @Override public String getNetconfSessionIdForReporting() { return netconfSessionIdForReporting; } + @Override public Set getServices() { return services; } @Override - public void close() { - RuntimeException firstException = null; - for (NetconfOperationService service : services) { - try { - service.close(); - } catch (RuntimeException e) { - logger.warn("Got exception while closing {}", service, e); - if (firstException == null) { - firstException = e; - } else { - firstException.addSuppressed(e); - } - } - } - if (firstException != null) { - throw firstException; - } + public void close() throws Exception { + CloseableUtil.closeAll(services); } @Override public String toString() { - return "NetconfOperationServiceSnapshot{" + netconfSessionIdForReporting + '}'; + return "NetconfOperationServiceSnapshotImpl{" + netconfSessionIdForReporting + '}'; } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java index fca3e8bc1b..31c4d4f57e 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java @@ -36,7 +36,7 @@ public final class @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - logger.warn("An exception occured during message handling", cause); + logger.warn("An exception occurred during message handling", cause); handleDeserializerException(ctx, cause); } diff --git a/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml b/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml deleted file mode 100644 index 6a3f911cd4..0000000000 --- a/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - urn:ietf:params:netconf:base:1.0 - - 1 - diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java index c1a7b1478b..db5a359d7a 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java @@ -18,10 +18,9 @@ import org.apache.commons.io.IOUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.mockito.Mock; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.client.NetconfClient; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService; @@ -53,7 +52,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doNothing; -import static org.mockito.MockitoAnnotations.initMocks; +import static org.mockito.Mockito.mock; public class ConcurrentClientsTest { @@ -68,14 +67,20 @@ public class ConcurrentClientsTest { private DefaultCommitNotificationProducer commitNot; private NetconfServerDispatcher dispatch; - @Mock - private SessionMonitoringService monitoring; + HashedWheelTimer hashedWheelTimer; + public static SessionMonitoringService createMockedMonitoringService() { + SessionMonitoringService monitoring = mock(SessionMonitoringService.class); + doNothing().when(monitoring).onSessionUp(any(NetconfServerSession.class)); + doNothing().when(monitoring).onSessionDown(any(NetconfServerSession.class)); + return monitoring; + } + @Before public void setUp() throws Exception { - initMocks(this); + nettyGroup = new NioEventLoopGroup(); NetconfHelloMessageAdditionalHeader additionalHeader = new NetconfHelloMessageAdditionalHeader("uname", "10.10.10.1", "830", "tcp", "client"); netconfClientDispatcher = new NetconfClientDispatcher( nettyGroup, nettyGroup, additionalHeader, 5000); @@ -86,16 +91,13 @@ public class ConcurrentClientsTest { SessionIdProvider idProvider = new SessionIdProvider(); hashedWheelTimer = new HashedWheelTimer(); NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory( - hashedWheelTimer, factoriesListener, idProvider, 5000); + hashedWheelTimer, factoriesListener, idProvider, 5000, commitNot, createMockedMonitoringService()); commitNot = new DefaultCommitNotificationProducer(ManagementFactory.getPlatformMBeanServer()); - doNothing().when(monitoring).onSessionUp(any(NetconfServerSession.class)); - doNothing().when(monitoring).onSessionDown(any(NetconfServerSession.class)); - NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory( - factoriesListener, commitNot, idProvider, monitoring); - NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(serverNegotiatorFactory, listenerFactory); + + NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(serverNegotiatorFactory); dispatch = new NetconfServerDispatcher(serverChannelInitializer, nettyGroup, nettyGroup); ChannelFuture s = dispatch.createServer(netconfAddress); @@ -259,13 +261,13 @@ public class ConcurrentClientsTest { @Override public void run() { try { - final NetconfClient netconfClient = new NetconfClient(clientId, netconfAddress, netconfClientDispatcher); + final TestingNetconfClient netconfClient = new TestingNetconfClient(clientId, netconfAddress, netconfClientDispatcher); long sessionId = netconfClient.getSessionId(); logger.info("Client with sessionid {} hello exchanged", sessionId); final NetconfMessage getMessage = XmlFileLoader .xmlFileToNetconfMessage("netconfMessages/getConfig.xml"); - NetconfMessage result = netconfClient.sendMessage(getMessage); + NetconfMessage result = netconfClient.sendRequest(getMessage).get(); logger.info("Client with sessionid {} got result {}", sessionId, result); netconfClient.close(); logger.info("Client with session id {} ended", sessionId); diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java index d7beb5df9b..58c6566d91 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java @@ -1,43 +1,43 @@ -/* - * Copyright (c) 2013 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.netconf.impl; - -import static junit.framework.Assert.assertNotNull; - -import org.junit.Test; -import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.test.XmlFileLoader; - -public class ExiEncodeDecodeTest { - @Test - public void encodeExi() throws Exception{ - - String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml"); - assertNotNull(startExiString); - - NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml")); - assertNotNull(startExiMessage); - - /* - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument().getDocumentElement())); - assertNotNull(exiParams); - - ByteBuf encodedBuf = Unpooled.buffer(); - ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes()); - ExiUtil.encode(sourceBuf, encodedBuf, exiParams); - - List newOut = new ArrayList(); - ExiUtil.decode(encodedBuf, newOut, exiParams); - - ByteBuf decodedBuf = (ByteBuf)newOut.get(0); - String decodedString = new String(decodedBuf.array(),"UTF-8"); - assertNotNull(decodedString); - */ - } -} +/* + * Copyright (c) 2013 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.netconf.impl; + +import static junit.framework.Assert.assertNotNull; + +import org.junit.Test; +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.test.XmlFileLoader; + +public class ExiEncodeDecodeTest { + @Test + public void encodeExi() throws Exception{ + + String startExiString = XmlFileLoader.xmlFileToString("netconfMessages/startExi.xml"); + assertNotNull(startExiString); + + NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml")); + assertNotNull(startExiMessage); + + /* + ExiParameters exiParams = new ExiParameters(); + exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument().getDocumentElement())); + assertNotNull(exiParams); + + ByteBuf encodedBuf = Unpooled.buffer(); + ByteBuf sourceBuf = Unpooled.copiedBuffer(startExiString.getBytes()); + ExiUtil.encode(sourceBuf, encodedBuf, exiParams); + + List newOut = new ArrayList(); + ExiUtil.decode(encodedBuf, newOut, exiParams); + + ByteBuf decodedBuf = (ByteBuf)newOut.get(0); + String decodedString = new String(decodedBuf.array(),"UTF-8"); + assertNotNull(decodedString); + */ + } +} diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java index d1c0b066d7..e13415b64b 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.netconf.impl; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -87,7 +88,7 @@ public class MessageParserTest { NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound(); assertNotNull(receivedMessage); - assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument())); + assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument()); } @Test @@ -106,6 +107,6 @@ public class MessageParserTest { testChunkChannel.writeInbound(recievedOutbound); NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound(); assertNotNull(receivedMessage); - assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument())); + assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument()); } } diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java index 9835c2393b..42bd033c71 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java @@ -15,7 +15,6 @@ import io.netty.util.HashedWheelTimer; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; import java.lang.management.ManagementFactory; @@ -28,22 +27,21 @@ public class NetconfDispatcherImplTest { private DefaultCommitNotificationProducer commitNot; private HashedWheelTimer hashedWheelTimer; + @Before public void setUp() throws Exception { nettyGroup = new NioEventLoopGroup(); commitNot = new DefaultCommitNotificationProducer( ManagementFactory.getPlatformMBeanServer()); - NetconfOperationServiceFactoryListener factoriesListener = new NetconfOperationServiceFactoryListenerImpl(); + NetconfOperationServiceFactoryListenerImpl factoriesListener = new NetconfOperationServiceFactoryListenerImpl(); SessionIdProvider idProvider = new SessionIdProvider(); hashedWheelTimer = new HashedWheelTimer(); NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory( - hashedWheelTimer, factoriesListener, idProvider, 5000); + hashedWheelTimer, factoriesListener, idProvider, 5000, commitNot, ConcurrentClientsTest.createMockedMonitoringService()); - NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory( - factoriesListener, commitNot, idProvider, null); - NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(serverNegotiatorFactory, listenerFactory); + NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(serverNegotiatorFactory); dispatch = new NetconfServerDispatcher( serverChannelInitializer, nettyGroup, nettyGroup); diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.json b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.json index 5e03681d95..fcef6b730c 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.json +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.json @@ -1,10 +1,10 @@ -{ - "value":null, - "status":200, - "request": { - "type":"exec", - "mbean":"java.util.logging:type=Logging", - "operation":"setLoggerLevel", - "arguments":["global","INFO"] - } +{ + "value":null, + "status":200, + "request": { + "type":"exec", + "mbean":"java.util.logging:type=Logging", + "operation":"setLoggerLevel", + "arguments":["global","INFO"] + } } \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.xml index b04ace303f..09ba714ea9 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.xml @@ -1,7 +1,7 @@ - - org.opendaylight.controller:type=AppDeployer - EXEC - lookupConfigBeans - abc,bcd.aas - 64 + + org.opendaylight.controller:type=AppDeployer + EXEC + lookupConfigBeans + abc,bcd.aas + 64 \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputList.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputList.xml index 5fc93532a4..011d472634 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputList.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputList.xml @@ -1,9 +1,9 @@ - - org.opendaylight.controller:type=AppDeployer - EXEC - lookupConfigBeans - - 22 - 69 - + + org.opendaylight.controller:type=AppDeployer + EXEC + lookupConfigBeans + + 22 + 69 + \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMap.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMap.xml index 9bf5b58dc4..947335d215 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMap.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMap.xml @@ -1,14 +1,14 @@ - - org.opendaylight.controller:type=AppDeployer - EXEC - lookupConfigBeans - - - single - mock - - 2 - 22 - arg - + + org.opendaylight.controller:type=AppDeployer + EXEC + lookupConfigBeans + + + single + mock + + 2 + 22 + arg + \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMultiple.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMultiple.xml index 23a3489310..2ad485f6c5 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMultiple.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMultiple.xml @@ -1,29 +1,29 @@ - - - org.opendaylight.controller:type=AppDeployer - EXEC - lookupConfigBeans - abc,bcd.aas - 22 - - - org.opendaylight.controller:type=AppDeployer - WRITE - attribute - 22 - - - org.opendaylight.controller:type=AppDeployer - EXEC - lookupConfigBeans - - - single - mock - - 2 - 22 - arg - - + + + org.opendaylight.controller:type=AppDeployer + EXEC + lookupConfigBeans + abc,bcd.aas + 22 + + + org.opendaylight.controller:type=AppDeployer + WRITE + attribute + 22 + + + org.opendaylight.controller:type=AppDeployer + EXEC + lookupConfigBeans + + + single + mock + + 2 + 22 + arg + + \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetter.xml index abad54d27a..a5882d6ded 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetter.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetter.xml @@ -1,6 +1,6 @@ - - org.opendaylight.controller:type=AppDeployer - WRITE - attribute - 22 + + org.opendaylight.controller:type=AppDeployer + WRITE + attribute + 22 \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterList.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterList.xml index 7162b8f056..24d2171fe4 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterList.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterList.xml @@ -1,8 +1,8 @@ - - org.opendaylight.controller:type=AppDeployer - WRITE - attribute - 22 - 222 - 223 + + org.opendaylight.controller:type=AppDeployer + WRITE + attribute + 22 + 222 + 223 \ No newline at end of file diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterMap.xml b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterMap.xml index 00a0536c0c..9af105fe58 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterMap.xml +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterMap.xml @@ -1,9 +1,9 @@ - - org.opendaylight.controller:type=AppDeployer - WRITE - setAtr - - 1 - 2 - - + + org.opendaylight.controller:type=AppDeployer + WRITE + setAtr + + 1 + 2 + + diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/map.json b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/map.json index 60fabb62d1..d7538663e3 100644 --- a/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/map.json +++ b/opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/map.json @@ -1,134 +1,134 @@ -{ - "timestamp":1362488209, - "status":200, - "request":{ - "mbean":"org.opendaylight.controller:type=ConfigRegistry", - "attribute":"AvailableInterfacesAndImplementations", - "type":"read" - }, - "value":{ - "topology-registry":[ - "single" - ], - "bgp-update":[ - "mock", - "bgp-impl" - ], - "positioning-service":[ - "combine", - "onehop", - "ondemand", - "pxe", - "precompute" - ], - "serializer":[ - "serializer-impl" - ], - "network-topology-factory":[ - "mock-xml", - "bgp-network-topology-factory", - "transient" - ], - "dwe-topology":[ - "ebgp", - "defaultmetric", - "igp", - "network" - ], - "thread-factory":[ - "naming-thread-factory" - ], - "bgp-parser":[ - "parser" - ], - "pcep-dispatcher":[ - "dispatcher" - ], - "threadpool":[ - "flexible", - "fixed", - "scheduled" - ], - "scheduled-threadpool":[ - "scheduled" - ], - "positioning-onehop":[ - "onehop" - ], - "bgp-dispatcher":[ - "bgp-dispatcher-impl" - ], - "cost-combiner":[ - "pxe" - ], - "apsp-provider":[ - "jgrapht", - "parallel", - "single-threaded" - ], - "topology":[ - "ebgp", - "defaultmetric", - "igp", - "network" - ], - "soap-resource":[ - "positioning-adaptor-pxe" - ], - "database-provider-factory":[ - "transient" - ], - "bgp-proposal-checker":[ - "bgp-proposal-checker-impl" - ], - "bgp-proposal":[ - "bgp-proposal-impl" - ], - "listenable-network-topology-factory":[ - "transient" - ], - "event-bus":[ - "sync", - "async" - ], - "topology-registry-provider":[ - "single" - ], - "topology-provider-factory":[ - "transient" - ], - "rest-resource":[ - "topology-resource-holder", - "alto-resource-holder", - "topology-visual-holder", - "network-resource-holder", - "path-resource-holder" - ], - "listenable-database-provider-factory":[ - "transient" - ], - "topology-validator":[ - "accept-all", - "threshold" - ], - "replicator":[ - "replicator-impl" - ], - "server":[ - "soap", - "rest" - ], - "combiner-pxe":[ - "pxe" - ], - "rest":[ - "rest" - ], - "soap":[ - "soap" - ], - "path-service":[ - "cariden" - ] - } +{ + "timestamp":1362488209, + "status":200, + "request":{ + "mbean":"org.opendaylight.controller:type=ConfigRegistry", + "attribute":"AvailableInterfacesAndImplementations", + "type":"read" + }, + "value":{ + "topology-registry":[ + "single" + ], + "bgp-update":[ + "mock", + "bgp-impl" + ], + "positioning-service":[ + "combine", + "onehop", + "ondemand", + "pxe", + "precompute" + ], + "serializer":[ + "serializer-impl" + ], + "network-topology-factory":[ + "mock-xml", + "bgp-network-topology-factory", + "transient" + ], + "dwe-topology":[ + "ebgp", + "defaultmetric", + "igp", + "network" + ], + "thread-factory":[ + "naming-thread-factory" + ], + "bgp-parser":[ + "parser" + ], + "pcep-dispatcher":[ + "dispatcher" + ], + "threadpool":[ + "flexible", + "fixed", + "scheduled" + ], + "scheduled-threadpool":[ + "scheduled" + ], + "positioning-onehop":[ + "onehop" + ], + "bgp-dispatcher":[ + "bgp-dispatcher-impl" + ], + "cost-combiner":[ + "pxe" + ], + "apsp-provider":[ + "jgrapht", + "parallel", + "single-threaded" + ], + "topology":[ + "ebgp", + "defaultmetric", + "igp", + "network" + ], + "soap-resource":[ + "positioning-adaptor-pxe" + ], + "database-provider-factory":[ + "transient" + ], + "bgp-proposal-checker":[ + "bgp-proposal-checker-impl" + ], + "bgp-proposal":[ + "bgp-proposal-impl" + ], + "listenable-network-topology-factory":[ + "transient" + ], + "event-bus":[ + "sync", + "async" + ], + "topology-registry-provider":[ + "single" + ], + "topology-provider-factory":[ + "transient" + ], + "rest-resource":[ + "topology-resource-holder", + "alto-resource-holder", + "topology-visual-holder", + "network-resource-holder", + "path-resource-holder" + ], + "listenable-database-provider-factory":[ + "transient" + ], + "topology-validator":[ + "accept-all", + "threshold" + ], + "replicator":[ + "replicator-impl" + ], + "server":[ + "soap", + "rest" + ], + "combiner-pxe":[ + "pxe" + ], + "rest":[ + "rest" + ], + "soap":[ + "soap" + ], + "path-service":[ + "cariden" + ] + } } \ No newline at end of file diff --git a/opendaylight/netconf/netconf-it/pom.xml b/opendaylight/netconf/netconf-it/pom.xml index aab939e8d9..b330f9bcd4 100644 --- a/opendaylight/netconf/netconf-it/pom.xml +++ b/opendaylight/netconf/netconf-it/pom.xml @@ -1,164 +1,192 @@ - + - 4.0.0 + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + - netconf-it - ${project.artifactId} + netconf-it + ${project.artifactId} + + 2.0.0 + - - - - ${project.groupId} - config-api - test - - - ${project.groupId} - config-util - test - - - ${project.groupId} - netconf-api - test - - - ${project.groupId} - netconf-client - test - - - ${project.groupId} - config-netconf-connector - test - - - ${project.groupId} - config-manager - test - - - ${project.groupId} - config-persister-impl - test - - - ${project.groupId} - config-manager - test - test-jar - - - ${project.groupId} - netconf-impl - test - - - ${project.groupId} - netconf-monitoring - test - - - ${project.groupId} - sal-binding-it - ${mdsal.version} - test - - - ${project.groupId} - netconf-mapping-api - test - - - ${project.groupId} - netconf-ssh - test - - - ${project.groupId} - netconf-ssh - test - test-jar - - - ${project.groupId} - netconf-util - test - test-jar - - - org.opendaylight.controller - yang-test - ${config.version} - test - - - org.opendaylight.controller - logback-config - - - org.slf4j - slf4j-api - - - org.opendaylight.yangtools - mockito-configuration - - - org.opendaylight.controller - commons.logback_settings - - + + + org.opendaylight.controller + commons.logback_settings + + + org.opendaylight.controller + logback-config + + + org.opendaylight.yangtools + mockito-configuration + + + org.slf4j + slf4j-api + + + xmlunit + xmlunit + + + + ${project.groupId} + config-api + test + + + ${project.groupId} + config-manager + test + + + ${project.groupId} + config-manager + test-jar + test + + + ${project.groupId} + config-netconf-connector + test + + + ${project.groupId} + config-persister-impl + test + + + ${project.groupId} + config-util + test + + + ${project.groupId} + netconf-api + test + + + ${project.groupId} + netconf-client + test + + + ${project.groupId} + netconf-client + ${project.version} + test-jar + test + + + ${project.groupId} + netconf-impl + test + + + ${project.groupId} + netconf-impl + test-jar + test + + + ${project.groupId} + netconf-mapping-api + test + + + ${project.groupId} + netconf-monitoring + test + + + ${project.groupId} + netconf-ssh + test + + + ${project.groupId} + netconf-ssh + test-jar + test + + + ${project.groupId} + netconf-util + test-jar + test + + + ${project.groupId} + netty-config-api + test + + + ${project.groupId} + sal-binding-it + + + org.opendaylight.controller + yang-test + test + + + org.ops4j.pax.tinybundles + tinybundles + ${tinybundles.version} + test + + - - - - org.apache.maven.plugins - maven-surefire-plugin - - 1 - false - false - - - - default-test - - true - - - - integration-tests - integration-test - - test - - - false - -Dlogback.configurationFile=${maven.test.dest}/logback.xml - - - - - - org.ops4j.pax.exam - maven-paxexam-plugin - 1.2.4 - - - generate-config - - generate-depends-file - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + false + + + + default-test + + true + + + + integration-tests + + test + + integration-test + + false + -Dlogback.configurationFile=${maven.test.dest}/logback.xml + + + + + + org.ops4j.pax.exam + maven-paxexam-plugin + 1.2.4 + + + generate-config + + generate-depends-file + + + + + + diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java index b261218bf1..b81f950cb3 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java @@ -15,7 +15,6 @@ import org.junit.Before; import org.opendaylight.controller.config.manager.impl.AbstractConfigTest; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; -import org.opendaylight.controller.netconf.impl.NetconfServerSessionListenerFactory; import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory; import org.opendaylight.controller.netconf.impl.SessionIdProvider; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; @@ -39,14 +38,10 @@ public class AbstractNetconfConfigTest extends AbstractConfigTest { SessionIdProvider idProvider = new SessionIdProvider(); NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory( - hashedWheelTimer, factoriesListener, idProvider, 5000); - - NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory( - factoriesListener, commitNotifier, idProvider, - sessionMonitoringService); + hashedWheelTimer, factoriesListener, idProvider, 5000, commitNotifier, sessionMonitoringService); NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer( - serverNegotiatorFactory, listenerFactory); + serverNegotiatorFactory); return new NetconfServerDispatcher(serverChannelInitializer, nettyThreadgroup, nettyThreadgroup); } diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java index 997cae0f7c..8b2af39343 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java @@ -7,15 +7,32 @@ */ package org.opendaylight.controller.netconf.it; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; +import static junit.framework.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithName; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertElementsCount; +import static org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToDocument; import io.netty.channel.ChannelFuture; -import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.InetSocketAddress; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import javax.management.InstanceNotFoundException; +import javax.management.Notification; +import javax.management.NotificationListener; + import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.matchers.JUnitMatchers; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; @@ -25,43 +42,29 @@ import org.opendaylight.controller.config.spi.ModuleFactory; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.jmx.CommitJMXNotification; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; -import org.opendaylight.controller.netconf.client.NetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshotImpl; import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService; import org.opendaylight.controller.netconf.mapping.api.Capability; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringActivator; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringOperationService; import org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler; import org.opendaylight.controller.netconf.util.test.XmlFileLoader; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.xml.sax.SAXException; -import javax.management.InstanceNotFoundException; -import javax.management.Notification; -import javax.management.NotificationListener; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetSocketAddress; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -import static junit.framework.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest { @@ -78,7 +81,7 @@ public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest { super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(NetconfITTest.getModuleFactoriesS().toArray( new ModuleFactory[0]))); - NetconfMonitoringServiceImpl monitoringService = new NetconfMonitoringServiceImpl(getFactoriesListener()); + NetconfMonitoringServiceImpl monitoringService = new NetconfMonitoringServiceImpl(getNetconfOperationProvider()); NetconfOperationServiceFactoryListenerImpl factoriesListener = new NetconfOperationServiceFactoryListenerImpl(); factoriesListener.onAddNetconfOperationServiceFactory(new NetconfOperationServiceFactoryImpl(getYangStore())); @@ -121,22 +124,22 @@ public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest { VerifyingNotificationListener notificationVerifier = createCommitNotificationListener(); VerifyingPersister mockedAggregator = mockAggregator(); - try (NetconfClient persisterClient = new NetconfClient("persister", tcpAddress, 4000, clientDispatcher)) { + try (TestingNetconfClient persisterClient = new TestingNetconfClient("persister", tcpAddress, 4000, clientDispatcher)) { try (ConfigPersisterNotificationHandler configPersisterNotificationHandler = new ConfigPersisterNotificationHandler( platformMBeanServer, mockedAggregator)) { - try (NetconfClient netconfClient = new NetconfClient("client", tcpAddress, 4000, clientDispatcher)) { + try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", tcpAddress, 4000, clientDispatcher)) { NetconfMessage response = netconfClient.sendMessage(loadGetConfigMessage()); - assertResponse(response, " caps = Sets.newHashSet(); doReturn(caps).when(service).getCapabilities(); Set services = Sets.newHashSet(service); doReturn(services).when(snap).getServices(); - doReturn(snap).when(factoriesListener).getSnapshot(anyLong()); + doReturn(snap).when(factoriesListener).openSnapshot(anyString()); return factoriesListener; } @@ -240,15 +239,14 @@ public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest { assertEquals(size, snapshots.size()); } - void assertSnapshotContent(int notificationIndex, int expectedModulesSize, int expectedServicesSize, int expectedCapsSize) { + void assertSnapshotContent(int notificationIndex, int expectedModulesSize, int expectedServicesSize, int expectedCapsSize) + throws SAXException, IOException { ConfigSnapshotHolder snapshot = snapshots.get(notificationIndex); int capsSize = snapshot.getCapabilities().size(); assertEquals("Expected capabilities count", expectedCapsSize, capsSize); - String configSnapshot = snapshot.getConfigSnapshot(); - int modulesSize = StringUtils.countMatches(configSnapshot, ""); - assertEquals("Expected modules count", expectedModulesSize, modulesSize); - int servicesSize = StringUtils.countMatches(configSnapshot, ""); - assertEquals("Expected services count", expectedServicesSize, servicesSize); + Document configSnapshot = readXmlToDocument(snapshot.getConfigSnapshot()); + assertElementsCount(configSnapshot, "module", expectedModulesSize); + assertElementsCount(configSnapshot, "instance", expectedServicesSize); } @Override diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java index 6989bf512f..e45a249ad4 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java @@ -14,10 +14,10 @@ import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; -import org.opendaylight.controller.netconf.client.NetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; @@ -91,7 +91,7 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { @Test public void testSecure() throws Exception { NetconfClientDispatcher dispatch = new NetconfClientDispatcher(nettyThreadgroup, nettyThreadgroup, 5000); - try (NetconfClient netconfClient = new NetconfClient("tls-client", tlsAddress, 4000, dispatch)) { + try (TestingNetconfClient netconfClient = new TestingNetconfClient("tls-client", tlsAddress, 4000, dispatch)) { } } diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java index 4ca9690211..d169858d35 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java @@ -22,22 +22,22 @@ import org.junit.Test; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory; import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory; import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMXBean; import org.opendaylight.controller.config.yang.test.impl.TestImplModuleFactory; import org.opendaylight.controller.netconf.StubUserManager; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.client.NetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshotImpl; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.ssh.NetconfSSHServer; import org.opendaylight.controller.netconf.ssh.authentication.AuthProvider; @@ -68,10 +68,10 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import static java.util.Collections.emptyList; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; -import static org.mockito.Matchers.anyLong; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -118,11 +118,11 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } static NetconfMonitoringServiceImpl getNetconfMonitoringListenerService() { - NetconfOperationServiceFactoryListener factoriesListener = mock(NetconfOperationServiceFactoryListener.class); - NetconfOperationServiceSnapshot snap = mock(NetconfOperationServiceSnapshot.class); + NetconfOperationProvider netconfOperationProvider = mock(NetconfOperationProvider.class); + NetconfOperationServiceSnapshotImpl snap = mock(NetconfOperationServiceSnapshotImpl.class); doReturn(Collections.emptySet()).when(snap).getServices(); - doReturn(snap).when(factoriesListener).getSnapshot(anyLong()); - return new NetconfMonitoringServiceImpl(factoriesListener); + doReturn(snap).when(netconfOperationProvider).openSnapshot(anyString()); + return new NetconfMonitoringServiceImpl(netconfOperationProvider); } @After @@ -148,6 +148,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } static Collection getBasicYangs() throws IOException { + List paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang", "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang", "/META-INF/yang/test-types.yang", "/META-INF/yang/ietf-inet-types.yang"); @@ -176,7 +177,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void testNetconfClientDemonstration() throws Exception { - try (NetconfClient netconfClient = new NetconfClient("client", tcpAddress, 4000, clientDispatcher)) { + try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", tcpAddress, 4000, clientDispatcher)) { Set capabilitiesFromNetconfServer = netconfClient.getCapabilities(); long sessionId = netconfClient.getSessionId(); @@ -191,8 +192,8 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void testTwoSessions() throws Exception { - try (NetconfClient netconfClient = new NetconfClient("1", tcpAddress, 10000, clientDispatcher)) { - try (NetconfClient netconfClient2 = new NetconfClient("2", tcpAddress, 10000, clientDispatcher)) { + try (TestingNetconfClient netconfClient = new TestingNetconfClient("1", tcpAddress, 10000, clientDispatcher)) { + try (TestingNetconfClient netconfClient2 = new TestingNetconfClient("2", tcpAddress, 10000, clientDispatcher)) { } } } @@ -208,7 +209,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void rpcReplyContainsAllAttributesTest() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { final String rpc = "" + "" + ""; final Document doc = XmlUtil.readXmlToDocument(rpc); @@ -236,7 +237,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void rpcReplyErrorContainsAllAttributesTest() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { final String rpc = "" + "" + ""; final Document doc = XmlUtil.readXmlToDocument(rpc); @@ -260,7 +261,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { transaction.commit(); - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { final String expectedNamespace = "urn:opendaylight:params:xml:ns:yang:controller:test:impl"; final String rpc = "" @@ -281,37 +282,9 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } } - /* - @Test - public void testStartExi() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { - - - Document rpcReply = netconfClient.sendMessage(this.startExi) - .getDocument(); - assertIsOK(rpcReply); - - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(XmlElement.fromDomDocument(this.startExi.getDocument())); - - netconfClient.getClientSession().addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); - netconfClient.getClientSession().addExiEncoder(ExiEncoderHandler.HANDLER_NAME, new ExiEncoderHandler(exiParams)); - - rpcReply = netconfClient.sendMessage(this.editConfig) - .getDocument(); - assertIsOK(rpcReply); - - rpcReply = netconfClient.sendMessage(this.stopExi) - .getDocument(); - assertIsOK(rpcReply); - - } - } - */ - @Test public void testCloseSession() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { // edit config Document rpcReply = netconfClient.sendMessage(this.editConfig) @@ -327,7 +300,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void testEditConfig() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { // send edit_config.xml final Document rpcReply = netconfClient.sendMessage(this.editConfig).getDocument(); assertIsOK(rpcReply); @@ -336,7 +309,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void testValidate() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { // begin transaction Document rpcReply = netconfClient.sendMessage(getConfigCandidate).getDocument(); assertEquals("data", XmlElement.fromDomDocument(rpcReply).getOnlyChildElement().getName()); @@ -353,11 +326,11 @@ public class NetconfITTest extends AbstractNetconfConfigTest { assertEquals("ok", XmlElement.fromDomDocument(rpcReply).getOnlyChildElement().getName()); } - private Document assertGetConfigWorks(final NetconfClient netconfClient) throws InterruptedException, ExecutionException, TimeoutException { + private Document assertGetConfigWorks(final TestingNetconfClient netconfClient) throws InterruptedException, ExecutionException, TimeoutException { return assertGetConfigWorks(netconfClient, this.getConfig); } - private Document assertGetConfigWorks(final NetconfClient netconfClient, final NetconfMessage getConfigMessage) + private Document assertGetConfigWorks(final TestingNetconfClient netconfClient, final NetconfMessage getConfigMessage) throws InterruptedException, ExecutionException, TimeoutException { final NetconfMessage rpcReply = netconfClient.sendMessage(getConfigMessage); assertNotNull(rpcReply); @@ -367,14 +340,14 @@ public class NetconfITTest extends AbstractNetconfConfigTest { @Test public void testGetConfig() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { assertGetConfigWorks(netconfClient); } } @Test public void createYangTestBasedOnYuma() throws Exception { - try (NetconfClient netconfClient = createSession(tcpAddress, "1")) { + try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { Document rpcReply = netconfClient.sendMessage( XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig_merge_yang-test.xml")) .getDocument(); @@ -392,8 +365,8 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } } - private NetconfClient createSession(final InetSocketAddress address, final String expected) throws Exception { - final NetconfClient netconfClient = new NetconfClient("test " + address.toString(), address, 5000, clientDispatcher); + private TestingNetconfClient createSession(final InetSocketAddress address, final String expected) throws Exception { + final TestingNetconfClient netconfClient = new TestingNetconfClient("test " + address.toString(), address, 5000, clientDispatcher); assertEquals(expected, Long.toString(netconfClient.getSessionId())); return netconfClient; } @@ -448,5 +421,4 @@ public class NetconfITTest extends AbstractNetconfConfigTest { }.join(); } - } diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java index 4af66532a1..92caea17d5 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java @@ -7,54 +7,54 @@ */ package org.opendaylight.controller.netconf.it; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; +import com.google.common.base.Charsets; +import com.google.common.base.Optional; +import com.google.common.collect.Sets; import io.netty.channel.ChannelFuture; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.util.Collection; -import java.util.List; -import java.util.Set; - import junit.framework.Assert; - import org.junit.Before; import org.junit.Test; -import org.junit.matchers.JUnitMatchers; import org.mockito.Mock; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; -import org.opendaylight.controller.netconf.client.NetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; -import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshot; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshotImpl; import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService; import org.opendaylight.controller.netconf.mapping.api.Capability; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringActivator; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringOperationService; import org.opendaylight.controller.netconf.util.test.XmlFileLoader; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; -import com.google.common.base.Charsets; -import com.google.common.base.Optional; -import com.google.common.collect.Sets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithText; public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { @@ -75,7 +75,7 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(NetconfITTest.getModuleFactoriesS().toArray( new ModuleFactory[0]))); - monitoringService = new NetconfMonitoringServiceImpl(getFactoriesListener()); + monitoringService = new NetconfMonitoringServiceImpl(getNetconfOperationProvider()); NetconfOperationServiceFactoryListenerImpl factoriesListener = new NetconfOperationServiceFactoryListenerImpl(); factoriesListener.onAddNetconfOperationServiceFactory(new NetconfOperationServiceFactoryImpl(getYangStore())); @@ -120,8 +120,8 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { @Test public void testGetResponseFromMonitoring() throws Exception { - try (NetconfClient netconfClient = new NetconfClient("client-monitoring", tcpAddress, 4000, clientDispatcher)) { - try (NetconfClient netconfClient2 = new NetconfClient("client-monitoring2", tcpAddress, 4000, clientDispatcher)) { + try (TestingNetconfClient netconfClient = new TestingNetconfClient("client-monitoring", tcpAddress, 4000, clientDispatcher)) { + try (TestingNetconfClient netconfClient2 = new TestingNetconfClient("client-monitoring2", tcpAddress, 4000, clientDispatcher)) { NetconfMessage response = netconfClient.sendMessage(loadGetMessage()); assertSessionElementsInResponse(response.getDocument(), 2); } @@ -131,7 +131,7 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { } - @Test(timeout = 5 * 10000) + @Test(timeout = 13 * 10000) public void testClientHelloWithAuth() throws Exception { String fileName = "netconfMessages/client_hello_with_auth.xml"; String hello = XmlFileLoader.fileToString(fileName); @@ -165,22 +165,28 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { sock.close(); - org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("urn:ietf:params:netconf:capability:candidate:1.0")); - org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("tomas")); + String helloMsg = responseBuilder.substring(0, responseBuilder.indexOf(separator)); + Document doc = XmlUtil.readXmlToDocument(helloMsg); + assertContainsElementWithText(doc, "urn:ietf:params:netconf:capability:candidate:1.0"); + + String replyMsg = responseBuilder.substring(responseBuilder.indexOf(separator) + separator.length()); + doc = XmlUtil.readXmlToDocument(replyMsg); + assertContainsElementWithText(doc, "tomas"); } private void assertSessionElementsInResponse(Document document, int i) { int elementSize = document.getElementsByTagName("session-id").getLength(); - Assert.assertEquals(i, elementSize); + Assert.assertEquals("Incorrect number of session-id tags in " + XmlUtil.toString(document),i, elementSize); } private NetconfMessage loadGetMessage() throws Exception { return XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/get.xml"); } - public static NetconfOperationServiceFactoryListener getFactoriesListener() { - NetconfOperationServiceFactoryListener factoriesListener = mock(NetconfOperationServiceFactoryListener.class); - NetconfOperationServiceSnapshot snap = mock(NetconfOperationServiceSnapshot.class); + public static NetconfOperationProvider getNetconfOperationProvider() throws Exception { + NetconfOperationProvider factoriesListener = mock(NetconfOperationProvider.class); + NetconfOperationServiceSnapshotImpl snap = mock(NetconfOperationServiceSnapshotImpl.class); + doNothing().when(snap).close(); NetconfOperationService service = mock(NetconfOperationService.class); Set caps = Sets.newHashSet(); caps.add(new Capability() { @@ -218,7 +224,7 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { doReturn(caps).when(service).getCapabilities(); Set services = Sets.newHashSet(service); doReturn(services).when(snap).getServices(); - doReturn(snap).when(factoriesListener).getSnapshot(anyLong()); + doReturn(snap).when(factoriesListener).openSnapshot(anyString()); return factoriesListener; } diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java index c75adbba8d..96a9effcfc 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java @@ -7,17 +7,37 @@ */ package org.opendaylight.controller.netconf.it.pax; -import com.google.common.base.Preconditions; -import com.google.common.base.Throwables; +import static org.junit.Assert.fail; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.CoreOptions.streamBundle; +import static org.ops4j.pax.exam.CoreOptions.systemPackages; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; import io.netty.channel.nio.NioEventLoopGroup; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +import javax.inject.Inject; +import javax.xml.parsers.ParserConfigurationException; + import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.junit.matchers.JUnitMatchers; import org.junit.runner.RunWith; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.client.NetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; +import org.opendaylight.controller.netconf.util.test.XmlFileLoader; import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.ops4j.pax.exam.Configuration; @@ -25,28 +45,12 @@ import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.options.DefaultCompositeOption; import org.ops4j.pax.exam.util.Filter; -import org.w3c.dom.Document; +import org.ops4j.pax.tinybundles.core.TinyBundles; +import org.osgi.framework.Constants; import org.xml.sax.SAXException; -import javax.inject.Inject; -import javax.xml.parsers.ParserConfigurationException; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetSocketAddress; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import static org.junit.Assert.fail; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemPackages; -import static org.ops4j.pax.exam.CoreOptions.systemProperty; +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; @Ignore @RunWith(PaxExam.class) @@ -71,7 +75,24 @@ public class IdentityRefNetconfTest { loggingModules(), mdSalCoreBundles(), bindingAwareSalBundles(), configMinumumBundles(), baseModelBundles(), flowCapableModelBundles(), - junitAndMockitoBundles()); + junitAndMockitoBundles(), + + // Classes from test-jars bundled for pax-exam test + streamBundle(TinyBundles.bundle() + .add(TestingNetconfClient.class) + .add(XmlFileLoader.class) + + .add("/netconfMessages/editConfig_identities.xml", + XmlFileLoader.class.getResource("/netconfMessages/editConfig_identities.xml")) + .add("/netconfMessages/commit.xml", + XmlFileLoader.class.getResource("/netconfMessages/commit.xml")) + .add("/netconfMessages/getConfig.xml", + XmlFileLoader.class.getResource("/netconfMessages/getConfig.xml")) + + .set(Constants.BUNDLE_SYMBOLICNAME, "TestingClient_bundle") + .set(Constants.EXPORT_PACKAGE, "org.opendaylight.controller.netconf.client.test, " + + "org.opendaylight.controller.netconf.util.test") + .build(TinyBundles.withBnd()))); } private Option loggingModules() { @@ -79,7 +100,11 @@ public class IdentityRefNetconfTest { mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), - mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject()); + mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject()); + + } private Option testingModules() { @@ -89,29 +114,26 @@ public class IdentityRefNetconfTest { private static final InetSocketAddress tcpAddress = new InetSocketAddress("127.0.0.1", 18383); - @Test public void testIdRef() throws Exception { - try { - Preconditions.checkNotNull(broker, "Controller not initialized"); - - NioEventLoopGroup nettyThreadgroup = new NioEventLoopGroup(); - NetconfClientDispatcher clientDispatcher = new NetconfClientDispatcher(nettyThreadgroup, nettyThreadgroup, - CLIENT_CONNECTION_TIMEOUT_MILLIS); - - NetconfMessage edit = xmlFileToNetconfMessage("netconfMessages/editConfig_identities.xml"); - NetconfMessage commit = xmlFileToNetconfMessage("netconfMessages/commit.xml"); - NetconfMessage getConfig = xmlFileToNetconfMessage("netconfMessages/getConfig.xml"); - - try (NetconfClient netconfClient = new NetconfClient("client", tcpAddress, CLIENT_CONNECTION_TIMEOUT_MILLIS, clientDispatcher)) { - sendMessage(edit, netconfClient); - sendMessage(commit, netconfClient); - sendMessage(getConfig, netconfClient, "id-test", - "prefix:test-identity1", - "prefix:test-identity2", - "prefix:test-identity2", - "prefix:test-identity1"); - } + Preconditions.checkNotNull(broker, "Controller not initialized"); + + NioEventLoopGroup nettyThreadgroup = new NioEventLoopGroup(); + NetconfClientDispatcher clientDispatcher = new NetconfClientDispatcher(nettyThreadgroup, nettyThreadgroup, + CLIENT_CONNECTION_TIMEOUT_MILLIS); + + NetconfMessage edit = xmlFileToNetconfMessage("netconfMessages/editConfig_identities.xml"); + NetconfMessage commit = xmlFileToNetconfMessage("netconfMessages/commit.xml"); + NetconfMessage getConfig = xmlFileToNetconfMessage("netconfMessages/getConfig.xml"); + + try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", tcpAddress, CLIENT_CONNECTION_TIMEOUT_MILLIS, clientDispatcher)) { + sendMessage(edit, netconfClient); + sendMessage(commit, netconfClient); + sendMessage(getConfig, netconfClient, "id-test", + "prefix:test-identity1", + "prefix:test-identity2", + "prefix:test-identity2", + "prefix:test-identity1"); clientDispatcher.close(); } catch (Exception e) { @@ -119,8 +141,7 @@ public class IdentityRefNetconfTest { } } - - private void sendMessage(NetconfMessage edit, NetconfClient netconfClient, String... containingResponse) + private void sendMessage(NetconfMessage edit, TestingNetconfClient netconfClient, String... containingResponse) throws ExecutionException, InterruptedException, TimeoutException { NetconfMessage response = netconfClient.sendRequest(edit).get(); if (containingResponse == null) { @@ -134,16 +155,6 @@ public class IdentityRefNetconfTest { public static NetconfMessage xmlFileToNetconfMessage(final String fileName) throws IOException, SAXException, ParserConfigurationException { - return new NetconfMessage(xmlFileToDocument(fileName)); - } - - public static Document xmlFileToDocument(final String fileName) throws IOException, SAXException, - ParserConfigurationException { - // TODO xml messages from netconf-util test-jar cannot be loaded here(in OSGi), since test jar is not a bundle - try (InputStream resourceAsStream = IdentityRefNetconfTest.class.getClassLoader().getResourceAsStream(fileName)) { - Preconditions.checkNotNull(resourceAsStream); - final Document doc = XmlUtil.readXmlToDocument(resourceAsStream); - return doc; - } + return XmlFileLoader.xmlFileToNetconfMessage(fileName); } } diff --git a/opendaylight/netconf/netconf-it/src/test/resources/controller.xml b/opendaylight/netconf/netconf-it/src/test/resources/controller.xml index 664a30daa5..96efc10403 100644 --- a/opendaylight/netconf/netconf-it/src/test/resources/controller.xml +++ b/opendaylight/netconf/netconf-it/src/test/resources/controller.xml @@ -17,56 +17,56 @@ - prefix:impl-identity-test - id-test + prefix:impl-identity-test + id-test - prefix:test-identity2 + prefix:test-identity2 - prefix:test-identity2 - prefix:test-identity1 + prefix:test-identity2 + prefix:test-identity1 - prefix:test-identity1 - prefix:test-identity2 + prefix:test-identity1 + prefix:test-identity2 - prefix:test-identity1 + prefix:test-identity1 - prefix:binding-broker-impl - binding-broker-impl + prefix:binding-broker-impl + binding-broker-impl - prefix:binding-notification-service + prefix:binding-notification-service ref_binding-notification-broker - prefix:binding-data-broker + prefix:binding-data-broker ref_binding-data-broker - prefix:runtime-generated-mapping - runtime-mapping-singleton + prefix:runtime-generated-mapping + runtime-mapping-singleton - prefix:binding-notification-broker - binding-notification-broker + prefix:binding-notification-broker + binding-notification-broker - prefix:binding-data-broker - binding-data-broker + prefix:binding-data-broker + binding-data-broker - prefix:dom-broker-osgi-registry + prefix:dom-broker-osgi-registry ref_dom-broker - prefix:binding-dom-mapping-service + prefix:binding-dom-mapping-service ref_runtime-mapping-singleton - prefix:logback - singleton + prefix:logback + singleton DEBUG console @@ -79,95 +79,95 @@ - prefix:schema-service-singleton - yang-schema-service + prefix:schema-service-singleton + yang-schema-service - prefix:hash-map-data-store - hash-map-data-store + prefix:hash-map-data-store + hash-map-data-store - prefix:dom-broker-impl - dom-broker + prefix:dom-broker-impl + dom-broker - prefix:dom-data-store + prefix:dom-data-store ref_hash-map-data-store - prefix:schema-service + prefix:schema-service ref_yang-schema-service /modules/module[type='schema-service-singleton'][name='yang-schema-service'] - prefix:dom-data-store + prefix:dom-data-store ref_hash-map-data-store /modules/module[type='hash-map-data-store'][name='hash-map-data-store'] - prefix:dom-broker-osgi-registry + prefix:dom-broker-osgi-registry ref_dom-broker /modules/module[type='dom-broker-impl'][name='dom-broker'] - prefix:testing + prefix:testing ref_id-test /modules/module[type='impl-identity-test'][name='id-test'] - prefix:binding-dom-mapping-service + prefix:binding-dom-mapping-service ref_runtime-mapping-singleton /modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton'] - prefix:binding-data-consumer-broker + prefix:binding-data-consumer-broker ref_binding-data-broker /modules/module[type='binding-data-broker'][name='binding-data-broker'] - prefix:binding-rpc-registry + prefix:binding-rpc-registry ref_binding-broker-impl /modules/module[type='binding-broker-impl'][name='binding-broker-impl'] - prefix:binding-notification-service + prefix:binding-notification-service ref_binding-notification-broker /modules/module[type='binding-notification-broker'][name='binding-notification-broker'] - prefix:binding-broker-osgi-registry + prefix:binding-broker-osgi-registry ref_binding-broker-impl /modules/module[type='binding-broker-impl'][name='binding-broker-impl'] - prefix:binding-notification-subscription-service + prefix:binding-notification-subscription-service ref_binding-notification-broker /modules/module[type='binding-notification-broker'][name='binding-notification-broker'] - prefix:binding-data-broker + prefix:binding-data-broker ref_binding-data-broker /modules/module[type='binding-data-broker'][name='binding-data-broker'] diff --git a/opendaylight/netconf/netconf-mapping-api/pom.xml b/opendaylight/netconf/netconf-mapping-api/pom.xml index 18c27238e9..1a510f939c 100644 --- a/opendaylight/netconf/netconf-mapping-api/pom.xml +++ b/opendaylight/netconf/netconf-mapping-api/pom.xml @@ -1,50 +1,44 @@ + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - netconf-mapping-api - ${project.artifactId} + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-mapping-api - bundle + bundle + ${project.artifactId} - - - ${project.groupId} - netconf-api - + + + ${project.groupId} + netconf-api + - - com.google.guava - guava - - + + com.google.guava + guava + + - - - - - org.apache.felix - maven-bundle-plugin - - - - - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + + com.google.common.base, org.opendaylight.controller.netconf.api, - org.w3c.dom - - - org.opendaylight.controller.netconf.mapping.api, - - - - - - + org.w3c.dom + org.opendaylight.controller.netconf.mapping.api, + + + + + diff --git a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationProvider.java b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationProvider.java new file mode 100644 index 0000000000..f5c50f8167 --- /dev/null +++ b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationProvider.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2013 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.netconf.mapping.api; + +public interface NetconfOperationProvider { + + NetconfOperationServiceSnapshot openSnapshot(String sessionIdForReporting); + + public static class NetconfOperationProviderUtil { + + public static String getNetconfSessionIdForReporting(long sessionId) { + return "netconf session id " + sessionId; + } + + } + +} diff --git a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationServiceSnapshot.java similarity index 65% rename from opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java rename to opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationServiceSnapshot.java index 816650c4bb..eaa69379f7 100644 --- a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java +++ b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationServiceSnapshot.java @@ -1,14 +1,18 @@ -/* - * Copyright (c) 2013 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.netconf.mapping.api; - -import org.opendaylight.controller.netconf.api.NetconfSession; - -public interface DefaultNetconfOperation { - void setNetconfSession(NetconfSession s); -} +/* + * Copyright (c) 2013 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.netconf.mapping.api; + +import java.util.Set; + +public interface NetconfOperationServiceSnapshot extends AutoCloseable { + String getNetconfSessionIdForReporting(); + + Set getServices(); + +} diff --git a/opendaylight/netconf/netconf-monitoring/pom.xml b/opendaylight/netconf/netconf-monitoring/pom.xml index 568aca9063..6730ccbb54 100644 --- a/opendaylight/netconf/netconf-monitoring/pom.xml +++ b/opendaylight/netconf/netconf-monitoring/pom.xml @@ -1,61 +1,58 @@ - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - 4.0.0 - netconf-monitoring - ${project.artifactId} - bundle + 4.0.0 + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-monitoring + bundle + ${project.artifactId} + + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-mapping-api + + + ${project.groupId} + netconf-util + - - - - ${project.groupId} - netconf-api - - - ${project.groupId} - netconf-util - - - ${project.groupId} - netconf-mapping-api - - - org.opendaylight.yangtools.model - ietf-inet-types - + + com.google.guava + guava + - - com.google.guava - guava - - - org.slf4j - slf4j-api - + + org.opendaylight.yangtools + mockito-configuration + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.slf4j + slf4j-api + + - - org.opendaylight.yangtools - mockito-configuration - - - - - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringActivator - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringActivator + com.google.common.base, com.google.common.collect, com.google.common.io, org.opendaylight.controller.netconf.api, @@ -81,12 +78,11 @@ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210, - org.opendaylight.yangtools.yang.binding, - - - - - - + org.opendaylight.yangtools.yang.binding, + + + + + diff --git a/opendaylight/netconf/netconf-ssh/pom.xml b/opendaylight/netconf/netconf-ssh/pom.xml index 23a69b23fc..622881352e 100644 --- a/opendaylight/netconf/netconf-ssh/pom.xml +++ b/opendaylight/netconf/netconf-ssh/pom.xml @@ -1,81 +1,65 @@ - - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - ../ - - 4.0.0 - netconf-ssh - ${project.artifactId} - bundle + + + 4.0.0 + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + ../ + + netconf-ssh + bundle + ${project.artifactId} + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-util + + + commons-io + commons-io + + + org.bouncycastle + bcpkix-jdk15on + + + org.bouncycastle + bcprov-jdk15on + + + org.opendaylight.controller + usermanager + + + org.opendaylight.controller.thirdparty + ganymed + + + org.slf4j + slf4j-api + + + org.opendaylight.yangtools + mockito-configuration + test + + - - - ${project.groupId} - netconf-util - - - ${project.groupId} - netconf-api - - - org.slf4j - slf4j-api - - - org.opendaylight.controller.thirdparty - ganymed - - - commons-io - commons-io - - - org.opendaylight.controller - usermanager - - - org.bouncycastle - bcprov-jdk15on - - - org.bouncycastle - bcpkix-jdk15on - - - org.opendaylight.yangtools - mockito-configuration - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - package - - test-jar - - - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.netconf.ssh.osgi.NetconfSSHActivator - - - com.google.common.base, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.ssh.osgi.NetconfSSHActivator + com.google.common.base, ch.ethz.ssh2, ch.ethz.ssh2.signature, org.apache.commons.io, @@ -86,12 +70,24 @@ org.osgi.framework, org.osgi.util.tracker, org.slf4j, - org.bouncycastle.openssl - - - - - - + org.bouncycastle.openssl + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + test-jar + + package + + + + + diff --git a/opendaylight/netconf/netconf-util/pom.xml b/opendaylight/netconf/netconf-util/pom.xml index d623dd9796..25db5f3f42 100644 --- a/opendaylight/netconf/netconf-util/pom.xml +++ b/opendaylight/netconf/netconf-util/pom.xml @@ -1,75 +1,84 @@ + - 4.0.0 + 4.0.0 - - netconf-subsystem - org.opendaylight.controller - 0.2.5-SNAPSHOT - - netconf-util - ${project.artifactId} - bundle + + org.opendaylight.controller + netconf-subsystem + 0.2.5-SNAPSHOT + + netconf-util + bundle + ${project.artifactId} + + + + ${project.groupId} + netconf-api + + + ${project.groupId} + netconf-mapping-api + + + com.google.guava + guava + + + io.netty + netty-handler + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + protocol-framework + + + org.opendaylight.controller.thirdparty + ganymed + + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + - - - - ${project.groupId} - netconf-api - - - ${project.groupId} - netconf-mapping-api - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - protocol-framework - + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + + xmlunit + xmlunit + + - - org.osgi - org.osgi.core - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - - io.netty - netty-handler - - - org.opendaylight.controller.thirdparty - ganymed - - - - - - - org.apache.felix - maven-bundle-plugin - - - - org.opendaylight.controller.netconf.util, + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.netconf.util, org.opendaylight.controller.netconf.util.xml, org.opendaylight.controller.netconf.util.osgi, org.opendaylight.controller.netconf.util.mapping, org.opendaylight.controller.netconf.util.messages, org.opendaylight.controller.netconf.util.handler, - org.opendaylight.controller.netconf.util.handler.*, - - - com.google.common.base, + org.opendaylight.controller.netconf.util.handler.*, + com.google.common.base, com.google.common.collect, ch.ethz.ssh2, io.netty.buffer, @@ -98,24 +107,24 @@ org.xml.sax, org.xml.sax.helpers, org.opendaylight.controller.config.api, - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - package - - test-jar - - - - - - + org.openexi.*, + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + test-jar + + package + + + + + diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java new file mode 100644 index 0000000000..270af3505f --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2013 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.netconf.util; + +import java.io.IOException; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.api.NetconfSession; +import org.opendaylight.controller.netconf.api.NetconfSessionListener; +import org.opendaylight.controller.netconf.api.NetconfTerminationReason; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +import org.opendaylight.controller.netconf.util.xml.EXIParameters; +import org.opendaylight.controller.netconf.util.xml.XmlElement; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.opendaylight.protocol.framework.AbstractProtocolSession; +import org.openexi.proc.common.EXIOptionsException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandler; + +public abstract class AbstractNetconfSession> extends AbstractProtocolSession implements NetconfSession, NetconfExiSession { + private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSession.class); + private final L sessionListener; + private final long sessionId; + private boolean up = false; + + private ChannelHandler delayedEncoder; + + private final Channel channel; + + protected AbstractNetconfSession(final L sessionListener, final Channel channel, final long sessionId) { + this.sessionListener = sessionListener; + this.channel = channel; + this.sessionId = sessionId; + logger.debug("Session {} created", sessionId); + } + + protected abstract S thisInstance(); + + @Override + public void close() { + channel.close(); + up = false; + sessionListener.onSessionTerminated(thisInstance(), new NetconfTerminationReason("Session closed")); + } + + @Override + protected void handleMessage(final NetconfMessage netconfMessage) { + logger.debug("handling incoming message"); + sessionListener.onMessage(thisInstance(), netconfMessage); + } + + @Override + public ChannelFuture sendMessage(final NetconfMessage netconfMessage) { + final ChannelFuture future = channel.writeAndFlush(netconfMessage); + if (delayedEncoder !=null) { + replaceMessageEncoder(delayedEncoder); + delayedEncoder = null; + } + + return future; + } + + @Override + protected void endOfInput() { + logger.debug("Session {} end of input detected while session was in state {}", toString(), isUp() ? "up" + : "initialized"); + if (isUp()) { + this.sessionListener.onSessionDown(thisInstance(), new IOException("End of input detected. Close the session.")); + } + } + + @Override + protected void sessionUp() { + logger.debug("Session {} up", toString()); + sessionListener.onSessionUp(thisInstance()); + this.up = true; + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer(getClass().getSimpleName() + "{"); + sb.append("sessionId=").append(sessionId); + sb.append('}'); + return sb.toString(); + } + + protected T removeHandler(final Class handlerType) { + return this.channel.pipeline().remove(handlerType); + } + + protected void replaceMessageDecoder(final ChannelHandler handler) { + replaceChannelHandler(AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, handler); + } + + protected void replaceMessageEncoder(final ChannelHandler handler) { + replaceChannelHandler(AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, handler); + } + + protected void replaceMessageEncoderAfterNextMessage(final ChannelHandler handler) { + this.delayedEncoder = handler; + } + + protected void replaceChannelHandler(final String handlerName, final ChannelHandler handler) { + channel.pipeline().replace(handlerName, handlerName, handler); + } + + @Override + public final void startExiCommunication(final NetconfMessage startExiMessage) { + final EXIParameters exiParams; + try { + exiParams = EXIParameters.fromXmlElement(XmlElement.fromDomDocument(startExiMessage.getDocument())); + } catch (final EXIOptionsException e) { + logger.warn("Unable to parse EXI parameters from {} om session {}", XmlUtil.toString(startExiMessage.getDocument()), this, e); + throw new IllegalArgumentException(e); + } + final NetconfEXICodec exiCodec = new NetconfEXICodec(exiParams.getOptions()); + addExiHandlers(exiCodec); + logger.debug("EXI handlers added to pipeline on session {}", this); + } + + protected abstract void addExiHandlers(NetconfEXICodec exiCodec); + + public final boolean isUp() { + return up; + } + + public final long getSessionId() { + return sessionId; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java index 71f08339c8..724b45bc08 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java @@ -8,9 +8,12 @@ package org.opendaylight.controller.netconf.util; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.ssl.SslHandler; import io.netty.util.Timeout; import io.netty.util.Timer; @@ -18,11 +21,6 @@ import io.netty.util.TimerTask; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import io.netty.util.concurrent.Promise; - -import java.util.concurrent.TimeUnit; - -import io.netty.channel.ChannelInboundHandlerAdapter; -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.NetconfSessionListener; import org.opendaylight.controller.netconf.api.NetconfSessionPreferences; @@ -39,16 +37,16 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; +import java.util.concurrent.TimeUnit; public abstract class AbstractNetconfSessionNegotiator

    , L extends NetconfSessionListener> extends AbstractSessionNegotiator { private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSessionNegotiator.class); + public static final String NAME_OF_EXCEPTION_HANDLER = "lastExceptionHandler"; - private final P sessionPreferences; + protected final P sessionPreferences; private final L sessionListener; private Timeout timeout; @@ -56,7 +54,7 @@ extends AbstractSessionNegotiator { /** * Possible states for Finite State Machine */ - private enum State { + protected enum State { IDLE, OPEN_WAIT, FAILED, ESTABLISHED } @@ -64,6 +62,7 @@ extends AbstractSessionNegotiator { private final Timer timer; private final long connectionTimeoutMillis; + // TODO shrink constructor protected AbstractNetconfSessionNegotiator(P sessionPreferences, Promise promise, Channel channel, Timer timer, L sessionListener, long connectionTimeoutMillis) { super(promise, channel); @@ -127,7 +126,6 @@ extends AbstractSessionNegotiator { sendMessage((NetconfHelloMessage)helloMessage); changeState(State.OPEN_WAIT); } - private void cancelTimeout() { if(timeout!=null) { timeout.cancel(); @@ -136,7 +134,12 @@ extends AbstractSessionNegotiator { @Override protected void handleMessage(NetconfHelloMessage netconfMessage) { - Preconditions.checkNotNull(netconfMessage != null, "netconfMessage"); + S session = getSessionForHelloMessage(netconfMessage); + negotiationSuccessful(session); + } + + protected final S getSessionForHelloMessage(NetconfHelloMessage netconfMessage) { + Preconditions.checkNotNull(netconfMessage, "netconfMessage"); final Document doc = netconfMessage.getDocument(); @@ -147,22 +150,20 @@ extends AbstractSessionNegotiator { } changeState(State.ESTABLISHED); - S session = getSession(sessionListener, channel, netconfMessage); - - negotiationSuccessful(session); + return getSession(sessionListener, channel, netconfMessage); } /** * Insert chunk framing handlers into the pipeline */ - private void insertChunkFramingToPipeline() { + protected void insertChunkFramingToPipeline() { replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_ENCODER, FramingMechanismHandlerFactory.createHandler(FramingMechanism.CHUNK)); replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_AGGREGATOR, new NetconfChunkAggregator()); } - private boolean shouldUseChunkFraming(Document doc) { + protected boolean shouldUseChunkFraming(Document doc) { return containsBase11Capability(doc) && containsBase11Capability(sessionPreferences.getHelloMessage().getDocument()); } @@ -170,7 +171,7 @@ extends AbstractSessionNegotiator { /** * Remove special handlers for hello message. Insert regular netconf xml message (en|de)coders. */ - private void replaceHelloMessageHandlers() { + protected void replaceHelloMessageHandlers() { replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, new NetconfXMLToMessageDecoder()); replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, new NetconfMessageToXMLEncoder()); } @@ -181,7 +182,7 @@ extends AbstractSessionNegotiator { protected abstract S getSession(L sessionListener, Channel channel, NetconfHelloMessage message); - private synchronized void changeState(final State newState) { + protected synchronized void changeState(final State newState) { logger.debug("Changing state from : {} to : {}", state, newState); Preconditions.checkState(isStateChangePermitted(state, newState), "Cannot change state from %s to %s", state, newState); @@ -208,7 +209,6 @@ extends AbstractSessionNegotiator { if (state == State.OPEN_WAIT && newState == State.FAILED) { return true; } - logger.debug("Transition from {} to {} is not allowed", state, newState); return false; } @@ -217,7 +217,6 @@ extends AbstractSessionNegotiator { * Handler to catch exceptions in pipeline during negotiation */ private final class ExceptionHandlingInboundChannelHandler extends ChannelInboundHandlerAdapter { - @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { logger.warn("An exception occurred during negotiation on channel {}", channel.localAddress(), cause); diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/CloseableUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/CloseableUtil.java new file mode 100644 index 0000000000..27960dfe16 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/CloseableUtil.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013 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.netconf.util; + +public class CloseableUtil { + + public static void closeAll(Iterable autoCloseables) throws Exception { + Exception lastException = null; + for (AutoCloseable autoCloseable : autoCloseables) { + try { + autoCloseable.close(); + } catch (Exception e) { + if (lastException == null) { + lastException = e; + } else { + lastException.addSuppressed(e); + } + } + } + if (lastException != null) { + throw lastException; + } + + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java new file mode 100644 index 0000000000..2a20ba2f61 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013 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.netconf.util; + +import org.opendaylight.controller.netconf.api.NetconfMessage; + +/** + * Session capable of exi communication according to http://tools.ietf.org/html/draft-varga-netconf-exi-capability-02 + */ +public interface NetconfExiSession { + + /** + * Start exi communication with parameters included in start-exi message + */ + void startExiCommunication(NetconfMessage startExiMessage); + + /** + * Stop exi communication, initiated by stop-exi message + */ + void stopExiCommunication(); +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java new file mode 100644 index 0000000000..a6e2e52ea5 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java @@ -0,0 +1,59 @@ +package org.opendaylight.controller.netconf.util.handler; + +import com.google.common.base.Preconditions; +import org.openexi.proc.HeaderOptionsOutputType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; +import org.openexi.proc.common.GrammarOptions; +import org.openexi.proc.grammars.GrammarCache; +import org.openexi.sax.EXIReader; +import org.openexi.sax.Transmogrifier; + +public final class NetconfEXICodec { + /** + * NETCONF is XML environment, so the use of EXI cookie is not really needed. Adding it + * decreases efficiency of encoding by adding human-readable 4 bytes "EXI$" to the head + * of the stream. This is really useful, so let's output it now. + */ + private static final boolean OUTPUT_EXI_COOKIE = true; + private final EXIOptions exiOptions; + + public NetconfEXICodec(final EXIOptions exiOptions) { + this.exiOptions = Preconditions.checkNotNull(exiOptions); + } + + private GrammarCache getGrammarCache() { + short go = GrammarOptions.DEFAULT_OPTIONS; + if (exiOptions.getPreserveComments()) { + go = GrammarOptions.addCM(go); + } + if (exiOptions.getPreserveDTD()) { + go = GrammarOptions.addDTD(go); + } + if (exiOptions.getPreserveNS()) { + go = GrammarOptions.addNS(go); + } + if (exiOptions.getPreservePIs()) { + go = GrammarOptions.addPI(go); + } + + return new GrammarCache(null, go); + } + + EXIReader getReader() throws EXIOptionsException { + final EXIReader r = new EXIReader(); + r.setPreserveLexicalValues(exiOptions.getPreserveLexicalValues()); + r.setGrammarCache(getGrammarCache()); + return r; + } + + Transmogrifier getTransmogrifier() throws EXIOptionsException { + final Transmogrifier transmogrifier = new Transmogrifier(); + transmogrifier.setAlignmentType(exiOptions.getAlignmentType()); + transmogrifier.setBlockSize(exiOptions.getBlockSize()); + transmogrifier.setGrammarCache(getGrammarCache()); + transmogrifier.setOutputCookie(OUTPUT_EXI_COOKIE); + transmogrifier.setOutputOptions(HeaderOptionsOutputType.all); + return transmogrifier; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java new file mode 100644 index 0000000000..cbfbfe1c05 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java @@ -0,0 +1,79 @@ +/* + * 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.netconf.util.handler; + +import java.io.InputStream; +import java.util.List; + +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.openexi.sax.EXIReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +import com.google.common.base.Preconditions; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.ByteBufUtil; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; + +public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { + + private static final Logger LOG = LoggerFactory.getLogger(NetconfEXIToMessageDecoder.class); + +// private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + + private final NetconfEXICodec codec; + + public NetconfEXIToMessageDecoder(final NetconfEXICodec codec) { + this.codec = Preconditions.checkNotNull(codec); + } + + @Override + protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List out) throws Exception { + /* + * Note that we could loop here and process all the messages, but we can't do that. + * The reason is operation, which has the contract of immediately stopping + * the use of EXI, which means the next message needs to be decoded not by us, but rather + * by the XML decoder. + */ + // If empty Byte buffer is passed to r.parse, EOFException is thrown + + if (in.readableBytes() == 0) { + LOG.debug("No more content in incoming buffer."); + return; + } + + LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in)); + + final EXIReader r = codec.getReader(); + + final SAXTransformerFactory transformerFactory + = (SAXTransformerFactory) TransformerFactory.newInstance(); + final TransformerHandler handler = transformerFactory.newTransformerHandler(); + r.setContentHandler(handler); + + final DOMResult domResult = new DOMResult(); + handler.setResult(domResult); + + + try (final InputStream is = new ByteBufInputStream(in)) { + r.parse(new InputSource(is)); + } + + out.add(new NetconfMessage((Document) domResult.getNode())); + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java new file mode 100644 index 0000000000..5edec0d1bd --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java @@ -0,0 +1,52 @@ +/* + * 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.netconf.util.handler; + +import java.io.ByteArrayInputStream; +import java.io.OutputStream; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.openexi.sax.Transmogrifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.InputSource; + +import com.google.common.base.Preconditions; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; + +public final class NetconfMessageToEXIEncoder extends MessageToByteEncoder { + + private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageToEXIEncoder.class); + + //private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + private final NetconfEXICodec codec; + + public NetconfMessageToEXIEncoder(final NetconfEXICodec codec) { + this.codec = Preconditions.checkNotNull(codec); + } + + @Override + protected void encode(final ChannelHandlerContext ctx, final NetconfMessage msg, final ByteBuf out) throws Exception { + LOG.trace("Sent to encode : {}", XmlUtil.toString(msg.getDocument())); + + try (final OutputStream os = new ByteBufOutputStream(out)) { + final Transmogrifier transmogrifier = codec.getTransmogrifier(); + transmogrifier.setOutputStream(os); + + // FIXME transformer not working, see EXILibTest + transmogrifier.encode(new InputSource(new ByteArrayInputStream(XmlUtil.toString(msg.getDocument()).getBytes()))); + //final Transformer transformer = saxTransformerFactory.newTransformer(); + //transformer.transform(new DOMSource(msg.getDocument()), new SAXResult(transmogrifier.getSAXTransmogrifier())); + } + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java index f9792a6c5b..121ef8d743 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java @@ -24,6 +24,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Comment; @@ -48,7 +49,7 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder attributes = requestElement.getAttributes(); Element response = handle(document, operationElement, subsequentOperation); - Element rpcReply = document.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, - XmlNetconfConstants.RPC_REPLY_KEY); + Element rpcReply = XmlUtil.createElement(document, XmlNetconfConstants.RPC_REPLY_KEY, Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); if(XmlElement.fromDomElement(response).hasNamespace()) { rpcReply.appendChild(response); } else { - Element responseNS = document.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, response.getNodeName()); + Element responseNS = XmlUtil.createElement(document, response.getNodeName(), Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); NodeList list = response.getChildNodes(); while(list.getLength()!=0) { responseNS.appendChild(list.item(0)); diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java index 249f894340..e3eb450704 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java @@ -8,13 +8,17 @@ package org.opendaylight.controller.netconf.util.messages; +import java.util.Set; + import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.w3c.dom.Document; +import org.w3c.dom.Element; import com.google.common.base.Optional; +import com.google.common.collect.Sets; /** * NetconfMessage that can carry additional header with session metadata. See {@link org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader} @@ -50,4 +54,37 @@ public final class NetconfHelloMessage extends NetconfMessage { XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlUtil.toString(doc)), e); } } + + public static NetconfHelloMessage createClientHello(Iterable capabilities, + Optional additionalHeaderOptional) { + Document doc = createHelloMessageDoc(capabilities); + return additionalHeaderOptional.isPresent() ? new NetconfHelloMessage(doc, additionalHeaderOptional.get()) + : new NetconfHelloMessage(doc); + } + + private static Document createHelloMessageDoc(Iterable capabilities) { + Document doc = XmlUtil.newDocument(); + Element helloElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + HELLO_TAG); + Element capabilitiesElement = doc.createElement(XmlNetconfConstants.CAPABILITIES); + + for (String capability : Sets.newHashSet(capabilities)) { + Element capElement = doc.createElement(XmlNetconfConstants.CAPABILITY); + capElement.setTextContent(capability); + capabilitiesElement.appendChild(capElement); + } + + helloElement.appendChild(capabilitiesElement); + + doc.appendChild(helloElement); + return doc; + } + + public static NetconfHelloMessage createServerHello(Set capabilities, long sessionId) { + Document doc = createHelloMessageDoc(capabilities); + Element sessionIdElement = doc.createElement(XmlNetconfConstants.SESSION_ID); + sessionIdElement.setTextContent(Long.toString(sessionId)); + doc.getDocumentElement().appendChild(sessionIdElement); + return new NetconfHelloMessage(doc); + } } diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java index 91eb86908b..e4d97cf65a 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java @@ -8,11 +8,17 @@ package org.opendaylight.controller.netconf.util.messages; +import com.google.common.base.Function; +import com.google.common.collect.Collections2; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; import org.w3c.dom.Document; +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; + public final class NetconfMessageUtil { private NetconfMessageUtil() {} @@ -26,10 +32,13 @@ public final class NetconfMessageUtil { } public static boolean isOKMessage(XmlElement xmlElement) { + if(xmlElement.getChildElements().size() != 1) { + return false; + } return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.OK); } - public static boolean isErrorMEssage(NetconfMessage message) { + public static boolean isErrorMessage(NetconfMessage message) { return isErrorMessage(message.getDocument()); } @@ -38,7 +47,26 @@ public final class NetconfMessageUtil { } public static boolean isErrorMessage(XmlElement xmlElement) { + if(xmlElement.getChildElements().size() != 1) { + return false; + } return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.RPC_ERROR); + } + + public static Collection extractCapabilitiesFromHello(Document doc) { + XmlElement responseElement = XmlElement.fromDomDocument(doc); + XmlElement capabilitiesElement = responseElement + .getOnlyChildElementWithSameNamespace(XmlNetconfConstants.CAPABILITIES); + List caps = capabilitiesElement.getChildElements(XmlNetconfConstants.CAPABILITY); + return Collections2.transform(caps, new Function() { + + @Nullable + @Override + public String apply(@Nullable XmlElement input) { + // Trim possible leading/tailing whitespace + return input.getTextContent().trim(); + } + }); } } diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java new file mode 100644 index 0000000000..4fe6adc0a5 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2013 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.netconf.util.messages; + +import java.util.List; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.openexi.proc.common.EXIOptions; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.google.common.collect.Lists; + +/** + * Start-exi netconf message. + */ +public final class NetconfStartExiMessage extends NetconfMessage { + + public static final String START_EXI = "start-exi"; + public static final String ALIGNMENT_KEY = "alignment"; + public static final String FIDELITY_KEY = "fidelity"; + public static final String COMMENTS_KEY = "comments"; + public static final String DTD_KEY = "dtd"; + public static final String LEXICAL_VALUES_KEY = "lexical-values"; + public static final String PIS_KEY = "pis"; + public static final String PREFIXES_KEY = "prefixes"; + + private NetconfStartExiMessage(Document doc) { + super(doc); + } + + public static NetconfStartExiMessage create(EXIOptions exiOptions, String messageId) { + Document doc = XmlUtil.newDocument(); + Element rpcElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.RPC_KEY); + rpcElement.setAttributeNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.MESSAGE_ID, messageId); + + // TODO draft http://tools.ietf.org/html/draft-varga-netconf-exi-capability-02#section-3.5.1 has no namespace for start-exi element in xml + Element startExiElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + START_EXI); + + addAlignemnt(exiOptions, doc, startExiElement); + addFidelity(exiOptions, doc, startExiElement); + + rpcElement.appendChild(startExiElement); + + doc.appendChild(rpcElement); + return new NetconfStartExiMessage(doc); + } + + private static void addFidelity(EXIOptions exiOptions, Document doc, Element startExiElement) { + List fidelityElements = Lists.newArrayList(); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveComments(), COMMENTS_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveDTD(), DTD_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveLexicalValues(), LEXICAL_VALUES_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreservePIs(), PIS_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveNS(), PREFIXES_KEY); + + if (fidelityElements.isEmpty() == false) { + Element fidelityElement = doc.createElementNS( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, FIDELITY_KEY); + for (Element element : fidelityElements) { + fidelityElement.appendChild(element); + } + startExiElement.appendChild(fidelityElement); + } + } + + private static void addAlignemnt(EXIOptions exiOptions, Document doc, Element startExiElement) { + Element alignmentElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + ALIGNMENT_KEY); + alignmentElement.setTextContent(exiOptions.getAlignmentType().toString()); + startExiElement.appendChild(alignmentElement); + } + + private static void createFidelityElement(Document doc, List fidelityElements, boolean fidelity, String fidelityName) { + + if (fidelity) { + fidelityElements.add(doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + fidelityName)); + } + + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java new file mode 100644 index 0000000000..593b77f193 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2013 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.netconf.util.xml; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; + +import com.google.common.base.Preconditions; + +public final class EXIParameters { + private static final String EXI_PARAMETER_ALIGNMENT = "alignment"; + private static final String EXI_PARAMETER_BYTE_ALIGNED = "byte-aligned"; + private static final String EXI_PARAMETER_BIT_PACKED = "bit-packed"; + private static final String EXI_PARAMETER_COMPRESSED = "compressed"; + private static final String EXI_PARAMETER_PRE_COMPRESSION = "pre-compression"; + + private static final String EXI_PARAMETER_FIDELITY = "fidelity"; + private static final String EXI_FIDELITY_DTD = "dtd"; + private static final String EXI_FIDELITY_LEXICAL_VALUES = "lexical-values"; + private static final String EXI_FIDELITY_COMMENTS = "comments"; + private static final String EXI_FIDELITY_PIS = "pis"; + private static final String EXI_FIDELITY_PREFIXES = "prefixes"; + + private static final String EXI_PARAMETER_SCHEMA = "schema"; + private static final String EXI_PARAMETER_SCHEMA_NONE = "none"; + private static final String EXI_PARAMETER_SCHEMA_BUILT_IN = "builtin"; + private static final String EXI_PARAMETER_SCHEMA_BASE_1_1 = "base:1.1"; + + private final EXIOptions options; + + private EXIParameters(final EXIOptions options) { + this.options = Preconditions.checkNotNull(options); + } + + public static EXIParameters fromNetconfMessage(final NetconfMessage root) throws EXIOptionsException { + return fromXmlElement(XmlElement.fromDomDocument(root.getDocument())); + } + + public static EXIParameters fromXmlElement(final XmlElement root) throws EXIOptionsException { + final EXIOptions options = new EXIOptions(); + + options.setAlignmentType(AlignmentType.bitPacked); + if (root.getElementsByTagName(EXI_PARAMETER_ALIGNMENT).getLength() > 0) { + if (root.getElementsByTagName(EXI_PARAMETER_BIT_PACKED).getLength() > 0) { + options.setAlignmentType(AlignmentType.bitPacked); + } else if (root.getElementsByTagName(EXI_PARAMETER_BYTE_ALIGNED).getLength() > 0) { + options.setAlignmentType(AlignmentType.byteAligned); + } else if (root.getElementsByTagName(EXI_PARAMETER_COMPRESSED).getLength() > 0) { + options.setAlignmentType(AlignmentType.compress); + } else if (root.getElementsByTagName(EXI_PARAMETER_PRE_COMPRESSION).getLength() > 0) { + options.setAlignmentType(AlignmentType.preCompress); + } + } + + if (root.getElementsByTagName(EXI_PARAMETER_FIDELITY).getLength() > 0) { + if (root.getElementsByTagName(EXI_FIDELITY_DTD).getLength() > 0) { + options.setPreserveDTD(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_LEXICAL_VALUES).getLength() > 0) { + options.setPreserveLexicalValues(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_COMMENTS).getLength() > 0) { + options.setPreserveComments(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_PIS).getLength() > 0) { + options.setPreservePIs(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_PREFIXES).getLength() > 0) { + options.setPreserveNS(true); + } + } + + if (root.getElementsByTagName(EXI_PARAMETER_SCHEMA).getLength() > 0) { +/* + GrammarFactory grammarFactory = GrammarFactory.newInstance(); + if (operationElement + .getElementsByTagName(EXI_PARAMETER_SCHEMA_NONE) + .getLength() > 0) { + this.grammars = grammarFactory.createSchemaLessGrammars(); + } + + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BUILT_IN).getLength() > 0) { + this.grammars = grammarFactory.createXSDTypesOnlyGrammars(); + } + + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BASE_1_1).getLength() > 0) { + this.grammars = grammarFactory + .createGrammars(NETCONF_XSD_LOCATION); + } +*/ + + } + + return new EXIParameters(options); + } + + public final EXIOptions getOptions() { + return options; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java index c9f3a8a53b..d0be73843b 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java @@ -9,6 +9,8 @@ package org.opendaylight.controller.netconf.util.xml; public final class XmlNetconfConstants { + + private XmlNetconfConstants() {} public static final String MOUNTPOINTS = "mountpoints"; @@ -37,8 +39,15 @@ public final class XmlNetconfConstants { public static final String PREFIX = "prefix"; + public static final String MESSAGE_ID = "message-id"; + public static final String SESSION_ID = "session-id"; + // public static final String URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0 = "urn:ietf:params:xml:ns:netconf:base:1.0"; + public static final String URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_1 = "urn:ietf:params:xml:ns:netconf:base:1.1"; + public static final String URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0 = "urn:ietf:params:xml:ns:netconf:exi:1.0"; + + public static final String URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0 = "urn:ietf:params:netconf:capability:exi:1.0"; public static final String URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"; // TODO where to store namespace of config ? public static final String URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG = "urn:opendaylight:params:xml:ns:yang:controller:config"; diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java index 238249dbbd..d8907424f8 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java @@ -40,10 +40,12 @@ import org.w3c.dom.Node; import org.xml.sax.SAXException; import com.google.common.base.Charsets; +import com.google.common.base.Optional; public final class XmlUtil { public static final String XMLNS_ATTRIBUTE_KEY = "xmlns"; + private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; private static final DocumentBuilderFactory BUILDERFACTORY; static { @@ -101,25 +103,30 @@ public final class XmlUtil { } } - public static Element createTextElement(Document document, String name, String content) { - Element typeElement = document.createElement(name); - typeElement.appendChild(document.createTextNode(content)); - return typeElement; - } - - public static void addNamespaceAttr(Element root, String namespace) { - root.setAttribute(XMLNS_ATTRIBUTE_KEY, namespace); + public static Element createElement(final Document document, String qName, Optional namespaceURI) { + if(namespaceURI.isPresent()) { + final Element element = document.createElementNS(namespaceURI.get(), qName); + String name = XMLNS_ATTRIBUTE_KEY; + if(element.getPrefix() != null) { + name += ":" + element.getPrefix(); + } + element.setAttributeNS(XMLNS_URI, name, namespaceURI.get()); + return element; + } + return document.createElement(qName); } - public static void addPrefixedNamespaceAttr(Element root, String prefix, String namespace) { - root.setAttribute(concat(XMLNS_ATTRIBUTE_KEY, prefix), namespace); + public static Element createTextElement(Document document, String qName, String content, Optional namespaceURI) { + Element typeElement = createElement(document, qName, namespaceURI); + typeElement.appendChild(document.createTextNode(content)); + return typeElement; } - public static Element createPrefixedTextElement(Document document, String key, String prefix, String content) { - return createTextElement(document, key, concat(prefix, content)); + public static Element createPrefixedTextElement(Document document, String qName, String prefix, String content, Optional namespace) { + return createTextElement(document, qName, createPrefixedValue(prefix, content), namespace); } - private static String concat(String prefix, String value) { + public static String createPrefixedValue(String prefix, String value) { return prefix + ":" + value; } diff --git a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java new file mode 100644 index 0000000000..360e8126ae --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java @@ -0,0 +1,207 @@ +/* + * 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.netconf.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; + +import org.junit.Ignore; +import org.junit.Test; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.GrammarOptions; +import org.openexi.proc.grammars.GrammarCache; +import org.openexi.sax.EXIReader; +import org.openexi.sax.Transmogrifier; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.InputSource; + +/** + * This test case tests nagasena library used for exi encode/decode. + * + * This library does not work correctly, since it is impossible to encode and then decode DOM xml. + * Encoding DOM using sax Transformer produces invalid xml, that cannot be decoded (Problem seems to be the namespace handling). + * + */ +@Ignore +public class EXILibTest { + + public static final AlignmentType ALIGNMENT_TYPE = AlignmentType.preCompress; + + @Test + public void testExiLibWithSaxTransformer() throws Exception { + final byte[] encode = encodeEXI(getDom2()); + final byte[] encodeWithTransformer = encodeEXITransformer(getDom2()); + + // System.err.println(Arrays.toString(encode)); + // System.err.println(Arrays.toString(encodeWithTransformer)); + + // This works fine (encoded from string) + decodeEXI(encode); + // Error, encoded from Dom with Transformer cannot be decoded, Exception is thrown + // + // either: + // org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. + // + // or: + // java.lang.NullPointerException + // + // depends on GrammarOptions.addNS(go); option set + decodeEXI(encodeWithTransformer); + } + + private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + + public static byte[] encodeEXITransformer(final Element xml) throws Exception { + final Transmogrifier transmogrifier = new Transmogrifier(); + + transmogrifier.setAlignmentType(ALIGNMENT_TYPE); + + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + + transmogrifier.setGrammarCache(getGrammarCache()); + + transmogrifier.setOutputStream(out); + + final Transformer transformer = saxTransformerFactory.newTransformer(); + transformer.transform(new DOMSource(xml), new SAXResult(transmogrifier.getSAXTransmogrifier())); + + return out.toByteArray(); + } + + public static byte[] encodeEXI(final Element xml) throws Exception { + final Transmogrifier transmogrifier = new Transmogrifier(); + + transmogrifier.setAlignmentType(ALIGNMENT_TYPE); + + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + + transmogrifier.setGrammarCache(getGrammarCache()); + + transmogrifier.setOutputStream(out); + + transmogrifier.encode(new InputSource(new ByteArrayInputStream(toString(xml, false).getBytes()))); + + out.flush(); + + return out.toByteArray(); + } + + private static GrammarCache getGrammarCache() { + short go = GrammarOptions.DEFAULT_OPTIONS; + + // This option on or off, nagasena still fails +// go = GrammarOptions.addNS(go); + + return new GrammarCache(null, go); + } + + public static Document decodeEXI(final byte[] input) throws Exception { + + final GrammarCache grammarCache; + final DOMResult domResult = new DOMResult(); + + try(ByteArrayInputStream in = new ByteArrayInputStream(input)) { + + final EXIReader reader = new EXIReader(); + + reader.setAlignmentType(ALIGNMENT_TYPE); + grammarCache = getGrammarCache(); + + reader.setGrammarCache(grammarCache); + + final SAXTransformerFactory transformerFactory + = (SAXTransformerFactory) TransformerFactory.newInstance(); + final TransformerHandler handler = transformerFactory.newTransformerHandler(); + handler.setResult(domResult); + + reader.setContentHandler(handler); + + reader.parse(new InputSource(in)); + } + + return (Document) domResult.getNode(); + } + + public static Element getDom() { + final Element dom; + + final Document d = newDocument(); + + dom = d.createElement("rpc"); + dom.setAttribute("xmlns", "a.b.c"); + dom.setAttribute("message-id", "id"); + dom.appendChild(d.createElement("inner")); + + return dom; + } + + public static Element getDom2() { + final Element dom; + + final Document d = newDocument(); + + dom = d.createElementNS("a.b.c", "rpc"); + dom.setAttribute("message-id", "id"); + dom.appendChild(d.createElement("inner")); + + return dom; + } + + private static final DocumentBuilderFactory BUILDERFACTORY; + + static { + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setCoalescing(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setIgnoringComments(true); + BUILDERFACTORY = factory; + } + + private static Document newDocument() { + try { + final DocumentBuilder builder = BUILDERFACTORY.newDocumentBuilder(); + return builder.newDocument(); + } catch (final ParserConfigurationException e) { + throw new RuntimeException("Failed to create document", e); + } + } + + private static String toString(final Element xml, final boolean addXmlDeclaration) { + try { + final Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, addXmlDeclaration ? "no" : "yes"); + + final StreamResult result = new StreamResult(new StringWriter()); + final DOMSource source = new DOMSource(xml); + transformer.transform(source, result); + + return result.getWriter().toString(); + } catch (IllegalArgumentException | TransformerFactoryConfigurationError | TransformerException e) { + throw new RuntimeException("Unable to serialize xml element " + xml, e); + } + } +} diff --git a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/test/XmlUnitUtil.java b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/test/XmlUnitUtil.java new file mode 100644 index 0000000000..e8a453e5d3 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/test/XmlUnitUtil.java @@ -0,0 +1,117 @@ +/* + * 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.netconf.util.test; + +import static org.custommonkey.xmlunit.XMLAssert.assertNodeTestPasses; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.custommonkey.xmlunit.AbstractNodeTester; +import org.custommonkey.xmlunit.NodeTest; +import org.custommonkey.xmlunit.NodeTestException; +import org.custommonkey.xmlunit.NodeTester; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.Text; + +public class XmlUnitUtil { + + private XmlUnitUtil() {} + + public static void assertContainsElementWithText(final Document doc, final String textToFind) throws NodeTestException { + NodeTest nt = new NodeTest(doc); + NodeTester tester = new AbstractNodeTester() { + + boolean textFound = false; + + @Override + public void testText(Text text) throws NodeTestException { + if(!textFound) { + if (text.getData().equalsIgnoreCase(textToFind)) { + textFound = true; + } + } + } + + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertTrue(textFound); + } + }; + assertNodeTestPasses(nt, tester, new short[]{Node.TEXT_NODE}, true); + } + + public static void assertContainsElement(final Document doc, final Element testElement) throws NodeTestException { + NodeTest nt = new NodeTest(doc); + NodeTester tester = new AbstractNodeTester() { + + private boolean elementFound = false; + + @Override + public void testElement(Element element) throws NodeTestException { + if (!elementFound) { + if(element.isEqualNode(testElement)) { + elementFound = true; + } + } + } + + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertTrue(elementFound); + } + }; + assertNodeTestPasses(nt, tester, new short[]{Node.ELEMENT_NODE}, true); + } + + public static void assertContainsElementWithName(final Document doc, final String elementName) throws NodeTestException { + NodeTest nt = new NodeTest(doc); + NodeTester tester = new AbstractNodeTester() { + + private boolean elementFound = false; + + @Override + public void testElement(Element element) throws NodeTestException { + if (!elementFound) { + if (element.getNodeName() != null && element.getNodeName().equals(elementName)) { + elementFound = true; + } + } + } + + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertTrue(elementFound); + } + }; + assertNodeTestPasses(nt, tester, new short[]{Node.ELEMENT_NODE}, true); + } + + public static void assertElementsCount(final Document doc, final String elementName, final int expectedCount) { + NodeTest nt = new NodeTest(doc); + NodeTester tester = new AbstractNodeTester() { + + private int elementFound = 0; + + @Override + public void testElement(Element element) throws NodeTestException { + if (element.getNodeName() != null && element.getNodeName().equals(elementName)) { + elementFound++; + } + } + + @Override + public void noMoreNodes(NodeTest forTest) throws NodeTestException { + assertEquals(expectedCount, elementFound); + } + }; + assertNodeTestPasses(nt, tester, new short[]{Node.ELEMENT_NODE}, true); + } +} diff --git a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/rpc-reply_ok.xml b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/rpc-reply_ok.xml new file mode 100644 index 0000000000..59496335f5 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/rpc-reply_ok.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml index 6b9e9452e8..e7a483e405 100644 --- a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml +++ b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml @@ -1,5 +1,5 @@ - + pre-compression diff --git a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml index 4168d21aba..6c0524a4fc 100644 --- a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml +++ b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/opendaylight/netconf/pom.xml b/opendaylight/netconf/pom.xml index 9a71c47193..86ef75d45f 100644 --- a/opendaylight/netconf/pom.xml +++ b/opendaylight/netconf/pom.xml @@ -1,245 +1,120 @@ + - 4.0.0 + 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../commons/opendaylight - + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../commons/opendaylight + + netconf-subsystem - 0.2.5-SNAPSHOT - netconf-subsystem - pom - ${project.artifactId} - - 3.0.4 - + 0.2.5-SNAPSHOT + pom + ${project.artifactId} + + 3.0.4 + + + netconf-api + netconf-impl + config-netconf-connector + netconf-util + config-persister-impl + netconf-mapping-api + netconf-client + netconf-ssh + netconf-monitoring + ietf-netconf-monitoring + ietf-netconf-monitoring-extension + ../../third-party/org.openexi + - - netconf-api - netconf-impl - config-netconf-connector - netconf-util - config-persister-impl - netconf-mapping-api - netconf-client - netconf-ssh - netconf-monitoring - ietf-netconf-monitoring - ietf-netconf-monitoring-extension - + + + org.osgi + org.osgi.core + + + ch.qos.logback + logback-classic + test + + + junit + junit + test + + - - - integrationtests - - false - - - netconf-it - - - + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + org.opendaylight.yangtools + yang-maven-plugin + ${yangtools.version} + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + + + + + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + ${project.build.directory}/site/models + + + true + + + + + - - 5.0.0 - 2.4.0 - 1.7.2 - + + + + org.apache.maven.plugins + maven-compiler-plugin + + + - - - junit - junit - test - - - ch.qos.logback - logback-classic - test - - - - - - - org.osgi - org.osgi.core - ${osgi.version} - - - ${project.groupId} - config-api - ${config.version} - - - ${project.groupId} - config-manager - ${config.version} - - - ${project.groupId} - config-manager - ${config.version} - test-jar - - - ${project.groupId} - yang-jmx-generator - ${config.version} - - - ${project.groupId} - config-util - ${config.version} - - - ${project.groupId} - yang-test - ${config.version} - - - ${project.groupId} - netconf-api - ${netconf.version} - - - ${project.groupId} - netconf-util - ${netconf.version} - - - ${project.groupId} - netconf-util - ${netconf.version} - test-jar - - - ${project.groupId} - netconf-ssh - ${netconf.version} - - - ${project.groupId} - netconf-ssh - ${netconf.version} - test-jar - - - ${project.groupId} - netconf-mapping-api - ${netconf.version} - - - ${project.groupId} - netconf-impl - ${netconf.version} - - - ${project.groupId} - netconf-monitoring - ${netconf.version} - - - ${project.groupId} - ietf-netconf-monitoring - ${netconf.version} - - - org.opendaylight.controller - config-persister-api - ${config.version} - - - ${project.groupId} - netconf-client - ${netconf.version} - - - xmlunit - xmlunit - 1.4 - - - ${project.groupId} - config-netconf-connector - ${netconf.version} - - - ${project.groupId} - config-persister-impl - ${netconf.version} - - - org.opendaylight.controller - logback-config - ${config.version} - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - - org.apache.felix - maven-bundle-plugin - ${maven.bundle.version} - true - - - ${project.groupId}.${project.artifactId} - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${yangtools.version} - - - - generate-sources - - - src/main/yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${salGeneratorPath} - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - ${project.build.directory}/site/models - - - true - - - - - - org.opendaylight.yangtools - maven-sal-api-gen-plugin - ${yangtools.version} - - - - - - - + + + integrationtests + + false + + + netconf-it + + + diff --git a/opendaylight/networkconfiguration/neutron/implementation/pom.xml b/opendaylight/networkconfiguration/neutron/implementation/pom.xml index f539f1ca69..9514ec1ed5 100644 --- a/opendaylight/networkconfiguration/neutron/implementation/pom.xml +++ b/opendaylight/networkconfiguration/neutron/implementation/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,36 +7,34 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - 1.26.2 - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - - - - - opendaylight-release - ${nexusproxy}/repositories/${nexus.repository.release}/ - - - - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - - - website - ${sitedeploy} - - networkconfig.neutron.implementation 0.4.2-SNAPSHOT bundle + + 1.26.2 + + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + networkconfig.neutron + + + org.opendaylight.controller + sal + + + org.osgi + org.osgi.core + + @@ -45,8 +44,7 @@ true - - org.opendaylight.controller.clustering.services, + org.opendaylight.controller.clustering.services, org.opendaylight.controller.configuration, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, @@ -55,37 +53,36 @@ org.osgi.service.component, org.opendaylight.controller.networkconfig.neutron, org.slf4j, - javax.xml.bind.annotation - - - org.opendaylight.controller.networkconfig.neutron.implementation.Activator - + javax.xml.bind.annotation + org.opendaylight.controller.networkconfig.neutron.implementation.Activator ${project.basedir}/src/main/resources/META-INF - - - org.osgi - org.osgi.core - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - networkconfig.neutron - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + + + opendaylight-release + ${nexusproxy}/repositories/${nexus.repository.release}/ + + + + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + website + ${sitedeploy} + + diff --git a/opendaylight/networkconfiguration/neutron/pom.xml b/opendaylight/networkconfiguration/neutron/pom.xml index b25e99e420..4d491a51d2 100644 --- a/opendaylight/networkconfiguration/neutron/pom.xml +++ b/opendaylight/networkconfiguration/neutron/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,35 +7,30 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - 1.26.2 - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - - - - opendaylight-release - ${nexusproxy}/repositories/${nexus.repository.release}/ - - - - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - - - website - ${sitedeploy} - - networkconfig.neutron 0.4.2-SNAPSHOT bundle + + 1.26.2 + + + + commons-net + commons-net + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + @@ -44,8 +40,7 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, @@ -53,30 +48,34 @@ org.apache.commons.net.util, org.osgi.service.component, org.slf4j, - javax.xml.bind.annotation - + javax.xml.bind.annotation ${project.basedir}/src/main/resources/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - commons-net - commons-net - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + + opendaylight-release + ${nexusproxy}/repositories/${nexus.repository.release}/ + + + + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + website + ${sitedeploy} + + diff --git a/opendaylight/northbound/bundlescanner/api/pom.xml b/opendaylight/northbound/bundlescanner/api/pom.xml index a0a3c9cfc6..d861e0a7c9 100644 --- a/opendaylight/northbound/bundlescanner/api/pom.xml +++ b/opendaylight/northbound/bundlescanner/api/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,17 +8,17 @@ ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - bundlescanner 0.4.2-SNAPSHOT bundle + + + org.osgi + org.osgi.core + + + @@ -27,27 +28,23 @@ true - - org.osgi.framework, + org.osgi.framework, org.slf4j, javax.ws.rs, javax.ws.rs.core, javax.xml.bind.annotation, - javax.xml.bind, - - - org.opendaylight.controller.northbound.bundlescanner - + javax.xml.bind, + org.opendaylight.controller.northbound.bundlescanner - - - org.osgi - org.osgi.core - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/bundlescanner/implementation/pom.xml b/opendaylight/northbound/bundlescanner/implementation/pom.xml index d4e08079a6..dc481ce74a 100644 --- a/opendaylight/northbound/bundlescanner/implementation/pom.xml +++ b/opendaylight/northbound/bundlescanner/implementation/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,17 +8,34 @@ ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - bundlescanner.implementation 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + bundlescanner + + + org.opendaylight.controller + sal + + + org.ow2.asm + asm-all + + + org.springframework.osgi + spring-osgi-mock + test + + + @@ -27,8 +45,7 @@ true - - org.apache.felix.dm, + org.apache.felix.dm, org.objectweb.asm, org.opendaylight.controller.sal.core, org.opendaylight.controller.northbound.bundlescanner, @@ -37,38 +54,18 @@ javax.ws.rs, javax.ws.rs.core, javax.xml.bind.annotation, - javax.xml.bind, - - - org.opendaylight.controller.northbound.bundlescanner.internal.Activator - + javax.xml.bind, + org.opendaylight.controller.northbound.bundlescanner.internal.Activator - - - org.ow2.asm - asm-all - - - junit - junit - - - org.springframework.osgi - spring-osgi-mock - test - - - org.opendaylight.controller - bundlescanner - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/commons/pom.xml b/opendaylight/northbound/commons/pom.xml index 684744c015..83699d2b4b 100644 --- a/opendaylight/northbound/commons/pom.xml +++ b/opendaylight/northbound/commons/pom.xml @@ -7,16 +7,65 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - commons.northbound 0.4.2-SNAPSHOT bundle + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-base + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + com.sun.jersey + jersey-client + + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-server + + + + junit + junit + + + org.opendaylight.controller + bundlescanner + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + usermanager + + @@ -27,14 +76,11 @@ true - - org.opendaylight.controller.northbound.commons.exception, + org.opendaylight.controller.northbound.commons.exception, org.opendaylight.controller.northbound.commons.types, org.opendaylight.controller.northbound.commons.utils, - org.opendaylight.controller.northbound.commons - - - javax.ws.rs, + org.opendaylight.controller.northbound.commons + javax.ws.rs, javax.ws.rs.ext, javax.ws.rs.core, javax.xml.bind, @@ -55,67 +101,17 @@ com.fasterxml.jackson.databind, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - org.slf4j - + org.slf4j ${project.basedir}/META-INF - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - bundlescanner - - - - com.fasterxml.jackson.core - jackson-databind - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base - - - - junit - junit - - - - com.sun.jersey - jersey-core - - - com.sun.jersey - jersey-server - - - com.sun.jersey - jersey-client - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/connectionmanager/pom.xml b/opendaylight/northbound/connectionmanager/pom.xml index fc620a99ee..7c17c74800 100644 --- a/opendaylight/northbound/connectionmanager/pom.xml +++ b/opendaylight/northbound/connectionmanager/pom.xml @@ -7,29 +7,38 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - connectionmanager.northbound 0.1.2-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,10 +46,8 @@ true - - - - org.opendaylight.controller.sal.core, + + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, org.opendaylight.controller.usermanager, @@ -59,42 +66,31 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/connectionmanager ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - containermanager - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - commons.northbound - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/containermanager/pom.xml b/opendaylight/northbound/containermanager/pom.xml index 89cb7446fa..1d91ab590e 100644 --- a/opendaylight/northbound/containermanager/pom.xml +++ b/opendaylight/northbound/containermanager/pom.xml @@ -7,23 +7,39 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - containermanager.northbound 0.4.2-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + appauth + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + web + + - - org.codehaus.enunciate - maven-enunciate-plugin - org.apache.felix maven-bundle-plugin @@ -31,10 +47,8 @@ true - - - - org.opendaylight.controller.appauth.authorization, + + org.opendaylight.controller.appauth.authorization, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.usermanager, org.opendaylight.controller.sal.core, @@ -52,39 +66,22 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /controller/nb/v2/containermanager ,${classes;ANNOTATION;javax.ws.rs.Path} + + org.codehaus.enunciate + maven-enunciate-plugin + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - appauth - - - org.opendaylight.controller - web - - - org.opendaylight.controller - sal - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - commons.northbound - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/controllermanager/pom.xml b/opendaylight/northbound/controllermanager/pom.xml index 2fcc2a593a..6c79f9d6e2 100644 --- a/opendaylight/northbound/controllermanager/pom.xml +++ b/opendaylight/northbound/controllermanager/pom.xml @@ -10,26 +10,43 @@ controllermanager.northbound 0.0.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller.thirdparty + com.sun.jersey.jersey-servlet + + + org.opendaylight.controller.thirdparty + org.apache.catalina.filters.CorsFilter + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix @@ -39,8 +56,7 @@ ${project.artifactId} - - org.opendaylight.controller.sal.core, + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.configuration, org.opendaylight.controller.containermanager, @@ -62,48 +78,30 @@ com.fasterxml.jackson.annotation, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /controller/nb/v2/controllermanager ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller.thirdparty - com.sun.jersey.jersey-servlet - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - - - org.opendaylight.controller.thirdparty - org.apache.catalina.filters.CorsFilter - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/flowprogrammer/pom.xml b/opendaylight/northbound/flowprogrammer/pom.xml index 6d2060ef73..2281aa8e3c 100644 --- a/opendaylight/northbound/flowprogrammer/pom.xml +++ b/opendaylight/northbound/flowprogrammer/pom.xml @@ -7,29 +7,42 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - flowprogrammer.northbound 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,8 +50,7 @@ true - - org.opendaylight.controller.forwardingrulesmanager, + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, @@ -57,46 +69,31 @@ org.slf4j, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/flowprogrammer ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - sal - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - commons.northbound - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/hosttracker/pom.xml b/opendaylight/northbound/hosttracker/pom.xml index bc0248d98e..d8dee6211a 100644 --- a/opendaylight/northbound/hosttracker/pom.xml +++ b/opendaylight/northbound/hosttracker/pom.xml @@ -10,26 +10,39 @@ hosttracker.northbound 0.4.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,8 +50,7 @@ true - - org.opendaylight.controller.hosttracker, + org.opendaylight.controller.hosttracker, org.opendaylight.controller.hosttracker.hostAware, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, @@ -60,44 +72,30 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /controller/nb/v2/hosttracker ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/httpservice-bridge/pom.xml b/opendaylight/northbound/httpservice-bridge/pom.xml index 20d60fbbc7..33f204885d 100644 --- a/opendaylight/northbound/httpservice-bridge/pom.xml +++ b/opendaylight/northbound/httpservice-bridge/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -10,8 +11,8 @@ httpservice-bridge 0.0.2-SNAPSHOT - HttpService bridge web application bundle + HttpService bridge web application @@ -22,17 +23,14 @@ true - - - - javax.servlet, + + javax.servlet, javax.servlet.http, org.eclipse.equinox.http.servlet, org.opendaylight.controller.web, org.osgi.framework, org.osgi.service.http, - org.slf4j, - + org.slf4j, /controller/osgi diff --git a/opendaylight/northbound/integrationtest/pom.xml b/opendaylight/northbound/integrationtest/pom.xml index 2789526668..6f0d897f99 100644 --- a/opendaylight/northbound/integrationtest/pom.xml +++ b/opendaylight/northbound/integrationtest/pom.xml @@ -7,474 +7,468 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - northbound.integrationtest 0.4.2-SNAPSHOT - - - central - maven repo1 - http://repo1.maven.org/maven2 - - false - - - true - - - - org.opendaylight.controller - commons.httpclient + ch.qos.logback + logback-classic - org.opendaylight.controller - connectionmanager + ch.qos.logback + logback-core + - org.opendaylight.controller - connectionmanager.implementation + com.fasterxml.jackson.core + jackson-annotations + - org.opendaylight.controller - sal + com.fasterxml.jackson.core + jackson-core + - org.opendaylight.controller - sal.implementation + com.fasterxml.jackson.core + jackson-databind + - org.opendaylight.controller - sal.connection + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + - org.opendaylight.controller - sal.connection.implementation + com.fasterxml.jackson.module + jackson-module-jaxb-annotations - org.opendaylight.controller - forwarding.staticrouting + com.google.code.gson + gson + compile - org.opendaylight.controller - clustering.services + com.sun.jersey + jersey-client + - org.opendaylight.controller - clustering.services-implementation + com.sun.jersey + jersey-core - org.opendaylight.controller - configuration + com.sun.jersey + jersey-server - org.opendaylight.controller - configuration.implementation + commons-codec + commons-codec - org.opendaylight.controller - routing.dijkstra_implementation + commons-fileupload + commons-fileupload - org.opendaylight.controller - arphandler + commons-io + commons-io - org.opendaylight.controller - forwardingrulesmanager + eclipselink + javax.persistence - org.opendaylight.controller - forwardingrulesmanager.implementation + eclipselink + javax.resource - org.opendaylight.controller - hosttracker + equinoxSDK381 + javax.servlet - org.opendaylight.controller - hosttracker.implementation + equinoxSDK381 + javax.servlet.jsp - org.opendaylight.controller - containermanager + equinoxSDK381 + org.apache.felix.gogo.command - org.opendaylight.controller - containermanager.it.implementation + equinoxSDK381 + org.apache.felix.gogo.runtime - org.opendaylight.controller - switchmanager + equinoxSDK381 + org.apache.felix.gogo.shell - org.opendaylight.controller - switchmanager.implementation + equinoxSDK381 + org.eclipse.equinox.cm - org.opendaylight.controller - statisticsmanager + equinoxSDK381 + org.eclipse.equinox.console - org.opendaylight.controller - statisticsmanager.implementation + equinoxSDK381 + org.eclipse.equinox.ds - org.opendaylight.controller - topologymanager + equinoxSDK381 + org.eclipse.equinox.launcher - org.opendaylight.controller - usermanager + equinoxSDK381 + org.eclipse.equinox.util - org.opendaylight.controller - usermanager.implementation + equinoxSDK381 + org.eclipse.osgi - org.opendaylight.controller - security + equinoxSDK381 + org.eclipse.osgi.services + - org.opendaylight.controller - commons.northbound + geminiweb + org.eclipse.gemini.web.core - org.opendaylight.controller - topology.northbound + geminiweb + org.eclipse.gemini.web.extender - org.opendaylight.controller - forwarding.staticrouting.northbound + geminiweb + org.eclipse.gemini.web.tomcat - org.opendaylight.controller - statistics.northbound + geminiweb + org.eclipse.virgo.kernel.equinox.extensions - org.opendaylight.controller - flowprogrammer.northbound + geminiweb + org.eclipse.virgo.util.common - org.opendaylight.controller - hosttracker.northbound + geminiweb + org.eclipse.virgo.util.io - org.opendaylight.controller - subnets.northbound + geminiweb + org.eclipse.virgo.util.math - org.opendaylight.controller - switchmanager.northbound + geminiweb + org.eclipse.virgo.util.osgi - - org.opendaylight.controller - logging.bridge + geminiweb + org.eclipse.virgo.util.osgi.manifest - - org.opendaylight.controller - protocol_plugins.stub + geminiweb + org.eclipse.virgo.util.parser.manifest - - org.opendaylight.controller - bundlescanner + orbit + javax.activation - - org.opendaylight.controller - bundlescanner.implementation + orbit + javax.annotation - - org.codehaus.enunciate - enunciate-core-annotations + orbit + javax.ejb - org.slf4j - jcl-over-slf4j + orbit + javax.el - org.slf4j - slf4j-api + orbit + javax.mail.glassfish - org.slf4j - log4j-over-slf4j + orbit + javax.servlet.jsp.jstl - ch.qos.logback - logback-core + orbit + javax.servlet.jsp.jstl.impl - ch.qos.logback - logback-classic + orbit + javax.xml.rpc - - com.fasterxml.jackson.core - jackson-databind + orbit + org.apache.catalina - - com.fasterxml.jackson.core - jackson-annotations + orbit + org.apache.catalina.ha - - com.fasterxml.jackson.core - jackson-core + orbit + org.apache.catalina.tribes - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider + orbit + org.apache.coyote - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations + orbit + org.apache.el - - org.codehaus.jettison - jettison + orbit + org.apache.jasper - commons-io - commons-io + orbit + org.apache.juli.extras - commons-fileupload - commons-fileupload + orbit + org.apache.tomcat.api - commons-codec - commons-codec + orbit + org.apache.tomcat.util - equinoxSDK381 - javax.servlet + org.aopalliance + com.springsource.org.aopalliance - equinoxSDK381 - javax.servlet.jsp + org.apache.commons + commons-lang3 - equinoxSDK381 - org.eclipse.equinox.ds + org.apache.felix + org.apache.felix.dependencymanager - equinoxSDK381 - org.eclipse.equinox.util + org.apache.felix + org.apache.felix.dependencymanager.shell - equinoxSDK381 - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.fileinstall + - equinoxSDK381 - org.eclipse.osgi + org.codehaus.enunciate + enunciate-core-annotations + - equinoxSDK381 - org.apache.felix.gogo.command + org.codehaus.jettison + jettison - equinoxSDK381 - org.apache.felix.gogo.runtime + org.jboss.spec.javax.transaction + jboss-transaction-api_1.1_spec - equinoxSDK381 - org.apache.felix.gogo.shell + org.opendaylight.controller + arphandler + + + + org.opendaylight.controller + bundlescanner + + + + org.opendaylight.controller + bundlescanner.implementation + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + clustering.services-implementation - equinoxSDK381 - org.eclipse.equinox.cm + org.opendaylight.controller + commons.httpclient - equinoxSDK381 - org.eclipse.equinox.console + org.opendaylight.controller + commons.northbound - equinoxSDK381 - org.eclipse.equinox.launcher + org.opendaylight.controller + configuration - - geminiweb - org.eclipse.gemini.web.core + org.opendaylight.controller + configuration.implementation - geminiweb - org.eclipse.gemini.web.extender + org.opendaylight.controller + connectionmanager - geminiweb - org.eclipse.gemini.web.tomcat + org.opendaylight.controller + connectionmanager.implementation - geminiweb - org.eclipse.virgo.kernel.equinox.extensions + org.opendaylight.controller + containermanager - geminiweb - org.eclipse.virgo.util.common + org.opendaylight.controller + containermanager.it.implementation - geminiweb - org.eclipse.virgo.util.io + org.opendaylight.controller + flowprogrammer.northbound - geminiweb - org.eclipse.virgo.util.math + org.opendaylight.controller + forwarding.staticrouting - geminiweb - org.eclipse.virgo.util.osgi + org.opendaylight.controller + forwarding.staticrouting.northbound - geminiweb - org.eclipse.virgo.util.osgi.manifest + org.opendaylight.controller + forwardingrulesmanager - geminiweb - org.eclipse.virgo.util.parser.manifest + org.opendaylight.controller + forwardingrulesmanager.implementation - org.apache.felix - org.apache.felix.dependencymanager + org.opendaylight.controller + hosttracker - org.apache.felix - org.apache.felix.dependencymanager.shell + org.opendaylight.controller + hosttracker.implementation - com.google.code.gson - gson - compile + org.opendaylight.controller + hosttracker.northbound + - org.jboss.spec.javax.transaction - jboss-transaction-api_1.1_spec + org.opendaylight.controller + logging.bridge + - org.apache.felix - org.apache.felix.fileinstall + org.opendaylight.controller + protocol_plugins.stub - org.apache.commons - commons-lang3 + org.opendaylight.controller + routing.dijkstra_implementation - virgomirror - org.eclipse.jdt.core.compiler.batch + org.opendaylight.controller + sal - eclipselink - javax.persistence + org.opendaylight.controller + sal.connection - orbit - javax.activation + org.opendaylight.controller + sal.connection.implementation - orbit - javax.annotation + org.opendaylight.controller + sal.implementation - orbit - javax.ejb + org.opendaylight.controller + security - orbit - javax.el + org.opendaylight.controller + statistics.northbound - orbit - javax.mail.glassfish + org.opendaylight.controller + statisticsmanager - orbit - javax.xml.rpc + org.opendaylight.controller + statisticsmanager.implementation - orbit - org.apache.catalina + org.opendaylight.controller + subnets.northbound - orbit - org.apache.catalina.ha + org.opendaylight.controller + switchmanager - orbit - org.apache.catalina.tribes + org.opendaylight.controller + switchmanager.implementation - orbit - org.apache.coyote + org.opendaylight.controller + switchmanager.northbound - orbit - org.apache.el + org.opendaylight.controller + topology.northbound - orbit - org.apache.jasper + org.opendaylight.controller + topologymanager - orbit - org.apache.juli.extras + org.opendaylight.controller + usermanager - orbit - org.apache.tomcat.api + org.opendaylight.controller + usermanager.implementation - orbit - org.apache.tomcat.util + org.opendaylight.controller.thirdparty + com.sun.jersey.jersey-servlet - orbit - javax.servlet.jsp.jstl + org.opendaylight.controller.thirdparty + org.apache.catalina.filters.CorsFilter - orbit - javax.servlet.jsp.jstl.impl + org.ow2.asm + asm-all - + - org.ops4j.pax.exam - pax-exam-container-native - test + org.ow2.chameleon.management + chameleon-mbeans - org.ops4j.pax.exam - pax-exam-junit4 - test + org.slf4j + jcl-over-slf4j - org.ops4j.pax.exam - pax-exam-link-mvn - test + org.slf4j + log4j-over-slf4j - org.ops4j.pax.url - pax-url-aether - test + org.slf4j + slf4j-api - org.ow2.asm - asm-all + org.springframework + org.springframework.aop org.springframework @@ -482,7 +476,7 @@ org.springframework - org.springframework.aop + org.springframework.beans org.springframework @@ -498,20 +492,16 @@ org.springframework - org.springframework.beans + org.springframework.expression org.springframework - org.springframework.expression + org.springframework.transaction org.springframework org.springframework.web - - org.aopalliance - com.springsource.org.aopalliance - org.springframework org.springframework.web.servlet @@ -525,47 +515,57 @@ org.springframework.security spring-security-core - - org.springframework.security - spring-security-web - org.springframework.security spring-security-taglibs - org.springframework - org.springframework.transaction - - - - org.ow2.chameleon.management - chameleon-mbeans - - - - com.sun.jersey - jersey-core + org.springframework.security + spring-security-web - com.sun.jersey - jersey-server + virgomirror + org.eclipse.jdt.core.compiler.batch + - com.sun.jersey - jersey-client + org.ops4j.pax.exam + pax-exam-container-native + test - eclipselink - javax.resource + org.ops4j.pax.exam + pax-exam-junit4 + test - org.opendaylight.controller.thirdparty - com.sun.jersey.jersey-servlet + org.ops4j.pax.exam + pax-exam-link-mvn + test - org.opendaylight.controller.thirdparty - org.apache.catalina.filters.CorsFilter + org.ops4j.pax.url + pax-url-aether + test + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + + true + + + false + + central + maven repo1 + http://repo1.maven.org/maven2 + + diff --git a/opendaylight/northbound/jolokia/pom.xml b/opendaylight/northbound/jolokia/pom.xml index ac0bf1bda0..f984d4e8ed 100644 --- a/opendaylight/northbound/jolokia/pom.xml +++ b/opendaylight/northbound/jolokia/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -9,9 +10,9 @@ jolokia-bridge - Jolokia bridge web application 0.0.2-SNAPSHOT bundle + Jolokia bridge web application @@ -22,18 +23,15 @@ true - - - - javax.servlet, + + javax.servlet, javax.servlet.http, org.eclipse.equinox.http.servlet, org.opendaylight.controller.web, org.osgi.framework, org.jolokia.osgi.servlet, org.apache.catalina.filters, - org.slf4j, - + org.slf4j, /controller/nb/v2/jolokia diff --git a/opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml b/opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml index 551d3b4877..e78035f00c 100644 --- a/opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml +++ b/opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml @@ -7,29 +7,42 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - networkconfig.bridgedomain.northbound 0.0.3-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller + sal.networkconfiguration + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,10 +50,8 @@ true - - - - org.opendaylight.controller.sal.core, + + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.networkconfig.bridgedomain, org.opendaylight.controller.containermanager, @@ -60,46 +71,31 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/networkconfig/bridgedomain ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - sal.networkconfiguration - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - containermanager - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - commons.northbound - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/networkconfiguration/neutron/pom.xml b/opendaylight/northbound/networkconfiguration/neutron/pom.xml index 774a125479..bc0ab2b78a 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/pom.xml +++ b/opendaylight/northbound/networkconfiguration/neutron/pom.xml @@ -1,67 +1,67 @@ + - 4.0.0 - - org.opendaylight.controller - commons.opendaylight - 1.4.2-SNAPSHOT - ../../../commons/opendaylight - - - 1.26.2 - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - - - - - - opendaylight-release - ${nexusproxy}/repositories/${nexus.repository.release}/ - - - - opendaylight-snapshot - ${nexusproxy}/repositories/${nexus.repository.snapshot}/ - - - - website - ${sitedeploy} - - - networkconfig.neutron.northbound - 0.4.2-SNAPSHOT - bundle + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../../commons/opendaylight + + networkconfig.neutron.northbound + 0.4.2-SNAPSHOT + bundle + + 1.26.2 + + + + com.sun.jersey + jersey-core + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.eclipse.persistence + org.eclipse.persistence.antlr + + + org.eclipse.persistence + org.eclipse.persistence.core + + + org.eclipse.persistence + org.eclipse.persistence.moxy + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + networkconfig.neutron + + + org.opendaylight.controller + sal + + - - - - org.codehaus.enunciate - maven-enunciate-plugin - - enunciate.xml - - - - - docs - - - - - - org.apache.felix - maven-bundle-plugin - 2.3.6 - true - - - - org.opendaylight.controller.sal.utils, + + + + org.apache.felix + maven-bundle-plugin + 2.3.6 + true + + + org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, org.opendaylight.controller.northbound.commons, org.opendaylight.controller.northbound.commons.exception, @@ -74,51 +74,50 @@ javax.xml.bind.annotation, javax.xml.bind, org.slf4j, - !org.codehaus.enunciate.jaxrs - - /controller/nb/v2/neutron - - ${project.basedir}/src/main/resources/META-INF - - - - - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.opendaylight.controller - networkconfig.neutron - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.eclipse.persistence - org.eclipse.persistence.moxy - - - org.eclipse.persistence - org.eclipse.persistence.core - - - org.eclipse.persistence - org.eclipse.persistence.antlr - - - com.sun.jersey - jersey-core - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/neutron + + ${project.basedir}/src/main/resources/META-INF + + + + org.codehaus.enunciate + maven-enunciate-plugin + + enunciate.xml + + + + + docs + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + + + + + + opendaylight-release + ${nexusproxy}/repositories/${nexus.repository.release}/ + + + + opendaylight-snapshot + ${nexusproxy}/repositories/${nexus.repository.snapshot}/ + + + + website + ${sitedeploy} + + diff --git a/opendaylight/northbound/staticrouting/pom.xml b/opendaylight/northbound/staticrouting/pom.xml index 937eea1396..0e496a420f 100644 --- a/opendaylight/northbound/staticrouting/pom.xml +++ b/opendaylight/northbound/staticrouting/pom.xml @@ -7,29 +7,38 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - forwarding.staticrouting.northbound 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwarding.staticrouting + + + org.opendaylight.controller + sal + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,10 +46,8 @@ true - - - - org.opendaylight.controller.forwarding.staticrouting, + + org.opendaylight.controller.forwarding.staticrouting, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, @@ -58,42 +65,31 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/staticroute ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - forwarding.staticrouting - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - commons.northbound - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/statistics/pom.xml b/opendaylight/northbound/statistics/pom.xml index 1a3388a796..5935db4893 100644 --- a/opendaylight/northbound/statistics/pom.xml +++ b/opendaylight/northbound/statistics/pom.xml @@ -7,29 +7,38 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - statistics.northbound 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + statisticsmanager + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -37,10 +46,8 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager, + + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.flowprogrammer, @@ -66,42 +73,31 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/statistics ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - statisticsmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/subnets/pom.xml b/opendaylight/northbound/subnets/pom.xml index 71a714717e..7c68f41cad 100644 --- a/opendaylight/northbound/subnets/pom.xml +++ b/opendaylight/northbound/subnets/pom.xml @@ -7,44 +7,39 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - subnets.northbound 0.4.2-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + junit + junit + test + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.opendaylight.controller - clustering.services - ${clustering.services.version} - - - org.opendaylight.controller - configuration - ${configuration.version} - - - org.opendaylight.controller - switchmanager - ${switchmanager.api.version} - - - org.apache.felix maven-bundle-plugin @@ -52,10 +47,8 @@ true - - - - org.opendaylight.controller.sal.core, + + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, org.opendaylight.controller.switchmanager, @@ -73,43 +66,46 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/subnetservice ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + clustering.services + ${clustering.services.version} + + + org.opendaylight.controller + configuration + ${configuration.version} + + + org.opendaylight.controller + sal + ${sal.version} + + + org.opendaylight.controller + switchmanager + ${switchmanager.api.version} + + + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - test - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/switchmanager/pom.xml b/opendaylight/northbound/switchmanager/pom.xml index 3abb5dd0b4..8f54a28bda 100644 --- a/opendaylight/northbound/switchmanager/pom.xml +++ b/opendaylight/northbound/switchmanager/pom.xml @@ -10,26 +10,35 @@ switchmanager.northbound 0.4.2-SNAPSHOT bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix @@ -38,8 +47,7 @@ true - - org.opendaylight.controller.sal.core, + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.containermanager, org.opendaylight.controller.switchmanager, @@ -59,40 +67,30 @@ org.apache.catalina.filters, com.fasterxml.jackson.annotation, com.fasterxml.jackson.databind, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /controller/nb/v2/switchmanager ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/topology/pom.xml b/opendaylight/northbound/topology/pom.xml index c27a68e45b..838a15db98 100644 --- a/opendaylight/northbound/topology/pom.xml +++ b/opendaylight/northbound/topology/pom.xml @@ -7,30 +7,39 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - topology.northbound 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + topologymanager + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - ${sal.version} - - - org.apache.felix maven-bundle-plugin @@ -38,10 +47,8 @@ true - - - - org.opendaylight.controller.containermanager, + + org.opendaylight.controller.containermanager, org.opendaylight.controller.northbound.commons, org.opendaylight.controller.northbound.commons.exception, org.opendaylight.controller.northbound.commons.utils, @@ -63,40 +70,30 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /controller/nb/v2/topology ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + ${sal.version} + + + - - - org.codehaus.enunciate - enunciate-core-annotations - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - commons.northbound - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - topologymanager - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/northbound/usermanager/pom.xml b/opendaylight/northbound/usermanager/pom.xml index e20dea437c..01e43085b6 100644 --- a/opendaylight/northbound/usermanager/pom.xml +++ b/opendaylight/northbound/usermanager/pom.xml @@ -7,22 +7,35 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - usermanager.northbound 0.0.2-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + usermanager + + + junit + junit + test + + - - org.codehaus.enunciate - maven-enunciate-plugin - org.apache.felix maven-bundle-plugin @@ -30,10 +43,8 @@ true - - - - org.opendaylight.controller.sal.utils, + + org.opendaylight.controller.sal.utils, org.opendaylight.controller.northbound.commons, org.opendaylight.controller.northbound.commons.exception, org.opendaylight.controller.northbound.commons.utils, @@ -48,39 +59,24 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - - - + !org.codehaus.enunciate.jaxrs + /controller/nb/v2/usermanager ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - - junit - junit - test - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/protocol_plugins/openflow/pom.xml b/opendaylight/protocol_plugins/openflow/pom.xml index 48555de525..e47933548a 100644 --- a/opendaylight/protocol_plugins/openflow/pom.xml +++ b/opendaylight/protocol_plugins/openflow/pom.xml @@ -7,16 +7,32 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - protocol_plugins.openflow 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.eclipse.osgi + + + junit + junit + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller.thirdparty + org.openflow.openflowj + + @@ -27,8 +43,7 @@ true - - org.opendaylight.controller.sal.packet, + org.opendaylight.controller.sal.packet, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.discovery, org.opendaylight.controller.sal.topology, @@ -45,46 +60,21 @@ org.slf4j, org.eclipse.osgi.framework.console, org.osgi.framework, - javax.net.ssl - - - org.opendaylight.controller.protocol_plugin.openflow.internal - - - org.openflow.openflowj - - - false - - - org.opendaylight.controller.protocol_plugin.openflow.internal.Activator - + javax.net.ssl + org.opendaylight.controller.protocol_plugin.openflow.internal + org.openflow.openflowj + false + org.opendaylight.controller.protocol_plugin.openflow.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - junit - junit - - - equinoxSDK381 - org.eclipse.osgi - - - org.opendaylight.controller.thirdparty - org.openflow.openflowj - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java index fc668b3f4d..1a59a325ad 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java @@ -148,7 +148,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa Thread.sleep(10); } } catch (InterruptedException e1) { - logger.warn("DiscoveryTransmit interupted", e1.getMessage()); + logger.trace("DiscoveryTransmit interupted", e1.getMessage()); if (shuttingDown) { return; } diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java index d5a80370fb..e1b244f2c1 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java @@ -515,7 +515,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener long sid = (Long) node.getID(); List ofList = (cached == true) ? statsMgr .getOFPortStatistics(sid) : statsMgr.queryStatistics(sid, - OFStatisticsType.FLOW, null); + OFStatisticsType.PORT, null); List filteredList = filterPortListPerContainer(containerName, sid, ofList); diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java index dacc130831..08ddbde30a 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java @@ -141,7 +141,7 @@ public class TopologyServiceShim implements IDiscoveryListener, Thread.sleep(100); } catch (InterruptedException e1) { - logger.warn("TopologyNotify interrupted {}", + logger.trace("TopologyNotify interrupted {}", e1.getMessage()); if (shuttingDown) { return; @@ -200,7 +200,7 @@ public class TopologyServiceShim implements IDiscoveryListener, } } } catch (InterruptedException e1) { - logger.warn( + logger.trace( "Edge Bandwidth Utilization Notify Thread interrupted {}", e1.getMessage()); if (shuttingDown) { @@ -235,10 +235,9 @@ public class TopologyServiceShim implements IDiscoveryListener, logger.debug("Bulk Notify container:{}", containerName); TopologyBulkUpdate(containerName); } catch (InterruptedException e) { - logger.warn("Topology Bulk update thread interrupted"); + logger.trace("Topology Bulk update thread interrupted"); if (shuttingDown) { - return; - } + return; } } } } @@ -265,6 +264,10 @@ public class TopologyServiceShim implements IDiscoveryListener, protected void pollTxBitRates() { Map>> globalContainerEdges = edgeMap .get(GlobalConstants.DEFAULT.toString()); + if (shuttingDown) { + logger.trace("Getting out the pollTxBitRates because bundle going down"); + return; + } if (globalContainerEdges == null) { return; } @@ -357,6 +360,9 @@ public class TopologyServiceShim implements IDiscoveryListener, logger.trace("STOP called!"); shuttingDown = true; notifyThread.interrupt(); + bwUtilNotifyThread.interrupt(); + ofPluginTopoBulkUpdate.interrupt(); + pollTimer.cancel(); } void setTopologyServiceShimListener(Map props, diff --git a/opendaylight/protocol_plugins/stub/pom.xml b/opendaylight/protocol_plugins/stub/pom.xml index 01822197bc..fc760e4919 100644 --- a/opendaylight/protocol_plugins/stub/pom.xml +++ b/opendaylight/protocol_plugins/stub/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - protocol_plugins.stub 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + sal + + @@ -26,7 +30,7 @@ true - org.opendaylight.controller.sal.packet, + org.opendaylight.controller.sal.packet, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.discovery, org.opendaylight.controller.sal.topology, @@ -39,28 +43,19 @@ org.apache.commons.lang3.builder, org.apache.commons.lang3.tuple, org.apache.felix.dm, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.protocol_plugins.stub.internal - - - org.opendaylight.controller.protocol_plugins.stub.internal.Activator - + org.osgi.framework + org.opendaylight.controller.protocol_plugins.stub.internal + org.opendaylight.controller.protocol_plugins.stub.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/routing/dijkstra_implementation/pom.xml b/opendaylight/routing/dijkstra_implementation/pom.xml index 5fe338528c..d923c452e6 100644 --- a/opendaylight/routing/dijkstra_implementation/pom.xml +++ b/opendaylight/routing/dijkstra_implementation/pom.xml @@ -7,16 +7,40 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - routing.dijkstra_implementation 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.apache.felix.gogo.runtime + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + + org.opendaylight.controller.thirdparty + net.sf.jung2 + + @@ -27,8 +51,7 @@ true - - org.slf4j, + org.slf4j, org.opendaylight.controller.sal.routing, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.topology, @@ -44,45 +67,18 @@ org.apache.felix.dm, org.osgi.framework, org.apache.felix.service.command, - org.junit;resolution:=optional - - - org.opendaylight.controller.routing.dijkstra_implementation.internal.Activator - + org.junit;resolution:=optional + org.opendaylight.controller.routing.dijkstra_implementation.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - topologymanager - - - junit - junit - - - org.opendaylight.controller.thirdparty - net.sf.jung2 - - - equinoxSDK381 - org.apache.felix.gogo.runtime - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/api/pom.xml b/opendaylight/sal/api/pom.xml index 326755309d..070029f891 100644 --- a/opendaylight/sal/api/pom.xml +++ b/opendaylight/sal/api/pom.xml @@ -7,16 +7,32 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal 0.8.1-SNAPSHOT bundle + + + junit + junit + + + org.apache.commons + commons-lang3 + + + org.apache.felix + org.apache.felix.dependencymanager + + + org.osgi + org.osgi.core + + + org.slf4j + slf4j-api + + @@ -27,17 +43,14 @@ true - - org.slf4j, + org.slf4j, org.osgi.framework, org.apache.commons.lang3.builder, org.apache.felix.dm, org.apache.commons.lang3.tuple, javax.xml.bind.annotation, - javax.xml.bind.annotation.adapters - - - org.opendaylight.controller.sal.authorization, + javax.xml.bind.annotation.adapters + org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.discovery, @@ -49,34 +62,17 @@ org.opendaylight.controller.sal.match, org.opendaylight.controller.sal.inventory, org.opendaylight.controller.sal.flowprogrammer, - org.opendaylight.controller.sal.reader - + org.opendaylight.controller.sal.reader ${project.basedir}/META-INF - - - junit - junit - - - org.osgi - org.osgi.core - - - org.slf4j - slf4j-api - - - org.apache.felix - org.apache.felix.dependencymanager - - - org.apache.commons - commons-lang3 - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java index 27660221ce..efb938e37f 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java @@ -291,10 +291,17 @@ public class LLDPTLV extends Packet { * @return the string */ static public String getStringValue(byte[] tlvValue, int tlvLen) { + byte[] pidSubType = new byte[portIDSubType.length]; byte[] pidBytes = new byte[tlvLen - portIDSubType.length]; + System.arraycopy(tlvValue, 0, pidSubType, 0, + pidSubType.length); System.arraycopy(tlvValue, portIDSubType.length, pidBytes, 0, pidBytes.length); - return (new String(pidBytes, Charset.defaultCharset())); + if (pidSubType[0] == (byte) 0x3) { + return HexEncode.bytesToHexStringFormat(pidBytes); + } else { + return (new String(pidBytes, Charset.defaultCharset())); + } } /** diff --git a/opendaylight/sal/connection/api/pom.xml b/opendaylight/sal/connection/api/pom.xml index 65ba5722a5..2340a829fd 100644 --- a/opendaylight/sal/connection/api/pom.xml +++ b/opendaylight/sal/connection/api/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal.connection 0.1.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + sal + + @@ -27,33 +31,25 @@ true - - org.slf4j, + org.slf4j, org.osgi.framework, org.apache.felix.dm, org.apache.commons.lang3.tuple, javax.xml.bind.annotation, javax.xml.bind.annotation.adapters, org.opendaylight.controller.sal.core, - org.opendaylight.controller.sal.utils - - - org.opendaylight.controller.sal.connection - + org.opendaylight.controller.sal.utils + org.opendaylight.controller.sal.connection ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/connection/implementation/pom.xml b/opendaylight/sal/connection/implementation/pom.xml index 59a985fea2..e771f846ae 100644 --- a/opendaylight/sal/connection/implementation/pom.xml +++ b/opendaylight/sal/connection/implementation/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal.connection.implementation 0.1.2-SNAPSHOT bundle + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + @@ -27,8 +31,7 @@ true - - org.slf4j, + org.slf4j, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.packet, org.opendaylight.controller.sal.inventory, @@ -41,27 +44,19 @@ org.opendaylight.controller.sal.connection, org.apache.felix.dm, org.eclipse.osgi.framework.console, - org.osgi.framework - - - - - org.opendaylight.controller.sal.connection.implementation.internal.Activator - + org.osgi.framework + + org.opendaylight.controller.sal.connection.implementation.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/implementation/pom.xml b/opendaylight/sal/implementation/pom.xml index 16eafa251a..d8a7d7beef 100644 --- a/opendaylight/sal/implementation/pom.xml +++ b/opendaylight/sal/implementation/pom.xml @@ -7,16 +7,25 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal.implementation 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.eclipse.osgi + + + org.opendaylight.controller + sal + + + junit + junit + test + + @@ -27,8 +36,7 @@ true - - org.slf4j, + org.slf4j, org.apache.commons.lang3.builder, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.packet, @@ -41,32 +49,19 @@ org.opendaylight.controller.sal.utils, org.apache.felix.dm, org.eclipse.osgi.framework.console, - org.osgi.framework - - - - - org.opendaylight.controller.sal.implementation.internal.Activator - + org.osgi.framework + + org.opendaylight.controller.sal.implementation.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - equinoxSDK381 - org.eclipse.osgi - - - junit - junit - test - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/networkconfiguration/api/pom.xml b/opendaylight/sal/networkconfiguration/api/pom.xml index 8f9dd47dc3..ed3b391947 100644 --- a/opendaylight/sal/networkconfiguration/api/pom.xml +++ b/opendaylight/sal/networkconfiguration/api/pom.xml @@ -7,16 +7,16 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal.networkconfiguration 0.0.3-SNAPSHOT bundle + + + org.opendaylight.controller + sal + + @@ -27,26 +27,22 @@ true - - org.slf4j, + org.slf4j, org.osgi.framework, org.apache.felix.dm, org.opendaylight.controller.sal.core, - org.opendaylight.controller.sal.utils - - - org.opendaylight.controller.sal.networkconfig.bridgedomain - + org.opendaylight.controller.sal.utils + org.opendaylight.controller.sal.networkconfig.bridgedomain ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/sal/networkconfiguration/implementation/pom.xml b/opendaylight/sal/networkconfiguration/implementation/pom.xml index 82cb8af4af..38944e6314 100644 --- a/opendaylight/sal/networkconfiguration/implementation/pom.xml +++ b/opendaylight/sal/networkconfiguration/implementation/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - sal.networkconfiguration.implementation 0.0.3-SNAPSHOT bundle + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.networkconfiguration + + @@ -27,33 +31,24 @@ true - - org.slf4j, + org.slf4j, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.networkconfig.bridgedomain, org.apache.felix.dm, - org.osgi.framework - - - - - org.opendaylight.controller.sal.networkconfig.internal.Activator - + org.osgi.framework + + org.opendaylight.controller.sal.networkconfig.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.networkconfiguration - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/samples/loadbalancer/pom.xml b/opendaylight/samples/loadbalancer/pom.xml index f7e9d7ebbc..4d8212209b 100644 --- a/opendaylight/samples/loadbalancer/pom.xml +++ b/opendaylight/samples/loadbalancer/pom.xml @@ -7,16 +7,36 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - samples.loadbalancer 0.5.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -27,14 +47,11 @@ true - - org.opendaylight.controller.samples.loadbalancer, + org.opendaylight.controller.samples.loadbalancer, org.opendaylight.controller.samples.loadbalancer.entities, org.opendaylight.controller.samples.loadbalancer.internal, - org.opendaylight.controller.samples.loadbalancer.policies - - - org.opendaylight.controller.sal.core, + org.opendaylight.controller.samples.loadbalancer.policies + org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.match, @@ -59,43 +76,19 @@ org.osgi.service.component, org.slf4j, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.samples.loadbalancer.internal.Activator - - - + org.osgi.framework + org.opendaylight.controller.samples.loadbalancer.internal.Activator + ${project.basedir}/META-INF - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - sal - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/samples/northbound/loadbalancer/pom.xml b/opendaylight/samples/northbound/loadbalancer/pom.xml index d90559372d..9dd0f99be6 100644 --- a/opendaylight/samples/northbound/loadbalancer/pom.xml +++ b/opendaylight/samples/northbound/loadbalancer/pom.xml @@ -7,30 +7,39 @@ 1.4.2-SNAPSHOT ../../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - samples.loadbalancer.northbound 0.4.2-SNAPSHOT bundle + + + org.codehaus.enunciate + enunciate-core-annotations + + + org.opendaylight.controller + commons.northbound + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + samples.loadbalancer + + - - org.codehaus.enunciate - maven-enunciate-plugin - - - org.opendaylight.controller - sal - 0.7.1-SNAPSHOT - - - org.apache.felix maven-bundle-plugin @@ -38,8 +47,7 @@ true - - org.opendaylight.controller.samples.loadbalancer, + org.opendaylight.controller.samples.loadbalancer, org.opendaylight.controller.samples.loadbalancer.entities, org.opendaylight.controller.samples.loadbalancer.internal, org.opendaylight.controller.samples.loadbalancer.policies, @@ -60,40 +68,30 @@ org.apache.catalina.filters, com.fasterxml.jackson.jaxrs.base, com.fasterxml.jackson.jaxrs.json, - !org.codehaus.enunciate.jaxrs - + !org.codehaus.enunciate.jaxrs /one/nb/v2/lb ,${classes;ANNOTATION;javax.ws.rs.Path} ${project.basedir}/src/main/resources/META-INF + + org.codehaus.enunciate + maven-enunciate-plugin + + + org.opendaylight.controller + sal + 0.7.1-SNAPSHOT + + + - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - samples.loadbalancer - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - commons.northbound - - - org.codehaus.enunciate - enunciate-core-annotations - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/samples/simpleforwarding/pom.xml b/opendaylight/samples/simpleforwarding/pom.xml index 38a32f6b88..d65980e26c 100644 --- a/opendaylight/samples/simpleforwarding/pom.xml +++ b/opendaylight/samples/simpleforwarding/pom.xml @@ -7,16 +7,36 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - samples.simpleforwarding 0.4.2-SNAPSHOT bundle + + + junit + junit + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + hosttracker + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + @@ -27,8 +47,7 @@ true - - org.opendaylight.controller.sal.utils, + org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.core, org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.hosttracker, @@ -45,44 +64,19 @@ org.apache.commons.lang3.builder, org.junit;resolution:=optional, org.slf4j, - org.apache.felix.dm - - - org.opendaylight.controller.samples.simpleforwarding - - - org.opendaylight.controller.samples.simpleforwarding.internal.Activator - + org.apache.felix.dm + org.opendaylight.controller.samples.simpleforwarding + org.opendaylight.controller.samples.simpleforwarding.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - hosttracker - - - org.opendaylight.controller - switchmanager - - - junit - junit - - - org.opendaylight.controller - sal - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/Activator.java b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/Activator.java index ed9374b6fa..6ee04b4e19 100644 --- a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/Activator.java +++ b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/Activator.java @@ -92,7 +92,7 @@ public class Activator extends ComponentActivatorAbstractBase { c.add(createContainerServiceDependency(containerName).setService( IForwardingRulesManager.class).setCallbacks( "setForwardingRulesManager", "unsetForwardingRulesManager") - .setRequired(false)); + .setRequired(true)); c.add(createContainerServiceDependency(containerName).setService( ITopologyManager.class).setCallbacks("setTopologyManager", diff --git a/opendaylight/security/pom.xml b/opendaylight/security/pom.xml index 8bb18367e9..7ac2dbbe31 100644 --- a/opendaylight/security/pom.xml +++ b/opendaylight/security/pom.xml @@ -7,16 +7,24 @@ 1.4.2-SNAPSHOT ../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - security 0.4.2-SNAPSHOT bundle + + + orbit + org.apache.catalina + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + usermanager + + @@ -26,11 +34,8 @@ true - - org.apache.catalina - - - org.slf4j, + org.apache.catalina + org.slf4j, javax.servlet, org.apache.catalina, org.apache.catalina.connector, @@ -38,29 +43,18 @@ org.apache.catalina.realm, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.authorization, - org.opendaylight.controller.usermanager - - - org.opendaylight.controller.security - + org.opendaylight.controller.usermanager + org.opendaylight.controller.security ${project.basedir}/META-INF - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - sal - - - orbit - org.apache.catalina - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/security/src/main/java/org/opendaylight/controller/security/ControllerCustomRealm.java b/opendaylight/security/src/main/java/org/opendaylight/controller/security/ControllerCustomRealm.java index 6657571f89..157909424b 100644 --- a/opendaylight/security/src/main/java/org/opendaylight/controller/security/ControllerCustomRealm.java +++ b/opendaylight/security/src/main/java/org/opendaylight/controller/security/ControllerCustomRealm.java @@ -71,7 +71,7 @@ public class ControllerCustomRealm extends RealmBase { || result.equals(AuthResultEnum.AUTH_ACCEPT)) { return this.getPrincipal(username); } else { - logger.error("Authentication failed for user " + username); + logger.debug("Authentication failed for user " + username); return null; } } else { diff --git a/opendaylight/statisticsmanager/api/pom.xml b/opendaylight/statisticsmanager/api/pom.xml index 466eeccf51..bcc4f407f0 100644 --- a/opendaylight/statisticsmanager/api/pom.xml +++ b/opendaylight/statisticsmanager/api/pom.xml @@ -7,16 +7,20 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - statisticsmanager 0.5.1-SNAPSHOT bundle + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + @@ -26,30 +30,22 @@ true - - org.opendaylight.controller.forwardingrulesmanager, + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.flowprogrammer, org.slf4j, org.opendaylight.controller.sal.reader, - org.apache.felix.dm - - - org.opendaylight.controller.statisticsmanager - + org.apache.felix.dm + org.opendaylight.controller.statisticsmanager ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - forwardingrulesmanager - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/statisticsmanager/implementation/pom.xml b/opendaylight/statisticsmanager/implementation/pom.xml index 46368b0762..623c028a56 100644 --- a/opendaylight/statisticsmanager/implementation/pom.xml +++ b/opendaylight/statisticsmanager/implementation/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - statisticsmanager.implementation 0.4.2-SNAPSHOT @@ -20,9 +14,43 @@ reuseReports - target/jacoco.exec target/jacoco-it.exec + target/jacoco.exec + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + sal.connection + + + org.opendaylight.controller + statisticsmanager + + + org.opendaylight.controller + switchmanager + + @@ -41,8 +69,7 @@ true - - org.opendaylight.controller.clustering.services, + org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.flowprogrammer, org.opendaylight.controller.sal.reader, @@ -55,13 +82,9 @@ org.opendaylight.controller.statisticsmanager, org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.connectionmanager, - org.apache.felix.dm - - - org.opendaylight.controller.statisticsmanager.internal.Activator - - - + org.apache.felix.dm + org.opendaylight.controller.statisticsmanager.internal.Activator + ${project.basedir}/META-INF @@ -70,7 +93,9 @@ org.jacoco jacoco-maven-plugin - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -81,47 +106,19 @@ post-test - test report + test - - - org.opendaylight.controller - statisticsmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - sal.connection - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - connectionmanager - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/statisticsmanager/integrationtest/pom.xml b/opendaylight/statisticsmanager/integrationtest/pom.xml index 21664cde6a..2946e698fe 100644 --- a/opendaylight/statisticsmanager/integrationtest/pom.xml +++ b/opendaylight/statisticsmanager/integrationtest/pom.xml @@ -7,100 +7,111 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - statisticsmanager.integrationtest 0.4.2-SNAPSHOT + + ../implementation/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + junit + junit + org.opendaylight.controller - protocol_plugins.stub + clustering.services org.opendaylight.controller - sal + clustering.stub - + + org.opendaylight.controller - sal.implementation + configuration org.opendaylight.controller - containermanager + configuration.implementation org.opendaylight.controller - containermanager.it.implementation + connectionmanager org.opendaylight.controller - forwardingrulesmanager + connectionmanager.implementation org.opendaylight.controller - clustering.services + containermanager org.opendaylight.controller - clustering.stub + containermanager.it.implementation org.opendaylight.controller - statisticsmanager + forwardingrulesmanager org.opendaylight.controller - statisticsmanager.implementation + hosttracker org.opendaylight.controller - switchmanager.implementation + protocol_plugins.stub org.opendaylight.controller - switchmanager + sal - - + org.opendaylight.controller - configuration + sal.connection org.opendaylight.controller - configuration.implementation + sal.connection.implementation - + org.opendaylight.controller - hosttracker + sal.implementation org.opendaylight.controller - topologymanager + statisticsmanager org.opendaylight.controller - connectionmanager + statisticsmanager.implementation org.opendaylight.controller - connectionmanager.implementation + switchmanager org.opendaylight.controller - sal.connection + switchmanager.implementation org.opendaylight.controller - sal.connection.implementation + topologymanager - junit - junit + org.slf4j + log4j-over-slf4j @@ -123,24 +134,7 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - - ../implementation/target/jacoco.exec - ../implementation/target/jacoco-it.exec - @@ -148,7 +142,9 @@ jacoco-maven-plugin ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -167,4 +163,10 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/switchmanager/api/pom.xml b/opendaylight/switchmanager/api/pom.xml index 760d13b706..223bb889bc 100644 --- a/opendaylight/switchmanager/api/pom.xml +++ b/opendaylight/switchmanager/api/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - switchmanager 0.7.1-SNAPSHOT @@ -24,6 +18,21 @@ target/jacoco.exec target/jacoco-it.exec + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + + junit + junit + test + + @@ -42,18 +51,14 @@ true - - org.opendaylight.controller.switchmanager - - - org.opendaylight.controller.configuration, + org.opendaylight.controller.switchmanager + org.opendaylight.controller.configuration, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.packet, org.opendaylight.controller.sal.inventory, org.slf4j, - javax.xml.bind.annotation - + javax.xml.bind.annotation ${project.basedir}/META-INF @@ -62,7 +67,9 @@ org.jacoco jacoco-maven-plugin - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -73,28 +80,19 @@ post-test - test report + test - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - junit - junit - test - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/switchmanager/implementation/pom.xml b/opendaylight/switchmanager/implementation/pom.xml index 73b83a0e95..542470acf1 100644 --- a/opendaylight/switchmanager/implementation/pom.xml +++ b/opendaylight/switchmanager/implementation/pom.xml @@ -7,12 +7,6 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - switchmanager.implementation 0.4.2-SNAPSHOT @@ -24,6 +18,40 @@ target/jacoco.exec target/jacoco-it.exec + + + equinoxSDK381 + org.apache.felix.gogo.runtime + + + equinoxSDK381 + org.eclipse.osgi + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + statisticsmanager + + + org.opendaylight.controller + switchmanager + + @@ -42,10 +70,8 @@ true - - - - org.opendaylight.controller.configuration, + + org.opendaylight.controller.configuration, org.opendaylight.controller.switchmanager, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.core, @@ -60,11 +86,8 @@ org.osgi.framework, org.apache.felix.service.command, javax.xml.bind.annotation, - org.apache.commons.lang3.builder - - - org.opendaylight.controller.switchmanager.internal.Activator - + org.apache.commons.lang3.builder + org.opendaylight.controller.switchmanager.internal.Activator ${project.basedir}/META-INF @@ -73,7 +96,9 @@ org.jacoco jacoco-maven-plugin - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -84,47 +109,19 @@ post-test - test report + test - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - statisticsmanager - - - junit - junit - - - equinoxSDK381 - org.eclipse.osgi - - - equinoxSDK381 - org.apache.felix.gogo.runtime - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/switchmanager/integrationtest/pom.xml b/opendaylight/switchmanager/integrationtest/pom.xml index daee7a33a8..4a8d93f3b3 100644 --- a/opendaylight/switchmanager/integrationtest/pom.xml +++ b/opendaylight/switchmanager/integrationtest/pom.xml @@ -7,32 +7,43 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - switchmanager.integrationtest 0.4.2-SNAPSHOT + + ../implementation/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + junit + junit + org.opendaylight.controller - switchmanager + clustering.services - + org.opendaylight.controller - switchmanager.implementation + clustering.stub - + org.opendaylight.controller - sal + configuration - + org.opendaylight.controller - sal.implementation + configuration.implementation org.opendaylight.controller @@ -44,39 +55,39 @@ org.opendaylight.controller - clustering.services + hosttracker org.opendaylight.controller - clustering.stub + hosttracker.implementation org.opendaylight.controller - configuration + protocol_plugins.stub org.opendaylight.controller - configuration.implementation + sal org.opendaylight.controller - hosttracker + sal.implementation org.opendaylight.controller - hosttracker.implementation + switchmanager org.opendaylight.controller - topologymanager + switchmanager.implementation org.opendaylight.controller - protocol_plugins.stub + topologymanager - junit - junit + org.slf4j + log4j-over-slf4j @@ -99,24 +110,7 @@ pax-url-aether test - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - - ../implementation/target/jacoco.exec - ../implementation/target/jacoco-it.exec - @@ -125,7 +119,9 @@ jacoco-maven-plugin ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -144,5 +140,11 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/topologymanager/implementation/pom.xml b/opendaylight/topologymanager/implementation/pom.xml index 76d849c6a8..746135891e 100644 --- a/opendaylight/topologymanager/implementation/pom.xml +++ b/opendaylight/topologymanager/implementation/pom.xml @@ -7,16 +7,37 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - topologymanager 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.eclipse.osgi + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + junit + junit + test + + @@ -27,11 +48,8 @@ true - - org.opendaylight.controller.topologymanager - - - javax.xml.bind.annotation, + org.opendaylight.controller.topologymanager + javax.xml.bind.annotation, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, org.opendaylight.controller.sal.packet, @@ -45,42 +63,18 @@ org.apache.commons.lang3.builder, org.apache.commons.lang3.tuple, org.eclipse.osgi.framework.console, - org.osgi.framework - - - org.opendaylight.controller.topologymanager.internal.Activator - + org.osgi.framework + org.opendaylight.controller.topologymanager.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - switchmanager - - - junit - junit - test - - - equinoxSDK381 - org.eclipse.osgi - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/topologymanager/integrationtest/pom.xml b/opendaylight/topologymanager/integrationtest/pom.xml index a72138548a..e278ecffd9 100644 --- a/opendaylight/topologymanager/integrationtest/pom.xml +++ b/opendaylight/topologymanager/integrationtest/pom.xml @@ -7,32 +7,30 @@ 0.5.2-SNAPSHOT ../../commons/integrationtest - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - topologymanager.integrationtest 0.4.1-SNAPSHOT + + ../implementaiton/target/jacoco-it.exec + + ../implementation/target/jacoco.exec + - org.ops4j.pax.exam - pax-exam-container-native - test + org.opendaylight.controller + clustering.services org.opendaylight.controller - protocol_plugins.stub + clustering.stub org.opendaylight.controller - sal + configuration - + org.opendaylight.controller - sal.implementation + configuration.implementation org.opendaylight.controller @@ -48,50 +46,46 @@ org.opendaylight.controller - clustering.services + hosttracker org.opendaylight.controller - clustering.stub + protocol_plugins.stub org.opendaylight.controller - statisticsmanager + sal org.opendaylight.controller - statisticsmanager.implementation + sal.implementation org.opendaylight.controller - switchmanager.implementation + statisticsmanager org.opendaylight.controller - switchmanager + statisticsmanager.implementation org.opendaylight.controller - configuration + switchmanager org.opendaylight.controller - configuration.implementation - - - org.opendaylight.controller - hosttracker + switchmanager.implementation org.opendaylight.controller topologymanager + + org.ops4j.pax.exam + pax-exam-container-native + test + - - - ../implementation/target/jacoco.exec - ../implementaiton/target/jacoco-it.exec - @@ -99,7 +93,9 @@ jacoco-maven-plugin ../implementation/target/jacoco-it.exec - org.opendaylight.controller.* + + org.opendaylight.controller.* + @@ -118,4 +114,10 @@ + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/usermanager/api/pom.xml b/opendaylight/usermanager/api/pom.xml index fa61602092..ab2bb4fa12 100644 --- a/opendaylight/usermanager/api/pom.xml +++ b/opendaylight/usermanager/api/pom.xml @@ -1,4 +1,5 @@ - + + 4.0.0 org.opendaylight.controller @@ -6,16 +7,37 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - usermanager 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + javax.servlet + + + junit + junit + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + sal + + + + org.springframework.security + spring-security-core + + + org.springframework.security + spring-security-web + + @@ -25,8 +47,7 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.packet, @@ -44,44 +65,19 @@ org.springframework.security.authentication, org.springframework.security.core.authority, org.springframework.security.core.userdetails, - javax.xml.bind.annotation - - - org.opendaylight.controller.usermanager, - - - + javax.xml.bind.annotation + org.opendaylight.controller.usermanager, + ${project.basedir}/META-INF - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - junit - junit - - - equinoxSDK381 - javax.servlet - - - - org.springframework.security - spring-security-core - - - org.springframework.security - spring-security-web - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java b/opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java index 958b15978c..8298f5b76a 100644 --- a/opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java +++ b/opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java @@ -223,7 +223,7 @@ public class UserConfig extends ConfigurationObject implements Serializable { return new Status(StatusCode.SUCCESS); } - private Status validateClearTextPassword(String password) { + public static Status validateClearTextPassword(String password) { if (password == null || password.isEmpty()) { return new Status(StatusCode.BADREQUEST, "Password cannot be empty"); } @@ -247,7 +247,7 @@ public class UserConfig extends ConfigurationObject implements Serializable { // To make any changes to a user configured profile, current password // must always be provided - if (!this.password.equals(hash(this.salt, currentPassword))) { + if (!isPasswordMatch(currentPassword)) { return new Status(StatusCode.BADREQUEST, "Current password is incorrect"); } @@ -271,9 +271,13 @@ public class UserConfig extends ConfigurationObject implements Serializable { return status; } + public boolean isPasswordMatch(String otherPass) { + return this.password.equals(hash(this.salt, otherPass)); + } + public AuthResponse authenticate(String clearTextPassword) { AuthResponse locResponse = new AuthResponse(); - if (password.equals(hash(this.salt, clearTextPassword))) { + if (isPasswordMatch(clearTextPassword)) { locResponse.setStatus(AuthResultEnum.AUTH_ACCEPT_LOC); locResponse.addData(getRolesString()); } else { diff --git a/opendaylight/usermanager/implementation/pom.xml b/opendaylight/usermanager/implementation/pom.xml index 58bbec3dc8..58539ae698 100644 --- a/opendaylight/usermanager/implementation/pom.xml +++ b/opendaylight/usermanager/implementation/pom.xml @@ -1,4 +1,5 @@ - + + 4.0.0 org.opendaylight.controller @@ -6,16 +7,49 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - usermanager.implementation 0.4.2-SNAPSHOT bundle + + + equinoxSDK381 + org.eclipse.osgi + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + usermanager + + + org.slf4j + jcl-over-slf4j + + + org.springframework.security + spring-security-web + + + @@ -25,8 +59,7 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.clustering.services, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.core, @@ -48,60 +81,24 @@ org.springframework.security.authentication, org.springframework.security.core.authority, org.springframework.security.core.userdetails, - org.opendaylight.controller.usermanager - + org.opendaylight.controller.usermanager - - - - org.opendaylight.controller.usermanager.internal.Activator - + + org.opendaylight.controller.usermanager.internal.Activator ${project.basedir}/META-INF - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - org.springframework.security - spring-security-web - - - equinoxSDK381 - org.eclipse.osgi - - - junit - junit - - - org.slf4j - jcl-over-slf4j - - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java b/opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java index be4b796a56..3f6ac4a8c7 100644 --- a/opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java +++ b/opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java @@ -8,9 +8,10 @@ package org.opendaylight.controller.usermanager.internal; +import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; @@ -52,6 +53,7 @@ import org.opendaylight.controller.usermanager.UserConfig; import org.opendaylight.controller.usermanager.security.SessionManager; import org.opendaylight.controller.usermanager.security.UserSecurityContextRepository; import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,6 +81,8 @@ public class UserManager implements IUserManager, IObjectReader, private static final String SERVERS_FILE_NAME = "servers.conf"; private static final String AUTH_FILE_NAME = "authorization.conf"; private static final String RECOVERY_FILE = "NETWORK_ADMIN_PASSWORD_RECOVERY"; + private static final boolean DISALLOW_DEFAULT_ADMIN_PASSWORD = + Boolean.getBoolean("usermanager.disable-default-admin-password"); private ConcurrentMap localUserConfigList; private ConcurrentMap remoteServerConfigList; // local authorization info for remotely authenticated users @@ -95,8 +99,8 @@ public class UserManager implements IUserManager, IObjectReader, ADD("add", "added"), MODIFY("modify", "modified"), REMOVE("remove", "removed"); - private String action; - private String postAction; + private final String action; + private final String postAction; private Command(String action, String postAction) { this.action = action; this.postAction = postAction; @@ -212,46 +216,94 @@ public class UserManager implements IUserManager, IObjectReader, } - private void checkDefaultNetworkAdmin() { - /* - * If startup config is not there, it's old or it was deleted or if a - * password recovery was run, need to add Default Network Admin User - */ - if (!localUserConfigList.containsKey(DEFAULT_ADMIN)) { - List roles = new ArrayList(1); - roles.add(DEFAULT_ADMIN_ROLE); - // Need to skip the strong password check for the default admin - UserConfig defaultAdmin = UserConfig.getUncheckedUserConfig(UserManager.DEFAULT_ADMIN, - UserManager.DEFAULT_ADMIN_PASSWORD, roles); - localUserConfigList.put(UserManager.DEFAULT_ADMIN, defaultAdmin); + private void checkDefaultNetworkAdmin(String newPass) { + boolean usingFactoryPassword = false; + // network admin already configured. + if (localUserConfigList.containsKey(DEFAULT_ADMIN)) { + UserConfig uc = localUserConfigList.get(DEFAULT_ADMIN); + if (!uc.isPasswordMatch(DEFAULT_ADMIN_PASSWORD)) { + return; + } else { + usingFactoryPassword = true; + } + } + + List defaultRoles = new ArrayList(1); + defaultRoles.add(DEFAULT_ADMIN_ROLE); + if (newPass == null) { + if (!localUserConfigList.containsKey(DEFAULT_ADMIN)) { + // Need to skip the strong password check for the default admin + UserConfig defaultAdmin = UserConfig.getUncheckedUserConfig( + UserManager.DEFAULT_ADMIN, UserManager.DEFAULT_ADMIN_PASSWORD, + defaultRoles); + localUserConfigList.put(UserManager.DEFAULT_ADMIN, defaultAdmin); + usingFactoryPassword = true; + } + } else { + // use new password for admin + Status status = UserConfig.validateClearTextPassword(newPass); + if (status.isSuccess()) { + localUserConfigList.put(UserManager.DEFAULT_ADMIN, + new UserConfig(UserManager.DEFAULT_ADMIN, newPass, defaultRoles)); + logger.trace("Network Adminstrator password is reset."); + if (newPass.equals(DEFAULT_ADMIN_PASSWORD)) { + usingFactoryPassword = true; + } + } else { + logger.warn("Password is invalid - {}. Network Adminstrator password " + + "cannot be set.", status.getDescription()); + } + } + + if (usingFactoryPassword) { + if (DISALLOW_DEFAULT_ADMIN_PASSWORD) { + logger.warn("Network Administrator factory default password " + + "is disallowed. Please set the password prior to starting " + + "the controller. Shutting down now."); + // shutdown osgi + try { + BundleContext bundleContext = FrameworkUtil.getBundle( + getClass()).getBundleContext(); + bundleContext.getBundle(0).stop(); + } catch (BundleException e) { + logger.warn("Cannot stop framework ", e); + } + } else { + logger.warn("Network Administrator password is set to factory default. " + + "Please change the password as soon as possible."); + } } } - private void checkPasswordRecovery() { + private String checkPasswordRecovery() { final String fileDescription = "Default Network Administrator password recovery file"; + File recoveryFile = new File(UserManager.RECOVERY_FILE); + if (!recoveryFile.exists()) return null; + // read the recovery file + String pwd = null; try { - FileInputStream fis = new FileInputStream(UserManager.RECOVERY_FILE); + BufferedReader reader = new BufferedReader(new FileReader(recoveryFile)); + // read password from recovery file if it has one + pwd = reader.readLine(); + if (pwd != null && pwd.trim().length() == 0) { + pwd = null; + } + reader.close(); /* * Recovery file detected, remove current default network * administrator entry from local users configuration list. * Warn user and delete recovery file. */ this.localUserConfigList.remove(UserManager.DEFAULT_ADMIN); - logger.info("Default Network Administrator password has been reset to factory default."); - logger.info("Please change the default Network Administrator password as soon as possible"); - File filePointer = new File(UserManager.RECOVERY_FILE); - boolean status = filePointer.delete(); - if (!status) { + if (!recoveryFile.delete()) { logger.warn("Failed to delete {}", fileDescription); } else { logger.trace("{} deleted", fileDescription); } - fis.close(); - } catch (FileNotFoundException fnf) { - logger.trace("{} not present", fileDescription); } catch (IOException e) { - logger.warn("Failed to close file stream for {}", fileDescription); + logger.warn("Failed to process file {}", fileDescription); } + return pwd; } @Override @@ -295,20 +347,20 @@ public class UserManager implements IUserManager, IObjectReader, if (!remotelyAuthenticated) { UserConfig localUser = this.localUserConfigList.get(userName); if (localUser == null) { - logger.info( + logger.trace( "Local Authentication Failed for User:\"{}\", Reason: " + "user not found in Local Database", userName); return (AuthResultEnum.AUTH_INVALID_LOC_USER); } rcResponse = localUser.authenticate(password); if (rcResponse.getStatus() != AuthResultEnum.AUTH_ACCEPT_LOC) { - logger.info( + logger.trace( "Local Authentication Failed for User: \"{}\", Reason: {}", userName, rcResponse.getStatus().toString()); return (rcResponse.getStatus()); } - logger.info("Local Authentication Succeeded for User: \"{}\"", + logger.trace("Local Authentication Succeeded for User: \"{}\"", userName); } @@ -336,16 +388,16 @@ public class UserManager implements IUserManager, IObjectReader, * data to the rcResponse */ if (remotelyAuthenticated && !authorizationInfoIsPresent) { - logger.info( + logger.trace( "No Remote Authorization Info provided by Server for User: \"{}\"", userName); - logger.info( + logger.trace( "Looking for Local Authorization Info for User: \"{}\"", userName); AuthorizationConfig resource = authorizationConfList.get(userName); if (resource != null) { - logger.info("Found Local Authorization Info for User: \"{}\"", + logger.trace("Found Local Authorization Info for User: \"{}\"", userName); attributes = resource.getRolesString(); @@ -362,7 +414,7 @@ public class UserManager implements IUserManager, IObjectReader, result.setRoleList(attributes.split(" ")); authorized = true; } else { - logger.info("Not able to find Authorization Info for User: \"{}\"", + logger.trace("Not able to find Authorization Info for User: \"{}\"", userName); } @@ -371,10 +423,10 @@ public class UserManager implements IUserManager, IObjectReader, */ putUserInActiveList(userName, result); if (authorized) { - logger.info("User \"{}\" authorized for the following role(s): {}", + logger.trace("User \"{}\" authorized for the following role(s): {}", userName, result.getUserRoles()); } else { - logger.info("User \"{}\" Not Authorized for any role ", userName); + logger.trace("User \"{}\" Not Authorized for any role ", userName); } return rcResponse.getStatus(); @@ -843,10 +895,10 @@ public class UserManager implements IUserManager, IObjectReader, loadConfigurations(); // Check if a password recovery was triggered for default network admin user - checkPasswordRecovery(); + String pwd = checkPasswordRecovery(); // Make sure default Network Admin account is there - checkDefaultNetworkAdmin(); + checkDefaultNetworkAdmin(pwd); BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); bundleContext.registerService(CommandProvider.class.getName(), this, null); diff --git a/opendaylight/web/devices/pom.xml b/opendaylight/web/devices/pom.xml index 617820b952..8ec05a1102 100644 --- a/opendaylight/web/devices/pom.xml +++ b/opendaylight/web/devices/pom.xml @@ -7,16 +7,44 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - devices.web 0.4.2-SNAPSHOT bundle + + + com.fasterxml.jackson.core + jackson-databind + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwarding.staticrouting + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + web + + @@ -26,10 +54,8 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager, + + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.connection, @@ -80,8 +106,7 @@ org.springframework.web.servlet.config, org.springframework.web.servlet.view, org.springframework.web.filter, - org.springframework.web.context - + org.springframework.web.context /controller/web/devices ${project.basedir}/src/main/resources/META-INF @@ -89,38 +114,10 @@ - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - web - - - org.opendaylight.controller - forwarding.staticrouting - - - com.fasterxml.jackson.core - jackson-databind - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/web/flows/pom.xml b/opendaylight/web/flows/pom.xml index c966f67da5..718b6dfc50 100644 --- a/opendaylight/web/flows/pom.xml +++ b/opendaylight/web/flows/pom.xml @@ -7,16 +7,36 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - flows.web 0.4.2-SNAPSHOT bundle + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + usermanager + + + org.opendaylight.controller + web + + @@ -26,10 +46,8 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager, + + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.core, @@ -78,8 +96,7 @@ org.springframework.web.servlet.config, org.springframework.web.servlet.view, org.springframework.web.filter, - org.springframework.web.context - + org.springframework.web.context /controller/web/flows ${project.basedir}/src/main/resources/META-INF @@ -87,30 +104,10 @@ - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - web - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/web/osgi-brandfragment/pom.xml b/opendaylight/web/osgi-brandfragment/pom.xml index 22758860b4..fc680a5493 100644 --- a/opendaylight/web/osgi-brandfragment/pom.xml +++ b/opendaylight/web/osgi-brandfragment/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -10,8 +11,8 @@ osgi-brandfragment.web 0.0.2-SNAPSHOT - OSGi management web application brand fragment bundle + OSGi management web application brand fragment diff --git a/opendaylight/web/root/pom.xml b/opendaylight/web/root/pom.xml index c2e62d6d41..441aab835e 100644 --- a/opendaylight/web/root/pom.xml +++ b/opendaylight/web/root/pom.xml @@ -7,16 +7,56 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - web 0.4.2-SNAPSHOT bundle + + + com.google.code.gson + gson + + + equinoxSDK381 + javax.servlet + + + junit + junit + + + org.opendaylight.controller + clustering.services + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + connectionmanager + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + usermanager + + + org.springframework + org.springframework.web + + @@ -27,8 +67,7 @@ true - - org.opendaylight.controller.configuration, + org.opendaylight.controller.configuration, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.core, org.opendaylight.controller.sal.utils, @@ -81,11 +120,8 @@ org.springframework.web.filter, org.springframework.web.context, org.springframework.util, - org.apache.catalina.filters - - - org.opendaylight.controller.web - + org.apache.catalina.filters + org.opendaylight.controller.web / ${project.basedir}/src/main/resources/META-INF @@ -93,50 +129,10 @@ - - - org.opendaylight.controller - clustering.services - - - org.opendaylight.controller - connectionmanager - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - usermanager - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.springframework - org.springframework.web - - - equinoxSDK381 - javax.servlet - - - com.google.code.gson - gson - - - junit - junit - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/web/topology/pom.xml b/opendaylight/web/topology/pom.xml index 7193ef3182..fbd07fb4fd 100644 --- a/opendaylight/web/topology/pom.xml +++ b/opendaylight/web/topology/pom.xml @@ -7,16 +7,45 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - topology.web 0.4.2-SNAPSHOT bundle + + + org.opendaylight.controller + configuration + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + topologymanager + + + org.opendaylight.controller + web + + + org.opendaylight.controller.thirdparty + net.sf.jung2 + + + junit + junit + test + + @@ -26,10 +55,8 @@ true - - - - org.opendaylight.controller.containermanager, + + org.opendaylight.controller.containermanager, org.opendaylight.controller.configuration, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.packet.address, @@ -82,8 +109,7 @@ org.springframework.web.servlet.config, org.springframework.web.servlet.view, org.springframework.web.filter, - org.springframework.web.context, - + org.springframework.web.context, /controller/web/topology ${project.basedir}/src/main/resources/META-INF @@ -91,39 +117,10 @@ - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - configuration - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - topologymanager - - - org.opendaylight.controller - web - - - org.opendaylight.controller.thirdparty - net.sf.jung2 - - - junit - junit - test - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/opendaylight/web/troubleshoot/pom.xml b/opendaylight/web/troubleshoot/pom.xml index bc65e699a0..1c03f30aae 100644 --- a/opendaylight/web/troubleshoot/pom.xml +++ b/opendaylight/web/troubleshoot/pom.xml @@ -7,16 +7,40 @@ 1.4.2-SNAPSHOT ../../commons/opendaylight - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - troubleshoot.web 0.4.2-SNAPSHOT bundle + + + com.fasterxml.jackson.core + jackson-databind + + + org.opendaylight.controller + containermanager + + + org.opendaylight.controller + forwardingrulesmanager + + + org.opendaylight.controller + sal + + + org.opendaylight.controller + statisticsmanager + + + org.opendaylight.controller + switchmanager + + + org.opendaylight.controller + web + + @@ -26,10 +50,8 @@ true - - - - org.opendaylight.controller.forwardingrulesmanager, + + org.opendaylight.controller.forwardingrulesmanager, org.opendaylight.controller.sal.authorization, org.opendaylight.controller.sal.action, org.opendaylight.controller.sal.core, @@ -80,8 +102,7 @@ org.springframework.web.servlet.config, org.springframework.web.servlet.view, org.springframework.web.filter, - org.springframework.web.context - + org.springframework.web.context /controller/web/troubleshoot ${project.basedir}/src/main/resources/META-INF @@ -89,34 +110,10 @@ - - - org.opendaylight.controller - forwardingrulesmanager - - - org.opendaylight.controller - containermanager - - - org.opendaylight.controller - switchmanager - - - org.opendaylight.controller - sal - - - org.opendaylight.controller - statisticsmanager - - - org.opendaylight.controller - web - - - com.fasterxml.jackson.core - jackson-databind - - + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + diff --git a/pom.xml b/pom.xml index 446c90048e..792c66dbda 100644 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,6 @@ 4.0.0 - - 3.0 - - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main - HEAD - org.opendaylight.controller commons.parent @@ -19,6 +10,9 @@ releasepom 0.1.2-SNAPSHOT pom + + 3.0 + opendaylight/distribution/opendaylight opendaylight/forwarding/staticrouting @@ -129,36 +123,42 @@ opendaylight/commons/parent opendaylight/commons/logback_settings + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main + - - - integrationtests - - false - - - opendaylight/clustering/integrationtest - opendaylight/configuration/integrationtest - opendaylight/forwardingrulesmanager/integrationtest - opendaylight/hosttracker/integrationtest - opendaylight/switchmanager/integrationtest - opendaylight/topologymanager/integrationtest - - opendaylight/northbound/integrationtest - opendaylight/statisticsmanager/integrationtest - opendaylight/commons/integrationtest - opendaylight/containermanager/it.implementation - opendaylight/distribution/sanitytest/ - - - - docs - - false - - - opendaylight/northbound/java-client - - - + + + integrationtests + + false + + + opendaylight/clustering/integrationtest + opendaylight/configuration/integrationtest + opendaylight/forwardingrulesmanager/integrationtest + opendaylight/hosttracker/integrationtest + opendaylight/switchmanager/integrationtest + opendaylight/topologymanager/integrationtest + + opendaylight/northbound/integrationtest + opendaylight/statisticsmanager/integrationtest + opendaylight/commons/integrationtest + opendaylight/containermanager/it.implementation + opendaylight/distribution/sanitytest/ + + + + docs + + false + + + opendaylight/northbound/java-client + + + diff --git a/third-party/commons/thirdparty/pom.xml b/third-party/commons/thirdparty/pom.xml index e388299262..3fc3a3bd6a 100644 --- a/third-party/commons/thirdparty/pom.xml +++ b/third-party/commons/thirdparty/pom.xml @@ -28,6 +28,7 @@ 2.13 2.3.2 1.3.1 + 2.3.7 @@ -93,6 +94,12 @@ maven-release-plugin ${releaseplugin.version} + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + true + org.apache.maven.plugins maven-site-plugin diff --git a/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar b/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar new file mode 100644 index 0000000000..060b171529 Binary files /dev/null and b/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar differ diff --git a/third-party/org.openexi/nagasena-rta/pom.xml b/third-party/org.openexi/nagasena-rta/pom.xml new file mode 100644 index 0000000000..6beba8c28b --- /dev/null +++ b/third-party/org.openexi/nagasena-rta/pom.xml @@ -0,0 +1,65 @@ + + + + + 4.0.0 + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena-rta + bundle + + + nagasena-rta-0000.0002.0035.0.jar + + + + + + org.codehaus.mojo + truezip-maven-plugin + + + extract + + copy + + compile + + + + ${archive} + ${project.build.outputDirectory} + + ** + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + + + diff --git a/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar b/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar new file mode 100644 index 0000000000..c566f27d83 Binary files /dev/null and b/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar differ diff --git a/third-party/org.openexi/nagasena/pom.xml b/third-party/org.openexi/nagasena/pom.xml new file mode 100644 index 0000000000..297f15f201 --- /dev/null +++ b/third-party/org.openexi/nagasena/pom.xml @@ -0,0 +1,65 @@ + + + + + 4.0.0 + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena + bundle + + + nagasena-0000.0002.0035.0.jar + + + + + + org.codehaus.mojo + truezip-maven-plugin + + + extract + + copy + + compile + + + + ${archive} + ${project.build.outputDirectory} + + ** + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html new file mode 100644 index 0000000000..11f9ed5153 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html @@ -0,0 +1,85 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
    + + + + + +
    AlignmentType +
    +BinaryDataHandler +
    +BinaryDataSink +
    +BinaryDataSource +
    +CharacterBuffer +
    +Characters +
    +EmptySchema +
    +EntityResolverEx +
    +EventDescription +
    +EventType +
    +EXIDecoder +
    +EXIOptions +
    +EXIReader +
    +EXISchema +
    +EXISchemaFactory +
    +EXISchemaFactoryErrorHandler +
    +EXISchemaFactoryException +
    +EXISchemaReader +
    +EXISchemaResolver +
    +GrammarCache +
    +GrammarOptions +
    +HeaderOptionsOutputType +
    +QName +
    +ReaderSupport +
    +SAXTransmogrifier +
    +Scanner +
    +Transmogrifier +
    +TransmogrifierException +
    +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html new file mode 100644 index 0000000000..8f32ae6587 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html @@ -0,0 +1,85 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
    + + + + + +
    AlignmentType +
    +BinaryDataHandler +
    +BinaryDataSink +
    +BinaryDataSource +
    +CharacterBuffer +
    +Characters +
    +EmptySchema +
    +EntityResolverEx +
    +EventDescription +
    +EventType +
    +EXIDecoder +
    +EXIOptions +
    +EXIReader +
    +EXISchema +
    +EXISchemaFactory +
    +EXISchemaFactoryErrorHandler +
    +EXISchemaFactoryException +
    +EXISchemaReader +
    +EXISchemaResolver +
    +GrammarCache +
    +GrammarOptions +
    +HeaderOptionsOutputType +
    +QName +
    +ReaderSupport +
    +SAXTransmogrifier +
    +Scanner +
    +Transmogrifier +
    +TransmogrifierException +
    +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html b/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html new file mode 100644 index 0000000000..6c4e3d2837 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html @@ -0,0 +1,553 @@ + + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Constant Field Values

    +
    +
    +Contents + + + + + + +
    +org.openexi.*
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    org.openexi.proc.common.EventDescription
    +public static final byteEVENT_AT3
    +public static final byteEVENT_BLOB13
    +public static final byteEVENT_CH6
    +public static final byteEVENT_CM10
    +public static final byteEVENT_DTD12
    +public static final byteEVENT_ED1
    +public static final byteEVENT_EE7
    +public static final byteEVENT_ER11
    +public static final byteEVENT_NL5
    +public static final byteEVENT_NS8
    +public static final byteEVENT_PI9
    +public static final byteEVENT_SD0
    +public static final byteEVENT_SE2
    +public static final byteEVENT_TP4
    + +

    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    org.openexi.proc.common.EventType
    +public static final byteITEM_AT12
    +public static final byteITEM_AT_WC_ANY_UNTYPED8
    +public static final byteITEM_CH3
    +public static final byteITEM_CM1
    +public static final byteITEM_DTD10
    +public static final byteITEM_ED4
    +public static final byteITEM_EE9
    +public static final byteITEM_ER2
    +public static final byteITEM_NS7
    +public static final byteITEM_PI0
    +public static final byteITEM_SC6
    +public static final byteITEM_SCHEMA_AT16
    +public static final byteITEM_SCHEMA_AT_INVALID_VALUE23
    +public static final byteITEM_SCHEMA_AT_WC_ANY17
    +public static final byteITEM_SCHEMA_AT_WC_NS18
    +public static final byteITEM_SCHEMA_CH19
    +public static final byteITEM_SCHEMA_CH_MIXED20
    +public static final byteITEM_SCHEMA_NIL21
    +public static final byteITEM_SCHEMA_TYPE22
    +public static final byteITEM_SCHEMA_WC_ANY14
    +public static final byteITEM_SCHEMA_WC_NS15
    +public static final byteITEM_SD13
    +public static final byteITEM_SE11
    +public static final byteITEM_SE_WC5
    + +

    + +

    + + + + + + + + + + + + + + + + + + + + + + +
    org.openexi.proc.common.GrammarOptions
    +public static final shortDEFAULT_OPTIONS2
    +public static final shortOPTIONS_UNUSED0
    +public static final shortSTRICT_OPTIONS1
    + +

    + +

    + + + + + + + + + + + + +
    org.openexi.proc.io.CharacterBuffer
    +public static final intBUFSIZE_DEFAULT4096
    + +

    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    org.openexi.sax.TransmogrifierException
    +public static final intPREFIX_BOUND_TO_ANOTHER_NAMESPACE11
    +public static final intPREFIX_NOT_BOUND10
    +public static final intSAX_ERROR6
    +public static final intSCRIBER_ERROR12
    +public static final intUNEXPECTED_ATTR2
    +public static final intUNEXPECTED_BINARY_VALUE4
    +public static final intUNEXPECTED_CHARS3
    +public static final intUNEXPECTED_ED8
    +public static final intUNEXPECTED_ELEM1
    +public static final intUNEXPECTED_END_ELEM7
    +public static final intUNEXPECTED_SD9
    +public static final intUNHANDLED_SAXPARSER_FEATURE5
    + +

    + +

    + + + + + + + + + + + + +
    org.openexi.scomp.EXISchemaFactoryException
    +public static final intXMLSCHEMA_ERROR1002
    + +

    + +

    +


    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html b/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html new file mode 100644 index 0000000000..60ad3edb6c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html @@ -0,0 +1,141 @@ + + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Deprecated API

    +
    +
    +Contents
      +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html b/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html new file mode 100644 index 0000000000..81850ce70b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html @@ -0,0 +1,214 @@ + + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +How This API Document Is Organized

    +
    +This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

    +Overview

    +
    + +

    +The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +

    +Package

    +
    + +

    +Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

      +
    • Interfaces (italic)
    • Classes
    • Enums
    • Exceptions
    • Errors
    • Annotation Types
    +
    +

    +Class/Interface

    +
    + +

    +Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

      +
    • Class inheritance diagram
    • Direct Subclasses
    • All Known Subinterfaces
    • All Known Implementing Classes
    • Class/interface declaration
    • Class/interface description +

      +

    • Nested Class Summary
    • Field Summary
    • Constructor Summary
    • Method Summary +

      +

    • Field Detail
    • Constructor Detail
    • Method Detail
    +Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
    + +

    +Annotation Type

    +
    + +

    +Each annotation type has its own separate page with the following sections:

      +
    • Annotation Type declaration
    • Annotation Type description
    • Required Element Summary
    • Optional Element Summary
    • Element Detail
    +
    + +

    +Enum

    +
    + +

    +Each enum has its own separate page with the following sections:

      +
    • Enum declaration
    • Enum description
    • Enum Constant Summary
    • Enum Constant Detail
    +
    +

    +Tree (Class Hierarchy)

    +
    +There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    +
    +

    +Deprecated API

    +
    +The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
    +

    +Index

    +
    +The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
    +

    +Prev/Next

    +These links take you to the next or previous class, interface, package, or related page.

    +Frames/No Frames

    +These links show and hide the HTML frames. All pages are available with or without frames. +

    +

    +Serialized Form

    +Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

    +

    +Constant Field Values

    +The Constant Field Values page lists the static final fields and their values. +

    + + +This help file applies to API documentation generated using the standard doclet. + +
    +


    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html b/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html new file mode 100644 index 0000000000..3fc6b297e3 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html @@ -0,0 +1,970 @@ + + + + + + + +Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +A B C D E F G H I L M N O P Q R S T U V W X _
    +

    +A

    +
    +
    addCM(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Sets Preserve Comments to true. +
    addDTD(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Sets Preserve Document Type Definition to true. +
    addNS(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Sets Preserve Namespaces to true. +
    addPI(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Sets Preserve Processing Instructions to true. +
    AlignmentType - Enum in org.openexi.proc.common
    AlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format.
    ancestryIds - +Variable in class org.openexi.schema.EXISchema +
      +
    +
    +

    +B

    +
    +
    binaryData(byte[], int, int, BinaryDataSink) - +Method in interface org.openexi.sax.BinaryDataHandler +
    Writes a binary value where the schema expects a binary value. +
    BinaryDataHandler - Interface in org.openexi.sax
     
    BinaryDataSink - Interface in org.openexi.proc.io
    BinaryDataSink represents a sink that accepts successive chunks of binary data.
    BinaryDataSource - Class in org.openexi.proc.common
     
    BinaryDataSource() - +Constructor for class org.openexi.proc.common.BinaryDataSource +
      +
    BUFSIZE_DEFAULT - +Static variable in class org.openexi.proc.io.CharacterBuffer +
      +
    +
    +

    +C

    +
    +
    CharacterBuffer - Class in org.openexi.proc.io
     
    CharacterBuffer(int) - +Constructor for class org.openexi.proc.io.CharacterBuffer +
      +
    Characters - Class in org.openexi.schema
     
    Characters(char[], int, int, boolean) - +Constructor for class org.openexi.schema.Characters +
      +
    characters - +Variable in class org.openexi.schema.Characters +
      +
    CHARACTERS_EMPTY - +Static variable in class org.openexi.schema.Characters +
      +
    closeInputStream() - +Method in class org.openexi.proc.io.Scanner +
    Close the input stream. +
    compile(InputSource) - +Method in class org.openexi.scomp.EXISchemaFactory +
    Compile an XML Schema Document into an EXISchema. +
    +
    +

    +D

    +
    +
    DEFAULT_OPTIONS - +Static variable in class org.openexi.proc.common.GrammarOptions +
    Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded. +
    +
    +

    +E

    +
    +
    EmptySchema - Class in org.openexi.schema
    EmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions.
    encode(InputSource) - +Method in class org.openexi.sax.Transmogrifier +
    Parses XML input source and converts it to an EXI stream. +
    endBinaryData(BinaryDataSink) - +Method in interface org.openexi.sax.BinaryDataHandler +
    Mark the end of a binary value. +
    EntityResolverEx - Interface in org.openexi.scomp
    Extended SAX EntityResolver interface for resolving entities and + schema documents.
    equals(Object) - +Method in class org.openexi.proc.common.QName +
      +
    equals(Object) - +Method in class org.openexi.schema.Characters +
      +
    error(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
    Report an error found during schema processing. +
    EVENT_AT - +Static variable in interface org.openexi.proc.common.EventDescription +
    Attribute event. +
    EVENT_BLOB - +Static variable in interface org.openexi.proc.common.EventDescription +
    BLOB event (content of an element). +
    EVENT_CH - +Static variable in interface org.openexi.proc.common.EventDescription +
    Character event (content of an element). +
    EVENT_CM - +Static variable in interface org.openexi.proc.common.EventDescription +
    Comment event. +
    EVENT_DTD - +Static variable in interface org.openexi.proc.common.EventDescription +
    Document Type Definition event. +
    EVENT_ED - +Static variable in interface org.openexi.proc.common.EventDescription +
    End Document event. +
    EVENT_EE - +Static variable in interface org.openexi.proc.common.EventDescription +
    End Element event. +
    EVENT_ER - +Static variable in interface org.openexi.proc.common.EventDescription +
    Entity Reference event. +
    EVENT_NL - +Static variable in interface org.openexi.proc.common.EventDescription +
    Attribute xsi:nil. +
    EVENT_NS - +Static variable in interface org.openexi.proc.common.EventDescription +
    Namespace declaration event. +
    EVENT_PI - +Static variable in interface org.openexi.proc.common.EventDescription +
    Processing Instruction event. +
    EVENT_SD - +Static variable in interface org.openexi.proc.common.EventDescription +
    Start Document event. +
    EVENT_SE - +Static variable in interface org.openexi.proc.common.EventDescription +
    Start Element event. +
    EVENT_TP - +Static variable in interface org.openexi.proc.common.EventDescription +
    Attribute xsi:type. +
    EventDescription - Interface in org.openexi.proc.common
    EventDescription provides accessors to the current EXI event data + during the decode process.
    EventType - Class in org.openexi.proc.common
    EventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification.
    EXIDecoder - Class in org.openexi.proc
    EXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream.
    EXIDecoder() - +Constructor for class org.openexi.proc.EXIDecoder +
    Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes. +
    EXIDecoder(int, boolean) - +Constructor for class org.openexi.proc.EXIDecoder +
    Creates an instance of EXIDecoder with the specified inflator buffer + size. +
    EXIOptions - Class in org.openexi.proc.common
    EXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream.
    EXIReader - Class in org.openexi.sax
    EXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream.
    EXIReader() - +Constructor for class org.openexi.sax.EXIReader +
      +
    EXISchema - Class in org.openexi.schema
    EXISchema provides methods to read and write compiled EXI schemas.
    EXISchemaFactory - Class in org.openexi.scomp
    EXISchemaFactory compiles XML Schema into an EXISchema instance.
    EXISchemaFactory() - +Constructor for class org.openexi.scomp.EXISchemaFactory +
      +
    EXISchemaFactoryErrorHandler - Interface in org.openexi.scomp
    This interface reports exceptions from EXISchemaFactory during schema + processing.
    EXISchemaFactoryException - Exception in org.openexi.scomp
    Any errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects.
    EXISchemaReader - Class in org.openexi.scomp
    EXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema.
    EXISchemaReader() - +Constructor for class org.openexi.scomp.EXISchemaReader +
      +
    EXISchemaResolver - Interface in org.openexi.proc
    Developers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream.
    +
    +

    +F

    +
    +
    fatalError(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
    Report a fatal error found during schema processing. +
    +
    +

    +G

    +
    +
    getAlignmentType() - +Method in class org.openexi.proc.common.EXIOptions +
    Get the bit alignment setting. +
    getBinaryDataSource() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the value of an EVENT_BLOB. +
    getBlockSize() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns the number of element and attribute values that are read and processed + as a group. +
    getByteArray() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    getCharacters() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event. +
    getCode() - +Method in exception org.openexi.sax.TransmogrifierException +
    Returns a code that represents the type of the exception. +
    getCode() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
    Returns a code that represents the type of the exception. +
    getContentHandler() - +Method in class org.openexi.sax.ReaderSupport +
    Get the SAX content handler currently in use. +
    getDatatypeRepresentationMap() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI. +
    getDatatypeRepresentationMapBindingsCount() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns the number of Datatype Representation Map QName pairs. +
    getEventKind() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the event kind of which instance data this EventDescription is describing. +
    getEventType() - +Method in interface org.openexi.proc.common.EventDescription +
    Returns the EventType from which this event is derived. +
    getException() - +Method in exception org.openexi.sax.TransmogrifierException +
    Returns an Exception object. +
    getException() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
    Returns an Exception object. +
    getEXISchema() - +Method in class org.openexi.proc.grammars.GrammarCache +
    Gets the compiled EXI Schema. +
    getEXISchema() - +Static method in class org.openexi.schema.EmptySchema +
    Returns an EXISchema that supports all datatypes inherent in XML Schema. +
    getFeature(String) - +Method in class org.openexi.sax.EXIReader +
    Get features for the SAX parser. +
    getGrammarCache() - +Method in interface org.openexi.sax.SAXTransmogrifier +
    Returns the GrammarCache that is in use by this SAXTransmogrifier. +
    getGrammarCache() - +Method in class org.openexi.sax.Transmogrifier +
    Returns the GrammarCache that was previously set. +
    getHeaderOptions() - +Method in class org.openexi.proc.io.Scanner +
    Returns the EXI Header options from the header of the + EXI stream, if present. +
    getLength() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    getLocator() - +Method in exception org.openexi.sax.TransmogrifierException +
    Returns the locator that is associated with this compilation error. +
    getLocator() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
    Returns the locator that is associated with this compilation error. +
    getMessage() - +Method in exception org.openexi.sax.TransmogrifierException +
    Returns a message that describes the exception. +
    getMessage() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
    Returns a message that describes the exception. +
    getName() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the name of the EXI event. +
    getPrefix() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the namespace prefix of the event. +
    getPreserveComments() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns whether comments are conserved in the EXI Stream. +
    getPreserveDTD() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns whether the document type definition is conserved in the EXI Stream. +
    getPreserveLexicalValues() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes. +
    getPreserveNS() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns whether the namespaces are preserved in the EXI stream. +
    getPreservePIs() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns whether processing instructions are conserved in the EXI Stream. +
    getProperty(String) - +Method in class org.openexi.sax.EXIReader +
    Use to retrieve the name of the lexical handler, currently the only + property recognized by this class. +
    getRemainingBytesCount() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    getSAXTransmogrifier() - +Method in class org.openexi.sax.Transmogrifier +
    Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler. +
    getStartIndex() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    getURI() - +Method in interface org.openexi.proc.common.EventDescription +
    Gets the URI of the EXI event. +
    getValueMaxLength() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns the maximum length in characters of strings that will be included + in the String Table. +
    getValuePartitionCapacity() - +Method in class org.openexi.proc.common.EXIOptions +
    Returns the maximum number of entries in the String Table. +
    GrammarCache - Class in org.openexi.proc.grammars
    A GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options.
    GrammarCache(EXISchema) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
    Creates an instance of GrammarCache informed by a schema with default + grammar options. +
    GrammarCache(short) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
    Creates an instance of GrammarCache with the specified grammar options. +
    GrammarCache(EXISchema, short) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
    Creates an instance of GrammarCache informed by a schema with the + specified grammar options. +
    GrammarOptions - Class in org.openexi.proc.common
    GrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded.
    grammarOptions - +Variable in class org.openexi.proc.grammars.GrammarCache +
    Short integer that encapsulates GrammarOptions + for the EXI stream. +
    +
    +

    +H

    +
    +
    hasCM(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Returns true if Preserve Comments is true. +
    hasDTD(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Returns true if Preserve Document Type Definition is true. +
    hashCode() - +Method in class org.openexi.schema.Characters +
      +
    hasNext() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    hasNS(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Returns true if Preserve Namespaces is true. +
    hasPI(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Returns true if Preserve Processing Instructions is true. +
    HeaderOptionsOutputType - Enum in org.openexi.proc
    This enumeration provides three possible settings for header options output.
    +
    +

    +I

    +
    +
    indexOf(char) - +Method in class org.openexi.schema.Characters +
      +
    isFragment() - +Method in class org.openexi.proc.common.EXIOptions +
    An XML fragment is a non-compliant XML document with multiple root + elements. +
    isPermitDeviation(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
    Returns true if DEFAULT_OPTIONS is set to true. +
    isSimpleType(int) - +Method in class org.openexi.schema.EXISchema +
      +
    isStrict() - +Method in class org.openexi.proc.common.EXIOptions +
    The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema. +
    isVolatile - +Variable in class org.openexi.schema.Characters +
      +
    ITEM_AT - +Static variable in class org.openexi.proc.common.EventType +
    Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences. +
    ITEM_AT_WC_ANY_UNTYPED - +Static variable in class org.openexi.proc.common.EventType +
    Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded. +
    ITEM_CH - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Character event (character events store values as strings). +
    ITEM_CM - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Comment. +
    ITEM_DTD - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Document Type Definition. +
    ITEM_ED - +Static variable in class org.openexi.proc.common.EventType +
    Event type for End of Document. +
    ITEM_EE - +Static variable in class org.openexi.proc.common.EventType +
    Event type for End of Element. +
    ITEM_ER - +Static variable in class org.openexi.proc.common.EventType +
    Event type for an Entity Reference. +
    ITEM_NS - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Namespace declaration. +
    ITEM_PI - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Processing Instruction. +
    ITEM_SC - +Static variable in class org.openexi.proc.common.EventType +
    Self-contained items are not supported in this release of OpenEXI. +
    ITEM_SCHEMA_AT - +Static variable in class org.openexi.proc.common.EventType +
    Event type for AttributeUse that matches an attribute event with + a valid value. +
    ITEM_SCHEMA_AT_INVALID_VALUE - +Static variable in class org.openexi.proc.common.EventType +
    Event type for AttributeUse that matches an attribute event with an + invalid value. +
    ITEM_SCHEMA_AT_WC_ANY - +Static variable in class org.openexi.proc.common.EventType +
    Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied. +
    ITEM_SCHEMA_AT_WC_NS - +Static variable in class org.openexi.proc.common.EventType +
    Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied. +
    ITEM_SCHEMA_CH - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a defined Character event in an EXI stream processed + using a schema. +
    ITEM_SCHEMA_CH_MIXED - +Static variable in class org.openexi.proc.common.EventType +
    Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema. +
    ITEM_SCHEMA_NIL - +Static variable in class org.openexi.proc.common.EventType +
    Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string. +
    ITEM_SCHEMA_TYPE - +Static variable in class org.openexi.proc.common.EventType +
    Special Attribute that describes a data type for the associated + element. +
    ITEM_SCHEMA_WC_ANY - +Static variable in class org.openexi.proc.common.EventType +
    Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied. +
    ITEM_SCHEMA_WC_NS - +Static variable in class org.openexi.proc.common.EventType +
    Event type for an element defined in a namespace in an EXI stream + processed using a schema. +
    ITEM_SD - +Static variable in class org.openexi.proc.common.EventType +
    Event type for Start Document. +
    ITEM_SE - +Static variable in class org.openexi.proc.common.EventType +
    Event type for Start Element. +
    ITEM_SE_WC - +Static variable in class org.openexi.proc.common.EventType +
    Wildcard event type for an element. +
    +
    +

    +L

    +
    +
    length - +Variable in class org.openexi.schema.Characters +
      +
    localName - +Variable in class org.openexi.proc.common.QName +
    Local name of the datatype. +
    +
    +

    +M

    +
    +
    makeString() - +Method in class org.openexi.schema.Characters +
      +
    +
    +

    +N

    +
    +
    name - +Variable in class org.openexi.proc.common.EventType +
    Local name of event type definition. +
    namespaceName - +Variable in class org.openexi.proc.common.QName +
    If namespaceName is null, this indicates a failure of + namespace-prefix binding. +
    next() - +Method in class org.openexi.proc.common.BinaryDataSource +
      +
    nextEvent() - +Method in class org.openexi.proc.io.Scanner +
    Gets the next event from the EXI stream. +
    +
    +

    +O

    +
    +
    OPTIONS_UNUSED - +Static variable in class org.openexi.proc.common.GrammarOptions +
    OPTIONS_UNUSED is an internal value. +
    org.openexi.proc - package org.openexi.proc
    + + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format.
    org.openexi.proc.common - package org.openexi.proc.common
    + + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values).
    org.openexi.proc.grammars - package org.openexi.proc.grammars
    + + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema.
    org.openexi.proc.io - package org.openexi.proc.io
    + + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams.
    org.openexi.sax - package org.openexi.sax
    + + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent.
    org.openexi.schema - package org.openexi.schema
    + + +The schema package contains classes that are used to represent XML Schema Documents (XSDs).
    org.openexi.scomp - package org.openexi.scomp
    + + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas.
    +
    +

    +P

    +
    +
    parse(InputStream) - +Method in class org.openexi.scomp.EXISchemaReader +
    Parses EXI-encoded EXI Grammar into an EXISchema. +
    PREFIX_BOUND_TO_ANOTHER_NAMESPACE - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Prefix is bound to another namespace. +
    PREFIX_NOT_BOUND - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Prefix is not bound. +
    processHeader() - +Method in class org.openexi.proc.EXIDecoder +
    This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream. +
    +
    +

    +Q

    +
    +
    QName - Class in org.openexi.proc.common
    QName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation.
    QName() - +Constructor for class org.openexi.proc.common.QName +
      +
    QName(String, String) - +Constructor for class org.openexi.proc.common.QName +
    Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name. +
    +
    +

    +R

    +
    +
    ReaderSupport - Class in org.openexi.sax
     
    readIn(DataInputStream) - +Static method in class org.openexi.schema.EXISchema +
    Reads an EXI Schema from a DataInputStream. +
    resolveEntity(String, String, String) - +Method in interface org.openexi.scomp.EntityResolverEx +
    This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas. +
    resolveSchema(String, short) - +Method in interface org.openexi.proc.EXISchemaResolver +
    Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream. +
    +
    +

    +S

    +
    +
    SAX_ERROR - +Static variable in exception org.openexi.sax.TransmogrifierException +
    SAX error reported by XML parser. +
    SAXTransmogrifier - Interface in org.openexi.sax
    Applications can directly feed SAX events into a transmogrifier through SAXTransmogrifier.
    Scanner - Class in org.openexi.proc.io
    The Scanner class provides methods for scanning events + in the body of an EXI stream.
    SCRIBER_ERROR - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Errors reported by Scriber. +
    setAlignmentType(AlignmentType) - +Method in class org.openexi.proc.EXIDecoder +
    Set the bit alignment style of the stream to be decoded. +
    setAlignmentType(AlignmentType) - +Method in class org.openexi.sax.EXIReader +
    Set the bit alignment style used to compile the EXI input stream. +
    setAlignmentType(AlignmentType) - +Method in class org.openexi.sax.Transmogrifier +
    Set the bit alignment style for the encoded EXI stream. +
    setBinaryChunkSize(int) - +Method in class org.openexi.proc.io.Scanner +
    Binary values are read in chunks of the specified size when the + use of binary data is enabled. +
    setBlockSize(int) - +Method in class org.openexi.proc.EXIDecoder +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. +
    setBlockSize(int) - +Method in class org.openexi.sax.EXIReader +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. +
    setBlockSize(int) - +Method in class org.openexi.sax.Transmogrifier +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream. +
    setCompilerErrorHandler(EXISchemaFactoryErrorHandler) - +Method in class org.openexi.scomp.EXISchemaFactory +
    Set an error handler to report any errors encountered during + schema compilation. +
    setContentHandler(ContentHandler) - +Method in class org.openexi.sax.ReaderSupport +
    Set a SAX content handler to receive SAX events. +
    setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.proc.EXIDecoder +
    Set a datatype representation map (DTRM). +
    setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.sax.EXIReader +
    Set a datatype representation map. +
    setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.sax.Transmogrifier +
    Set a datatype representation map (DTRM). +
    setEnableBinaryData(boolean) - +Method in class org.openexi.proc.EXIDecoder +
    Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled. +
    setEntityResolver(EntityResolver) - +Method in class org.openexi.sax.Transmogrifier +
    Set an external SAX entity resolver. +
    setEntityResolver(EntityResolverEx) - +Method in class org.openexi.scomp.EXISchemaFactory +
    Set an entity resolver for use to resolve entities and schema documents. +
    setEXISchemaResolver(EXISchemaResolver) - +Method in class org.openexi.sax.EXIReader +
    Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream. +
    setFeature(String, boolean) - +Method in class org.openexi.sax.EXIReader +
    Set features for the SAX parser. +
    setFragment(boolean) - +Method in class org.openexi.proc.EXIDecoder +
    Set whether the document is a fragment. +
    setFragment(boolean) - +Method in class org.openexi.sax.EXIReader +
    Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +
    setFragment(boolean) - +Method in class org.openexi.sax.Transmogrifier +
    Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +
    setGrammarCache(GrammarCache) - +Method in class org.openexi.proc.EXIDecoder +
    Set the GrammarCache used in decoding EXI streams. +
    setGrammarCache(GrammarCache) - +Method in class org.openexi.sax.ReaderSupport +
    Set the GrammarCache used in parsing EXI streams. +
    setGrammarCache(GrammarCache) - +Method in class org.openexi.sax.Transmogrifier +
    Set the GrammarCache used in transmogrifying XML data to EXI. +
    setGrammarCache(GrammarCache, SchemaId) - +Method in class org.openexi.sax.Transmogrifier +
    Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier. +
    setInitialBinaryDataBufferSize(int) - +Method in class org.openexi.proc.EXIDecoder +
      +
    setInputStream(InputStream) - +Method in class org.openexi.proc.EXIDecoder +
    Set an input stream from which the encoded stream is read. +
    setLexicalHandler(LexicalHandler) - +Method in class org.openexi.sax.EXIReader +
    Set a SAX lexical handler to receive SAX lexical events. +
    setOutputCookie(boolean) - +Method in class org.openexi.sax.Transmogrifier +
    Tells the encoder whether to or not to start the stream by + adding an EXI cookie. +
    setOutputOptions(HeaderOptionsOutputType) - +Method in class org.openexi.sax.Transmogrifier +
    Set the header output options. +
    setOutputStream(OutputStream) - +Method in class org.openexi.sax.Transmogrifier +
    Set an output stream to which encoded streams are written. +
    setPreserveLexicalValues(boolean) - +Method in class org.openexi.proc.EXIDecoder +
    Set to true to preserve the original string values from the EXI + stream. +
    setPreserveLexicalValues(boolean) - +Method in class org.openexi.sax.EXIReader +
    Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true. +
    setPreserveLexicalValues(boolean) - +Method in class org.openexi.sax.Transmogrifier +
    Set to true to preserve the original string values from the XML + stream. +
    setPreserveWhitespaces(boolean) - +Method in class org.openexi.sax.Transmogrifier +
    Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream. +
    setProperty(String, Object) - +Method in class org.openexi.sax.EXIReader +
    This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers. +
    setResolveExternalGeneralEntities(boolean) - +Method in class org.openexi.sax.Transmogrifier +
    Change the way a Transmogrifier handles external general entities. +
    setSchema(EXISchema, QName[], int) - +Method in class org.openexi.proc.io.Scanner +
      +
    setValueMaxLength(int) - +Method in class org.openexi.proc.EXIDecoder +
    Set the maximum length of a string that will be stored for reuse in the + String Table. +
    setValueMaxLength(int) - +Method in class org.openexi.sax.EXIReader +
    Set the maximum length of a string that will be stored for reuse in the + String Table. +
    setValueMaxLength(int) - +Method in class org.openexi.sax.Transmogrifier +
    Set the maximum length of a string that will be stored for reuse in the + String Table. +
    setValuePartitionCapacity(int) - +Method in class org.openexi.proc.EXIDecoder +
    Set the maximum number of values in the String Table. +
    setValuePartitionCapacity(int) - +Method in class org.openexi.sax.EXIReader +
    Set the maximum number of values in the String Table. +
    setValuePartitionCapacity(int) - +Method in class org.openexi.sax.Transmogrifier +
    Set the maximum number of values in the String Table. +
    startBinaryData(long) - +Method in interface org.openexi.sax.BinaryDataHandler +
    Mark the start of a binary value. +
    startIndex - +Variable in class org.openexi.schema.Characters +
      +
    STRICT_OPTIONS - +Static variable in class org.openexi.proc.common.GrammarOptions +
    Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded. +
    substring(int, int) - +Method in class org.openexi.schema.Characters +
      +
    +
    +

    +T

    +
    +
    Transmogrifier - Class in org.openexi.sax
    The Transmogrifier converts an XML stream to an EXI stream.
    Transmogrifier() - +Constructor for class org.openexi.sax.Transmogrifier +
    Create an instance of the Transmogrifier with a default SAX parser. +
    Transmogrifier(SAXParserFactory) - +Constructor for class org.openexi.sax.Transmogrifier +
    Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser. +
    TransmogrifierException - Exception in org.openexi.sax
    Exception handler for the Transmogrifier.
    turnPermanent() - +Method in class org.openexi.schema.Characters +
      +
    +
    +

    +U

    +
    +
    ucsCount - +Variable in class org.openexi.schema.Characters +
      +
    UNEXPECTED_ATTR - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected Attribute. +
    UNEXPECTED_BINARY_VALUE - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected Binary value. +
    UNEXPECTED_CHARS - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected Character Sequence. +
    UNEXPECTED_ED - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected End of Document event. +
    UNEXPECTED_ELEM - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected Element. +
    UNEXPECTED_END_ELEM - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected End of Element event. +
    UNEXPECTED_SD - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unexpected Start of Document event. +
    UNHANDLED_SAXPARSER_FEATURE - +Static variable in exception org.openexi.sax.TransmogrifierException +
    Unhandled SAX parser feature. +
    uri - +Variable in class org.openexi.proc.common.EventType +
    URI of event type definition. +
    +
    +

    +V

    +
    +
    valueOf(String) - +Static method in enum org.openexi.proc.common.AlignmentType +
    Returns the enum constant of this type with the specified name. +
    valueOf(String) - +Static method in enum org.openexi.proc.HeaderOptionsOutputType +
    Returns the enum constant of this type with the specified name. +
    values() - +Static method in enum org.openexi.proc.common.AlignmentType +
    Returns an array containing the constants of this enum type, in +the order they're declared. +
    values() - +Static method in enum org.openexi.proc.HeaderOptionsOutputType +
    Returns an array containing the constants of this enum type, in +the order they're declared. +
    +
    +

    +W

    +
    +
    warning(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
    Report a warning found during schema processing. +
    writeOut(DataOutputStream) - +Method in class org.openexi.schema.EXISchema +
    Writes out a serialized EXISchema. +
    writeXml(OutputStream, boolean) - +Method in class org.openexi.schema.EXISchema +
      +
    +
    +

    +X

    +
    +
    XMLSCHEMA_ERROR - +Static variable in exception org.openexi.scomp.EXISchemaFactoryException +
    The underlying XMLSchema parser found an error in the schema. +
    +
    +

    +_

    +
    +
    _isSimpleType(int, int[]) - +Static method in class org.openexi.schema.EXISchema +
      +
    +
    +A B C D E F G H I L M N O P Q R S T U V W X _ + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/index.html b/third-party/org.openexi/nagasena/src/main/resources/doc/index.html new file mode 100644 index 0000000000..f8c172cd85 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/index.html @@ -0,0 +1,40 @@ + + + + + + + +Generated Documentation (Untitled) + + + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html new file mode 100644 index 0000000000..15bd150a78 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html @@ -0,0 +1,580 @@ + + + + + + + +EXIDecoder + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc +
    +Class EXIDecoder

    +
    +java.lang.Object
    +  extended by org.openexi.proc.EXIDecoder
    +
    +
    +
    +
    public class EXIDecoder
    extends java.lang.Object
    + + +

    +EXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + +
    +Constructor Summary
    EXIDecoder() + +
    +          Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes.
    EXIDecoder(int inflatorBufSize, + boolean useThreadedInflater) + +
    +          Creates an instance of EXIDecoder with the specified inflator buffer + size.
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + ScannerprocessHeader() + +
    +          This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream.
    + voidsetAlignmentType(AlignmentType alignmentType) + +
    +          Set the bit alignment style of the stream to be decoded.
    + voidsetBlockSize(int blockSize) + +
    +          Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream.
    + voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
    +          Set a datatype representation map (DTRM).
    + voidsetEnableBinaryData(boolean enable) + +
    +          Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled.
    + voidsetFragment(boolean isFragment) + +
    +          Set whether the document is a fragment.
    + voidsetGrammarCache(GrammarCache grammarCache) + +
    +          Set the GrammarCache used in decoding EXI streams.
    + voidsetInitialBinaryDataBufferSize(int initialSize) + +
    +           
    + voidsetInputStream(java.io.InputStream istream) + +
    +          Set an input stream from which the encoded stream is read.
    + voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
    +          Set to true to preserve the original string values from the EXI + stream.
    + voidsetValueMaxLength(int valueMaxLength) + +
    +          Set the maximum length of a string that will be stored for reuse in the + String Table.
    + voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
    +          Set the maximum number of values in the String Table.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +EXIDecoder

    +
    +public EXIDecoder()
    +
    +
    Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes. Buffer size is only used when + the EXI stream is encoded with EXI compression. +

    +

    +
    + +

    +EXIDecoder

    +
    +public EXIDecoder(int inflatorBufSize,
    +                  boolean useThreadedInflater)
    +
    +
    Creates an instance of EXIDecoder with the specified inflator buffer + size. When dynamic memory is limited on the target device, reducing + the buffer size can improve performance and avoid runtime errors. Buffer + size is only used when the EXI stream is encoded with EXI compression. +

    +

    +
    Parameters:
    inflatorBufSize - size of the buffer, in bytes.
    useThreadedInflater - Inflater will be run in its own thread if true
    +
    + + + + + + + + +
    +Method Detail
    + +

    +setInputStream

    +
    +public final void setInputStream(java.io.InputStream istream)
    +
    +
    Set an input stream from which the encoded stream is read. +

    +

    +
    Parameters:
    istream - InputSream to be read.
    +
    +
    +
    + +

    +setAlignmentType

    +
    +public final void setAlignmentType(AlignmentType alignmentType)
    +                            throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the bit alignment style of the stream to be decoded. +

    +

    +
    Parameters:
    alignmentType - AlignmentType object +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setFragment

    +
    +public final void setFragment(boolean isFragment)
    +
    +
    Set whether the document is a fragment. Fragments are nonstandard + XML documents with multiple root elements. Default is false. +

    +

    +
    Parameters:
    isFragment - true if the stream is an XML fragment
    +
    +
    +
    + +

    +setGrammarCache

    +
    +public final void setGrammarCache(GrammarCache grammarCache)
    +                           throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the GrammarCache used in decoding EXI streams. +

    +

    +
    Parameters:
    grammarCache - GrammarCache +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setBlockSize

    +
    +public final void setBlockSize(int blockSize)
    +                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

    +

    +
    Parameters:
    blockSize - number of values in each processing block. Default is 1,000,000. +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setValueMaxLength

    +
    +public final void setValueMaxLength(int valueMaxLength)
    +
    +
    Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

    +

    +
    Parameters:
    valueMaxLength - maximum length of entries in the String Table.
    +
    +
    +
    + +

    +setValuePartitionCapacity

    +
    +public final void setValuePartitionCapacity(int valuePartitionCapacity)
    +
    +
    Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

    +

    +
    Parameters:
    valuePartitionCapacity - maximum number of entries in the String Table
    +
    +
    +
    + +

    +setPreserveLexicalValues

    +
    +public final void setPreserveLexicalValues(boolean preserveLexicalValues)
    +                                    throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set to true to preserve the original string values from the EXI + stream. For example, a date string might be converted to a different + format when interpreted by the EXIDecoder. Preserving the lexical values + ensures that the identical strings are restored, and not just their + logical values. +

    +

    +
    Parameters:
    preserveLexicalValues - true to keep original strings intact +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setDatatypeRepresentationMap

    +
    +public final void setDatatypeRepresentationMap(QName[] dtrm,
    +                                               int n_bindings)
    +                                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set a datatype representation map (DTRM). The DTRM allows you to remap + XMLSchema datatypes to EXI datatypes other than their default equivalents. + The map is created using a sequence of Qualified Name pairs that identify + a datatype definition in the XMLSchema namespace followed by the new + corresponding datatype mapping in the EXI namespace. +

    + For example, the following lines map the boolean datatype from XMLSchema + to the integer datatype in EXI. +
    +   QName q1 = new QName("xsd:boolean","http://www.w3.org/2001/XMLSchema");
    +   QName q2 = new QName("exi:integer","http://www.w3.org/2009/exi");
    +   QName[] dtrm = new QName[2];
    +   dtrm = {q1, q2}; // Each mapping requires 2 qualified names.
    +   decoderInstance.setDatatypeRepresentationMap(dtrm, 1); // The array, and the number of pairs (1).
    + 
    +

    +

    +
    Parameters:
    dtrm - a sequence of pairs of datatype QName and datatype representation QName
    n_bindings - the number of QName pairs +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setEnableBinaryData

    +
    +public final void setEnableBinaryData(boolean enable)
    +
    +
    Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled. +

    +

    +
    Parameters:
    enable -
    +
    +
    +
    + +

    +setInitialBinaryDataBufferSize

    +
    +public final void setInitialBinaryDataBufferSize(int initialSize)
    +
    +
    +
    +
    +
    +
    + +

    +processHeader

    +
    +public Scanner processHeader()
    +                      throws java.io.IOException,
    +                             org.openexi.proc.common.EXIOptionsException
    +
    +
    This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream. +

    +

    + +
    Returns:
    Scanner parsable object with header options applied. +
    Throws: +
    java.io.IOException +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html new file mode 100644 index 0000000000..7c90b7d5fb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html @@ -0,0 +1,218 @@ + + + + + + + +EXISchemaResolver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc +
    +Interface EXISchemaResolver

    +
    +
    +
    public interface EXISchemaResolver
    + + +

    +Developers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + +
    +Method Summary
    + GrammarCacheresolveSchema(java.lang.String schemaId, + short grammarOptions) + +
    +          Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream.
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +resolveSchema

    +
    +GrammarCache resolveSchema(java.lang.String schemaId,
    +                           short grammarOptions)
    +
    +
    Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream. +

    +

    +
    Parameters:
    schemaId - the specific schema used to decode an EXI stream
    grammarOptions - the specific grammar options used to decode an EXI stream +
    Returns:
    a GrammarCache object
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html new file mode 100644 index 0000000000..db42f8f040 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html @@ -0,0 +1,357 @@ + + + + + + + +HeaderOptionsOutputType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc +
    +Enum HeaderOptionsOutputType

    +
    +java.lang.Object
    +  extended by java.lang.Enum<HeaderOptionsOutputType>
    +      extended by org.openexi.proc.HeaderOptionsOutputType
    +
    +
    +
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HeaderOptionsOutputType>
    +
    +
    +
    +
    public enum HeaderOptionsOutputType
    extends java.lang.Enum<HeaderOptionsOutputType>
    + + +

    +This enumeration provides three possible settings for header options output. +

    +

      +
    • none – Header options are not included in the header. + The receiver of the document must have precise knowledge of the + settings used to encode the document.

      +
    • +
    • + lessSchemaId – Header options are present. Every + setting used is written out in the header options, except SchemaID. + The receiver of the document must know which schema is used to + encode the document.

      +
    • +
    • + all – All header options are present. Every setting + used is written to the header options, including SchemaID. +
    • +
    +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + +
    +Enum Constant Summary
    all + +
    +           
    lessSchemaId + +
    +           
    none + +
    +           
    +  + + + + + + + + + + + + + + + +
    +Method Summary
    +static HeaderOptionsOutputTypevalueOf(java.lang.String name) + +
    +          Returns the enum constant of this type with the specified name.
    +static HeaderOptionsOutputType[]values() + +
    +          Returns an array containing the constants of this enum type, in +the order they're declared.
    + + + + + + + +
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    + + + + + + + +
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    +  +

    + + + + + + + + +
    +Enum Constant Detail
    + +

    +none

    +
    +public static final HeaderOptionsOutputType none
    +
    +
    +
    +
    +
    + +

    +lessSchemaId

    +
    +public static final HeaderOptionsOutputType lessSchemaId
    +
    +
    +
    +
    +
    + +

    +all

    +
    +public static final HeaderOptionsOutputType all
    +
    +
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +values

    +
    +public static final HeaderOptionsOutputType[] values()
    +
    +
    Returns an array containing the constants of this enum type, in +the order they're declared. This method may be used to iterate +over the constants as follows: +
    +for(HeaderOptionsOutputType c : HeaderOptionsOutputType.values())
    +        System.out.println(c);
    +
    +

    +

    + +
    Returns:
    an array containing the constants of this enum type, in +the order they're declared
    +
    +
    +
    + +

    +valueOf

    +
    +public static HeaderOptionsOutputType valueOf(java.lang.String name)
    +
    +
    Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

    +

    +
    Parameters:
    name - the name of the enum constant to be returned. +
    Returns:
    the enum constant with the specified name +
    Throws: +
    java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html new file mode 100644 index 0000000000..cd6ca90e7d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html @@ -0,0 +1,379 @@ + + + + + + + +AlignmentType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Enum AlignmentType

    +
    +java.lang.Object
    +  extended by java.lang.Enum<AlignmentType>
    +      extended by org.openexi.proc.common.AlignmentType
    +
    +
    +
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<AlignmentType>
    +
    +
    +
    +
    public enum AlignmentType
    extends java.lang.Enum<AlignmentType>
    + + +

    +AlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format. +
    +

    • bitPacked is the default setting. Data are + stored in the fewest number of bits in sequential streams + that cross byte barriers. Conceptually, 8 boolean values + might be stored in a single byte, for example.

    • +
    • byteAligned stores data using EXI tags with + byte barriers intact. Byte-aligned files are useful for + troubleshooting, because the data are often human-readable + when the values are literally encoded as strings. It + is not meant for data transfer, as the file has not been + optimized.

    • +
    • preCompress is a byte-aligned format that arranges + the data into channels. It is intended for use cases where + file compression is part of the transfer process, so as + not to perform the compression step twice.

    • +
    • compress is not a bit alignment in and of itself, + but the Deflate algorithm requires that files be byte-aligned. + When compression is selected, byte-alignment is used, the + data are arranged in channels, and the file is compressed + at the end of processing.
    • +
    +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + +
    +Enum Constant Summary
    bitPacked + +
    +           
    byteAligned + +
    +           
    compress + +
    +           
    preCompress + +
    +           
    +  + + + + + + + + + + + + + + + +
    +Method Summary
    +static AlignmentTypevalueOf(java.lang.String name) + +
    +          Returns the enum constant of this type with the specified name.
    +static AlignmentType[]values() + +
    +          Returns an array containing the constants of this enum type, in +the order they're declared.
    + + + + + + + +
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    + + + + + + + +
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    +  +

    + + + + + + + + +
    +Enum Constant Detail
    + +

    +bitPacked

    +
    +public static final AlignmentType bitPacked
    +
    +
    +
    +
    +
    + +

    +byteAligned

    +
    +public static final AlignmentType byteAligned
    +
    +
    +
    +
    +
    + +

    +preCompress

    +
    +public static final AlignmentType preCompress
    +
    +
    +
    +
    +
    + +

    +compress

    +
    +public static final AlignmentType compress
    +
    +
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +values

    +
    +public static final AlignmentType[] values()
    +
    +
    Returns an array containing the constants of this enum type, in +the order they're declared. This method may be used to iterate +over the constants as follows: +
    +for(AlignmentType c : AlignmentType.values())
    +        System.out.println(c);
    +
    +

    +

    + +
    Returns:
    an array containing the constants of this enum type, in +the order they're declared
    +
    +
    +
    + +

    +valueOf

    +
    +public static AlignmentType valueOf(java.lang.String name)
    +
    +
    Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

    +

    +
    Parameters:
    name - the name of the enum constant to be returned. +
    Returns:
    the enum constant with the specified name +
    Throws: +
    java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html new file mode 100644 index 0000000000..27a32a0db3 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html @@ -0,0 +1,349 @@ + + + + + + + +BinaryDataSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Class BinaryDataSource

    +
    +java.lang.Object
    +  extended by org.openexi.proc.common.BinaryDataSource
    +
    +
    +
    +
    public final class BinaryDataSource
    extends java.lang.Object
    + + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Constructor Summary
    BinaryDataSource() + +
    +           
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + byte[]getByteArray() + +
    +           
    + intgetLength() + +
    +           
    + longgetRemainingBytesCount() + +
    +           
    + intgetStartIndex() + +
    +           
    + booleanhasNext() + +
    +           
    + intnext() + +
    +           
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +BinaryDataSource

    +
    +public BinaryDataSource()
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +getByteArray

    +
    +public final byte[] getByteArray()
    +
    +
    +
    +
    +
    +
    + +

    +getStartIndex

    +
    +public final int getStartIndex()
    +
    +
    +
    +
    +
    +
    + +

    +getLength

    +
    +public final int getLength()
    +
    +
    +
    +
    +
    +
    + +

    +getRemainingBytesCount

    +
    +public final long getRemainingBytesCount()
    +
    +
    +
    +
    +
    +
    + +

    +hasNext

    +
    +public boolean hasNext()
    +
    +
    +
    +
    +
    +
    + +

    +next

    +
    +public int next()
    +         throws java.io.IOException
    +
    +
    + +
    Throws: +
    java.io.IOException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html new file mode 100644 index 0000000000..27d78e0a99 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html @@ -0,0 +1,502 @@ + + + + + + + +EXIOptions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Class EXIOptions

    +
    +java.lang.Object
    +  extended by org.openexi.proc.common.EXIOptions
    +
    +
    +
    +
    public final class EXIOptions
    extends java.lang.Object
    + + +

    +EXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + AlignmentTypegetAlignmentType() + +
    +          Get the bit alignment setting.
    + intgetBlockSize() + +
    +          Returns the number of element and attribute values that are read and processed + as a group.
    + QName[]getDatatypeRepresentationMap() + +
    +          Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI.
    + intgetDatatypeRepresentationMapBindingsCount() + +
    +          Returns the number of Datatype Representation Map QName pairs.
    + booleangetPreserveComments() + +
    +          Returns whether comments are conserved in the EXI Stream.
    + booleangetPreserveDTD() + +
    +          Returns whether the document type definition is conserved in the EXI Stream.
    + booleangetPreserveLexicalValues() + +
    +          Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes.
    + booleangetPreserveNS() + +
    +          Returns whether the namespaces are preserved in the EXI stream.
    + booleangetPreservePIs() + +
    +          Returns whether processing instructions are conserved in the EXI Stream.
    + intgetValueMaxLength() + +
    +          Returns the maximum length in characters of strings that will be included + in the String Table.
    + intgetValuePartitionCapacity() + +
    +          Returns the maximum number of entries in the String Table.
    + booleanisFragment() + +
    +          An XML fragment is a non-compliant XML document with multiple root + elements.
    + booleanisStrict() + +
    +          The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +getAlignmentType

    +
    +public AlignmentType getAlignmentType()
    +
    +
    Get the bit alignment setting. +

    +

    + +
    Returns:
    AlignmentType
    +
    +
    +
    + +

    +isFragment

    +
    +public boolean isFragment()
    +
    +
    An XML fragment is a non-compliant XML document with multiple root + elements. +

    +

    + +
    Returns:
    true if the stream is an XML fragment.
    +
    +
    +
    + +

    +isStrict

    +
    +public boolean isStrict()
    +
    +
    The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema. +

    +

    + +
    Returns:
    true if using strict interpretation of an associated XML Schema.
    +
    +
    +
    + +

    +getPreserveComments

    +
    +public boolean getPreserveComments()
    +
    +
    Returns whether comments are conserved in the EXI Stream. +

    +

    + +
    Returns:
    true if comments are preserved.
    +
    +
    +
    + +

    +getPreservePIs

    +
    +public boolean getPreservePIs()
    +
    +
    Returns whether processing instructions are conserved in the EXI Stream. +

    +

    + +
    Returns:
    true if processing instructions are preserved.
    +
    +
    +
    + +

    +getPreserveDTD

    +
    +public boolean getPreserveDTD()
    +
    +
    Returns whether the document type definition is conserved in the EXI Stream. +

    +

    + +
    Returns:
    true if the document type definition is preserved.
    +
    +
    +
    + +

    +getPreserveNS

    +
    +public boolean getPreserveNS()
    +
    +
    Returns whether the namespaces are preserved in the EXI stream. +

    +

    + +
    Returns:
    true if namespaces are preserved.
    +
    +
    +
    + +

    +getBlockSize

    +
    +public int getBlockSize()
    +
    +
    Returns the number of element and attribute values that are read and processed + as a group. +

    +

    + +
    Returns:
    the current block size. Default is 1,000,000.
    +
    +
    +
    + +

    +getValueMaxLength

    +
    +public int getValueMaxLength()
    +
    +
    Returns the maximum length in characters of strings that will be included + in the String Table. +

    +

    + +
    Returns:
    the maximum length of values added to the String Table. Default is unbounded (-1).
    +
    +
    +
    + +

    +getValuePartitionCapacity

    +
    +public int getValuePartitionCapacity()
    +
    +
    Returns the maximum number of entries in the String Table. +

    +

    + +
    Returns:
    the maximum number of partitions (entries) in the String Table. Default is unbounded (-1).
    +
    +
    +
    + +

    +getPreserveLexicalValues

    +
    +public boolean getPreserveLexicalValues()
    +
    +
    Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes. +

    +

    + +
    Returns:
    true if lexical values are preserved.
    +
    +
    +
    + +

    +getDatatypeRepresentationMapBindingsCount

    +
    +public int getDatatypeRepresentationMapBindingsCount()
    +
    +
    Returns the number of Datatype Representation Map QName pairs. +

    +

    + +
    Returns:
    the number of DTRM bindings.
    +
    +
    +
    + +

    +getDatatypeRepresentationMap

    +
    +public QName[] getDatatypeRepresentationMap()
    +
    +
    Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI. +

    +

    + +
    Returns:
    an array of qualified names comprising a DTRM.
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html new file mode 100644 index 0000000000..396802fbc6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html @@ -0,0 +1,653 @@ + + + + + + + +EventDescription + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Interface EventDescription

    +
    +
    All Known Implementing Classes:
    EventType
    +
    +
    +
    +
    public interface EventDescription
    + + +

    +

    EventDescription provides accessors to the current EXI event data + during the decode process.

    + +

    Note that the content of EventDescription is transient, which means + its content may change when the decoder is asked for access to the + next EXI event data.

    +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Field Summary
    +static byteEVENT_AT + +
    +          Attribute event.
    +static byteEVENT_BLOB + +
    +          BLOB event (content of an element).
    +static byteEVENT_CH + +
    +          Character event (content of an element).
    +static byteEVENT_CM + +
    +          Comment event.
    +static byteEVENT_DTD + +
    +          Document Type Definition event.
    +static byteEVENT_ED + +
    +          End Document event.
    +static byteEVENT_EE + +
    +          End Element event.
    +static byteEVENT_ER + +
    +          Entity Reference event.
    +static byteEVENT_NL + +
    +          Attribute xsi:nil.
    +static byteEVENT_NS + +
    +          Namespace declaration event.
    +static byteEVENT_PI + +
    +          Processing Instruction event.
    +static byteEVENT_SD + +
    +          Start Document event.
    +static byteEVENT_SE + +
    +          Start Element event.
    +static byteEVENT_TP + +
    +          Attribute xsi:type.
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + BinaryDataSourcegetBinaryDataSource() + +
    +          Gets the value of an EVENT_BLOB.
    + CharactersgetCharacters() + +
    +          Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event.
    + bytegetEventKind() + +
    +          Gets the event kind of which instance data this EventDescription is describing.
    + EventTypegetEventType() + +
    +          Returns the EventType from which this event is derived.
    + java.lang.StringgetName() + +
    +          Gets the name of the EXI event.
    + java.lang.StringgetPrefix() + +
    +          Gets the namespace prefix of the event.
    + java.lang.StringgetURI() + +
    +          Gets the URI of the EXI event.
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +EVENT_SD

    +
    +static final byte EVENT_SD
    +
    +
    Start Document event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_ED

    +
    +static final byte EVENT_ED
    +
    +
    End Document event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_SE

    +
    +static final byte EVENT_SE
    +
    +
    Start Element event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_AT

    +
    +static final byte EVENT_AT
    +
    +
    Attribute event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_TP

    +
    +static final byte EVENT_TP
    +
    +
    Attribute xsi:type. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_NL

    +
    +static final byte EVENT_NL
    +
    +
    Attribute xsi:nil. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_CH

    +
    +static final byte EVENT_CH
    +
    +
    Character event (content of an element). +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_EE

    +
    +static final byte EVENT_EE
    +
    +
    End Element event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_NS

    +
    +static final byte EVENT_NS
    +
    +
    Namespace declaration event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_PI

    +
    +static final byte EVENT_PI
    +
    +
    Processing Instruction event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_CM

    +
    +static final byte EVENT_CM
    +
    +
    Comment event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_ER

    +
    +static final byte EVENT_ER
    +
    +
    Entity Reference event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_DTD

    +
    +static final byte EVENT_DTD
    +
    +
    Document Type Definition event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +EVENT_BLOB

    +
    +static final byte EVENT_BLOB
    +
    +
    BLOB event (content of an element). +

    +

    +
    See Also:
    Constant Field Values
    +
    + + + + + + + + +
    +Method Detail
    + +

    +getEventKind

    +
    +byte getEventKind()
    +
    +
    Gets the event kind of which instance data this EventDescription is describing. +

    +

    + +
    Returns:
    a byte representing the event kind.
    +
    +
    +
    + +

    +getURI

    +
    +java.lang.String getURI()
    +
    +
    Gets the URI of the EXI event. +

    +

    + +
    Returns:
    the URI as a String.
    +
    +
    +
    + +

    +getName

    +
    +java.lang.String getName()
    +
    +
    Gets the name of the EXI event. +

    +

    + +
    Returns:
    the name of the event as a String.
    +
    +
    +
    + +

    +getPrefix

    +
    +java.lang.String getPrefix()
    +
    +
    Gets the namespace prefix of the event. +

    +

    + +
    Returns:
    the prefix as a String.
    +
    +
    +
    + +

    +getCharacters

    +
    +Characters getCharacters()
    +
    +
    Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event. +

    +

    + +
    Returns:
    a Characters of the corresponding value
    +
    +
    +
    + +

    +getBinaryDataSource

    +
    +BinaryDataSource getBinaryDataSource()
    +
    +
    Gets the value of an EVENT_BLOB. +

    +

    + +
    Returns:
    a BinaryData of the corresponding value
    +
    +
    +
    + +

    +getEventType

    +
    +EventType getEventType()
    +
    +
    Returns the EventType from which this event is derived. +

    +

    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html new file mode 100644 index 0000000000..aaef0c43ed --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html @@ -0,0 +1,829 @@ + + + + + + + +EventType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Class EventType

    +
    +java.lang.Object
    +  extended by org.openexi.proc.common.EventCode
    +      extended by org.openexi.proc.common.EventType
    +
    +
    +
    All Implemented Interfaces:
    EventDescription
    +
    +
    +
    +
    public class EventType
    extends org.openexi.proc.common.EventCode
    implements EventDescription
    + + +

    +EventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Field Summary
    +static byteITEM_AT + +
    +          Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences.
    +static byteITEM_AT_WC_ANY_UNTYPED + +
    +          Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded.
    +static byteITEM_CH + +
    +          Event type for a Character event (character events store values as strings).
    +static byteITEM_CM + +
    +          Event type for a Comment.
    +static byteITEM_DTD + +
    +          Event type for a Document Type Definition.
    +static byteITEM_ED + +
    +          Event type for End of Document.
    +static byteITEM_EE + +
    +          Event type for End of Element.
    +static byteITEM_ER + +
    +          Event type for an Entity Reference.
    +static byteITEM_NS + +
    +          Event type for a Namespace declaration.
    +static byteITEM_PI + +
    +          Event type for a Processing Instruction.
    +static byteITEM_SC + +
    +          Self-contained items are not supported in this release of OpenEXI.
    +static byteITEM_SCHEMA_AT + +
    +          Event type for AttributeUse that matches an attribute event with + a valid value.
    +static byteITEM_SCHEMA_AT_INVALID_VALUE + +
    +          Event type for AttributeUse that matches an attribute event with an + invalid value.
    +static byteITEM_SCHEMA_AT_WC_ANY + +
    +          Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied.
    +static byteITEM_SCHEMA_AT_WC_NS + +
    +          Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied.
    +static byteITEM_SCHEMA_CH + +
    +          Event type for a defined Character event in an EXI stream processed + using a schema.
    +static byteITEM_SCHEMA_CH_MIXED + +
    +          Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema.
    +static byteITEM_SCHEMA_NIL + +
    +          Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string.
    +static byteITEM_SCHEMA_TYPE + +
    +          Special Attribute that describes a data type for the associated + element.
    +static byteITEM_SCHEMA_WC_ANY + +
    +          Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied.
    +static byteITEM_SCHEMA_WC_NS + +
    +          Event type for an element defined in a namespace in an EXI stream + processed using a schema.
    +static byteITEM_SD + +
    +          Event type for Start Document.
    +static byteITEM_SE + +
    +          Event type for Start Element.
    +static byteITEM_SE_WC + +
    +          Wildcard event type for an element.
    + java.lang.Stringname + +
    +          Local name of event type definition.
    + java.lang.Stringuri + +
    +          URI of event type definition.
    + + + + + + + +
    Fields inherited from class org.openexi.proc.common.EventCode
    EVENT_CODE_DEPTH_ONE, EVENT_CODE_DEPTH_THREE, EVENT_CODE_DEPTH_TWO, ITEM_TUPLE, itemType, parent, position
    + + + + + + + +
    Fields inherited from interface org.openexi.proc.common.EventDescription
    EVENT_AT, EVENT_BLOB, EVENT_CH, EVENT_CM, EVENT_DTD, EVENT_ED, EVENT_EE, EVENT_ER, EVENT_NL, EVENT_NS, EVENT_PI, EVENT_SD, EVENT_SE, EVENT_TP
    +  + + + + + + + +
    +Method Summary
    + + + + + + + +
    Methods inherited from class org.openexi.proc.common.EventCode
    setParentalContext
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    + + + + + + + +
    Methods inherited from interface org.openexi.proc.common.EventDescription
    getBinaryDataSource, getCharacters, getEventKind, getEventType, getName, getPrefix, getURI
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +ITEM_PI

    +
    +public static final byte ITEM_PI
    +
    +
    Event type for a Processing Instruction. Value is 0. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_CM

    +
    +public static final byte ITEM_CM
    +
    +
    Event type for a Comment. +
    Value is 1. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_ER

    +
    +public static final byte ITEM_ER
    +
    +
    Event type for an Entity Reference. +
    Value is 2. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_CH

    +
    +public static final byte ITEM_CH
    +
    +
    Event type for a Character event (character events store values as strings). +
    Value is 3. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_ED

    +
    +public static final byte ITEM_ED
    +
    +
    Event type for End of Document. +
    Value is 4. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SE_WC

    +
    +public static final byte ITEM_SE_WC
    +
    +
    Wildcard event type for an element. OpenEXI will first attempt + to find a corresponding element name in the schema, if present. If + no definition is available, it is given this tag. +
    Value is 5. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SC

    +
    +public static final byte ITEM_SC
    +
    +
    Self-contained items are not supported in this release of OpenEXI. + Event type for self-contained item. +
    Value is 6. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_NS

    +
    +public static final byte ITEM_NS
    +
    +
    Event type for a Namespace declaration.
    +
    Value is 7. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_AT_WC_ANY_UNTYPED

    +
    +public static final byte ITEM_AT_WC_ANY_UNTYPED
    +
    +
    Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded. + This is the "catch-all" for Attributes that do not match any of the + other Event Types in an EXI stream processed using Default options. +
    Value is 8. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_EE

    +
    +public static final byte ITEM_EE
    +
    +
    Event type for End of Element. +
    Value is 9. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_DTD

    +
    +public static final byte ITEM_DTD
    +
    +
    Event type for a Document Type Definition. +
    Value is 10. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SE

    +
    +public static final byte ITEM_SE
    +
    +
    Event type for Start Element. +
    Value is 11. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_AT

    +
    +public static final byte ITEM_AT
    +
    +
    Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences. +
    Value is 12. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SD

    +
    +public static final byte ITEM_SD
    +
    +
    Event type for Start Document. +
    Value is 13. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_WC_ANY

    +
    +public static final byte ITEM_SCHEMA_WC_ANY
    +
    +
    Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied. +
    Value is 14. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_WC_NS

    +
    +public static final byte ITEM_SCHEMA_WC_NS
    +
    +
    Event type for an element defined in a namespace in an EXI stream + processed using a schema. +
    Value is 15. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_AT

    +
    +public static final byte ITEM_SCHEMA_AT
    +
    +
    Event type for AttributeUse that matches an attribute event with + a valid value. +
    Value is 16. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_AT_WC_ANY

    +
    +public static final byte ITEM_SCHEMA_AT_WC_ANY
    +
    +
    Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied. +
    Value is 17. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_AT_WC_NS

    +
    +public static final byte ITEM_SCHEMA_AT_WC_NS
    +
    +
    Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied. +
    Value is 18. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_CH

    +
    +public static final byte ITEM_SCHEMA_CH
    +
    +
    Event type for a defined Character event in an EXI stream processed + using a schema. +
    Value is 19. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_CH_MIXED

    +
    +public static final byte ITEM_SCHEMA_CH_MIXED
    +
    +
    Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema. +
    Value is 20. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_NIL

    +
    +public static final byte ITEM_SCHEMA_NIL
    +
    +
    Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string. +
    Value is 21. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_TYPE

    +
    +public static final byte ITEM_SCHEMA_TYPE
    +
    +
    Special Attribute that describes a data type for the associated + element. For example, the schema might define a String value, but + the XML document being processed can declare that the element contains a + date-time field. +
    Value is 22. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +ITEM_SCHEMA_AT_INVALID_VALUE

    +
    +public static final byte ITEM_SCHEMA_AT_INVALID_VALUE
    +
    +
    Event type for AttributeUse that matches an attribute event with an + invalid value. +
    Value is 23. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +uri

    +
    +public final java.lang.String uri
    +
    +
    URI of event type definition. +

    +

    +
    +
    +
    + +

    +name

    +
    +public final java.lang.String name
    +
    +
    Local name of event type definition. +

    +

    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html new file mode 100644 index 0000000000..7ea6e13a8c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html @@ -0,0 +1,528 @@ + + + + + + + +GrammarOptions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Class GrammarOptions

    +
    +java.lang.Object
    +  extended by org.openexi.proc.common.GrammarOptions
    +
    +
    +
    +
    public final class GrammarOptions
    extends java.lang.Object
    + + +

    +GrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded. +

    + Values are set using binary switch values (represented as short integers). +

    + If no options have been set, the value is 0 (this is an temporary internal + value, rather than a valid setting). +

    + If an XSD is available, and the file to be processed is 100% compatible with the XSD, choosing + STRICT_OPTIONS (1) provides the best performance. No other options can be set + when files are encoded or decoded in strict mode. +

    + The DEFAULT_OPTIONS setting is 2. The following table lists all of the options and their values. +

    + + + + + + + + +
    ConstantValue
    STRICT_OPTIONS1
    DEFAULT_OPTIONS2
    + ADD_NS4 +
    + ADD_SCN/A* +
    + ADD_DTD16 +
    + ADD_CM32 +
    + ADD_PI64 +
    *The self-contained option is not supported in this release. +
    +

    + The value of DEFAULT_OPTIONS is 2. When you pass the options variable to an add[??] method, + the binary switch value is added to the current value of the options variable. + The sum of all additional switches becomes a concise list of the selected options. +

    + For example, if you preserve comments and processing instructions, the total is + 98 (2 + 32 + 64). The bitwise options are set correctly, because there is one and only one + combination of options that sums up to 98. +

    + If your application uses the same options every time, you can hard code the numeric value + as a short integer and use it to create your GrammarCache. For example: +

    + GrammarCache gc = new GrammarCache((EXISchema)null,98);
    + 
    + Be careful to use the correct numeric value, to avoid unexpected results. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + +
    +Field Summary
    +static shortDEFAULT_OPTIONS + +
    +          Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded.
    +static shortOPTIONS_UNUSED + +
    +          OPTIONS_UNUSED is an internal value.
    +static shortSTRICT_OPTIONS + +
    +          Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded.
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    +static shortaddCM(short options) + +
    +          Sets Preserve Comments to true.
    +static shortaddDTD(short options) + +
    +          Sets Preserve Document Type Definition to true.
    +static shortaddNS(short options) + +
    +          Sets Preserve Namespaces to true.
    +static shortaddPI(short options) + +
    +          Sets Preserve Processing Instructions to true.
    +static booleanhasCM(short options) + +
    +          Returns true if Preserve Comments is true.
    +static booleanhasDTD(short options) + +
    +          Returns true if Preserve Document Type Definition is true.
    +static booleanhasNS(short options) + +
    +          Returns true if Preserve Namespaces is true.
    +static booleanhasPI(short options) + +
    +          Returns true if Preserve Processing Instructions is true.
    +static booleanisPermitDeviation(short options) + +
    +          Returns true if DEFAULT_OPTIONS is set to true.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +OPTIONS_UNUSED

    +
    +public static final short OPTIONS_UNUSED
    +
    +
    OPTIONS_UNUSED is an internal value. + It indicates that the grammar options value has not yet been set. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +DEFAULT_OPTIONS

    +
    +public static final short DEFAULT_OPTIONS
    +
    +
    Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +STRICT_OPTIONS

    +
    +public static final short STRICT_OPTIONS
    +
    +
    Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded. When + STRICT_OPTIONS is set, all other Grammar Options are ignored. +

    +

    +
    See Also:
    Constant Field Values
    +
    + + + + + + + + +
    +Method Detail
    + +

    +isPermitDeviation

    +
    +public static boolean isPermitDeviation(short options)
    +
    +
    Returns true if DEFAULT_OPTIONS is set to true. +

    +

    +
    +
    +
    +
    + +

    +hasNS

    +
    +public static boolean hasNS(short options)
    +
    +
    Returns true if Preserve Namespaces is true. +

    +

    +
    +
    +
    +
    + +

    +hasDTD

    +
    +public static boolean hasDTD(short options)
    +
    +
    Returns true if Preserve Document Type Definition is true. +

    +

    +
    +
    +
    +
    + +

    +hasCM

    +
    +public static boolean hasCM(short options)
    +
    +
    Returns true if Preserve Comments is true. +

    +

    +
    +
    +
    +
    + +

    +hasPI

    +
    +public static boolean hasPI(short options)
    +
    +
    Returns true if Preserve Processing Instructions is true. +

    +

    +
    +
    +
    +
    + +

    +addNS

    +
    +public static short addNS(short options)
    +
    +
    Sets Preserve Namespaces to true. (Adds 4 to the options value.) +

    +

    + +
    Returns:
    the new options short integer value
    +
    +
    +
    + +

    +addDTD

    +
    +public static short addDTD(short options)
    +
    +
    Sets Preserve Document Type Definition to true. (Adds 16 to the options value.) +

    +

    + +
    Returns:
    the new options short integer value
    +
    +
    +
    + +

    +addCM

    +
    +public static short addCM(short options)
    +
    +
    Sets Preserve Comments to true. (Adds 32 to the options value.) +

    +

    + +
    Returns:
    the new options short integer value
    +
    +
    +
    + +

    +addPI

    +
    +public static short addPI(short options)
    +
    +
    Sets Preserve Processing Instructions to true. (Adds 64 to the options value.) +

    +

    + +
    Returns:
    the new options short integer value
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html new file mode 100644 index 0000000000..61485ec734 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html @@ -0,0 +1,346 @@ + + + + + + + +QName + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.common +
    +Class QName

    +
    +java.lang.Object
    +  extended by org.openexi.proc.common.QName
    +
    +
    +
    +
    public final class QName
    extends java.lang.Object
    + + +

    +QName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + +
    +Field Summary
    + java.lang.StringlocalName + +
    +          Local name of the datatype.
    + java.lang.StringnamespaceName + +
    +          If namespaceName is null, this indicates a failure of + namespace-prefix binding.
    +  + + + + + + + + + + + + + +
    +Constructor Summary
    QName() + +
    +           
    QName(java.lang.String qname, + java.lang.String uri) + +
    +          Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name.
    +  + + + + + + + + + + + +
    +Method Summary
    + booleanequals(java.lang.Object obj) + +
    +           
    + + + + + + + +
    Methods inherited from class java.lang.Object
    getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +namespaceName

    +
    +public java.lang.String namespaceName
    +
    +
    If namespaceName is null, this indicates a failure of + namespace-prefix binding. No namespace binding for the + unprefixed QName is indicated by an empty namespace + name "". +

    +

    +
    +
    +
    + +

    +localName

    +
    +public java.lang.String localName
    +
    +
    Local name of the datatype. +

    +

    +
    +
    + + + + + + + + +
    +Constructor Detail
    + +

    +QName

    +
    +public QName()
    +
    +
    +
    + +

    +QName

    +
    +public QName(java.lang.String qname,
    +             java.lang.String uri)
    +
    +
    Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name. +

    +

    +
    Parameters:
    qname - literal qualified name in its entirety
    uri - namespace name (nullable) of the QName
    See Also:
    http://www.w3.org/TR/xml-names/#ns-qualnames
    +
    + + + + + + + + +
    +Method Detail
    + +

    +equals

    +
    +public boolean equals(java.lang.Object obj)
    +
    +
    +
    Overrides:
    equals in class java.lang.Object
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html new file mode 100644 index 0000000000..fcab6106d9 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html @@ -0,0 +1,63 @@ + + + + + + + +org.openexi.proc.common + + + + + + + + + + + +org.openexi.proc.common + + + + +
    +Interfaces  + +
    +EventDescription
    + + + + + + +
    +Classes  + +
    +BinaryDataSource +
    +EventType +
    +EXIOptions +
    +GrammarOptions +
    +QName
    + + + + + + +
    +Enums  + +
    +AlignmentType
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html new file mode 100644 index 0000000000..c4f3e1c6fe --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html @@ -0,0 +1,235 @@ + + + + + + + +org.openexi.proc.common + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.proc.common +

    + + + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). +

    +See: +
    +          Description +

    + + + + + + + + + +
    +Interface Summary
    EventDescriptionEventDescription provides accessors to the current EXI event data + during the decode process.
    +  + +

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Class Summary
    BinaryDataSource 
    EventTypeEventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification.
    EXIOptionsEXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream.
    GrammarOptionsGrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded.
    QNameQName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation.
    +  + +

    + + + + + + + + + +
    +Enum Summary
    AlignmentTypeAlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format.
    +  + +

    +

    +Package org.openexi.proc.common Description +

    + +

    + + + + + +
    +

    The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). +

    +
    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html new file mode 100644 index 0000000000..778ae7c56b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html @@ -0,0 +1,166 @@ + + + + + + + +org.openexi.proc.common Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.proc.common +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    + +

    +Interface Hierarchy +

    + +

    +Enum Hierarchy +

    +
      +
    • java.lang.Object
        +
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
      +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html new file mode 100644 index 0000000000..55b03fa67b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html @@ -0,0 +1,362 @@ + + + + + + + +GrammarCache + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.grammars +
    +Class GrammarCache

    +
    +java.lang.Object
    +  extended by org.openexi.proc.grammars.GrammarCache
    +
    +
    +
    All Implemented Interfaces:
    org.openexi.proc.common.IGrammarCache
    +
    +
    +
    +
    public final class GrammarCache
    extends java.lang.Object
    implements org.openexi.proc.common.IGrammarCache
    + + +

    +A GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options. + The GrammarCache is passed as an argument to + the EXIReader and Transmogrifier prior to processing an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Field Summary
    + shortgrammarOptions + +
    +          Short integer that encapsulates GrammarOptions + for the EXI stream.
    +  + + + + + + + + + + + + + + + + +
    +Constructor Summary
    GrammarCache(EXISchema schema) + +
    +          Creates an instance of GrammarCache informed by a schema with default + grammar options.
    GrammarCache(EXISchema schema, + short grammarOptions) + +
    +          Creates an instance of GrammarCache informed by a schema with the + specified grammar options.
    GrammarCache(short grammarOptions) + +
    +          Creates an instance of GrammarCache with the specified grammar options.
    +  + + + + + + + + + + + +
    +Method Summary
    + EXISchemagetEXISchema() + +
    +          Gets the compiled EXI Schema.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    + + + + + + + +
    Methods inherited from interface org.openexi.proc.common.IGrammarCache
    getElementGrammarUse
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +grammarOptions

    +
    +public final short grammarOptions
    +
    +
    Short integer that encapsulates GrammarOptions + for the EXI stream. +

    +

    +
    +
    + + + + + + + + +
    +Constructor Detail
    + +

    +GrammarCache

    +
    +public GrammarCache(EXISchema schema)
    +
    +
    Creates an instance of GrammarCache informed by a schema with default + grammar options. +

    +

    +
    Parameters:
    EXISchema - compiled schema
    +
    +
    + +

    +GrammarCache

    +
    +public GrammarCache(short grammarOptions)
    +
    +
    Creates an instance of GrammarCache with the specified grammar options. +

    +

    +
    Parameters:
    grammarOptions - integer value that represents a grammar option configuration
    +
    +
    + +

    +GrammarCache

    +
    +public GrammarCache(EXISchema schema,
    +                    short grammarOptions)
    +
    +
    Creates an instance of GrammarCache informed by a schema with the + specified grammar options. +

    +

    +
    Parameters:
    EXISchema - compiled schema
    grammarOptions - integer value that represents a grammar option configuration
    +
    + + + + + + + + +
    +Method Detail
    + +

    +getEXISchema

    +
    +public EXISchema getEXISchema()
    +
    +
    Gets the compiled EXI Schema. +

    +

    +
    Specified by:
    getEXISchema in interface org.openexi.proc.common.IGrammarCache
    +
    +
    + +
    Returns:
    an EXI schema.
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html new file mode 100644 index 0000000000..5eb44a3df0 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html @@ -0,0 +1,33 @@ + + + + + + + +org.openexi.proc.grammars + + + + + + + + + + + +org.openexi.proc.grammars + + + + +
    +Classes  + +
    +GrammarCache
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html new file mode 100644 index 0000000000..3ae5291fc4 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html @@ -0,0 +1,184 @@ + + + + + + + +org.openexi.proc.grammars + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.proc.grammars +

    + + + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. +

    +See: +
    +          Description +

    + + + + + + + + + +
    +Class Summary
    GrammarCacheA GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options.
    +  + +

    +

    +Package org.openexi.proc.grammars Description +

    + +

    + + + + + +
    +

    The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. +

    +
    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html new file mode 100644 index 0000000000..542514937f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html @@ -0,0 +1,149 @@ + + + + + + + +org.openexi.proc.grammars Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.proc.grammars +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    +
      +
    • java.lang.Object
        +
      • org.openexi.proc.grammars.GrammarCache (implements org.openexi.proc.common.IGrammarCache) +
      +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html new file mode 100644 index 0000000000..0f9e531c25 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html @@ -0,0 +1,171 @@ + + + + + + + +BinaryDataSink + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.io +
    +Interface BinaryDataSink

    +
    +
    +
    public interface BinaryDataSink
    + + +

    +BinaryDataSink represents a sink that accepts successive chunks of binary data. +

    + +

    +

    + +
    +
    + +

    + +

    + +


    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html new file mode 100644 index 0000000000..7b7e75e920 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html @@ -0,0 +1,259 @@ + + + + + + + +CharacterBuffer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.io +
    +Class CharacterBuffer

    +
    +java.lang.Object
    +  extended by org.openexi.proc.io.CharacterBuffer
    +
    +
    +
    +
    public final class CharacterBuffer
    extends java.lang.Object
    + + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Field Summary
    +static intBUFSIZE_DEFAULT + +
    +           
    +  + + + + + + + + + + +
    +Constructor Summary
    CharacterBuffer(int bufSize) + +
    +           
    +  + + + + + + + +
    +Method Summary
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +BUFSIZE_DEFAULT

    +
    +public static final int BUFSIZE_DEFAULT
    +
    +
    +
    See Also:
    Constant Field Values
    +
    + + + + + + + + +
    +Constructor Detail
    + +

    +CharacterBuffer

    +
    +public CharacterBuffer(int bufSize)
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html new file mode 100644 index 0000000000..82b51284e6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html @@ -0,0 +1,354 @@ + + + + + + + +Scanner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.proc.io +
    +Class Scanner

    +
    +java.lang.Object
    +  extended by org.openexi.proc.grammars.Apparatus
    +      extended by org.openexi.proc.io.Scanner
    +
    +
    +
    +
    public abstract class Scanner
    extends org.openexi.proc.grammars.Apparatus
    + + +

    +The Scanner class provides methods for scanning events + in the body of an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + +
    +Field Summary
    + + + + + + + +
    Fields inherited from class org.openexi.proc.grammars.Apparatus
    CODEC_BASE64BINARY, CODEC_BOOLEAN, CODEC_DATE, CODEC_DATETIME, CODEC_DECIMAL, CODEC_DOUBLE, CODEC_ENUMERATION, CODEC_GDAY, CODEC_GMONTH, CODEC_GMONTHDAY, CODEC_GYEAR, CODEC_GYEARMONTH, CODEC_HEXBINARY, CODEC_INTEGER, CODEC_LEXICAL, CODEC_LIST, CODEC_STRING, CODEC_TIME, currentState, eventTypesWorkSpace, schema, stringTable
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + voidcloseInputStream() + +
    +          Close the input stream.
    + EXIOptionsgetHeaderOptions() + +
    +          Returns the EXI Header options from the header of the + EXI stream, if present.
    +abstract  EventDescriptionnextEvent() + +
    +          Gets the next event from the EXI stream.
    +abstract  voidsetBinaryChunkSize(int chunkSize) + +
    +          Binary values are read in chunks of the specified size when the + use of binary data is enabled.
    + voidsetSchema(EXISchema schema, + QName[] dtrm, + int n_bindings) + +
    +           
    + + + + + + + +
    Methods inherited from class org.openexi.proc.grammars.Apparatus
    attribute, characters, endDocument, endElement, getAlignmentType, getNextEventCodes, getNextEventTypes, getPreserveLexicalValues, miscContent, nillify, reset, setPreserveLexicalValues, setStringTable, startDocument, startElement, startWildcardElement, undeclaredCharacters, wildcardAttribute, xsitp
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +setSchema

    +
    +public void setSchema(EXISchema schema,
    +                      QName[] dtrm,
    +                      int n_bindings)
    +
    +
    +
    Overrides:
    setSchema in class org.openexi.proc.grammars.Apparatus
    +
    +
    +
    +
    +
    +
    + +

    +nextEvent

    +
    +public abstract EventDescription nextEvent()
    +                                    throws java.io.IOException
    +
    +
    Gets the next event from the EXI stream. +

    +

    + +
    Returns:
    EXIEvent +
    Throws: +
    java.io.IOException
    +
    +
    +
    + +

    +closeInputStream

    +
    +public void closeInputStream()
    +                      throws java.io.IOException
    +
    +
    Close the input stream. +

    +

    + +
    Throws: +
    java.io.IOException
    +
    +
    +
    + +

    +getHeaderOptions

    +
    +public final EXIOptions getHeaderOptions()
    +
    +
    Returns the EXI Header options from the header of the + EXI stream, if present. Otherwise, returns null. +

    +

    + +
    Returns:
    EXIOptions or null if no header options are set.
    +
    +
    +
    + +

    +setBinaryChunkSize

    +
    +public abstract void setBinaryChunkSize(int chunkSize)
    +
    +
    Binary values are read in chunks of the specified size when the + use of binary data is enabled. +

    +

    +
    Parameters:
    chunkSize -
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html new file mode 100644 index 0000000000..fe7bf70760 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html @@ -0,0 +1,46 @@ + + + + + + + +org.openexi.proc.io + + + + + + + + + + + +org.openexi.proc.io + + + + +
    +Interfaces  + +
    +BinaryDataSink
    + + + + + + +
    +Classes  + +
    +CharacterBuffer +
    +Scanner
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html new file mode 100644 index 0000000000..42831b8609 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html @@ -0,0 +1,205 @@ + + + + + + + +org.openexi.proc.io + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.proc.io +

    + + + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. +

    +See: +
    +          Description +

    + + + + + + + + + +
    +Interface Summary
    BinaryDataSinkBinaryDataSink represents a sink that accepts successive chunks of binary data.
    +  + +

    + + + + + + + + + + + + + +
    +Class Summary
    CharacterBuffer 
    ScannerThe Scanner class provides methods for scanning events + in the body of an EXI stream.
    +  + +

    +

    +Package org.openexi.proc.io Description +

    + +

    + + + + + +
    +

    The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. +

    +

    +The IO package also contains the non-public Scriber class, which is used by the Transmogrifier to encode EXI streams (which is why this is called the IO package). Scriber settings are fully implemented in the Transmogrifier. +

    +
    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html new file mode 100644 index 0000000000..b0cbe124ae --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html @@ -0,0 +1,155 @@ + + + + + + + +org.openexi.proc.io Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.proc.io +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    +
      +
    • java.lang.Object +
    +

    +Interface Hierarchy +

    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html new file mode 100644 index 0000000000..31406d379f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html @@ -0,0 +1,55 @@ + + + + + + + +org.openexi.proc + + + + + + + + + + + +org.openexi.proc + + + + +
    +Interfaces  + +
    +EXISchemaResolver
    + + + + + + +
    +Classes  + +
    +EXIDecoder
    + + + + + + +
    +Enums  + +
    +HeaderOptionsOutputType
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html new file mode 100644 index 0000000000..957e54a056 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html @@ -0,0 +1,219 @@ + + + + + + + +org.openexi.proc + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.proc +

    + + + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. +

    +See: +
    +          Description +

    + + + + + + + + + +
    +Interface Summary
    EXISchemaResolverDevelopers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream.
    +  + +

    + + + + + + + + + +
    +Class Summary
    EXIDecoderEXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream.
    +  + +

    + + + + + + + + + +
    +Enum Summary
    HeaderOptionsOutputTypeThis enumeration provides three possible settings for header options output.
    +  + +

    +

    +Package org.openexi.proc Description +

    + +

    + + + + + +
    +

    The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. +EXIDecoder uses the org.openexi.proc.io.Scanner to parse EXI streams into a sequence of XML events. org.openexi.sax.EXIReader wraps EXIDecoder to provide a SAX interface for accessing the XML content. +

    +

    +The EXISchemaResolver interface can be implemented and used to add a hint in the EXI header to help EXIDecoder locate the EXISchema. +

    +

    The HeaderOptionsOutputType enumerator is used to set the header output options in the Transmogrifier.

    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html new file mode 100644 index 0000000000..3bf180e361 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html @@ -0,0 +1,163 @@ + + + + + + + +org.openexi.proc Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.proc +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    + +

    +Interface Hierarchy +

    + +

    +Enum Hierarchy +

    +
      +
    • java.lang.Object
        +
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
      +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html new file mode 100644 index 0000000000..b73a833559 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html @@ -0,0 +1,267 @@ + + + + + + + +BinaryDataHandler + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Interface BinaryDataHandler

    +
    +
    All Known Subinterfaces:
    SAXTransmogrifier
    +
    +
    +
    +
    public interface BinaryDataHandler
    + + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + voidbinaryData(byte[] byteArray, + int offset, + int length, + BinaryDataSink binaryDataSink) + +
    +          Writes a binary value where the schema expects a binary value.
    + voidendBinaryData(BinaryDataSink binaryDataSink) + +
    +          Mark the end of a binary value.
    + BinaryDataSinkstartBinaryData(long totalSize) + +
    +          Mark the start of a binary value.
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +startBinaryData

    +
    +BinaryDataSink startBinaryData(long totalSize)
    +                               throws org.xml.sax.SAXException
    +
    +
    Mark the start of a binary value. +

    +

    + +
    Throws: +
    org.xml.sax.SAXException
    +
    +
    +
    + +

    +binaryData

    +
    +void binaryData(byte[] byteArray,
    +                int offset,
    +                int length,
    +                BinaryDataSink binaryDataSink)
    +                throws org.xml.sax.SAXException
    +
    +
    Writes a binary value where the schema expects a binary value. +

    +

    + +
    Throws: +
    org.xml.sax.SAXException
    +
    +
    +
    + +

    +endBinaryData

    +
    +void endBinaryData(BinaryDataSink binaryDataSink)
    +                   throws org.xml.sax.SAXException
    +
    +
    Mark the end of a binary value. +

    +

    + +
    Throws: +
    org.xml.sax.SAXException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html new file mode 100644 index 0000000000..228aa7506e --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html @@ -0,0 +1,645 @@ + + + + + + + +EXIReader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Class EXIReader

    +
    +java.lang.Object
    +  extended by org.openexi.sax.ReaderSupport
    +      extended by org.openexi.sax.EXIReader
    +
    +
    +
    All Implemented Interfaces:
    org.xml.sax.Attributes, org.xml.sax.XMLReader
    +
    +
    +
    +
    public final class EXIReader
    extends ReaderSupport
    implements org.xml.sax.XMLReader
    + + +

    +EXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Constructor Summary
    EXIReader() + +
    +           
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + booleangetFeature(java.lang.String name) + +
    +          Get features for the SAX parser.
    + java.lang.ObjectgetProperty(java.lang.String name) + +
    +          Use to retrieve the name of the lexical handler, currently the only + property recognized by this class.
    + voidsetAlignmentType(AlignmentType alignmentType) + +
    +          Set the bit alignment style used to compile the EXI input stream.
    + voidsetBlockSize(int blockSize) + +
    +          Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream.
    + voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
    +          Set a datatype representation map.
    + voidsetEXISchemaResolver(EXISchemaResolver schemaResolver) + +
    +          Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream.
    + voidsetFeature(java.lang.String name, + boolean value) + +
    +          Set features for the SAX parser.
    + voidsetFragment(boolean isFragment) + +
    +          Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements).
    + voidsetLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler) + +
    +          Set a SAX lexical handler to receive SAX lexical events.
    + voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
    +          Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true.
    + voidsetProperty(java.lang.String name, + java.lang.Object value) + +
    +          This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers.
    + voidsetValueMaxLength(int valueMaxLength) + +
    +          Set the maximum length of a string that will be stored for reuse in the + String Table.
    + voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
    +          Set the maximum number of values in the String Table.
    + + + + + + + +
    Methods inherited from class org.openexi.sax.ReaderSupport
    getContentHandler, setContentHandler, setGrammarCache
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    + + + + + + + +
    Methods inherited from interface org.xml.sax.XMLReader
    getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler
    + + + + + + + +
    Methods inherited from interface org.xml.sax.Attributes
    getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +EXIReader

    +
    +public EXIReader()
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +setProperty

    +
    +public final void setProperty(java.lang.String name,
    +                              java.lang.Object value)
    +                       throws org.xml.sax.SAXNotRecognizedException
    +
    +
    This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers. The only property + supported is:
    http://xml.org/sax/properties/lexical-handler
    +

    +

    +
    Specified by:
    setProperty in interface org.xml.sax.XMLReader
    +
    +
    +
    Parameters:
    name - must equal "http://xml.org/sax/properties/lexical-handler"
    value - an org.xml.sax.ext.LexicalHandler object +
    Throws: +
    org.xml.sax.SAXNotRecognizedException
    +
    +
    +
    + +

    +getProperty

    +
    +public final java.lang.Object getProperty(java.lang.String name)
    +                                   throws org.xml.sax.SAXNotRecognizedException
    +
    +
    Use to retrieve the name of the lexical handler, currently the only + property recognized by this class. Pass the String + "http://xml.org/sax/properties/lexical-handler" as the name. +

    +

    +
    Specified by:
    getProperty in interface org.xml.sax.XMLReader
    +
    +
    + +
    Returns:
    String name of the lexical handler +
    Throws: +
    org.xml.sax.SAXNotRecognizedException
    +
    +
    +
    + +

    +setFeature

    +
    +public final void setFeature(java.lang.String name,
    +                             boolean value)
    +                      throws org.xml.sax.SAXNotRecognizedException,
    +                             org.xml.sax.SAXNotSupportedException
    +
    +
    Set features for the SAX parser. The only supported arguments are
    + EXIReader.setFeature("http://xml.org/sax/features/namespaces", true);
    and
    + EXIReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
    +

    +

    +
    Specified by:
    setFeature in interface org.xml.sax.XMLReader
    +
    +
    + +
    Throws: +
    org.xml.sax.SAXNotRecognizedException +
    org.xml.sax.SAXNotSupportedException
    +
    +
    +
    + +

    +getFeature

    +
    +public final boolean getFeature(java.lang.String name)
    +                         throws org.xml.sax.SAXNotRecognizedException
    +
    +
    Get features for the SAX parser. +

    +

    +
    Specified by:
    getFeature in interface org.xml.sax.XMLReader
    +
    +
    + +
    Returns:
    true if the feature is "http://xml.org/sax/features/namespaces" + and false if the feature is "http://xml.org/sax/features/namespace-prefixes" +
    Throws: +
    org.xml.sax.SAXNotRecognizedException
    +
    +
    +
    + +

    +setAlignmentType

    +
    +public final void setAlignmentType(AlignmentType alignmentType)
    +                            throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the bit alignment style used to compile the EXI input stream. +

    +

    +
    +
    +
    +
    Parameters:
    alignmentType - AlignmentType +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setFragment

    +
    +public final void setFragment(boolean isFragment)
    +
    +
    Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +

    +

    +
    +
    +
    +
    Parameters:
    isFragment - true if the EXI input stream is an XML fragment.
    +
    +
    +
    + +

    +setPreserveLexicalValues

    +
    +public final void setPreserveLexicalValues(boolean preserveLexicalValues)
    +                                    throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true. The original strings, rather than logical XML + equivalents, are restored in the XML output stream. +

    +

    +
    +
    +
    +
    Parameters:
    preserveLexicalValues - set to true if the EXI input stream was compiled with + Preserve Lexical Values set to true. +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setEXISchemaResolver

    +
    +public final void setEXISchemaResolver(EXISchemaResolver schemaResolver)
    +
    +
    Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream. +

    +

    +
    +
    +
    +
    Parameters:
    schemaResolver - EXISchemaResolver
    +
    +
    +
    + +

    +setDatatypeRepresentationMap

    +
    +public final void setDatatypeRepresentationMap(QName[] dtrm,
    +                                               int n_bindings)
    +                                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set a datatype representation map. +

    +

    +
    +
    +
    +
    Parameters:
    dtrm - a sequence of pairs of datatype qname and datatype representation qname
    n_bindings - the number of qname pairs +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setBlockSize

    +
    +public final void setBlockSize(int blockSize)
    +                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

    +

    +
    +
    +
    +
    Parameters:
    blockSize - number of values in each processing block. Default is 1,000,000. +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setValueMaxLength

    +
    +public final void setValueMaxLength(int valueMaxLength)
    +
    +
    Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

    +

    +
    +
    +
    +
    Parameters:
    valueMaxLength - maximum length of entries in the String Table.
    +
    +
    +
    + +

    +setValuePartitionCapacity

    +
    +public final void setValuePartitionCapacity(int valuePartitionCapacity)
    +
    +
    Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

    +

    +
    +
    +
    +
    Parameters:
    valuePartitionCapacity - maximum number of entries in the String Table
    +
    +
    +
    + +

    +setLexicalHandler

    +
    +public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
    +
    +
    Set a SAX lexical handler to receive SAX lexical events. +

    +

    +
    +
    +
    +
    Parameters:
    lexicalHandler - SAX lexical handler
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html new file mode 100644 index 0000000000..7d392bb5b6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html @@ -0,0 +1,290 @@ + + + + + + + +ReaderSupport + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Class ReaderSupport

    +
    +java.lang.Object
    +  extended by org.openexi.sax.ReaderSupport
    +
    +
    +
    All Implemented Interfaces:
    org.xml.sax.Attributes
    +
    +
    +
    Direct Known Subclasses:
    EXIReader
    +
    +
    +
    +
    public abstract class ReaderSupport
    extends java.lang.Object
    implements org.xml.sax.Attributes
    + + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + org.xml.sax.ContentHandlergetContentHandler() + +
    +          Get the SAX content handler currently in use.
    + voidsetContentHandler(org.xml.sax.ContentHandler contentHandler) + +
    +          Set a SAX content handler to receive SAX events.
    + voidsetGrammarCache(GrammarCache grammarCache) + +
    +          Set the GrammarCache used in parsing EXI streams.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    + + + + + + + +
    Methods inherited from interface org.xml.sax.Attributes
    getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +setContentHandler

    +
    +public final void setContentHandler(org.xml.sax.ContentHandler contentHandler)
    +
    +
    Set a SAX content handler to receive SAX events. +

    +

    +
    +
    +
    +
    Parameters:
    contentHandler - SAX content handler
    +
    +
    +
    + +

    +getContentHandler

    +
    +public final org.xml.sax.ContentHandler getContentHandler()
    +
    +
    Get the SAX content handler currently in use. +

    +

    +
    +
    +
    + +
    Returns:
    ContentHandler SAX content handler.
    +
    +
    +
    + +

    +setGrammarCache

    +
    +public void setGrammarCache(GrammarCache grammarCache)
    +                     throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the GrammarCache used in parsing EXI streams. +

    +

    +
    +
    +
    +
    Parameters:
    grammarCache - GrammarCache +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html new file mode 100644 index 0000000000..15e2e7d77f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html @@ -0,0 +1,245 @@ + + + + + + + +SAXTransmogrifier + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Interface SAXTransmogrifier

    +
    +
    All Superinterfaces:
    BinaryDataHandler, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
    +
    +
    +
    +
    public interface SAXTransmogrifier
    extends org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, BinaryDataHandler
    + + +

    +Applications can directly feed SAX events into a transmogrifier through SAXTransmogrifier. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + +
    +Method Summary
    + GrammarCachegetGrammarCache() + +
    +          Returns the GrammarCache that is in use by this SAXTransmogrifier.
    + + + + + + + +
    Methods inherited from interface org.xml.sax.ContentHandler
    characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
    + + + + + + + +
    Methods inherited from interface org.xml.sax.ext.LexicalHandler
    comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
    + + + + + + + +
    Methods inherited from interface org.openexi.sax.BinaryDataHandler
    binaryData, endBinaryData, startBinaryData
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +getGrammarCache

    +
    +GrammarCache getGrammarCache()
    +
    +
    Returns the GrammarCache that is in use by this SAXTransmogrifier. +

    +

    +
    +
    +
    + +
    Returns:
    a GrammarCache
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html new file mode 100644 index 0000000000..b857aab51c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html @@ -0,0 +1,735 @@ + + + + + + + +Transmogrifier + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Class Transmogrifier

    +
    +java.lang.Object
    +  extended by org.openexi.sax.Transmogrifier
    +
    +
    +
    +
    public final class Transmogrifier
    extends java.lang.Object
    + + +

    +The Transmogrifier converts an XML stream to an EXI stream. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + +
    +Constructor Summary
    Transmogrifier() + +
    +          Create an instance of the Transmogrifier with a default SAX parser.
    Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory) + +
    +          Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser.
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + voidencode(org.xml.sax.InputSource is) + +
    +          Parses XML input source and converts it to an EXI stream.
    + GrammarCachegetGrammarCache() + +
    +          Returns the GrammarCache that was previously set.
    + SAXTransmogrifiergetSAXTransmogrifier() + +
    +          Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler.
    + voidsetAlignmentType(AlignmentType alignmentType) + +
    +          Set the bit alignment style for the encoded EXI stream.
    + voidsetBlockSize(int blockSize) + +
    +          Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream.
    + voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
    +          Set a datatype representation map (DTRM).
    + voidsetEntityResolver(org.xml.sax.EntityResolver entityResolver) + +
    +          Set an external SAX entity resolver.
    + voidsetFragment(boolean isFragment) + +
    +          Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements).
    + voidsetGrammarCache(GrammarCache grammarCache) + +
    +          Set the GrammarCache used in transmogrifying XML data to EXI.
    + voidsetGrammarCache(GrammarCache grammarCache, + org.openexi.proc.common.SchemaId schemaId) + +
    +          Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier.
    + voidsetOutputCookie(boolean outputCookie) + +
    +          Tells the encoder whether to or not to start the stream by + adding an EXI cookie.
    + voidsetOutputOptions(HeaderOptionsOutputType outputOptions) + +
    +          Set the header output options.
    + voidsetOutputStream(java.io.OutputStream ostream) + +
    +          Set an output stream to which encoded streams are written.
    + voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
    +          Set to true to preserve the original string values from the XML + stream.
    + voidsetPreserveWhitespaces(boolean preserveWhitespaces) + +
    +          Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream.
    + voidsetResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities) + +
    +          Change the way a Transmogrifier handles external general entities.
    + voidsetValueMaxLength(int valueMaxLength) + +
    +          Set the maximum length of a string that will be stored for reuse in the + String Table.
    + voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
    +          Set the maximum number of values in the String Table.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +Transmogrifier

    +
    +public Transmogrifier()
    +               throws org.openexi.sax.TransmogrifierRuntimeException
    +
    +
    Create an instance of the Transmogrifier with a default SAX parser. +

    +

    + +
    Throws: +
    TransmogrifierException +
    org.openexi.sax.TransmogrifierRuntimeException
    +
    +
    + +

    +Transmogrifier

    +
    +public Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory)
    +               throws org.openexi.sax.TransmogrifierRuntimeException
    +
    +
    Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser. +

    +

    +
    Parameters:
    saxParserFactory - +
    Throws: +
    TransmogrifierException +
    org.openexi.sax.TransmogrifierRuntimeException
    +
    + + + + + + + + +
    +Method Detail
    + +

    +setResolveExternalGeneralEntities

    +
    +public void setResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities)
    +                                       throws TransmogrifierException
    +
    +
    Change the way a Transmogrifier handles external general entities. When the value + of resolveExternalGeneralEntities is set to true, a Transmogrifier will try to + resolve external general entities. Otherwise, external general entities will not + be resolved. +

    +

    +
    Parameters:
    resolveExternalGeneralEntities - +
    Throws: +
    TransmogrifierException - Thrown when the underlying XMLReader does not + support the specified behavior.
    +
    +
    +
    + +

    +setOutputStream

    +
    +public final void setOutputStream(java.io.OutputStream ostream)
    +
    +
    Set an output stream to which encoded streams are written. +

    +

    +
    Parameters:
    ostream - output stream
    +
    +
    +
    + +

    +setAlignmentType

    +
    +public final void setAlignmentType(AlignmentType alignmentType)
    +                            throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the bit alignment style for the encoded EXI stream. +

    +

    +
    Parameters:
    alignmentType - AlignmentType. + Default is bit-packed. +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setFragment

    +
    +public final void setFragment(boolean isFragment)
    +
    +
    Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +

    +

    +
    Parameters:
    isFragment - true if the XML input stream is an XML fragment.
    +
    +
    +
    + +

    +setBlockSize

    +
    +public final void setBlockSize(int blockSize)
    +                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

    +

    +
    Parameters:
    blockSize - number of values in each processing block. Default is 1,000,000. +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setValueMaxLength

    +
    +public final void setValueMaxLength(int valueMaxLength)
    +
    +
    Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

    +

    +
    Parameters:
    valueMaxLength - maximum length of entries in the String Table.
    +
    +
    +
    + +

    +setValuePartitionCapacity

    +
    +public final void setValuePartitionCapacity(int valuePartitionCapacity)
    +
    +
    Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

    +

    +
    Parameters:
    valuePartitionCapacity - maximum number of entries in the String Table
    +
    +
    +
    + +

    +setPreserveLexicalValues

    +
    +public final void setPreserveLexicalValues(boolean preserveLexicalValues)
    +                                    throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set to true to preserve the original string values from the XML + stream. For example, a date string might be converted to a different + format when interpreted by the Transmogrifier. Preserving the lexical values + ensures that the identical strings are restored, and not just their + logical values. +

    +

    +
    Parameters:
    preserveLexicalValues - true to keep original strings intact +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setGrammarCache

    +
    +public final void setGrammarCache(GrammarCache grammarCache)
    +                           throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the GrammarCache used in transmogrifying XML data to EXI. +

    +

    +
    Parameters:
    grammarCache - GrammarCache +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setGrammarCache

    +
    +public final void setGrammarCache(GrammarCache grammarCache,
    +                                  org.openexi.proc.common.SchemaId schemaId)
    +                           throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier. + The SchemaId contains the string that is written in the header when + HeaderOptionsOutputType.all is set. +

    +

    +
    Parameters:
    grammarCache - GrammarCache
    schemaId - +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +getGrammarCache

    +
    +public final GrammarCache getGrammarCache()
    +
    +
    Returns the GrammarCache that was previously set. +

    +

    + +
    Returns:
    a GrammarCache
    +
    +
    +
    + +

    +setDatatypeRepresentationMap

    +
    +public final void setDatatypeRepresentationMap(QName[] dtrm,
    +                                               int n_bindings)
    +                                        throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set a datatype representation map (DTRM). The DTRM allows you to remap + XMLSchema datatypes to EXI datatypes other than their default equivalents. + The map is created using a sequence of Qualified Name pairs that identify + a datatype definition in the XMLSchema namespace followed by the new + corresponding datatype mapping in the EXI namespace. +

    + For example, the following lines map the boolean datatype from XMLSchema + to the integer datatype in EXI. +
    +   QName q1 = new QName("xsd:boolean","http://www.w3.org/2001/XMLSchema");
    +   QName q2 = new QName("exi:integer","http://www.w3.org/2009/exi");
    +   QName[] dtrm = new QName[2];
    +   dtrm = {q1, q2}; // Each mapping requires 2 qualified names.
    +   transmogrifierInstance.setDatatypeRepresentationMap(dtrm, 1); // The array, and the number of pairs (1).
    + 
    +

    +

    +
    Parameters:
    dtrm - a sequence of pairs of datatype QName and datatype representation QName
    n_bindings - the number of QName pairs +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setEntityResolver

    +
    +public final void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
    +
    +
    Set an external SAX entity resolver. +

    +

    +
    Parameters:
    entityResolver - EntityResolver
    +
    +
    +
    + +

    +setOutputCookie

    +
    +public final void setOutputCookie(boolean outputCookie)
    +
    +
    Tells the encoder whether to or not to start the stream by + adding an EXI cookie. +

    +

    +
    Parameters:
    outputCookie - true to include the EXI cookie
    +
    +
    +
    + +

    +setOutputOptions

    +
    +public final void setOutputOptions(HeaderOptionsOutputType outputOptions)
    +                            throws org.openexi.proc.common.EXIOptionsException
    +
    +
    Set the header output options. Choices are set using the + HeaderOptionsOutputType enumeration. + Options are all, lessSchemaID (that is, all values + except for the SchemaId), or none. +

    +

    +
    Parameters:
    outputOptions - HeaderOptionsOutputType +
    Throws: +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    +
    + +

    +setPreserveWhitespaces

    +
    +public final void setPreserveWhitespaces(boolean preserveWhitespaces)
    +
    +
    Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream. By default, non-essential whitespace + is removed from the encoded stream. +

    +

    +
    Parameters:
    preserveWhitespaces - true to retain whitespace in the encoded EXI stream
    +
    +
    +
    + +

    +encode

    +
    +public void encode(org.xml.sax.InputSource is)
    +            throws TransmogrifierException,
    +                   java.io.IOException
    +
    +
    Parses XML input source and converts it to an EXI stream. +

    +

    +
    Parameters:
    is - XML input source +
    Throws: +
    TransmogrifierException +
    java.io.IOException
    +
    +
    +
    + +

    +getSAXTransmogrifier

    +
    +public SAXTransmogrifier getSAXTransmogrifier()
    +
    +
    Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler. SAX programmers can connect the SAXTransmogrifier to + their favorite XML Parser to convert SAX events into an EXI stream. +

    +

    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html new file mode 100644 index 0000000000..55e1e1feaa --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html @@ -0,0 +1,566 @@ + + + + + + + +TransmogrifierException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.sax +
    +Class TransmogrifierException

    +
    +java.lang.Object
    +  extended by java.lang.Throwable
    +      extended by java.lang.Exception
    +          extended by org.openexi.sax.TransmogrifierException
    +
    +
    +
    All Implemented Interfaces:
    java.io.Serializable
    +
    +
    +
    +
    public final class TransmogrifierException
    extends java.lang.Exception
    + + +

    +Exception handler for the Transmogrifier. +

    + +

    +

    +
    See Also:
    Serialized Form +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Field Summary
    +static intPREFIX_BOUND_TO_ANOTHER_NAMESPACE + +
    +          Prefix is bound to another namespace.
    +static intPREFIX_NOT_BOUND + +
    +          Prefix is not bound.
    +static intSAX_ERROR + +
    +          SAX error reported by XML parser.
    +static intSCRIBER_ERROR + +
    +          Errors reported by Scriber.
    +static intUNEXPECTED_ATTR + +
    +          Unexpected Attribute.
    +static intUNEXPECTED_BINARY_VALUE + +
    +          Unexpected Binary value.
    +static intUNEXPECTED_CHARS + +
    +          Unexpected Character Sequence.
    +static intUNEXPECTED_ED + +
    +          Unexpected End of Document event.
    +static intUNEXPECTED_ELEM + +
    +          Unexpected Element.
    +static intUNEXPECTED_END_ELEM + +
    +          Unexpected End of Element event.
    +static intUNEXPECTED_SD + +
    +          Unexpected Start of Document event.
    +static intUNHANDLED_SAXPARSER_FEATURE + +
    +          Unhandled SAX parser feature.
    +  + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + intgetCode() + +
    +          Returns a code that represents the type of the exception.
    + java.lang.ExceptiongetException() + +
    +          Returns an Exception object.
    + org.xml.sax.LocatorgetLocator() + +
    +          Returns the locator that is associated with this compilation error.
    + java.lang.StringgetMessage() + +
    +          Returns a message that describes the exception.
    + + + + + + + +
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +UNEXPECTED_ELEM

    +
    +public static final int UNEXPECTED_ELEM
    +
    +
    Unexpected Element. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_ATTR

    +
    +public static final int UNEXPECTED_ATTR
    +
    +
    Unexpected Attribute. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_CHARS

    +
    +public static final int UNEXPECTED_CHARS
    +
    +
    Unexpected Character Sequence. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_BINARY_VALUE

    +
    +public static final int UNEXPECTED_BINARY_VALUE
    +
    +
    Unexpected Binary value. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNHANDLED_SAXPARSER_FEATURE

    +
    +public static final int UNHANDLED_SAXPARSER_FEATURE
    +
    +
    Unhandled SAX parser feature. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +SAX_ERROR

    +
    +public static final int SAX_ERROR
    +
    +
    SAX error reported by XML parser. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_END_ELEM

    +
    +public static final int UNEXPECTED_END_ELEM
    +
    +
    Unexpected End of Element event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_ED

    +
    +public static final int UNEXPECTED_ED
    +
    +
    Unexpected End of Document event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +UNEXPECTED_SD

    +
    +public static final int UNEXPECTED_SD
    +
    +
    Unexpected Start of Document event. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +PREFIX_NOT_BOUND

    +
    +public static final int PREFIX_NOT_BOUND
    +
    +
    Prefix is not bound. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +PREFIX_BOUND_TO_ANOTHER_NAMESPACE

    +
    +public static final int PREFIX_BOUND_TO_ANOTHER_NAMESPACE
    +
    +
    Prefix is bound to another namespace. +

    +

    +
    See Also:
    Constant Field Values
    +
    +
    + +

    +SCRIBER_ERROR

    +
    +public static final int SCRIBER_ERROR
    +
    +
    Errors reported by Scriber. +

    +

    +
    See Also:
    Constant Field Values
    +
    + + + + + + + + +
    +Method Detail
    + +

    +getCode

    +
    +public int getCode()
    +
    +
    Returns a code that represents the type of the exception. +

    +

    + +
    Returns:
    error code
    +
    +
    +
    + +

    +getMessage

    +
    +public java.lang.String getMessage()
    +
    +
    Returns a message that describes the exception. +

    +

    +
    Overrides:
    getMessage in class java.lang.Throwable
    +
    +
    + +
    Returns:
    error message
    +
    +
    +
    + +

    +getException

    +
    +public java.lang.Exception getException()
    +
    +
    Returns an Exception object. +

    +

    + +
    Returns:
    the error as an Exception instance
    +
    +
    +
    + +

    +getLocator

    +
    +public org.xml.sax.Locator getLocator()
    +
    +
    Returns the locator that is associated with this compilation error. +

    +

    + +
    Returns:
    a Locator if available, otherwise null
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html new file mode 100644 index 0000000000..22e45d692b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html @@ -0,0 +1,61 @@ + + + + + + + +org.openexi.sax + + + + + + + + + + + +org.openexi.sax + + + + +
    +Interfaces  + +
    +BinaryDataHandler +
    +SAXTransmogrifier
    + + + + + + +
    +Classes  + +
    +EXIReader +
    +ReaderSupport +
    +Transmogrifier
    + + + + + + +
    +Exceptions  + +
    +TransmogrifierException
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html new file mode 100644 index 0000000000..b0e720814c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html @@ -0,0 +1,224 @@ + + + + + + + +org.openexi.sax + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.sax +

    + + + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. +

    +See: +
    +          Description +

    + + + + + + + + + + + + + +
    +Interface Summary
    BinaryDataHandler 
    SAXTransmogrifierApplications can directly feed SAX events into a transmogrifier through SAXTransmogrifier.
    +  + +

    + + + + + + + + + + + + + + + + + +
    +Class Summary
    EXIReaderEXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream.
    ReaderSupport 
    TransmogrifierThe Transmogrifier converts an XML stream to an EXI stream.
    +  + +

    + + + + + + + + + +
    +Exception Summary
    TransmogrifierExceptionException handler for the Transmogrifier.
    +  + +

    +

    +Package org.openexi.sax Description +

    + +

    + + + + + +
    +

    The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. These classes are wrappers for the Scriber and EXIDecoder, respectively, and are primarily meant to provide access to EXI using familiar SAX syntax. +

    +
    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html new file mode 100644 index 0000000000..f4184bf934 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html @@ -0,0 +1,171 @@ + + + + + + + +org.openexi.sax Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.sax +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    +
      +
    • java.lang.Object +
    +

    +Interface Hierarchy +

    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html new file mode 100644 index 0000000000..022f5be35a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html @@ -0,0 +1,486 @@ + + + + + + + +Characters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.schema +
    +Class Characters

    +
    +java.lang.Object
    +  extended by org.openexi.schema.Characters
    +
    +
    +
    +
    public final class Characters
    extends java.lang.Object
    + + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Field Summary
    + char[]characters + +
    +           
    +static CharactersCHARACTERS_EMPTY + +
    +           
    + booleanisVolatile + +
    +           
    + intlength + +
    +           
    + intstartIndex + +
    +           
    + intucsCount + +
    +           
    +  + + + + + + + + + + +
    +Constructor Summary
    Characters(char[] characters, + int startIndex, + int length, + boolean isVolatile) + +
    +           
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + booleanequals(java.lang.Object object) + +
    +           
    + inthashCode() + +
    +           
    + intindexOf(char c) + +
    +           
    + java.lang.StringmakeString() + +
    +           
    + java.lang.Stringsubstring(int beginIndex, + int endIndex) + +
    +           
    + voidturnPermanent() + +
    +           
    + + + + + + + +
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +isVolatile

    +
    +public boolean isVolatile
    +
    +
    +
    +
    +
    + +

    +characters

    +
    +public char[] characters
    +
    +
    +
    +
    +
    + +

    +startIndex

    +
    +public int startIndex
    +
    +
    +
    +
    +
    + +

    +length

    +
    +public final int length
    +
    +
    +
    +
    +
    + +

    +ucsCount

    +
    +public final int ucsCount
    +
    +
    +
    +
    +
    + +

    +CHARACTERS_EMPTY

    +
    +public static final Characters CHARACTERS_EMPTY
    +
    +
    +
    +
    + + + + + + + + +
    +Constructor Detail
    + +

    +Characters

    +
    +public Characters(char[] characters,
    +                  int startIndex,
    +                  int length,
    +                  boolean isVolatile)
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +turnPermanent

    +
    +public void turnPermanent()
    +
    +
    +
    +
    +
    +
    + +

    +indexOf

    +
    +public int indexOf(char c)
    +
    +
    +
    +
    +
    +
    + +

    +substring

    +
    +public java.lang.String substring(int beginIndex,
    +                                  int endIndex)
    +
    +
    +
    +
    +
    +
    + +

    +hashCode

    +
    +public int hashCode()
    +
    +
    +
    Overrides:
    hashCode in class java.lang.Object
    +
    +
    +
    +
    +
    +
    + +

    +equals

    +
    +public boolean equals(java.lang.Object object)
    +
    +
    +
    Overrides:
    equals in class java.lang.Object
    +
    +
    +
    +
    +
    +
    + +

    +makeString

    +
    +public java.lang.String makeString()
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html new file mode 100644 index 0000000000..f3c472ec5e --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html @@ -0,0 +1,355 @@ + + + + + + + +EXISchema + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.schema +
    +Class EXISchema

    +
    +java.lang.Object
    +  extended by org.openexi.schema.EXISchema
    +
    +
    +
    +
    public final class EXISchema
    extends java.lang.Object
    + + +

    +EXISchema provides methods to read and write compiled EXI schemas. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Field Summary
    + byte[]ancestryIds + +
    +           
    +  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    +static boolean_isSimpleType(int tp, + int[] types) + +
    +           
    + booleanisSimpleType(int tp) + +
    +           
    +static EXISchemareadIn(java.io.DataInputStream in) + +
    +          Reads an EXI Schema from a DataInputStream.
    + voidwriteOut(java.io.DataOutputStream out) + +
    +          Writes out a serialized EXISchema.
    + voidwriteXml(java.io.OutputStream out, + boolean whole) + +
    +           
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +ancestryIds

    +
    +public transient byte[] ancestryIds
    +
    +
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +isSimpleType

    +
    +public boolean isSimpleType(int tp)
    +
    +
    +
    +
    +
    +
    + +

    +_isSimpleType

    +
    +public static boolean _isSimpleType(int tp,
    +                                    int[] types)
    +
    +
    +
    +
    +
    +
    + +

    +readIn

    +
    +public static EXISchema readIn(java.io.DataInputStream in)
    +                        throws java.io.IOException,
    +                               java.lang.ClassNotFoundException
    +
    +
    Reads an EXI Schema from a DataInputStream. +

    +

    +
    Parameters:
    in - DataInputStream containing a serialized EXISchema +
    Returns:
    EXISchema +
    Throws: +
    IOException, - ClassNotFoundException +
    java.io.IOException +
    java.lang.ClassNotFoundException
    +
    +
    +
    + +

    +writeOut

    +
    +public void writeOut(java.io.DataOutputStream out)
    +              throws java.io.IOException
    +
    +
    Writes out a serialized EXISchema. +

    +

    +
    Parameters:
    out - DataOutputStream to receive the serialized EXISchema +
    Throws: +
    java.io.IOException
    +
    +
    +
    + +

    +writeXml

    +
    +public void writeXml(java.io.OutputStream out,
    +                     boolean whole)
    +              throws java.io.IOException
    +
    +
    + +
    Throws: +
    java.io.IOException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html new file mode 100644 index 0000000000..2a932cc5fb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html @@ -0,0 +1,229 @@ + + + + + + + +EmptySchema + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.schema +
    +Class EmptySchema

    +
    +java.lang.Object
    +  extended by org.openexi.schema.EmptySchema
    +
    +
    +
    +
    public final class EmptySchema
    extends java.lang.Object
    + + +

    +EmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions. This is to support the use of dynamic + datatype associations discovered within elements during processing. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + +
    +Method Summary
    +static EXISchemagetEXISchema() + +
    +          Returns an EXISchema that supports all datatypes inherent in XML Schema.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +getEXISchema

    +
    +public static EXISchema getEXISchema()
    +
    +
    Returns an EXISchema that supports all datatypes inherent in XML Schema. + Calls to this method always return the same object. +

    +

    + +
    Returns:
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html new file mode 100644 index 0000000000..4fdd831792 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html @@ -0,0 +1,37 @@ + + + + + + + +org.openexi.schema + + + + + + + + + + + +org.openexi.schema + + + + +
    +Classes  + +
    +Characters +
    +EmptySchema +
    +EXISchema
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html new file mode 100644 index 0000000000..53242f2e32 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html @@ -0,0 +1,195 @@ + + + + + + + +org.openexi.schema + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.schema +

    + + + +The schema package contains classes that are used to represent XML Schema Documents (XSDs). +

    +See: +
    +          Description +

    + + + + + + + + + + + + + + + + + +
    +Class Summary
    Characters 
    EmptySchemaEmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions.
    EXISchemaEXISchema provides methods to read and write compiled EXI schemas.
    +  + +

    +

    +Package org.openexi.schema Description +

    + +

    + + + + + +
    +

    The schema package contains classes that are used to represent XML Schema Documents (XSDs). EXISchema.writeOut writes an EXISchema to a DataOutputStream (which is typically saved to disk). EXISchema.readIn returns an EXISchema from a DataInputStream (typically from a file on disk), saving the step of processing the schema at runtime. +

    +

    +EmptySchema is used to create an explicit schema object with default settings. This is to enable the EXIDecoder and Transmogrifier to process element tags that have embedded datatype overrides. +

    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html new file mode 100644 index 0000000000..dda7f6246f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html @@ -0,0 +1,148 @@ + + + + + + + +org.openexi.schema Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.schema +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html new file mode 100644 index 0000000000..7a95df8e6d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html @@ -0,0 +1,308 @@ + + + + + + + +EXISchemaFactory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.scomp +
    +Class EXISchemaFactory

    +
    +java.lang.Object
    +  extended by EXISchemaStruct
    +      extended by org.openexi.scomp.EXISchemaFactory
    +
    +
    +
    +
    public class EXISchemaFactory
    extends EXISchemaStruct
    + + +

    +EXISchemaFactory compiles XML Schema into an EXISchema instance. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Constructor Summary
    EXISchemaFactory() + +
    +           
    +  + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + EXISchemacompile(org.xml.sax.InputSource inputSource) + +
    +          Compile an XML Schema Document into an EXISchema.
    + voidsetCompilerErrorHandler(EXISchemaFactoryErrorHandler errorHandler) + +
    +          Set an error handler to report any errors encountered during + schema compilation.
    + voidsetEntityResolver(EntityResolverEx entityResolver) + +
    +          Set an entity resolver for use to resolve entities and schema documents.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +EXISchemaFactory

    +
    +public EXISchemaFactory()
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +setCompilerErrorHandler

    +
    +public void setCompilerErrorHandler(EXISchemaFactoryErrorHandler errorHandler)
    +
    +
    Set an error handler to report any errors encountered during + schema compilation. +

    +

    +
    Parameters:
    errorHandler - Error handler
    +
    +
    +
    + +

    +setEntityResolver

    +
    +public void setEntityResolver(EntityResolverEx entityResolver)
    +
    +
    Set an entity resolver for use to resolve entities and schema documents. +

    +

    +
    Parameters:
    entityResolverEx - extended SAX entity resolver
    +
    +
    +
    + +

    +compile

    +
    +public final EXISchema compile(org.xml.sax.InputSource inputSource)
    +                        throws java.io.IOException,
    +                               EXISchemaFactoryException
    +
    +
    Compile an XML Schema Document into an EXISchema. +

    +

    +
    Parameters:
    is - XML Schema Document stream from an InputSource +
    Returns:
    an EXISchema instance +
    Throws: +
    java.io.IOException +
    EXISchemaFactoryException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html new file mode 100644 index 0000000000..48648e4635 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html @@ -0,0 +1,268 @@ + + + + + + + +EXISchemaFactoryErrorHandler + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.scomp +
    +Interface EXISchemaFactoryErrorHandler

    +
    +
    +
    public interface EXISchemaFactoryErrorHandler
    + + +

    +This interface reports exceptions from EXISchemaFactory during schema + processing. Users of EXISchemaFactory need to provide an + implementation of this interface to receive errors from EXISchemaFactory. +

    + +

    +

    +
    Author:
    +
    Dennis Dawson
    + +
    +
    + +

    + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + voiderror(EXISchemaFactoryException exc) + +
    +          Report an error found during schema processing.
    + voidfatalError(EXISchemaFactoryException exc) + +
    +          Report a fatal error found during schema processing.
    + voidwarning(EXISchemaFactoryException exc) + +
    +          Report a warning found during schema processing.
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +warning

    +
    +void warning(EXISchemaFactoryException exc)
    +             throws EXISchemaFactoryException
    +
    +
    Report a warning found during schema processing. +

    +

    +
    Parameters:
    exc - warning found +
    Throws: +
    EXISchemaFactoryException - at the discretion of the application
    +
    +
    +
    + +

    +error

    +
    +void error(EXISchemaFactoryException exc)
    +           throws EXISchemaFactoryException
    +
    +
    Report an error found during schema processing. Note that errors are + recoverable only as far as the schema processor is concerned. They might + be fatal at the application level. +

    +

    +
    Parameters:
    exc - error found +
    Throws: +
    EXISchemaFactoryException - at the discretion of the application
    +
    +
    +
    + +

    +fatalError

    +
    +void fatalError(EXISchemaFactoryException exc)
    +                throws EXISchemaFactoryException
    +
    +
    Report a fatal error found during schema processing. +

    +

    +
    Parameters:
    exc - fatal error found +
    Throws: +
    EXISchemaFactoryException - at the discretion of the application
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html new file mode 100644 index 0000000000..598f7db597 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html @@ -0,0 +1,350 @@ + + + + + + + +EXISchemaFactoryException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.scomp +
    +Class EXISchemaFactoryException

    +
    +java.lang.Object
    +  extended by java.lang.Throwable
    +      extended by java.lang.Exception
    +          extended by org.openexi.scomp.EXISchemaFactoryException
    +
    +
    +
    All Implemented Interfaces:
    java.io.Serializable
    +
    +
    +
    +
    public class EXISchemaFactoryException
    extends java.lang.Exception
    + + +

    +Any errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects. +

    + +

    +

    +
    See Also:
    EXISchemaFactoryErrorHandler, +Serialized Form
    Author:
    +
    Dennis Dawson
    + +
    +
    + +

    + + + + + + + + + + + +
    +Field Summary
    +static intXMLSCHEMA_ERROR + +
    +          The underlying XMLSchema parser found an error in the schema.
    +  + + + + + + + + + + + + + + + + + + + + + + + +
    +Method Summary
    + intgetCode() + +
    +          Returns a code that represents the type of the exception.
    + java.lang.ExceptiongetException() + +
    +          Returns an Exception object.
    + org.xml.sax.LocatorgetLocator() + +
    +          Returns the locator that is associated with this compilation error.
    + java.lang.StringgetMessage() + +
    +          Returns a message that describes the exception.
    + + + + + + + +
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    +  +

    + + + + + + + + +
    +Field Detail
    + +

    +XMLSCHEMA_ERROR

    +
    +public static final int XMLSCHEMA_ERROR
    +
    +
    The underlying XMLSchema parser found an error in the schema. +

    +

    +
    See Also:
    Constant Field Values
    +
    + + + + + + + + +
    +Method Detail
    + +

    +getCode

    +
    +public int getCode()
    +
    +
    Returns a code that represents the type of the exception. +

    +

    + +
    Returns:
    error code
    +
    +
    +
    + +

    +getMessage

    +
    +public java.lang.String getMessage()
    +
    +
    Returns a message that describes the exception. +

    +

    +
    Overrides:
    getMessage in class java.lang.Throwable
    +
    +
    + +
    Returns:
    error message
    +
    +
    +
    + +

    +getException

    +
    +public java.lang.Exception getException()
    +
    +
    Returns an Exception object. +

    +

    + +
    Returns:
    an Exception instance for the current exception.
    +
    +
    +
    + +

    +getLocator

    +
    +public org.xml.sax.Locator getLocator()
    +
    +
    Returns the locator that is associated with this compilation error. +

    +

    + +
    Returns:
    a Locator if available, otherwise null
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html new file mode 100644 index 0000000000..6249b50feb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html @@ -0,0 +1,264 @@ + + + + + + + +EXISchemaReader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.scomp +
    +Class EXISchemaReader

    +
    +java.lang.Object
    +  extended by EXISchemaStruct
    +      extended by org.openexi.scomp.EXISchemaReader
    +
    +
    +
    +
    public final class EXISchemaReader
    extends EXISchemaStruct
    + + +

    +EXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + +
    +Constructor Summary
    EXISchemaReader() + +
    +           
    +  + + + + + + + + + + + +
    +Method Summary
    + EXISchemaparse(java.io.InputStream inputStream) + +
    +          Parses EXI-encoded EXI Grammar into an EXISchema.
    + + + + + + + +
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +  +

    + + + + + + + + +
    +Constructor Detail
    + +

    +EXISchemaReader

    +
    +public EXISchemaReader()
    +
    +
    + + + + + + + + +
    +Method Detail
    + +

    +parse

    +
    +public EXISchema parse(java.io.InputStream inputStream)
    +                throws java.io.IOException,
    +                       org.openexi.proc.common.EXIOptionsException
    +
    +
    Parses EXI-encoded EXI Grammar into an EXISchema. +

    +

    +
    Parameters:
    inputStream - EXI-encoded EXI Grammar +
    Returns:
    EXISchema +
    Throws: +
    java.io.IOException +
    org.openexi.proc.common.EXIOptionsException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html new file mode 100644 index 0000000000..cd12bdddb1 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html @@ -0,0 +1,241 @@ + + + + + + + +EntityResolverEx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +org.openexi.scomp +
    +Interface EntityResolverEx

    +
    +
    All Superinterfaces:
    org.xml.sax.EntityResolver
    +
    +
    +
    +
    public interface EntityResolverEx
    extends org.xml.sax.EntityResolver
    + + +

    +Extended SAX EntityResolver interface for resolving entities and + schema documents. +

    + +

    +

    + +
    +
    + +

    + + + + + + + + + + + + +
    +Method Summary
    + org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, + java.lang.String systemId, + java.lang.String namespaceURI) + +
    +          This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas.
    + + + + + + + +
    Methods inherited from interface org.xml.sax.EntityResolver
    resolveEntity
    +  +

    + + + + + + + + +
    +Method Detail
    + +

    +resolveEntity

    +
    +org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
    +                                      java.lang.String systemId,
    +                                      java.lang.String namespaceURI)
    +                                      throws org.xml.sax.SAXException,
    +                                             java.io.IOException
    +
    +
    This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas. +

    +

    +
    +
    +
    +
    Parameters:
    publicId - Public identifier of the schema document that is being resolved
    systemId - System identifier of the schema document that is being resolved
    namespaceURI - Target namespace name of the schema document that is being resolved +
    Returns:
    InputSource that represents the schema document if resolved otherwise null +
    Throws: +
    org.xml.sax.SAXException +
    java.io.IOException
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html new file mode 100644 index 0000000000..65600a98d7 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html @@ -0,0 +1,59 @@ + + + + + + + +org.openexi.scomp + + + + + + + + + + + +org.openexi.scomp + + + + +
    +Interfaces  + +
    +EntityResolverEx +
    +EXISchemaFactoryErrorHandler
    + + + + + + +
    +Classes  + +
    +EXISchemaFactory +
    +EXISchemaReader
    + + + + + + +
    +Exceptions  + +
    +EXISchemaFactoryException
    + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html new file mode 100644 index 0000000000..a35b92a223 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html @@ -0,0 +1,222 @@ + + + + + + + +org.openexi.scomp + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +

    +Package org.openexi.scomp +

    + + + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. +

    +See: +
    +          Description +

    + + + + + + + + + + + + + +
    +Interface Summary
    EntityResolverExExtended SAX EntityResolver interface for resolving entities and + schema documents.
    EXISchemaFactoryErrorHandlerThis interface reports exceptions from EXISchemaFactory during schema + processing.
    +  + +

    + + + + + + + + + + + + + +
    +Class Summary
    EXISchemaFactoryEXISchemaFactory compiles XML Schema into an EXISchema instance.
    EXISchemaReaderEXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema.
    +  + +

    + + + + + + + + + +
    +Exception Summary
    EXISchemaFactoryExceptionAny errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects.
    +  + +

    +

    +Package org.openexi.scomp Description +

    + +

    + + + + + +
    +

    The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. Developers can implement the interface EXISchemaFactoryErrorHandler to capture and report runtime exceptions from EXISchemaFactory. +

    +
    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html new file mode 100644 index 0000000000..93d1752d5a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html @@ -0,0 +1,162 @@ + + + + + + + +org.openexi.scomp Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For Package org.openexi.scomp +

    +
    +
    +
    Package Hierarchies:
    All Packages
    +
    +

    +Class Hierarchy +

    + +

    +Interface Hierarchy +

    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html new file mode 100644 index 0000000000..045191d7df --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html @@ -0,0 +1,55 @@ + + + + + + + +Overview + + + + + + + + + + + + + + + +
    +
    + + + + + +
    All Classes +

    + +Packages +
    +org.openexi.proc +
    +org.openexi.proc.common +
    +org.openexi.proc.grammars +
    +org.openexi.proc.io +
    +org.openexi.sax +
    +org.openexi.schema +
    +org.openexi.scomp +
    +

    + +

    +  + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html new file mode 100644 index 0000000000..1a299fd622 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html @@ -0,0 +1,227 @@ + + + + + + + +Overview + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +


    +
    +

    +OpenEXI Nagasena +

    +
    + + + +OpenEXI is a W3C open source API for converting XML files to the Efficient XML Interchange format (EXI). +

    +See: +
    +          Description +

    + + + + + + + + + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. + + + + + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). + + + + + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. + + + + + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. + + + + + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. + + + + + +The schema package contains classes that are used to represent XML Schema Documents (XSDs). + + + + + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. + +
    +Packages
    org.openexi.proc +
    org.openexi.proc.common +
    org.openexi.proc.grammars +
    org.openexi.proc.io +
    org.openexi.sax +
    org.openexi.schema +
    org.openexi.scomp +
    + +

    +

    + + + + + +
    +

    OpenEXI is a W3C open source API for converting XML files to the Efficient XML Interchange format (EXI). +

    +

    You can learn more about OpenEXI by visiting the OpenEXI homepage at openexi.sourceforge.net. +

    + +
    +

    +

    + +

    +

    + +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html new file mode 100644 index 0000000000..8409fdb317 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html @@ -0,0 +1,190 @@ + + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Hierarchy For All Packages

    +
    +
    +
    Package Hierarchies:
    org.openexi.proc, org.openexi.proc.common, org.openexi.proc.grammars, org.openexi.proc.io, org.openexi.sax, org.openexi.schema, org.openexi.scomp
    +
    +

    +Class Hierarchy +

    + +

    +Interface Hierarchy +

    + +

    +Enum Hierarchy +

    +
      +
    • java.lang.Object +
    +
    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/package-list b/third-party/org.openexi/nagasena/src/main/resources/doc/package-list new file mode 100644 index 0000000000..746aadc8bd --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/package-list @@ -0,0 +1,7 @@ +org.openexi.proc +org.openexi.proc.common +org.openexi.proc.grammars +org.openexi.proc.io +org.openexi.sax +org.openexi.schema +org.openexi.scomp diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif b/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif new file mode 100644 index 0000000000..c814867a13 Binary files /dev/null and b/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif differ diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html b/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html new file mode 100644 index 0000000000..c3688f526d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html @@ -0,0 +1,269 @@ + + + + + + + +Serialized Form + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +

    +Serialized Form

    +
    +
    + + + + + +
    +Package org.openexi.sax
    + +

    + + + + + +
    +Class org.openexi.sax.TransmogrifierException extends java.lang.Exception implements Serializable
    + +

    +serialVersionUID: -4536662596727577640L + +

    + + + + + +
    +Serialized Fields
    + +

    +m_code

    +
    +int m_code
    +
    +
    +
    +
    +
    +

    +m_message

    +
    +java.lang.String m_message
    +
    +
    +
    +
    +
    +

    +m_exception

    +
    +java.lang.Exception m_exception
    +
    +
    +
    +
    +
    +

    +m_locator

    +
    +org.xml.sax.Locator m_locator
    +
    +
    +
    +
    +
    + + + + + +
    +Package org.openexi.scomp
    + +

    + + + + + +
    +Class org.openexi.scomp.EXISchemaFactoryException extends java.lang.Exception implements Serializable
    + +

    +serialVersionUID: 3816521974819647026L + +

    + + + + + +
    +Serialized Fields
    + +

    +m_code

    +
    +int m_code
    +
    +
    +
    +
    +
    +

    +m_message

    +
    +java.lang.String m_message
    +
    +
    +
    +
    +
    +

    +m_exception

    +
    +java.lang.Exception m_exception
    +
    +
    +
    +
    +
    +

    +m_locator

    +
    +org.xml.sax.Locator m_locator
    +
    +
    +
    +
    + +

    +


    + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css b/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css new file mode 100644 index 0000000000..14c3737e8a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/third-party/org.openexi/pom.xml b/third-party/org.openexi/pom.xml new file mode 100644 index 0000000000..d623ef8cdc --- /dev/null +++ b/third-party/org.openexi/pom.xml @@ -0,0 +1,50 @@ + + + + + 4.0.0 + + + org.opendaylight.controller + commons.thirdparty + 1.1.2-SNAPSHOT + ../commons/thirdparty + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + pom + + 3.0.4 + + + + nagasena + nagasena-rta + + + + + + + org.codehaus.mojo + truezip-maven-plugin + 1.1 + + + org.apache.felix + maven-bundle-plugin + 2.4.0 + + + + + +