From 5ba7a23d4dc8d43d54839722cf8b35c620398bea Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 1 Apr 2014 01:01:22 +0200 Subject: [PATCH] Introduce the OpenDaylight Toaster Edition This introduces a minimal packaging of the OpenDaylight project, aimed at providing just enough infrastructure to support a single useful application -- or appliance, really -- the venerable Toaster. Change-Id: I8502482d3083f95715ea9b96b7546fa66cf3daf0 Signed-off-by: Robert Varga --- distributions/extra/toaster/pom.xml | 973 ++++++++++++++++++ .../extra/toaster/src/assemble/bin.xml | 99 ++ .../toaster/src/main/resources/TOASTER.txt | 18 + .../src/main/resources/configuration/RSA.pk | 27 + .../main/resources/configuration/config.ini | 135 +++ .../main/resources/configuration/context.xml | 1 + .../configuration/initial/00-netty.xml | 60 ++ .../configuration/initial/01-md-sal.xml | 135 +++ .../configuration/initial/02-toaster.xml | 78 ++ .../main/resources/configuration/logback.xml | 99 ++ .../resources/configuration/startup/README | 1 + .../configuration/tomcat-logging.properties | 42 + .../resources/configuration/tomcat-server.xml | 62 ++ .../extra/toaster/src/main/resources/run.bat | 150 +++ .../extra/toaster/src/main/resources/run.sh | 240 +++++ .../src/main/resources/version.properties | 6 + distributions/pom.xml | 1 + 17 files changed, 2127 insertions(+) create mode 100644 distributions/extra/toaster/pom.xml create mode 100644 distributions/extra/toaster/src/assemble/bin.xml create mode 100644 distributions/extra/toaster/src/main/resources/TOASTER.txt create mode 100644 distributions/extra/toaster/src/main/resources/configuration/RSA.pk create mode 100644 distributions/extra/toaster/src/main/resources/configuration/config.ini create mode 100644 distributions/extra/toaster/src/main/resources/configuration/context.xml create mode 100644 distributions/extra/toaster/src/main/resources/configuration/initial/00-netty.xml create mode 100644 distributions/extra/toaster/src/main/resources/configuration/initial/01-md-sal.xml create mode 100644 distributions/extra/toaster/src/main/resources/configuration/initial/02-toaster.xml create mode 100644 distributions/extra/toaster/src/main/resources/configuration/logback.xml create mode 100644 distributions/extra/toaster/src/main/resources/configuration/startup/README create mode 100644 distributions/extra/toaster/src/main/resources/configuration/tomcat-logging.properties create mode 100644 distributions/extra/toaster/src/main/resources/configuration/tomcat-server.xml create mode 100644 distributions/extra/toaster/src/main/resources/run.bat create mode 100755 distributions/extra/toaster/src/main/resources/run.sh create mode 100644 distributions/extra/toaster/src/main/resources/version.properties diff --git a/distributions/extra/toaster/pom.xml b/distributions/extra/toaster/pom.xml new file mode 100644 index 00000000..a4ba6ec4 --- /dev/null +++ b/distributions/extra/toaster/pom.xml @@ -0,0 +1,973 @@ + + + + + 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.integration + distributions + 0.1.2-SNAPSHOT + ../.. + + + distributions-toaster + pom + OpenDaylight Toaster Edition + + + 2.5.0 + 2.2.0.RELEASE + 2.3.0 + 1.17 + 1.0.9 + 4.0.19.Final + 1.7.2 + 3.6.0.RELEASE + 0000.0002.0038.0 + + 0.5.2-SNAPSHOT + 0.4.2-SNAPSHOT + 0.2.5-SNAPSHOT + 0.5.0-SNAPSHOT + 1.1-SNAPSHOT + ${controller.config.version} + 0.6.2-SNAPSHOT + + UTF-8 + + + + + + opendaylight-mirror + opendaylight-mirror + ${nexusproxy}/groups/public/ + + false + + + true + never + + + + + opendaylight-snapshot + opendaylight-snapshot + ${nexusproxy}/repositories/opendaylight.snapshot/ + + true + + + false + + + + + + + + opendaylight-mirror + opendaylight-mirror + ${nexusproxy}/groups/public/ + + false + + + true + never + + + + + opendaylight-snapshot + opendaylight-snapshot + ${nexusproxy}/repositories/opendaylight.snapshot/ + + true + + + false + + + + + + + opendaylight-release + ${nexusproxy}/repositories/opendaylight.release/ + + + + opendaylight-snapshot + ${nexusproxy}/repositories/opendaylight.snapshot/ + + + + website + ${sitedeploy} + + + + + + + org.opendaylight.yangtools + binding-type-provider + ${yangtools.version} + + + org.opendaylight.yangtools + binding-generator-api + ${yangtools.version} + + + org.opendaylight.yangtools + binding-generator-spi + ${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} + + + org.opendaylight.yangtools + concepts + ${yangtools.version} + + + org.opendaylight.yangtools + util + ${yangtools.version} + + + org.opendaylight.yangtools + yang-binding + ${yangtools.version} + + + org.opendaylight.yangtools + yang-common + ${yangtools.version} + + + org.opendaylight.yangtools + yang-data-api + ${yangtools.version} + + + org.opendaylight.yangtools + yang-data-impl + ${yangtools.version} + + + org.opendaylight.yangtools + yang-data-util + ${yangtools.version} + + + org.opendaylight.yangtools + yang-model-api + ${yangtools.version} + + + org.opendaylight.yangtools + yang-model-util + ${yangtools.version} + + + org.opendaylight.yangtools + yang-parser-api + ${yangtools.version} + + + org.opendaylight.yangtools + yang-parser-impl + ${yangtools.version} + + + + + org.opendaylight.yangtools.thirdparty + antlr4-runtime-osgi-nohead + 4.0 + + + org.opendaylight.yangtools.thirdparty + xtend-lib-osgi + 2.4.3 + + + + + org.opendaylight.yangtools.model + ietf-inet-types + 2010.09.24.4-SNAPSHOT + + + org.opendaylight.yangtools.model + ietf-yang-types + 2010.09.24.4-SNAPSHOT + + + org.opendaylight.yangtools.model + yang-ext + 2013.09.07.4-SNAPSHOT + + + + + org.opendaylight.controller + concepts + ${concepts.version} + + + + + org.opendaylight.controller + protocol-framework + ${controller.framework.version} + + + + + org.opendaylight.controller + sal-common + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-common-api + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-common-impl + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-common-util + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-core-api + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-core-spi + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-broker-impl + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-binding-api + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-binding-config + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-binding-broker-impl + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-connector-api + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-rest-connector + ${controller.mdsal.version} + + + org.opendaylight.controller + sal-binding-util + ${controller.mdsal.version} + + + + + org.opendaylight.controller + config-api + ${controller.config.version} + + + org.opendaylight.controller + config-manager + ${controller.config.version} + + + org.opendaylight.controller + yang-jmx-generator + ${controller.config.version} + + + org.opendaylight.controller + config-persister-api + ${controller.config.version} + + + org.opendaylight.controller + config-persister-file-xml-adapter + ${controller.config.version} + + + org.opendaylight.controller + config-persister-directory-adapter + ${controller.config.version} + + + org.opendaylight.controller + config-persister-directory-xml-adapter + ${controller.config.version} + + + org.opendaylight.controller + shutdown-api + ${controller.config.version} + + + org.opendaylight.controller + shutdown-impl + ${controller.config.version} + + + + + org.opendaylight.controller + logback-config + ${controller.config.version} + + + org.opendaylight.controller + netty-config-api + ${controller.config.version} + + + org.opendaylight.controller + threadpool-config-api + ${controller.config.version} + + + org.opendaylight.controller + threadpool-config-impl + ${controller.config.version} + + + org.opendaylight.controller + netty-event-executor-config + ${controller.config.version} + + + org.opendaylight.controller + netty-threadgroup-config + ${controller.config.version} + + + org.opendaylight.controller + netty-timer-config + ${controller.config.version} + + + + + org.opendaylight.controller + netconf-api + ${netconf.version} + + + org.opendaylight.controller + netconf-impl + ${netconf.version} + + + org.opendaylight.controller + netconf-netty-util + ${netconf.version} + + + org.opendaylight.controller + netconf-util + ${netconf.version} + + + org.opendaylight.controller + netconf-mapping-api + ${netconf.version} + + + org.opendaylight.controller + config-netconf-connector + ${netconf.version} + + + org.opendaylight.controller + netconf-monitoring + ${netconf.version} + + + org.opendaylight.controller + ietf-netconf-monitoring + ${netconf.version} + + + org.opendaylight.controller + ietf-netconf-monitoring-extension + ${netconf.version} + + + org.opendaylight.controller + config-persister-impl + ${netconf.version} + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + ch.qos.logback + logback-core + ${logback.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + org.opendaylight.controller + logging.bridge + ${controller.version} + + + + + io.netty + netty-buffer + ${netty.version} + + + io.netty + netty-codec + ${netty.version} + + + io.netty + netty-codec-http + ${netty.version} + + + io.netty + netty-common + ${netty.version} + + + io.netty + netty-handler + ${netty.version} + + + io.netty + netty-transport + ${netty.version} + + + + + com.sun.jersey + jersey-core + ${jersey.version} + + + com.sun.jersey + jersey-server + ${jersey.version} + + + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-core + ${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} + + + + + commons-codec + commons-codec + 1.7 + + + commons-io + commons-io + 2.4 + + + org.apache.commons + commons-lang3 + 3.1 + + + + + com.google.code.gson + gson + 2.2.4 + + + com.google.guava + guava + 14.0.1 + + + org.javassist + javassist + 3.17.1-GA + + + org.opendaylight.controller.thirdparty + ganymed + 1.1-SNAPSHOT + + + org.openexi + nagasena + ${openexi.version} + + + org.openexi + nagasena-rta + ${openexi.version} + + + + + equinoxSDK381 + javax.servlet + 3.0.0.v201112011016 + + + equinoxSDK381 + javax.servlet.jsp + 2.2.0.v201112011158 + + + equinoxSDK381 + org.eclipse.equinox.ds + 1.4.0.v20120522-1841 + + + equinoxSDK381 + org.eclipse.equinox.util + 1.0.400.v20120522-2049 + + + equinoxSDK381 + org.eclipse.osgi.services + 3.3.100.v20120522-1822 + + + equinoxSDK381 + org.eclipse.osgi + 3.8.1.v20120830-144521 + + + equinoxSDK381 + org.eclipse.equinox.cm + 1.0.400.v20120522-1841 + + + equinoxSDK381 + org.eclipse.equinox.console + 1.0.0.v20120522-1841 + + + equinoxSDK381 + org.eclipse.equinox.launcher + 1.3.0.v20120522-1813 + + + + + equinoxSDK381 + org.apache.felix.gogo.command + 0.8.0.v201108120515 + + + equinoxSDK381 + org.apache.felix.gogo.runtime + 0.8.0.v201108120515 + + + equinoxSDK381 + org.apache.felix.gogo.shell + 0.8.0.v201110170705 + + + + + geminiweb + org.eclipse.gemini.web.core + ${geminiweb.version} + + + geminiweb + org.eclipse.gemini.web.extender + ${geminiweb.version} + + + geminiweb + org.eclipse.gemini.web.tomcat + ${geminiweb.version} + + + + + geminiweb + org.eclipse.virgo.kernel.equinox.extensions + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.common + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.io + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.math + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.osgi + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.osgi.manifest + ${virgo.version} + + + geminiweb + org.eclipse.virgo.util.parser.manifest + ${virgo.version} + + + + + org.jboss.spec.javax.transaction + jboss-transaction-api_1.1_spec + 1.0.1.Final + + + orbit + javax.activation + 1.1.0.v201211130549 + + + orbit + javax.annotation + 1.1.0.v201209060031 + + + orbit + javax.ejb + 3.1.1.v201204261316 + + + orbit + javax.el + 2.2.0.v201108011116 + + + orbit + javax.mail.glassfish + 1.4.1.v201108011116 + + + eclipselink + javax.persistence + 2.0.4.v201112161009 + + + eclipselink + javax.resource + 1.5.0.v200906010428 + + + orbit + javax.xml.rpc + 1.1.0.v201005080400 + + + orbit + org.apache.catalina + 7.0.32.v201211201336 + + + orbit + org.apache.coyote + 7.0.32.v201211201952 + + + orbit + org.apache.el + 7.0.32.v201211081135 + + + orbit + org.apache.jasper + 7.0.32.v201211201952 + + + + + org.eclipse.equinox.http + servlet + 1.0.0-v20070606 + + + 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.apache.felix + org.apache.felix.fileinstall + 3.1.6 + + + virgomirror + org.eclipse.jdt.core.compiler.batch + 3.8.0.I20120518-2145 + + + orbit + org.apache.juli.extras + 7.0.32.v201211081135 + + + orbit + org.apache.tomcat.api + 7.0.32.v201211081135 + + + orbit + org.apache.tomcat.util + 7.0.32.v201211201952 + + + orbit + javax.servlet.jsp.jstl + 1.2.0.v201105211821 + + + + org.eclipse.persistence + org.eclipse.persistence.moxy + ${eclipselink.version} + + + org.eclipse.persistence + org.eclipse.persistence.core + ${eclipselink.version} + + + + + org.opendaylight.controller.thirdparty + net.sf.jung2 + 2.0.1 + + + org.opendaylight.controller.thirdparty + com.sun.jersey.jersey-servlet + 1.17 + + + org.opendaylight.controller.thirdparty + org.apache.catalina.filters.CorsFilter + 7.0.42 + + + + + org.opendaylight.controller + osgi-brandfragment.web + 0.0.2-SNAPSHOT + + + + + org.opendaylight.controller.samples + sample-toaster + ${controller.mdsal.version} + + + org.opendaylight.controller.samples + sample-toaster-consumer + ${controller.mdsal.version} + + + org.opendaylight.controller.samples + sample-toaster-provider + ${controller.mdsal.version} + + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.2 + + + validate + + create + + + + + false + false + VersionUnknown + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.8 + + + unpack-provided-configs + + unpack-dependencies + + generate-resources + + ${project.build.directory}/provided-configs + + bgp-controller-config, + pcep-controller-config, + programming-controller-config, + + + org.opendaylight.bgpcep, + + true + false + + + + + + maven-assembly-plugin + 2.3 + + + distro-assembly + package + + single + + + + src/assemble/bin.xml + + ${project.artifactId} + + + + + + + diff --git a/distributions/extra/toaster/src/assemble/bin.xml b/distributions/extra/toaster/src/assemble/bin.xml new file mode 100644 index 00000000..7acca5e9 --- /dev/null +++ b/distributions/extra/toaster/src/assemble/bin.xml @@ -0,0 +1,99 @@ + + osgipackage + + dir + zip + + false + + + false + opendaylight/plugins + + equinoxSDK381:org.eclipse.osgi + equinoxSDK381:org.eclipse.equinox.console + equinoxSDK381:org.eclipse.equinox.launcher + equinoxSDK381:org.eclipse.equinox.ds + equinoxSDK381:org.eclipse.equinox.util + equinoxSDK381:org.eclipse.osgi.services + virgomirror:org.eclipse.jdt.core.compiler.batch + org.apache.felix:org.apache.felix.fileinstall + geminiweb:org.eclipse.virgo.kernel.equinox.extensions + org.slf4j:slf4j-api + ch.qos.logback:logback-core + ch.qos.logback:logback-classic + com.sun.jersey:jersey-core + com.sun.jersey:jersey-server + org.opendaylight.controller:logging.bridge + + + ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} + + false + runtime + false + + + false + opendaylight/lib + + equinoxSDK381:org.eclipse.osgi + equinoxSDK381:org.eclipse.equinox.console + equinoxSDK381:org.eclipse.equinox.launcher + equinoxSDK381:org.eclipse.equinox.ds + equinoxSDK381:org.eclipse.equinox.util + equinoxSDK381:org.eclipse.osgi.services + virgomirror:org.eclipse.jdt.core.compiler.batch + org.apache.felix:org.apache.felix.fileinstall + geminiweb:org.eclipse.virgo.kernel.equinox.extensions + org.slf4j:slf4j-api + ch.qos.logback:logback-core + ch.qos.logback:logback-classic + com.sun.jersey:jersey-core + com.sun.jersey:jersey-server + org.opendaylight.controller:logging.bridge + + false + + ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} + + false + runtime + + + + + + src/main/resources/ + + + version.properties + configuration/config.ini + + + opendaylight/ + + + + ${project.build.directory}/provided-configs + /opendaylight/configuration + + META-INF + + + + + + src/main/resources/version.properties + opendaylight + true + + + src/main/resources/configuration/config.ini + opendaylight/configuration + true + + + diff --git a/distributions/extra/toaster/src/main/resources/TOASTER.txt b/distributions/extra/toaster/src/main/resources/TOASTER.txt new file mode 100644 index 00000000..516b1651 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/TOASTER.txt @@ -0,0 +1,18 @@ +To request a toast, do the equivalent of: + +curl -v -H "Content-Type: application/yang.operation+json" -XPOST \ + http://localhost:8080/restconf/operations/toaster:make-toast -d \ + '{ + "input" : { + "toasterDoneness" : 10, + "toasterToastType" : "white-bread" + } + }' + +Note that the darker the toast, the longer it takes to make. + +You can view the toaster status over by examining + +http://localhost:8080/restconf/operational/toaster:toaster/ + +Happy toasting! :) diff --git a/distributions/extra/toaster/src/main/resources/configuration/RSA.pk b/distributions/extra/toaster/src/main/resources/configuration/RSA.pk new file mode 100644 index 00000000..c0266c7b --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/RSA.pk @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAuC9hbEacpewvylI0mwFwjy3Wou2hpr/ncN9BBiFDSaG5yW2k +3Oy+SCAcFCL+ZKWb6cc6Ch4gUeCwyEHRojZguuhliKtak9YQf6qbvpPLe00842Lx +iqNAGurMpzizCDsGFq8ChaAkBZQI3TvcHuPoSUWSMJ+K8xHpRyUdVr6g2yEjezKJ +sTXBtWaeCCh6YUafFujuDJk7fvYcPW7Je5KRBBStIKvxcMW0zB+7eq04deTHwGbJ +gGjKWilQ72hsDDP3Hbp5CJMAYg1r4GlCmFx3KyHRGztgWgNgaD7nNpKCkTLjtmA6 +b4x7TA+jrzZ6Af2z5TMrI4dv5w1SrxHaZ+ziLQIDAQABAoIBAHTndeGgq/rQf8De +Do+4CTaHtK0zQSAyu/azbXUzlZ7drKuCEVs8VMY4wzmwwGEnkF+A2YDkgEUX5X0l +8aYQ97KKoS9u+43MGCrAIhyDeGrpqlT1TzRcy+qJz53v6gq2U/X/3QztiQ+VV078 +mIluxNgE9XYxPaNsYfGLSCTv1+9c8y/hjGVX2kwFK+u4ut0ZZETggNa8UxfaHVDS +fIJQX9Gm3J3GSUV30fDGMBIUW6ESLc2L8b7u8Mp9TRP39ZeQSuEUjBe8MYKv0Rel +oEpjZvcnniMTpFbLpndBYn7/AoIiEBvtCN8faVTuRRcvvLcsRm09IctzKQYnMh6M +6PLKV+ECgYEA8HFRYaKHUzxpzE/fyon82GQbzqFFY0/bbWrfWICMfNbIgshJUie6 +FmH5iUFMfeqaT7v557HFM0GB9FeIeSbvd88YmiBAcRopZ3DfMkDH+DT73yJ+/TKG +2nrQtdhyuTIs4bwHqeS2BBJYs7PK9R2rratF3l34Tf7mjlvyOgygHdUCgYEAxBo2 +8hEBlAVNcNb1hTYUxe1w1B6675/mFlmw98Xmj9dRYfICXNhahs8tX3/lsBEd+vBu +fI0oyHaff8m5bPgGzD1ZMybfeROujNrgxaKVk7Ef0FDRRCop4bm18OroFlFAt9l8 +wMp++ToACbdvQvL/mjWMPYlIxhB/YxHswICZZvkCgYAexxKYwdo6sGAGlC7cWT9x +X5cjowcjyEQZRHXkeUgCbufpvcOM7aLnXJE5nY8yCwbHsBM0MlBA2GDPKylAANjk +aDEJAZneIHAuWodngl1Wi0m2bU7+ECqs6s2uiU9eH2sZVh1RBQK7kLGkBx6ys6KX +L3ZZGYRAT6GplWFzRsx0JQKBgCeVlxPD5QqpC1nEumi6YvUVGdpnnZpzL3HBhxxs +wT612wKnZFyze4qM1X7ahVXGDsQxtkvD/sCAWW/lG13orw6ZL6FIroF1PJ3ILOkY +CZN3hJF7TtKwpCWhZB2OfWzL2AGEkE8mUP0j/Q/5DCd6f6f0OSvOw3bfq6cm3iB5 +lP2ZAoGAXsRN5TZTX4AQ2xTlrDQ8A5XgcvyWQpJOmEXMTyHV7VaJVzmNWFVAvndK +5UIq8ALDwB2t7vjmMUW6euvIwqtXiop7G79UOb3e3NhzeyWFGQyBLqCRznGaXQTT +dlFy73xhukZMhFnj006bjKCYvOPnwuGl3+0fuWil5Rq3jOuY5c8= +-----END RSA PRIVATE KEY----- diff --git a/distributions/extra/toaster/src/main/resources/configuration/config.ini b/distributions/extra/toaster/src/main/resources/configuration/config.ini new file mode 100644 index 00000000..3a977b15 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/config.ini @@ -0,0 +1,135 @@ +osgi.bundles=\ + reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\ + reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\ + reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\ + reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\ + reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\ + reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\ + 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/jersey-core-1.17.jar@2:start,\ + reference\:file\:../lib/jersey-server-1.17.jar@2:start + +# Netconf startup configuration +netconf.tcp.address=127.0.0.1 +netconf.tcp.port=8383 + +netconf.ssh.address=0.0.0.0 +netconf.ssh.port=1830 +netconf.ssh.pk.path = ./configuration/RSA.pk + +netconf.config.persister.active=1,2 +# read startup configuration +netconf.config.persister.1.storageAdapterClass=org.opendaylight.controller.config.persist.storage.directory.xml.XmlDirectoryStorageAdapter +netconf.config.persister.1.properties.directoryStorage=configuration/initial/ +netconf.config.persister.1.readonly=true + +netconf.config.persister.2.storageAdapterClass=org.opendaylight.controller.config.persist.storage.file.xml.XmlFileStorageAdapter +netconf.config.persister.2.properties.fileStorage=configuration/current/controller.currentconfig.xml +netconf.config.persister.2.properties.numberOfBackups=2 + +yangstore.blacklist=.*controller.model.* + +# Set Default start level for framework +osgi.bundles.defaultStartLevel=4 +# Extra packages to import from the boot class loader +org.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc,sun.nio.ch +# This is not Eclipse App +eclipse.ignoreApp=true +# Don't shutdown equinox if the eclipse App has ended, +# which is our case because we are not running any eclipse application +osgi.noShutdown=true +# Clean any cached data on restart of the framework +osgi.clean=true +# Extend the framework to avoid the resources to be presented with +# a URL of type bundleresource: but to be presented as file: +osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator +# Directory from where the fileinstall will monitor for new bundles +felix.fileinstall.dir=./plugins +# Immediately learn new bundles at startup +felix.fileinstall.noInitialDelay=true +# Auto start the bundles at level 4 +felix.fileinstall.start.level=4 +# Avoid to auto-install following bundles, that means those need +# to be started manually or in other way like osgi.bundles +felix.fileinstall.filter=^(?!org.apache.felix.fileinstall).* + +# logback configuration +logback.configurationFile=configuration/logback.xml + +# Container configuration +container.profile = Container + +# Connection manager configuration +connection.scheme = ANY_CONTROLLER_ONE_MASTER + +# Embedded Tomcat configuration File +org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml + +# Open Flow related system parameters +# TCP port on which the controller is listening (default 6633) +# of.listenPort=6633 +# IP address of the controller (default: wild card) +# of.address = 127.0.0.1 +# The time (in milliseconds) the controller will wait for a response after sending a Barrier Request or a Statistic Request message (default 2000 msec) +# of.messageResponseTimer=2000 +# The switch liveness timeout value (default 60500 msec) +# of.switchLivenessTimeout=60500 +# The size of the queue holding pending statistics requests (default 64). For large networks of n switches, it is recommended to set the queue size to n +# of.statsQueueSize = 64 +# The flow statistics polling interval in second (default 10 sec) +# of.flowStatsPollInterval=10 +# The port statistics polling interval in second (default 5 sec) +# of.portStatsPollInterval=5 +# The description statistics polling interval in second (default 60 sec) +# of.descStatsPollInterval=60 +# The table statistics polling interval in second (default 10 sec) +# of.tableStatsPollInterval=10 +# The maximum number of asynchronous messages can be sent before sending a Barrier Request (default 100) +# of.barrierMessagePriorCount=100 +# The interval which determines how often the discovery packets should be sent (default 300 sec) +# of.discoveryInterval=300 +# The timeout multiple of discovery interval +# of.discoveryTimeoutMultiple=2 +# For newly added ports, allow one more retry if the elapsed time exceeds this threshold (default 30 sec) +# of.discoveryThreshold=30 +# The maximum number of ports handled in one discovery batch (default 512) +# of.discoveryBatchMaxPorts=512 + +# OVSDB configuration +# ovsdb plugin supports both active and passive connections. It listens on port 6640 by default for Active connections. +ovsdb.listenPort=6640 + +# ovsdb creates Openflow nodes/bridges. This configuration configures the bridge's Openflow version. +# default Openflow version = 1.0, we also support 1.3. +# ovsdb.of.version=1.3 + +# TLS configuration +# To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files. +# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate +# entries, including switches' Certification Authority (CA) certificates. For example, +# secureChannelEnabled=true +# controllerKeyStore=./configuration/ctlKeyStore +# controllerKeyStorePassword=xxxxxxxx (this password should match the password used for KeyStore generation and at least 6 characters) +# controllerTrustStore=./configuration/ctlTrustStore +# controllerTrustStorePassword=xxxxxxxx (this password should match the password used for TrustStore generation and at least 6 characters) + +secureChannelEnabled=false +controllerKeyStore= +controllerKeyStorePassword= +controllerTrustStore= +controllerTrustStorePassword= + +# User Manager configurations +enableStrongPasswordCheck = false + +#Jolokia configurations +org.jolokia.listenForHttpService=false + +# Logging configuration for Tomcat-JUL logging +java.util.logging.config.file=configuration/tomcat-logging.properties + +#Hosttracker hostsdb key scheme setting +hosttracker.keyscheme=IP diff --git a/distributions/extra/toaster/src/main/resources/configuration/context.xml b/distributions/extra/toaster/src/main/resources/configuration/context.xml new file mode 100644 index 00000000..90b9ddf1 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/context.xml @@ -0,0 +1 @@ + diff --git a/distributions/extra/toaster/src/main/resources/configuration/initial/00-netty.xml b/distributions/extra/toaster/src/main/resources/configuration/initial/00-netty.xml new file mode 100644 index 00000000..2365c700 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/initial/00-netty.xml @@ -0,0 +1,60 @@ + + + urn:opendaylight:params:xml:ns:yang:controller:netty?module=netty&revision=2013-11-19 + urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor?module=netty-event-executor&revision=2013-11-12 + urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup?module=threadgroup&revision=2013-11-07 + urn:opendaylight:params:xml:ns:yang:controller:netty:timer?module=netty-timer&revision=2013-11-19 + + + + + + + netty:netty-threadgroup-fixed + global-boss-group + + + netty:netty-threadgroup-fixed + global-worker-group + + + netty:netty-hashed-wheel-timer + global-timer + + + netty:netty-global-event-executor + singleton + + + + + + netty:netty-threadgroup + + global-boss-group + /modules/module[type='netty-threadgroup-fixed'][name='global-boss-group'] + + + global-worker-group + /modules/module[type='netty-threadgroup-fixed'][name='global-worker-group'] + + + + netty:netty-event-executor + + global-event-executor + /modules/module[type='netty-global-event-executor'][name='singleton'] + + + + netty:netty-timer + + global-timer + /modules/module[type='netty-hashed-wheel-timer'][name='global-timer'] + + + + + + + diff --git a/distributions/extra/toaster/src/main/resources/configuration/initial/01-md-sal.xml b/distributions/extra/toaster/src/main/resources/configuration/initial/01-md-sal.xml new file mode 100644 index 00000000..36a5e986 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/initial/01-md-sal.xml @@ -0,0 +1,135 @@ + + + + + + + + + prefix:schema-service-singleton + yang-schema-service + + + prefix:hash-map-data-store + hash-map-data-store + + + prefix:dom-broker-impl + dom-broker + + dom:dom-data-store + + hash-map-data-store + + + + + prefix:binding-broker-impl + binding-broker-impl + + binding:binding-notification-service + binding-notification-broker + + + binding:binding-data-broker + binding-data-broker + + + + prefix:runtime-generated-mapping + runtime-mapping-singleton + + + prefix:binding-notification-broker + binding-notification-broker + + + prefix:binding-data-broker + binding-data-broker + + dom:dom-broker-osgi-registry + dom-broker + + + binding:binding-dom-mapping-service + runtime-mapping-singleton + + + + + + + + dom:schema-service + + yang-schema-service + /modules/module[type='schema-service-singleton'][name='yang-schema-service'] + + + + binding:binding-notification-service + + binding-notification-broker + /modules/module[type='binding-notification-broker'][name='binding-notification-broker'] + + + + dom:dom-data-store + + hash-map-data-store + /modules/module[type='hash-map-data-store'][name='hash-map-data-store'] + + + + binding:binding-broker-osgi-registry + + binding-osgi-broker + /modules/module[type='binding-broker-impl'][name='binding-broker-impl'] + + + + binding:binding-rpc-registry + + binding-rpc-broker + /modules/module[type='binding-broker-impl'][name='binding-broker-impl'] + + + + binding-impl:binding-dom-mapping-service + + runtime-mapping-singleton + /modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton'] + + + + dom:dom-broker-osgi-registry + + dom-broker + /modules/module[type='dom-broker-impl'][name='dom-broker'] + + + + binding:binding-data-broker + + binding-data-broker + /modules/module[type='binding-data-broker'][name='binding-data-broker'] + + + + + + + + + + urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor?module=netty-event-executor&revision=2013-11-12 + urn:opendaylight:params:xml:ns:yang:controller:threadpool?module=threadpool&revision=2013-04-09 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&revision=2013-10-28 + + + + diff --git a/distributions/extra/toaster/src/main/resources/configuration/initial/02-toaster.xml b/distributions/extra/toaster/src/main/resources/configuration/initial/02-toaster.xml new file mode 100644 index 00000000..6f1faa28 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/initial/02-toaster.xml @@ -0,0 +1,78 @@ + + + + + + + + + + toaster:toaster-provider-impl + + toaster-provider-impl + + + binding:binding-rpc-registry + binding-rpc-broker + + + + binding:binding-data-broker + binding-data-broker + + + + + binding:binding-notification-service + + binding-notification-broker + + + + + + kitchen:kitchen-service-impl + + kitchen-service-impl + + + binding:binding-rpc-registry + binding-rpc-broker + + + + + binding:binding-notification-service + + binding-notification-broker + + + + + + + + kitchen:kitchen-service + + + kitchen-service + /modules/module[type='kitchen-service-impl'][name='kitchen-service-impl'] + + + + + + + + + urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl?module=kitchen-service-impl&revision=2014-01-31 + urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl?module=toaster-provider-impl&revision=2014-01-31 + + + diff --git a/distributions/extra/toaster/src/main/resources/configuration/logback.xml b/distributions/extra/toaster/src/main/resources/configuration/logback.xml new file mode 100644 index 00000000..88f75770 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/logback.xml @@ -0,0 +1,99 @@ + + + + + %date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n + + + + logs/opendaylight.log + + + logs/opendaylight.%d.log.zip + 1 + + + + 10MB + + + + %date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n + + + + logs/audit.log + true + + %date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distributions/extra/toaster/src/main/resources/configuration/startup/README b/distributions/extra/toaster/src/main/resources/configuration/startup/README new file mode 100644 index 00000000..2da70fff --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/startup/README @@ -0,0 +1 @@ +Directory where the opendaylight controller modules store their configuration files diff --git a/distributions/extra/toaster/src/main/resources/configuration/tomcat-logging.properties b/distributions/extra/toaster/src/main/resources/configuration/tomcat-logging.properties new file mode 100644 index 00000000..3dbd9921 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/tomcat-logging.properties @@ -0,0 +1,42 @@ +############################################################ +# Configuration file for tomcat logging +############################################################ +# Handlers: +# "handlers" specifies a comma separated list of log Handler +# classes. These handlers will be installed during VM startup. +# Note that these classes must be on the system classpath. +# Following line configures a ConsoleHandler and a FileHandler + +handlers= java.util.logging.FileHandler,java.util.logging.ConsoleHandler + +############################################################ +# Handler specific properties +# Describes specific configuration info for Handlers +# JUL does not support rolling file handler based on date +# For now we will keep count of files to 5 with rolling size of 10MB +############################################################ + +java.util.logging.FileHandler.pattern = logs/tomcat%g.log +java.util.logging.FileHandler.limit = 104857600 +java.util.logging.FileHandler.count = 5 +java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter +java.util.logging.FileHandler.append = true +java.util.logging.FileHandler.level = INFO + +# Limit the message that are printed on the console to SEVERE and above. +java.util.logging.ConsoleHandler.level = WARNING +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +# SimpleFormatter output format to print one-line log message like this: +# --
:: [] > +# +java.util.logging.SimpleFormatter.format=%1$tF %1$tT %1$tZ [%3$s] %4$s %2$s %5$s%6$s%n + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages +#org.apache.catalina = SEVERE diff --git a/distributions/extra/toaster/src/main/resources/configuration/tomcat-server.xml b/distributions/extra/toaster/src/main/resources/configuration/tomcat-server.xml new file mode 100644 index 00000000..32dce771 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/configuration/tomcat-server.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distributions/extra/toaster/src/main/resources/run.bat b/distributions/extra/toaster/src/main/resources/run.bat new file mode 100644 index 00000000..9d6ac8d1 --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/run.bat @@ -0,0 +1,150 @@ +@ECHO OFF +SETLOCAL ENABLEDELAYEDEXPANSION + +IF NOT EXIST "%JAVA_HOME%" ( + ECHO JAVA_HOME environment variable is not set + EXIT /B 2 +) + +SET basedir=%~dp0 +SET debugport=8000 +SET consoleport=2400 +SET jmxport=1088 +SET extraJVMOpts= +SET consoleOpts=-console -consoleLog +SET PID= + +:LOOP +IF "%~1" NEQ "" ( + SET CARG=%~1 + IF "!CARG!"=="-debug" ( + SET debugEnabled=true + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-debugsuspend" ( + SET debugEnabled=true + SET debugSuspended=true + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-debugport" ( + SET debugEnabled=true + SET debugport=%~2 + SHIFT & SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-jmx" ( + SET jmxEnabled=true + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-jmxport" ( + SET jmxEnabled=true + SET jmxport=%~2 + SHIFT & SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-start" ( + SET startEnabled=true + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-consoleport" ( + SET consoleport=%~2 + SHIFT & SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-console" ( + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-status" ( + for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do ( + set PID=%%G + ) + if "!PID!" NEQ "" ( + ECHO Controller is running with PID !PID! + ) else ( + ECHO Controller is not running. + ) + GOTO :EOF + ) + IF "!CARG!"=="-stop" ( + for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do ( + set PID=%%G + ) + if "!PID!" NEQ "" ( + ECHO Stopping controller PID !PID! + TASKKILL /F /PID !PID! + ) else ( + ECHO Controller is not running. + ) + GOTO :EOF + ) + IF "!CARG:~0,2!"=="-D" ( + SET extraJVMOpts=%extraJVMOpts% !CARG! + SHIFT + GOTO :LOOP + ) + IF "!CARG:~0,2!"=="-X" ( + SET extraJVMOpts=%extraJVMOpts% !CARG! + SHIFT + GOTO :LOOP + ) + IF "!CARG!"=="-help" ( + ECHO "Usage: %0 [-jmx] [-jmxport ] [-debug] [-debugsuspend] [-debugport ] [-start] [-consoleport ]] [-stop] [-status] [-console] [-help] []" + ECHO Note: Enclose any JVM or System properties within double quotes. + GOTO :EOF + ) + + ECHO "Unknown option: !CARG!" + EXIT /B 1 +) + +IF "%debugEnabled%" NEQ "" ( + REM ECHO "DEBUG enabled" + SET extraJVMOpts=%extraJVMOpts% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%debugport% +) +IF "%debugSuspended%" NEQ "" ( + REM ECHO "DEBUG enabled suspended" + SET extraJVMOpts=%extraJVMOpts% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%debugport% +) +IF "%jmxEnabled%" NEQ "" ( + REM ECHO "JMX enabled " + SET extraJVMOpts=%extraJVMOpts% -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=%jmxport% -Dcom.sun.management.jmxremote +) +IF "%startEnabled%" NEQ "" ( + REM ECHO "START enabled " + SET consoleOpts=-console %consoleport% -consoleLog +) + +REM Check if controller is already running +for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do ( + SET PID=%%G +) +if "!PID!" NEQ "" ( + ECHO Controller is already running with PID !PID! + EXIT /B 1 +) + + +REM Now set the classpath: +SET cp="%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar" + +REM Now set framework classpath +SET fwcp="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar,file:\%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar,file:\%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar" + +SET RUN_CMD="%JAVA_HOME%\bin\java.exe" -Dopendaylight.controller %extraJVMOpts% -Djava.io.tmpdir="%basedir%work\tmp" -Djava.awt.headless=true -Dosgi.install.area=%basedir% -Dosgi.configuration.area="%basedir%configuration" -Dosgi.frameworkClassPath=%fwcp% -Dosgi.framework="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar" -classpath %cp% org.eclipse.equinox.launcher.Main %consoleOpts% + +ECHO %RUN_CMD% + +if "%startEnabled%" NEQ "" ( + START /B cmd /C CALL %RUN_CMD% > %basedir%\logs\controller.out 2>&1 + ECHO Running controller in the background. +) else ( + %RUN_CMD% + EXIT /B %ERRORLEVEL% +) + + diff --git a/distributions/extra/toaster/src/main/resources/run.sh b/distributions/extra/toaster/src/main/resources/run.sh new file mode 100755 index 00000000..90e3b03a --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/run.sh @@ -0,0 +1,240 @@ +#!/bin/bash + +platform='unknown' +unamestr=`uname` +if [[ "$unamestr" == 'Linux' ]]; then + platform='linux' +elif [[ "$unamestr" == 'Darwin' ]]; then + platform='osx' +fi + +if [[ $platform == 'linux' ]]; then + fullpath=`readlink -f $0` + + if [[ -z ${JAVA_HOME} ]]; then + # Find the actual location of the Java launcher: + java_launcher=`which java` + java_launcher=`readlink -f "${java_launcher}"` + + # Compute the Java home from the location of the Java launcher: + export JAVA_HOME="${java_launcher%/bin/java}" + fi +elif [[ $platform == 'osx' ]]; then + TARGET_FILE=$0 + cd `dirname "$TARGET_FILE"` + TARGET_FILE=`basename $TARGET_FILE` + + # Iterate down a (possible) chain of symlinks + while [ -L "$TARGET_FILE" ] + do + TARGET_FILE=`readlink "$TARGET_FILE"` + cd `dirname "$TARGET_FILE"` + TARGET_FILE=`basename "$TARGET_FILE"` + done + + # Compute the canonicalized name by finding the physical path + # for the directory we're in and appending the target file. + PHYS_DIR=`pwd -P` + RESULT=$PHYS_DIR/$TARGET_FILE + fullpath=$RESULT + + [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/libexec/java_home" ]] && export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; + +fi + +[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1; +[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \ +JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1; + +if [ -z ${ODL_BASEDIR} ]; then + basedir=`dirname "${fullpath}"` +else + basedir=${ODL_BASEDIR} +fi + +if [ -z ${ODL_DATADIR} ]; then + datadir=`dirname "${fullpath}"` +else + datadir=${ODL_DATADIR} +fi + +function usage { + echo "Usage: $0 [-jmx] [-jmxport ] [-debug] [-debugsuspend] [-debugport ] [-start []] [-stop] [-status] [-console] [-help] []" + exit 1 +} + +if [ -z ${TMP} ]; then + pidfile="/tmp/opendaylight.PID" +else + pidfile="${TMP}/opendaylight.PID" +fi +debug=0 +debugsuspend=0 +debugport=8000 +debugportread="" +startdaemon=0 +daemonport=2400 +daemonportread="" +jmxport=1088 +jmxportread="" +startjmx=0 +stopdaemon=0 +statusdaemon=0 +consolestart=1 +dohelp=0 +extraJVMOpts="" +unknown_option=0 +while true ; do + case "$1" in + -debug) debug=1; shift ;; + -jmx) startjmx=1; shift ;; + -debugsuspend) debugsuspend=1; shift ;; + -debugport) shift; debugportread="$1"; if [[ "${debugportread}" =~ ^[0-9]+$ ]] ; then debugport=${debugportread}; shift; else echo "-debugport expects a number but was not found"; exit -1; fi;; + -jmxport) shift; jmxportread="$1"; if [[ "${jmxportread}" =~ ^[0-9]+$ ]] ; then jmxport=${jmxportread}; shift; else echo "-jmxport expects a number but was not found"; exit -1; fi;; + -start) startdaemon=1; shift; daemonportread="$1"; if [[ "${daemonportread}" =~ ^[0-9]+$ ]] ; then daemonport=${daemonportread}; shift; fi;; + -stop) stopdaemon=1; shift ;; + -status) statusdaemon=1; shift ;; + -console) shift ;; + -help) dohelp=1; shift;; + -D*) extraJVMOpts="${extraJVMOpts} $1"; shift;; + -X*) extraJVMOpts="${extraJVMOpts} $1"; shift;; + "") break ;; + *) echo "Unknown option $1"; unknown_option=1; shift ;; + esac +done + +# Unknown Options and help +if [ "${unknown_option}" -eq 1 ]; then + usage +fi + +if [ "${dohelp}" -eq 1 ]; then + usage +fi + +# Validate debug port +if [[ "${debugport}" -lt 1024 ]] || [[ "${debugport}" -gt 65535 ]]; then + echo "Debug Port not in the range [1024,65535] ${debugport}" + exit -1 +fi + +# Validate daemon console port +if [[ "${daemonport}" -lt 1024 ]] || [[ "${daemonport}" -gt 65535 ]]; then + echo "Daemon console Port not in the range [1024,65535] value is ${daemonport}" + exit -1 +fi + +# Validate jmx port +if [[ "${jmxport}" -lt 1024 ]] || [[ "${jmxport}" -gt 65535 ]]; then + echo "JMX Port not in the range [1024,65535] value is ${jmxport}" + exit -1 +fi + +# Debug options +if [ "${debugsuspend}" -eq 1 ]; then + extraJVMOpts="${extraJVMOpts} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debugport}" +elif [ "${debug}" -eq 1 ]; then + extraJVMOpts="${extraJVMOpts} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${debugport}" +fi + +# Add JMX support +if [ "${startjmx}" -eq 1 ]; then + extraJVMOpts="${extraJVMOpts} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=${jmxport} -Dcom.sun.management.jmxremote" +fi + +######################################## +# Now add to classpath the OSGi JAR +######################################## +CLASSPATH="${basedir}"/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar +FWCLASSPATH=file:"${basedir}"/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar + +######################################## +# Now add the extensions +######################################## + +# Extension 1: this is used to be able to convert all the +# bundleresouce: URL in file: so packages that are not OSGi ready can +# still work. Notably this is the case for spring classes +CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar +FWCLASSPATH=${FWCLASSPATH},file:${basedir}/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar + +######################################## +# Now add the launcher +######################################## +CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar +FWCLASSPATH=${FWCLASSPATH},file:${basedir}/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar + +cd $basedir + +if [ "${stopdaemon}" -eq 1 ]; then + if [ -e "${pidfile}" ]; then + daemonpid=`cat "${pidfile}"` + kill "${daemonpid}" + rm -f "${pidfile}" + echo "Controller with PID: ${daemonpid} -- Stopped!" + exit 0 + else + echo "Doesn't seem any Controller daemon is currently running" + exit -1 + fi +fi + +if [ "${statusdaemon}" -eq 1 ]; then + if [ -e "${pidfile}" ]; then + daemonpid=`cat "${pidfile}"` + ps -p ${daemonpid} > /dev/null + daemonexists=$? + if [ "${daemonexists}" -eq 0 ]; then + echo "Controller with PID: ${daemonpid} -- Running!" + exit 0 + else + echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist" + rm -f "${pidfile}" + exit 1 + fi + else + echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found" + exit -1 + fi +fi + +iotmpdir=`echo "${datadir}" | sed 's/ /\\ /g'` +bdir=`echo "${basedir}" | sed 's/ /\\ /g'` +confarea=`echo "${datadir}" | sed 's/ /\\ /g'` +fwclasspath=`echo "${FWCLASSPATH}" | sed 's/ /\\ /g'` + +if [ "${startdaemon}" -eq 1 ]; then + if [ -e "${pidfile}" ]; then + echo "Another instance of controller running, check with $0 -status" + exit -1 + fi + $JAVA_HOME/bin/java ${extraJVMOpts} \ + -Djava.io.tmpdir="${iotmpdir}/work/tmp" \ + -Dosgi.install.area="${bdir}" \ + -Dosgi.configuration.area="${confarea}/configuration" \ + -Dosgi.frameworkClassPath="${fwclasspath}" \ + -Dosgi.framework=file:"${bdir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar" \ + -Djava.awt.headless=true \ + -classpath "${CLASSPATH}" \ + org.eclipse.equinox.launcher.Main \ + -console ${daemonport} \ + -consoleLog & + daemonpid=$! + echo ${daemonpid} > ${pidfile} +elif [ "${consolestart}" -eq 1 ]; then + if [ -e "${pidfile}" ]; then + echo "Another instance of controller running, check with $0 -status" + exit -1 + fi + $JAVA_HOME/bin/java ${extraJVMOpts} \ + -Djava.io.tmpdir="${iotmpdir}/work/tmp" \ + -Dosgi.install.area="${bdir}" \ + -Dosgi.configuration.area="${confarea}/configuration" \ + -Dosgi.frameworkClassPath="${fwclasspath}" \ + -Dosgi.framework=file:"${bdir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar" \ + -Djava.awt.headless=true \ + -classpath "${CLASSPATH}" \ + org.eclipse.equinox.launcher.Main \ + -console \ + -consoleLog +fi diff --git a/distributions/extra/toaster/src/main/resources/version.properties b/distributions/extra/toaster/src/main/resources/version.properties new file mode 100644 index 00000000..90af49df --- /dev/null +++ b/distributions/extra/toaster/src/main/resources/version.properties @@ -0,0 +1,6 @@ +org.opendaylight.controller.version = 0.1 +org.opendaylight.controller.build.scm.version = ${buildNumber} +org.opendaylight.controller.build.user = ${env.USER} +org.opendaylight.controller.build.workspace = ********** +org.opendaylight.controller.build.timestamp = ${timestamp} +org.opendaylight.controller.build.machine = ********** diff --git a/distributions/pom.xml b/distributions/pom.xml index 5511f1fe..6ae66d3a 100644 --- a/distributions/pom.xml +++ b/distributions/pom.xml @@ -17,6 +17,7 @@ base/ virtualization/ serviceprovider/ + extra/toaster -- 2.36.6