diff options
author | 2019-02-18 18:20:55 +0000 | |
---|---|---|
committer | 2019-02-21 17:48:01 +0000 | |
commit | d0a915d10c00314ecc1f07c2ecf9dd239ee47aad (patch) | |
tree | 7174d8a3350dc4449ab24942457ac6c78822fd32 /dmaap-bc | |
parent | cdd17d2146e854d13a71922bcb4f3741f9c15ffe (diff) |
Restructure project for 2 images
Change-Id: I05b858012a05b1c177a8a2e25ec610b0174b6a54
Signed-off-by: dglFromAtt <dgl@research.att.com>
Issue-ID: DMAAP-1046
Signed-off-by: dglFromAtt <dgl@research.att.com>
Patchset2 - corrected some typos
Signed-off-by: dglFromAtt <dgl@research.att.com>
Signed-off-by: dglFromAtt <dgl@research.att.com>
Change-Id: I05b858012a05b1c177a8a2e25ec610b0174b6a54
Signed-off-by: dglFromAtt <dgl@research.att.com>
Patchset3 - use latest dbcapi.jar
Change-Id: I05b858012a05b1c177a8a2e25ec610b0174b6a54
Signed-off-by: dglFromAtt <dgl@research.att.com>
Diffstat (limited to 'dmaap-bc')
-rw-r--r-- | dmaap-bc/misc/LocalKey | 27 | ||||
-rw-r--r-- | dmaap-bc/misc/PolicyEngineApi.properties.tmpl | 36 | ||||
-rw-r--r-- | dmaap-bc/misc/dbc-api.jks | bin | 0 -> 3740 bytes | |||
-rw-r--r-- | dmaap-bc/misc/dmaapbc | 252 | ||||
-rw-r--r-- | dmaap-bc/misc/dmaapbc.properties.tmpl | 218 | ||||
-rw-r--r-- | dmaap-bc/misc/doaction | 63 | ||||
-rw-r--r-- | dmaap-bc/misc/havecert.tmpl | 32 | ||||
-rw-r--r-- | dmaap-bc/misc/log4j.properties.tmpl | 32 | ||||
-rw-r--r-- | dmaap-bc/misc/logback.xml | 358 | ||||
-rw-r--r-- | dmaap-bc/misc/opensource.env | 120 | ||||
-rw-r--r-- | dmaap-bc/misc/org.onap.dmaap-bc.trust.jks | bin | 0 -> 1413 bytes | |||
-rw-r--r-- | dmaap-bc/misc/policyLogger.properties | 45 | ||||
-rw-r--r-- | dmaap-bc/pom.xml | 408 | ||||
-rw-r--r-- | dmaap-bc/src/main/resources/docker-compose.yml | 25 | ||||
-rw-r--r-- | dmaap-bc/src/main/resources/docker-databus-controller.conf | 12 | ||||
-rw-r--r-- | dmaap-bc/src/main/webapp/HelloJetty.html | 30 | ||||
-rw-r--r-- | dmaap-bc/src/main/webapp/WEB-INF/log4j.xml | 45 | ||||
-rw-r--r-- | dmaap-bc/src/main/webapp/WEB-INF/web.xml | 38 | ||||
-rw-r--r-- | dmaap-bc/src/main/webapp/index.jsp | 28 | ||||
-rw-r--r-- | dmaap-bc/version.properties | 35 |
20 files changed, 1804 insertions, 0 deletions
diff --git a/dmaap-bc/misc/LocalKey b/dmaap-bc/misc/LocalKey new file mode 100644 index 0000000..38ede55 --- /dev/null +++ b/dmaap-bc/misc/LocalKey @@ -0,0 +1,27 @@ +7ntUvubggJ1h6AXwQENQScrnlqmLMno_583XufLsguAT11bnBk0DVLE2GtCZ0pNQzlR8I3PJ1_nZ +UEVQs1G_qZzV-MHQZvz54solEp8dNUVji4JUzP7WiPuJdvCX8vvGLc8-jOVzEJ2DAGmV3gNp60_F +jrKx7F7Dz-h94jWZ45rNn7-Re_BneSto6HiSj0DN_SKSNhE5z9Qf3tFyFLGIYmlQoxzbTYC38uN0 +FjAYuKz6W_pTLzyOjHNAagYwEjTUUU-ei-QA5pL20-oG3jSYGnj_V94kd8X5ncB1-nybUsy5OOvZ +huCxf9hSetn2fpIszkRcuFxaxiwubpmEWp2L_zovhcRI1OMFPIIK0IckRHD1a5CpFVzR7P5L7LQk +FErATsQkHsPS9BJN5wlj1EoIhA2uaELjXjmOqPQg76eyQqXXcMHRJTA6czbXPYfTQMQx1r2USC9o +HdoLT4-so7zARZidmYmvPPT9qvNisK6BF4M32K-_s6YyJspSEB1MscNPujsD7zczIsBct7BTRoeZ +CbtkskT_yFhQzdzdSMzFN_NJ7Yb9p3d1G4gSkj2rbA-BDybHHPij8k6-k-ipvi_T_LW9B_J8Jf5f +aRclZqVgwwSG-mUKUyk9bI3cVc-1P2ICUmr59EjuauDAtlMQL-hnTJUs1rUerh4Q7d4XgrNLjLHY +Oue8MEj24VSMl-f28DDIV1N6ODiBKDHUmdENsmlbqeNpzQxu7FoSbLu6gN6zDP8Jw4ck1NHEIv8H +ecUf-hBGdB0HINClaV9X2ycafWcmRY-NCzX65cp7a1Rpl1kCEW5u79LLN28aJeTzmriewhy87hJf +rAah8z3dHteIN1fuvRoGsFwZ4jKo6olFxcBOlpHQIW5JJ1roO1vQ2Dx_l-Foo7wV_AD127zCu7ci +lYodnAOocKbhAub4sf90P3D2NMKb20e5CQrBSchtIEaD3G7J-vL5xYydLuLu5WipOdZuq3VhSSZm +TZIR3Ya2QiZVokxKgH-N0gPDz-TimNV_MkUSCNsv2NxjBM7oPF3dzEHbHS5eue41_R4vqxFdTdva +o0ASTFkARmmnMFBx1a73jmcoBBx-i4el8Rce7RvFWn1PALOnRsIQPy_Pgx0OE9_6eHfOSvyxbyMM +0FwE5f77gO967tgc4LwqB1pzz2Uk7hfizLKNc6nrrgDxSb_9rDWwiE4rWw7WYcRKvRQ270lCH4FQ +ezrPacnnK3cKM5L6brOyhbhiL4MnNX714L0K8C6TQnIVisQCLHwif40G_DSEWxICQ5V2DMzFn3JT +PefaubHlqxRZVikNH71b_2ZRLEi84m5iUuy8Ir1s3W6xuyIdt-yKLnjgnLjOPPxTDC5G_xaXAAuM +SkSOjvPzOArMUUnwYk68jAxXS2tBT8JN6OnglN8dHC-P24tYzfs4B4tMYJ1ibz6BUsQ6nYxsRUak +4ZjRmo3UG0OFJbOY-f0ja6Q4pISe1IXmlM4Ly9QdCfeHyDV-7Fiud9V_zo92lpQwttwSpBvFoDYQ +oePdA0zmCx6GIX_8L9e8a03hUx4aUtZ8C3Kf0PzOWTcjrV7nGb99ctjmRtfGw5GPWudH6CI3WFK2 +5wFDhrQSbRhzV4iQalYVPJQ7LO4WEi4EsBTRSiz074UpvkMV3UfMGDlpXAAq5rEjj-d5WbHhzbs8 +MGKzZLTfUz9lP4CME9AOwto_ey1ly3H-yaEgCpnshm-CZoSqVDmuFYM0QR_NcrqmSQ9ZKJEF_wTa +TEAXNJ99CYE0ZLvU9FjgCqH1-q1zL7z3NLX1uFYazEZWGMZFPVD5XOcCtUlVyUz9KuAO9ARVyu5C +7kzo_AFePtnsA_JUvvkauo6RwO6qhLJjZuSjvmiSdOAohiXUalDFjWVW8CMfgLF4PbRDklsAcsiT +P0xUdyWJ5slu87f9PunXDwQZWNv6haTIhVX7bilCDpRPbTbmimmE_C2J7tgV2EvazD7o8V_jeu0g +cnIpzRnaPG9l-uy2UKoxOXI4CSymcJoyV2xxC0SF7Q5quAhf3UGAdQUeFtHwxZtYiAMXLs06
\ No newline at end of file diff --git a/dmaap-bc/misc/PolicyEngineApi.properties.tmpl b/dmaap-bc/misc/PolicyEngineApi.properties.tmpl new file mode 100644 index 0000000..248b288 --- /dev/null +++ b/dmaap-bc/misc/PolicyEngineApi.properties.tmpl @@ -0,0 +1,36 @@ +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# + +cat <<!EOF +#PDP URLs to which will be used by the Policy Engine API to take Decisions. There are multiple to support redundancy. +#Format: PDP_URL{PriorityNumber} = URL, id, password. +PDP_URL1 = ${DMAAPBC_PDP1_URL:-https://host1.domain.notset.com:8081/pdp/} , ${DMAAPBC_PDP1_USER:-testpdp} , ${DMAAPBC_PDP1_PWD:-alpha123} +PDP_URL2 = ${DMAAPBC_PDP2_URL:-https://host2.domain.notset.com:8082/pdp/} , ${DMAAPBC_PDP2_USER:-testpdp} , ${DMAAPBC_PDP2_PWD:-alpha456} +PAP_URL = ${DMAAPBC_PAP_URL:-https://host3.domain.notset.com:9091/pap/} , ${DMAAPBC_PAP_USER:-testpap} , ${DMAAPBC_PAP_PWD:-alpha123} + + + +CLIENT_ID=${DMAAPBC_TOPICMGR_USER:-mechIdNotSet@namespaceNotSet} +ENVIRONMENT=${DMAAPBC_PE_AAF_ENV:-DEVL} + + +!EOF diff --git a/dmaap-bc/misc/dbc-api.jks b/dmaap-bc/misc/dbc-api.jks Binary files differnew file mode 100644 index 0000000..66142d3 --- /dev/null +++ b/dmaap-bc/misc/dbc-api.jks diff --git a/dmaap-bc/misc/dmaapbc b/dmaap-bc/misc/dmaapbc new file mode 100644 index 0000000..f1e8ae7 --- /dev/null +++ b/dmaap-bc/misc/dmaapbc @@ -0,0 +1,252 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# + +umask 0022 +TZ=GMT0 +COMPONENT=dmaapbc +APP_ROOT=/opt/app/$COMPONENT +USER=root +export TZ +PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin +export PATH +CLASSPATH=`echo $APP_ROOT/etc $APP_ROOT/lib/*.jar | tr ' ' ':'` +export CLASSPATH +CONFIGMAP_ROOT=${CONFIGMAP_ROOT:-/opt/app/config} +CONFIGMAP_PROPS=${CONFIGMAP_PROPS:-$CONFIGMAP_ROOT/conf/dmaapbc.properties} +CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf/buscontroller.env +MAIN=org.onap.dmaap.dbcapi.server.Main + + + +pids() { + set -x + ps -ef | grep java | grep $MAIN | sed -e 's/[^ ]* *//' -e 's/ .*//' + set +x +} + +config() { + echo "ENTER config" + set -x + if [ ! -d $APP_ROOT ] + then + echo "Expected app root directory $APP_ROOT does not exist" + exit 1 + fi + if [ ! -f $CONTAINER_CONFIG ] + then + echo "WARNING: Expected env file $CONTAINER_CONFIG not found. Default behaviors in effect" + find $CONTAINER_ROOT -type f + fi + cd $APP_ROOT + source $CONTAINER_CONFIG + + if [ "$DMAAPBC_WAIT_TO_EXIT" != "Y" ] + then + echo "Creating $APP_ROOT/ok_to_exit so no waiting..." + > $APP_ROOT/ok_to_exit + else + echo "Not creating $APP_ROOT/ok_to_exit" + fi + + if [ ! -f $APP_ROOT/misc/cert-client-init.sh ] + then + echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore" + exit 1 + fi + $APP_ROOT/misc/cert-client-init.sh + . misc/havecert.tmpl > etc/havecert + chmod +x etc/havecert + + # These files might be better provided in kubernetes configmaps + # so if they are there, use them + if [ -f $CONFIGMAP_PROPS ] + then + PROPS=$CONFIGMAP_PROPS + else + PROPS=etc/dmaapbc.properties + . misc/dmaapbc.properties.tmpl > $PROPS + fi + if [ ! -f config/PolicyEngineApi.properties ] + then + . misc/PolicyEngineApi.properties.tmpl > config/PolicyEngineApi.properties + fi + set +x +} + +start() { + echo "ENTER start" + set -x + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "$USER" ] + then + echo $COMPONENT must be started as user $USER not $ID + exit 1 + fi + if [ "$GRP" != "$USER" ] + then + echo $COMPONENT must be started as group $USER not $GRP + exit 1 + fi + cd $APP_ROOT + pwd + + if etc/havecert + then + echo >/dev/null + else + echo No certificate file available. Cannot start + exit 0 + fi + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo $COMPONENT already running + exit 0 + fi + rm -f $APP_ROOT/etc/SHUTDOWN + + # JVM flags +#old line from Dockerfile...keep for reference only + FLAGS="-cp etc:lib/* -Dlog4j.configuration=etc/log4j.properties -DConfigFile=$PROPS -Dlogback.configurationFile=etc/logback.xml -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + #nohup java $FLAGS $MAIN </dev/null >/dev/null 2>&1 & + nohup java $FLAGS $MAIN </dev/null & + sleep 5 + PIDS=`pids` + set +x +} + +stop() { + echo "ENTER stop" + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "$USER" ] + then + echo $COMPONENT must be stopped as user $USER not $ID + exit 1 + fi + if [ "$GRP" != "$USER" ] + then + echo $COMPONENT must be stopped as group $USER not $GRP + exit 1 + fi + touch $APP_ROOT/etc/SHUTDOWN + PIDS=`pids` + if [ "$PIDS" != "" ] + then + sleep 5 + kill -9 $PIDS + sleep 5 + echo $COMPONENT stopped + else + echo $COMPONENT not running + fi +} + +status() { + echo "ENTER status" + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo $COMPONENT running + else + echo $COMPONENT not running + fi +} + +init() { + echo "ENTER init" + if [ ! -d $CONFIGMAP_ROOT ] + then + echo $CONFIGMAP_ROOT does not exist + return + fi + + #loop on get /dmaap until we get a good response to indicate other provisioning can continue + rc=999 + while [ $rc != "200" ] + do + sleep 10 + rc=`curl -s -o /dev/null -I -w "%{http_code}" -X GET -H "Content-Type: application/json" http://dmaap-bc:8080/webapi/dmaap` + echo "get dmaap response=${rc}" + done + + cd $CONFIGMAP_ROOT + pwd + # order is important in this next list + for uri in dmaap dcaeLocations mr_clusters topics feeds + do + if [ -d ${uri} ] + then + for j in `ls ${uri}/*.json` + do + echo "POST $j to $uri" + rc=`curl -v -X POST -w "%{http_code}" -H "Content-Type: application/json" -d @${j} http://dmaap-bc:8080/webapi/${uri}` + echo "response=$rc" + done + fi + done +} + +set -x +case "$1" in +'deploy') + config + start + #init + wait + ;; +'start') + start + ;; +'stop') + stop + ;; +'restart') + stop + sleep 20 + start + ;; +'status') + status + ;; +*) + echo "Usage: $0 { start | stop | restart }" + exit 1 + ;; +esac + ls -l $APP_ROOT/logs/ONAP + echo "------------ tail -100 error.log ---------------" + tail -100 $APP_ROOT/logs/ONAP/error.log + echo "------------ tail -100 server.log ---------------" + tail -100 $APP_ROOT/logs/ONAP/server.log + echo "------------ tail -100 application.log ---------------" + tail -100 $APP_ROOT/logs/ONAP/application.log + + echo "Check $APP_ROOT/ok_to_exit" + while [ ! -f $APP_ROOT/ok_to_exit ] + do + echo "$APP_ROOT/ok_to_exit does not exist. Sticking around for debugging..." + sleep 10 + done +exit 0 diff --git a/dmaap-bc/misc/dmaapbc.properties.tmpl b/dmaap-bc/misc/dmaapbc.properties.tmpl new file mode 100644 index 0000000..40ce8f5 --- /dev/null +++ b/dmaap-bc/misc/dmaapbc.properties.tmpl @@ -0,0 +1,218 @@ +cat <<!EOF +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# +# +# Configuration parameters fixed at startup for the DMaaP Bus Controller +# +# CSIT TESTING +csit: ${DMAAPBC_CSIT:-No} + +# +# URI to retrieve dynamic DR configuration +# +ProvisioningURI: ${DMAAPBC_INTURI:-/internal/prov} +# +# Allow http access to API +# +HttpAllowed: ${DMAAPBC_HTTPALLOWED:-true} +# +# The port number for http as seen within the server +# +IntHttpPort: ${DMAAPBC_INT_HTTP_PORT:-8080} +# +# The port number for https as seen within the server +# Set to 0 if no certificate is available yet... +# +IntHttpsPort: ${DMAAPBC_INT_HTTPS_PORT:-8443} +# +# The external port number for https taking port mapping into account +# +ExtHttpsPort: ${DMAAPBC_EXT_HTTPS_PORT:-443} +# +# The type of keystore for https +# +KeyStoreType: jks +# +# The path to the keystore for https +# +KeyStoreFile: ${DMAAPBC_KSTOREFILE:-etc/keystore} +# +# The password for the https keystore +# +KeyStorePassword: ${DMAAPBC_KSTOREPASS:-*j&Z*Ma;.4My4M]W0eB*fal$} +# +# The password for the private key in the https keystore +# +KeyPassword: ${DMAAPBC_PVTKEYPASS:-*j&Z*Ma;.4My4M]W0eB*fal$} +# +# The type of truststore for https +# +TrustStoreType: jks +# +# The path to the truststore for https +# +TrustStoreFile: ${DMAAPBC_TSTOREFILE:-etc/org.onap.dmaap-bc.trust.jks} +# +# The password for the https truststore +# +TrustStorePassword: ${DMAAPBC_TSTOREPASS:-pi8HuuSbN03MtQQ7(5TcyQ6;} +# +# The path to the file used to trigger an orderly shutdown +# +QuiesceFile: etc/SHUTDOWN +# +# Enable postgress +# +UsePGSQL: ${DMAAPBC_PG_ENABLED:-false} +# +# The host for postgres access +# +DB.host: ${DMAAPBC_PGHOST:-HostNotSet} +# +# For postgres access +# +DB.cred: ${DMAAPBC_PGCRED:-ValueNotSet} +# +# Name of this environment +# +DmaapName: ${DMAAPBC_INSTANCE_NAME:-demo} +# +# Name of DR prov server +# +DR.provhost: ${DMAAPBC_DRPROV_FQDN:-dcae-drps.domain.notset.com} +# +# handling of feed delete +# DeleteOnDR - means use the DR API to DELETE a feed. (default for backwards compatibility) +# SimulateDelete - means preserve the feed on DR (after cleaning it up), and mark as DELETED in DBCL. Better for cfy environments +Feed.deleteHandling: ${DMAAPBC_FEED_DELETE:-DeleteOnDR} + +################################################################################ +# MR Related Properties: +# +# ONAP Beijing and Casablanca are a single site deployment. +MR.multisite: false +# +# Value of the CNAME DNS entry which resolves to the primary central MR cluster (when there are more than one central clusters). +# if there is only one MR cluster in an environment, set this to the DNS name for that cluster +# +MR.CentralCname: ${DMAAPBC_MR_CNAME:-message-router} +# +# MR Client Delete Level thoroughness: +# 0 = don't delete +# 1 = delete from persistent store +# 2 = delete from persistent store (DB) and authorization store (AAF) +MR.ClientDeleteLevel: 1 +# +# MR Topic Factory Namespace +# +MR.TopicFactoryNS: org.onap.dcae.dmaap.topicFactory +# +# MR TopicMgr Role +MR.TopicMgrRole: org.onap.dmaap-bc-topic-mgr.client + +# MR topic name style +MR.topicStyle: FQTN_LEGACY_FORMAT + +# MR topic ProjectID +MR.projectID: 23456 +# +# end of MR Related Properties +################################################################################ + +# +# The Role and credentials of the MirrorMaker Provisioner. This is used by DMaaP Bus Controller to pub to the provisioning topic +# Not part of 1701 +# +MM.ProvRole: ${DMAAPBC_MMPROV_ROLE:-org.onap.dmaap-bc-mm-prov.prov} +MM.ProvUserMechId: ${DMAAPBC_MMPROV_ID:-dmaap-bc-mm-prov@dmaap-bc-mm-prov.onap.org} +MM.ProvUserPwd: ${DMAAPBC_MMPROV_PWD:-demo123456!} +# +# The Role of the MirrorMaker Agent. This is used by MM to sub to provisioning topic +# +MM.AgentRole: ${DMAAPBC_MMAGENT_ROLE:-org.onap.dmaap-bc-mm-prov.agent} +################# +# +# path to cadi.properties +# +cadi.properties: /opt/app/osaaf/local/org.onap.dmaap-bc.props + +################# +# AAF Properties: +UseAAF: ${DMAAPBC_USEAAF:-false} +# +# regarding password encryption: +# In the dependencies that Maven retrieves (e.g., under dcae_dmaapbc/target/deps/ is a jar file cadi-core-version.jar. Generate the key file with: +# +# java \u2013jar wherever/cadi-core-*.jar keygen keyfilename +# chmod 400 keyfilename +# +# To encrypt a key: +# +# java \u2013jar wherever/cadi-core-*.jar digest password-to-encrypt keyfilename +# +# This will generate a string. Put \u201Cenc:\u201D on the front of the string, and put the result in this properties file. +# +# Location of the Codec Keyfile which is used to decrypt passwords in this properties file before they are passed to AAF +# +# REF: https://wiki.domain.notset.com/display/cadi/CADI+Deployment +# +CredentialCodecKeyfile: ${DMAAPBC_CODEC_KEYFILE:-etc/LocalKey} +# +# This overrides the Class used for Decryption. +# This allows for a plugin encryption/decryption method if needed. +# Call this Class for decryption at runtime. +#AafDecryption.Class: com.company.proprietaryDecryptor + +# +# This overrides the Class used for API Permission check. +# This allows for a plugin policy check, if needed +#ApiPermission.Class: com.company.policy.DecisionPolicy + +# Namespace for URI values for API used to create AAF permissions +# e.g. if ApiNamespace is X.Y..dmaapBC.api then for URI /topics we create an AAF perm X.Y..dmaapBC.api.topics +ApiNamespace: ${DMAAPBC_API_NAMESPACE:-org.onap.dmaap-bc.api} +# +# URL of AAF environment to use. +# +aaf.URL: ${DMAAPBC_AAF_URL:-https://aaf-onap-test.osaaf.org:8095} +# +# TopicMgr mechid@namespace +# +aaf.TopicMgrUser: ${DMAAPBC_TOPICMGR_USER:-dmaap-bc-topic-mgr@dmaap-bc-topic-mgr.onap.org} +# +# TopicMgr password +# +aaf.TopicMgrPassword: ${DMAAPBC_TOPICMGR_PWD:-enc:l0ScEojNQiiKbbkuM6U1mtnrme69q960} +# +# Bus Controller Namespace Admin mechid@namespace +# +aaf.AdminUser: ${DMAAPBC_ADMIN_USER:-aaf_admin@people.osaag.org} +# +# Bus Controller Namespace Admin password +# +aaf.AdminPassword: ${DMAAPBC_ADMIN_PWD:-demo123456!} + + +# +# endof AAF Properties +################# +!EOF diff --git a/dmaap-bc/misc/doaction b/dmaap-bc/misc/doaction new file mode 100644 index 0000000..7fee592 --- /dev/null +++ b/dmaap-bc/misc/doaction @@ -0,0 +1,63 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# + +cd /opt/app/dmaapbc/etc +for action in "$@" +do +case "$action" in +'backup') + cp log4j.properties log4j.properties.save 2>/dev/null + cp dmaapbc.properties dmaapbc.properties.save 2>/dev/null + cp havecert havecert.save 2>/dev/null + ;; +'stop') + /opt/app/platform/init.d/dmaapbc stop + ;; +'start') + /opt/app/platform/init.d/dmaapbc start || exit 1 + ;; +'config') + /bin/bash log4j.properties.tmpl >log4j.properties + /bin/bash dmaapbc.properties.tmpl >dmaapbc.properties + /bin/bash havecert.tmpl >havecert + /bin/bash PolicyEngineApi.properties.tmpl > ../config/PolicyEngineApi.properties + chmod +x havecert + rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc + ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/K90dmaapbc + ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/S10dmaapbc + ;; +'restore') + cp log4j.properties.save log4j.properties 2>/dev/null + cp dmaapbc.properties.save dmaapbc.properties 2>/dev/null + cp havecert.save havecert 2>/dev/null + ;; +'clean') + rm -f log4j.properties dmaapbc.properties havecert log4j.properties.save dmaapbc.properties.save havecert.save SHUTDOWN redirections.dat VERSION.dmaapbc + rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc + ;; +*) + exit 1 + ;; +esac +done +exit 0 diff --git a/dmaap-bc/misc/havecert.tmpl b/dmaap-bc/misc/havecert.tmpl new file mode 100644 index 0000000..a3a5ff8 --- /dev/null +++ b/dmaap-bc/misc/havecert.tmpl @@ -0,0 +1,32 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# +cat <<!EOF +TZ=GMT0 +cd /opt/app/dmaapbc; +if [ -f ${DMAAPBC_KSTOREFILE:-etc/keystore} ] +then + exit 0 +fi +echo `date '+%F %T,000'` WARN Certificate file "${DMAAPBC_KSTOREFILE:-etc/keystore}" is missing >>${DMAAPBC_LOGS:-logs}/dmaapbc.log +exit 1 +!EOF diff --git a/dmaap-bc/misc/log4j.properties.tmpl b/dmaap-bc/misc/log4j.properties.tmpl new file mode 100644 index 0000000..2a30bf5 --- /dev/null +++ b/dmaap-bc/misc/log4j.properties.tmpl @@ -0,0 +1,32 @@ +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# +cat <<!EOF +log4j.debug=FALSE +log4j.rootLogger=INFO,Root + +log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender +log4j.appender.Root.file=${DMAAPBC_LOGS:-logs}/buscontroller.log +log4j.appender.Root.datePattern='.'yyyyMMdd +log4j.appender.Root.append=true +log4j.appender.Root.layout=org.apache.log4j.PatternLayout +log4j.appender.Root.layout.ConversionPattern=%d %p %F %L %t %m%n +!EOF diff --git a/dmaap-bc/misc/logback.xml b/dmaap-bc/misc/logback.xml new file mode 100644 index 0000000..2af00f1 --- /dev/null +++ b/dmaap-bc/misc/logback.xml @@ -0,0 +1,358 @@ + +<!-- + ============LICENSE_START========================================== + org.onap.dmaap + =================================================================== + Copyright © 2018 AT&T Intellectual Property. All rights reserved. + =================================================================== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END============================================ + ECOMP is a trademark and service mark of AT&T Intellectual Property. +--> + + +<configuration scan="true" scanPeriod="3 seconds"> + <!--<jmxConfigurator /> --> + <!-- directory path for all other type logs --> + <property name="logDir" value="logs" /> + + <!-- directory path for debugging type logs --> + <property name="debugDir" value="logs" /> + + <!-- specify the component name + <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> + <property name="componentName" value="ONAP"></property> + + <!-- log file names --> + <property name="generalLogName" value="application" /> + <property name="securityLogName" value="security" /> + <property name="performanceLogName" value="performance" /> + <property name="serverLogName" value="server" /> + <property name="policyLogName" value="policy" /> + <property name="errorLogName" value="error" /> + <property name="metricsLogName" value="metrics" /> + <property name="auditLogName" value="audit" /> + <property name="debugLogName" value="debug" /> + + <property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|%msg%n" /> + + <property name="auditLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" /> + <property name="metricsLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" /> + <property name="errorLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDescription}|%msg%n" /> + <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%thread|%msg%n" /> + + <property name="logDirectory" value="${logDir}/${componentName}" /> + <property name="debugLogDirectory" value="${debugDir}/${componentName}" /> + + + <!-- Example evaluator filter applied against console appender --> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <!-- ============================================================================ --> + <!-- EELF Appenders --> + <!-- ============================================================================ --> + + <!-- The EELFAppender is used to record events to the general application + log --> + + + <appender name="EELF" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${generalLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELF" /> + </appender> + + <!-- EELF Security Appender. This appender is used to record security events + to the security log file. Security events are separate from other loggers + in EELF so that security log records can be captured and managed in a secure + way separate from the other logs. This appender is set to never discard any + events. --> + <appender name="EELFSecurity" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${securityLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${securityLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFSecurity" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <discardingThreshold>0</discardingThreshold> + <appender-ref ref="EELFSecurity" /> + </appender> + + <!-- EELF Performance Appender. This appender is used to record performance + records. --> + <appender name="EELFPerformance" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${performanceLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${performanceLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFPerformance" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFPerformance" /> + </appender> + + <!-- EELF Server Appender. This appender is used to record Server related + logging events. The Server logger and appender are specializations of the + EELF application root logger and appender. This can be used to segregate Server + events from other components, or it can be eliminated to record these events + as part of the application root log. --> + <appender name="EELFServer" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${serverLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${serverLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFServer" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFServer" /> + </appender> + + + <!-- EELF Policy Appender. This appender is used to record Policy engine + related logging events. The Policy logger and appender are specializations + of the EELF application root logger and appender. This can be used to segregate + Policy engine events from other components, or it can be eliminated to record + these events as part of the application root log. --> + <appender name="EELFPolicy" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${policyLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${policyLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFPolicy" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFPolicy" /> + </appender> + + + <!-- EELF Audit Appender. This appender is used to record audit engine + related logging events. The audit logger and appender are specializations + of the EELF application root logger and appender. This can be used to segregate + Policy engine events from other components, or it can be eliminated to record + these events as part of the application root log. --> + + <appender name="EELFAudit" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${auditLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${auditLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${auditLoggerPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFAudit" /> + </appender> + +<appender name="EELFMetrics" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${metricsLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${metricsLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${metricsLoggerPattern}</pattern> + </encoder> + </appender> + + + <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFMetrics"/> + </appender> + + <appender name="EELFError" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${errorLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${errorLoggerPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFError"/> + </appender> + + <appender name="EELFDebug" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${debugLogDirectory}/${debugLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${debugLoggerPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFDebug" /> + <includeCallerData>true</includeCallerData> + </appender> + + + <!-- ============================================================================ --> + <!-- EELF loggers --> + <!-- ============================================================================ --> + <logger name="com.att.eelf" level="info" additivity="false"> + <appender-ref ref="asyncEELF" /> + </logger> + <logger name="com.att.eelf.security" level="info" additivity="false"> + <appender-ref ref="asyncEELFSecurity" /> + </logger> + <logger name="com.att.eelf.perf" level="info" additivity="false"> + <appender-ref ref="asyncEELFPerformance" /> + </logger> + <logger name="com.att.eelf.server" level="info" additivity="false"> + <appender-ref ref="asyncEELFServer" /> + </logger> + <logger name="com.att.eelf.policy" level="info" additivity="false"> + <appender-ref ref="asyncEELFPolicy" /> + </logger> + + <logger name="com.att.eelf.audit" level="info" additivity="false"> + <appender-ref ref="asyncEELFAudit" /> + </logger> + + <logger name="com.att.eelf.metrics" level="info" additivity="false"> + <appender-ref ref="asyncEELFMetrics" /> + </logger> + + + <logger name="com.att.eelf.error" level="error" additivity="false"> + <appender-ref ref="asyncEELFError" /> + </logger> + + <logger name="com.att.eelf.debug" level="debug" additivity="false"> + <appender-ref ref="asyncEELFDebug" /> + </logger> + + + + + <root level="INFO"> + <appender-ref ref="asyncEELF" /> + </root> + +</configuration> + diff --git a/dmaap-bc/misc/opensource.env b/dmaap-bc/misc/opensource.env new file mode 100644 index 0000000..80d82f8 --- /dev/null +++ b/dmaap-bc/misc/opensource.env @@ -0,0 +1,120 @@ +# +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# +# The Controller domain +# +CONT_DOMAIN=simpledemo.onap.org +# +# The https port +# set to 0 if certificate is not ready +DMAAPBC_INT_HTTPS_PORT=0 + +# +# The path to the keystore for https +# +DMAAPBC_KSTOREFILE=/opt/app/dcae-certificates + +# The password for the https keystore +# +DMAAPBC_KSTOREPASS=foofoofoo +# +# The password for the private key in the https keystore +# +DMAAPBC_PVTKEYPASS=barbarbar +# +# Flag for whether we are using PG connection for persistence +# +DMAAPBC_PG_ENABLED=false +# +# The host for postgres access +# +DMAAPBC_PGHOST=zldciad1vipstg00.${CONT_DOMAIN} +# +# For postgres access +# +DMAAPBC_PGCRED=test234-ftl +# +# Name of this environment +# +DMAAPBC_INSTANCE_NAME=onap1 +# +# Name of DR prov server +# +DMAAPBC_DRPROV_FQDN=dcae-drps.${CONT_DOMAIN} + +################# +# AAF Properties: +# +# regarding password encryption: +# In the dependencies that Maven retrieves (e.g., under dcae_dmaapbc/target/deps/ is a jar file cadi-core-version.jar. Generate the key file with: +# +# java \u2013jar wherever/cadi-core-*.jar keygen keyfilename +# chmod 400 keyfilename +# +# To encrypt a key: +# +# java \u2013jar wherever/cadi-core-*.jar digest password-to-encrypt keyfilename +# +# This will generate a string. Put \u201Cenc:\u201D on the front of the string, and put the result in this properties file. +# +# Location of the Codec Keyfile which is used to decrypt passwords in this properties file before they are passed to AAF +# +# REF: https://wiki.domain.notset.com/display/cadi/CADI+Deployment +# +# URL of AAF environment to use. +# +DMAAPBC_AAF_URL=https://aafapi.${CONT_DOMAIN}:8095/proxy/ +# +# TopicMgr mechid@namespace +# +DMAAPBC_TOPICMGR_USER=m99751@dmaapBC.onap.org +# +# TopicMgr password +# +DMAAPBC_TOPICMGR_PWD=enc:zyRL9zbI0py3rJAjMS0dFOnYfEw_mJhO +# +# Bus Controller Namespace Admin mechid@namespace +# +DMAAPBC_ADMIN_USER=m99501@dcae.onap.org +# +# Bus Controller Namespace Admin password +# +DMAAPBC_ADMIN_PWD=enc:YEaHwOJrwhDY8a6usetlhbB9mEjUq9m + +# +# endof AAF Properties +################# + +################# +# PolicyEngine Properties + +# +# Flag to turn on/off Authentication +DMAAPBC_PE_ENABLED=false +# +# Argument to decisionAttributes.put("AAF_ENVIRONMENT", X); +# where X is: TEST= UAT, PROD = PROD, DEVL = TEST +# +DMAAPBC_PE_AAF_ENV=DEMO + +# endof PolicyEngineProperties +################# diff --git a/dmaap-bc/misc/org.onap.dmaap-bc.trust.jks b/dmaap-bc/misc/org.onap.dmaap-bc.trust.jks Binary files differnew file mode 100644 index 0000000..00cc35e --- /dev/null +++ b/dmaap-bc/misc/org.onap.dmaap-bc.trust.jks diff --git a/dmaap-bc/misc/policyLogger.properties b/dmaap-bc/misc/policyLogger.properties new file mode 100644 index 0000000..6b9ad99 --- /dev/null +++ b/dmaap-bc/misc/policyLogger.properties @@ -0,0 +1,45 @@ +# +# ============LICENSE_START========================================== +# org.onap.dmaap +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# +################################### Set concurrentHashMap and timer info ####################### +#Timer initial delay and the delay between in milliseconds before task is to be execute. +timer.delay.time=1000 +#Timer scheduleAtFixedRate period - time in milliseconds between successive task executions. +check.interval= 30000 +#Longest time an event info can be stored in the concurrentHashMap for logging - in seconds. +event.expired.time=86400 +#Size of the concurrentHashMap which stores the event starting time, etc - when its size reaches this limit, the Timer gets executed +#to remove all expired records from this concurrentHashMap. +concurrentHashMap.limit=5000 +#Size of the concurrentHashMap - when its size drops to this point, stop the Timer +stop.check.point=2500 +################################### Set logging format ############################################# +# set EELF for EELF logging format, set LOG4J for using log4j, set SYSTEMOUT for using system.out.println +logger.type=EELF +#################################### Set level for EELF or SYSTEMOUT logging ################################## +# Set level for debug file. Set DEBUG to enable .info, .warn and .debug; set INFO for enable .info and .warn; set OFF to disable all +debugLogger.level=OFF +# Set level for metrics file. Set OFF to disable; set ON to enable +metricsLogger.level=ON +# Set level for error file. Set OFF to disable; set ON to enable +error.level=ON +# Set level for audit file. Set OFF to disable; set ON to enable +audit.level=ON diff --git a/dmaap-bc/pom.xml b/dmaap-bc/pom.xml new file mode 100644 index 0000000..f7f2bc1 --- /dev/null +++ b/dmaap-bc/pom.xml @@ -0,0 +1,408 @@ +<?xml version="1.0"?> +<!-- + ============LICENSE_START========================================== + org.onap.dmaap + =================================================================== + Copyright © 2018 AT&T Intellectual Property. All rights reserved. + =================================================================== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END============================================ + ECOMP is a trademark and service mark of AT&T Intellectual Property. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.onap.dmaap.buscontroller</groupId> + <artifactId>dmaap-bc</artifactId> + <version>${artifact.version}</version> + <name>dmaap-bc</name> + <parent> + <groupId>org.onap.oparent</groupId> + <artifactId>oparent</artifactId> + <version>1.2.2</version> + <relativePath/> + </parent> + <build> + <finalName>dmaap-bc</finalName> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>enforce-no-snapshots</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireReleaseDeps> + <message>No Snapshots Allowed!</message> + <excludes> + <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude> + <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude> + <exclude>org.onap.aaf.authz:aaf-misc-env</exclude> + <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude> + <exclude>org.onap.aaf.authz:aaf-auth-client</exclude> + <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude> + <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude> + </excludes> + </requireReleaseDeps> + </rules> + <fail>true</fail> + </configuration> + </execution> + </executions> + </plugin> + + <!-- Package an Uber jar --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.4.3</version> + <executions> + <!-- Run shade goal on package phase --> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + <!-- this filter section is needed to avoid runtime error: + java.lang.SecurityException: Invalid signature file digest for Manifest main attributes + suggestion found at: https://stackoverflow.com/q/999489 + --> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <transformers> + <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error + Solution found from here: + http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working + Some more context here: + https://github.com/dropwizard/dropwizard/issues/455 --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + <!-- add Main-Class to manifest file --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.sonatype.plugins</groupId> + <artifactId>nexus-staging-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <serverId>ecomp-staging</serverId> + <nexusUrl>${nexusproxy}</nexusUrl> + <stagingProfileId>176c31dfe190a</stagingProfileId> + </configuration> + </plugin> + + <!-- for Distribution management --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav-jackrabbit</artifactId> + <version>2.10</version> + </dependency> + </dependencies> + </plugin> + + </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <versionRange>[2.10,)</versionRange> + <phase>install</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore/> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <profiles> + <profile> + <id>docker</id> + <properties> + <skipDockerBuild>false</skipDockerBuild> + <skipDockerTag>false</skipDockerTag> + <skipTests>true</skipTests> + </properties> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker.maven.plugin.version}</version> + <configuration> + <baseImage>java:openjdk-8-jre</baseImage> + <imageName>${onap.nexus.dockerregistry.daily}/${docker.image}</imageName> + <entryPoint>["./bin/dmaapbc", "deploy"]</entryPoint> + <serverId>${onap.nexus.dockerregistry.daily}</serverId> + <skipDockerBuild>false</skipDockerBuild> + <imageTags> + <imageTag>${artifact.version}</imageTag> + <imageTag>latest</imageTag> + </imageTags> + <volumes> + <volume>/opt/app/dmaapbc/log</volume> + </volumes> + <forceTags>true</forceTags> + <user>root</user> + <resources> + <resource> + <targetPath>/opt/app/dmaapbc/lib</targetPath> + <directory>${multiproject.basedir}/dmaap-bc/target</directory> + <include>dmaap-bc.jar</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/etc</targetPath> + <directory>${multiproject.basedir}/dmaap-bc/misc</directory> + <include>LocalKey</include> + <include>logback.xml</include> + <include>org.onap.dmaap-bc.trust.jks</include> + <include>dbc-api.jks</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/etc</targetPath> + <directory>${multiproject.basedir}/dmaap-bc</directory> + <include>version.properties</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/misc</targetPath> + <directory>${multiproject.basedir}/dmaap-bc/misc</directory> + <include>opensource.env</include> + <include>*.tmpl</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/misc</targetPath> + <directory>${multiproject.basedir}/misc</directory> + <include>cert-client-init.sh</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/bin</targetPath> + <directory>${multiproject.basedir}/dmaap-bc/misc</directory> + <include>dmaapbc</include> + <include>doaction</include> + </resource> + </resources> + <runs> + <run>mv /opt/app/dmaapbc/etc/dbc-api.jks /opt/app/dmaapbc/etc/keystore</run> + <run>chmod 600 /opt/app/dmaapbc/etc/keystore</run> + <run>chmod 600 /opt/app/dmaapbc/etc/org.onap.dmaap-bc.trust.jks</run> + <run>chmod +x /opt/app/dmaapbc/misc/cert-client-init.sh</run> + <run>chmod +x /opt/app/dmaapbc/bin/*</run> + <run>mkdir /opt/app/dmaapbc/logs</run> + <run>mkdir /opt/app/dmaapbc/www</run> + <run>mkdir /opt/app/dmaapbc/www/doc</run> + </runs> + <workdir>/opt/app/dmaapbc</workdir> + </configuration> + <executions> + <execution> + <id>default</id> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.glassfish.jersey</groupId> + <artifactId>jersey-bom</artifactId> + <version>${jersey.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-core</artifactId> + <version>${swagger.version}</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jersey2-jaxrs</artifactId> + <version>${swagger.version}</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>${swagger.version}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-servlet-core</artifactId> + <!-- use the following artifactId if you don't need servlet 2.x compatibility --> + <!-- artifactId>jersey-container-servlet</artifactId --> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-moxy</artifactId> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-server</artifactId> + <version>${jettyVersion}</version> + </dependency> + <dependency> + <groupId>org.onap.aaf.authz</groupId> + <artifactId>aaf-cadi-aaf</artifactId> + <version>2.1.7</version> + <classifier>full</classifier> + </dependency> + + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlet</artifactId> + <version>${jettyVersion}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlets</artifactId> + <version>${jettyVersion}</version> + <scope>compile</scope> + </dependency> + <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.11</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql --> + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>42.2.5</version> + </dependency> + + <dependency> + <groupId>org.onap.dmaap.dbcapi</groupId> + <artifactId>dbcapi</artifactId> + <version>1.0.23-SNAPSHOT</version> + </dependency> + </dependencies> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.10.4</version> + <configuration> + <failOnError>false</failOnError> + <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> + <docletArtifact> + <groupId>org.umlgraph</groupId> + <artifactId>umlgraph</artifactId> + <version>5.6</version> + </docletArtifact> + <additionalparam>-views</additionalparam> + <useStandardDocletOptions>true</useStandardDocletOptions> + </configuration> + </plugin> + </plugins> + </reporting> + + <distributionManagement> + <site> + <id>ecomp-site</id> + <url>dav:${nexusproxy}${sitePath}</url> + </site> + </distributionManagement> + <properties> + <multiproject.basedir>${basedir}/..</multiproject.basedir> + <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version> + <jersey.version>2.16</jersey.version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <jettyVersion>9.4.12.RC2</jettyVersion> + <eelf.version>1.0.0</eelf.version> + <swagger.version>1.5.19</swagger.version> + <artifact.version>1.1.1</artifact.version> + <!-- SONAR --> + <jacoco.version>0.7.7.201606060606</jacoco.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> + <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- docker image --> + <docker.image>onap/dmaap/dmaap-bc</docker.image> + + <nexusproxy>https://nexus.onap.org</nexusproxy> + <docker.push.registry>10.12.5.45:5000</docker.push.registry> + + <!-- for Distribution Management --> + <sitePath>/content/sites/site/org/onap/dmaap/dmaap-bc/${artifact.version}</sitePath> + </properties> + <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description> +</project> diff --git a/dmaap-bc/src/main/resources/docker-compose.yml b/dmaap-bc/src/main/resources/docker-compose.yml new file mode 100644 index 0000000..41bc473 --- /dev/null +++ b/dmaap-bc/src/main/resources/docker-compose.yml @@ -0,0 +1,25 @@ +version: '2' +services: + dbc-pg-primary: + image: crunchydata/crunchy-postgres:centos7-10.4-2.0.0 + ports: + - "5432:5432" + environment: + - PG_MODE=master + - PG_PRIMARY_USER="dmaap_admin" + - PG_PRIMARY_PASSWORD=onapdemodb + - PG_USER="dmaap_admin" + - PG_PASSWORD=onapdemodb + - PG_ROOT_PASSWORD=onapdemodb + - PG_DATABASE="dmaap" + - PG_PRIMARY_PORT=5432 + + dmaap-bc: + image: nexus3.onap.org:10001/onap/dmaap/buscontroller:latest + ports: + - "30241:8080" + - "30242:8443" + volumes: + - /var/tmp/docker-databus-controller.conf:/opt/app/config/conf + depends_on: + - dbc-pg-primary diff --git a/dmaap-bc/src/main/resources/docker-databus-controller.conf b/dmaap-bc/src/main/resources/docker-databus-controller.conf new file mode 100644 index 0000000..7214adf --- /dev/null +++ b/dmaap-bc/src/main/resources/docker-databus-controller.conf @@ -0,0 +1,12 @@ +DMAAPBC_WAIT_TO_EXIT=Y +DMAAPBC_PG_ENABLED=true +DMAAPBC_PGHOST=dbc-pg-primary +DMAAPBC_PGDBNAME=dmaap +DMAAPBC_PGCRED=onapdemodb +DMAAPBC_PGUSER=dmaap_admin +DMAAPBC_MR_CNAME=message-router +DMAAPBC_AAF_URL=https://aaf-authz/ +DMAAPBC_TOPICMGR_USER=m23456@dmaapbc.onap.org +DMAAPBC_TOPICMGR_PWD=onapdemo +DMAAPBC_ADMIN_USER=m12345@dmaapbc.onap.org +DMAAPBC_ADMIN_PWD=onapdemo
\ No newline at end of file diff --git a/dmaap-bc/src/main/webapp/HelloJetty.html b/dmaap-bc/src/main/webapp/HelloJetty.html new file mode 100644 index 0000000..4d61636 --- /dev/null +++ b/dmaap-bc/src/main/webapp/HelloJetty.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- + ============LICENSE_START======================================================= + OpenECOMP - org.openecomp.dmaapbc + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<html> +<head> +<meta charset="ISO-8859-1"> +<title>Index</title> +</head> +<body> +Hello Jetty! +</body> +</html> diff --git a/dmaap-bc/src/main/webapp/WEB-INF/log4j.xml b/dmaap-bc/src/main/webapp/WEB-INF/log4j.xml new file mode 100644 index 0000000..4e4d5e9 --- /dev/null +++ b/dmaap-bc/src/main/webapp/WEB-INF/log4j.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ============LICENSE_START======================================================= + OpenECOMP - org.openecomp.dmaapbc + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" > +<log4j:configuration> + <appender name="dmaapBC" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="dmaapBC.log"/> + <param name="MaxFileSize" value="1000KB"/> + <param name="MaxBackupIndex" value="3"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="[%d{HH:mm:ss:SSS}] - %-6p - %c.%M() - %m%n"/> + </layout> + </appender> + <appender name="media" class="org.apache.log4j.ConsoleAppender"> + <param name="Threshold" value="FATAL"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> + </layout> + </appender> + <category name="org.openecomp.dcae.dmaapBC"> + <appender-ref ref="dmaapBC"/> + </category> + <root> + <priority value="all"/> + <appender-ref ref="media"/> + </root> +</log4j:configuration> diff --git a/dmaap-bc/src/main/webapp/WEB-INF/web.xml b/dmaap-bc/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..055fbf0 --- /dev/null +++ b/dmaap-bc/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ============LICENSE_START======================================================= + OpenECOMP - org.openecomp.dmaapbc + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<!-- This web.xml file is not required when using Servlet 3.0 container, + see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html --> +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> + <servlet> + <servlet-name>Jersey Web Application</servlet-name> + <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> + <init-param> + <param-name>jersey.config.server.provider.packages</param-name> + <param-value>org.openecomp.dmaapBC</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>Jersey Web Application</servlet-name> + <url-pattern>/webapi/*</url-pattern> + </servlet-mapping> +</web-app> diff --git a/dmaap-bc/src/main/webapp/index.jsp b/dmaap-bc/src/main/webapp/index.jsp new file mode 100644 index 0000000..3c20e06 --- /dev/null +++ b/dmaap-bc/src/main/webapp/index.jsp @@ -0,0 +1,28 @@ +<%-- + ============LICENSE_START======================================================= + org.onap.dcae + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --%> + +<html> +<body> + <h2>Jersey RESTful Web Application!</h2> + <p><a href="webapi/dmaap">Jersey resource</a> + <p>Visit <a href="http://jersey.java.net">Project Jersey website</a> + for more information on Jersey! +</body> +</html> diff --git a/dmaap-bc/version.properties b/dmaap-bc/version.properties new file mode 100644 index 0000000..67e2f3a --- /dev/null +++ b/dmaap-bc/version.properties @@ -0,0 +1,35 @@ +### +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# =================================================================== +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +### + +# Versioning variables +# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) +# because they are used in Jenkins, whose plug-in doesn't support + +major=1 +minor=1 +patch=1 +base_version=${major}.${minor}.${patch} + +# Release must be completed with git revision # in Jenkins +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT |