From 92927f8985ae5f381143b8b295df2f466e4349ae Mon Sep 17 00:00:00 2001 From: Ravi Geda Date: Mon, 30 Apr 2018 16:54:51 +0100 Subject: [PATCH] Migrate to Spring Boot Convert from AJSC to Spring Boot micro service Change-Id: I17bed6d10a00b35dbc63f5dd2b93642b1b3eb7a5 Issue-ID: AAI-1040 Signed-off-by: Ravi Geda --- ajsc-shared-config/README.txt | 8 - ajsc-shared-config/etc/aft.properties | 15 - .../etc/basic-logback_root_logger_level_off.xml | 87 ----- antBuild/build.xml | 231 ------------- bundleconfig-local/README.txt | 2 - bundleconfig-local/RELEASE_NOTES.txt | 2 - .../etc/appprops/AAFUserRoles.properties | 13 - .../appprops/PostProcessorInterceptors.properties | 3 - .../appprops/PreProcessorInterceptors.properties | 4 - .../etc/appprops/app-intercepts.properties | 8 - bundleconfig-local/etc/appprops/error.properties | 164 ---------- .../etc/appprops/methodMapper.properties | 30 -- .../etc/sysprops/sys-props.properties | 119 ------- pom.xml | 364 ++++++++------------- .../crud-api_v1/crud-api/v1/conf/jaxrsBeans.groovy | 11 - .../ajsc/crud-api_v1/crud-api/v1/docs/README.txt | 1 - .../ajsc/crud-api_v1/crud-api/v1/lib/README.txt | 1 - .../crud-api_v1/crud-api/v1/props/module.props | 1 - .../crud-api/v1/routes/aaiResources.route | 4 - .../ajsc/crud-api_v1/crud-api/v1/routes/crud.route | 4 - .../crud-api/v1/routes/helloWorld.route | 4 - .../crud-api/v1/routes/jaxrsExample.route | 5 - src/main/assemble/ajsc_module_assembly.xml | 69 ---- src/main/assemble/ajsc_props_assembly.xml | 26 -- src/main/assemble/ajsc_runtime_assembly.xml | 47 --- src/main/bin/start.sh | 56 +--- src/main/config/ajsc-jetty.xml | 114 ------- src/main/config/ajsc-override-web.xml | 53 --- src/main/config/ajscJetty.jks | Bin 3736 -> 0 bytes src/main/config/jul-redirect.properties | 13 - src/main/config/keyfile | 27 -- src/main/config/runner-web.xml | 97 ------ src/main/docker/Dockerfile | 2 +- src/main/java/org/onap/crud/CrudApplication.java | 46 +++ .../java/org/onap/crud/config/JerseyConfig.java | 39 +++ .../crud/event/envelope/GraphEventEnvelope.java | 11 +- .../onap/crud/event/envelope/GraphEventHeader.java | 11 +- .../event/response/GraphEventResponseHandler.java | 11 +- .../event/response/GraphEventResponseMessage.java | 11 +- .../org/onap/crud/service/CrudRestService.java | 30 +- .../org/onap/crud/service/JaxrsEchoService.java | 11 +- src/main/resources/application.properties | 10 + .../etc => src/main/resources}/logback.xml | 4 +- ...ame__#__module.ajsc.namespace.version__.context | 1 - src/main/runtime/context/default#0.context | 1 - ...e.name__#__module.ajsc.namespace.version__.json | 1 - src/main/runtime/shiroRole/ajscadmin.json | 1 - ...ontextadmin#__module.ajsc.namespace.name__.json | 1 - .../runtime/shiroRole/contextadmin#default.json | 1 - src/main/runtime/shiroUser/ajsc.json | 1 - src/main/runtime/shiroUserRole/ajsc#ajscadmin.json | 1 - ...ontextadmin#__module.ajsc.namespace.name__.json | 1 - .../shiroUserRole/ajsc#contextadmin#default.json | 1 - .../onap/crud/event/GraphEventEnvelopeTest.java | 20 ++ .../response/GraphEventResponseHandlerTest.java | 20 ++ .../java/org/onap/crud/test/util/TestUtil.java | 20 ++ .../onap/schema/RelationshipSchemaLoaderTest.java | 14 +- 57 files changed, 348 insertions(+), 1505 deletions(-) delete mode 100644 ajsc-shared-config/README.txt delete mode 100644 ajsc-shared-config/etc/aft.properties delete mode 100644 ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml delete mode 100644 antBuild/build.xml delete mode 100644 bundleconfig-local/README.txt delete mode 100644 bundleconfig-local/RELEASE_NOTES.txt delete mode 100644 bundleconfig-local/etc/appprops/AAFUserRoles.properties delete mode 100644 bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties delete mode 100644 bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties delete mode 100644 bundleconfig-local/etc/appprops/app-intercepts.properties delete mode 100644 bundleconfig-local/etc/appprops/error.properties delete mode 100644 bundleconfig-local/etc/appprops/methodMapper.properties delete mode 100644 bundleconfig-local/etc/sysprops/sys-props.properties delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/conf/jaxrsBeans.groovy delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/docs/README.txt delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/lib/README.txt delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/props/module.props delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/routes/aaiResources.route delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/routes/crud.route delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/routes/helloWorld.route delete mode 100644 src/main/ajsc/crud-api_v1/crud-api/v1/routes/jaxrsExample.route delete mode 100644 src/main/assemble/ajsc_module_assembly.xml delete mode 100644 src/main/assemble/ajsc_props_assembly.xml delete mode 100644 src/main/assemble/ajsc_runtime_assembly.xml delete mode 100644 src/main/config/ajsc-jetty.xml delete mode 100644 src/main/config/ajsc-override-web.xml delete mode 100644 src/main/config/ajscJetty.jks delete mode 100644 src/main/config/jul-redirect.properties delete mode 100644 src/main/config/keyfile delete mode 100644 src/main/config/runner-web.xml create mode 100644 src/main/java/org/onap/crud/CrudApplication.java create mode 100644 src/main/java/org/onap/crud/config/JerseyConfig.java create mode 100644 src/main/resources/application.properties rename {ajsc-shared-config/etc => src/main/resources}/logback.xml (99%) delete mode 100644 src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context delete mode 100644 src/main/runtime/context/default#0.context delete mode 100644 src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json delete mode 100644 src/main/runtime/shiroRole/ajscadmin.json delete mode 100644 src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json delete mode 100644 src/main/runtime/shiroRole/contextadmin#default.json delete mode 100644 src/main/runtime/shiroUser/ajsc.json delete mode 100644 src/main/runtime/shiroUserRole/ajsc#ajscadmin.json delete mode 100644 src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json delete mode 100644 src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json diff --git a/ajsc-shared-config/README.txt b/ajsc-shared-config/README.txt deleted file mode 100644 index e0f7ff1..0000000 --- a/ajsc-shared-config/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. - -The ajsc-shared-config folder is included in the service project to provide the functionality of the AJSC_SHARED_CONFIG -location that will exist in CSI envs. This includes the logback.xml for logging configurations, and some csm related -artifacts necessary for proper functionality of the csm framework within the CSI env. Within the 2 profiles that can -be utilized to run the AJSC locally, "runLocal" and "runAjsc", the system propery, "AJSC_SHARED_CONFIG", has been set -to point to this directory. The files in this folder will NOT be copied/moved anywhere within the AJSC SWM package. These -files will already be in existence within the CSI env. \ No newline at end of file diff --git a/ajsc-shared-config/etc/aft.properties b/ajsc-shared-config/etc/aft.properties deleted file mode 100644 index 95c7762..0000000 --- a/ajsc-shared-config/etc/aft.properties +++ /dev/null @@ -1,15 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -# Flow test 319 -# The DEFAULT setup for this file is for deployment to soa cloud node which will use the "bundleconfig/etc/spm2.jks" location -# For Testing Locally, you can set the system property, csiEnable=true, found within bundleconfig-local/etc/sysprops/sys-props.properties -# and switch com.att.aft.keyStore and com.att.aft.trustStore values commented out below to "ajsc-shared-config/etc/spm2.jks" - -#replace proper values for the dummy values. -com.att.aft.discovery.client.environment=TEST -com.att.aft.discovery.client.latitude=35.318900 -com.att.aft.discovery.client.longitude=-80.762200 -com.att.aft.alias=fusionbus -com.att.aft.keyStore=bundleconfig/etc/key.jks -com.att.aft.keyStorePassword=password -com.att.aft.trustStore=bundleconfig/etc/key.jks -com.att.aft.trustStorePassword=password diff --git a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml b/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml deleted file mode 100644 index 4ebe2db..0000000 --- a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - ERROR - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n - - - - - - - DEBUG - - ${logDirectory}/info_ajsc.log - - ${logDirectory}/info_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - ERROR - - ${logDirectory}/error_ajsc.log - - ${logDirectory}/error_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] %msg - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] mdc:[%mdc] %msg - - - - - - - - - diff --git a/antBuild/build.xml b/antBuild/build.xml deleted file mode 100644 index ab0f890..0000000 --- a/antBuild/build.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bundleconfig-local/README.txt b/bundleconfig-local/README.txt deleted file mode 100644 index 37f2670..0000000 --- a/bundleconfig-local/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -The bundleconfig-local directory contains the necessary configuration files \ No newline at end of file diff --git a/bundleconfig-local/RELEASE_NOTES.txt b/bundleconfig-local/RELEASE_NOTES.txt deleted file mode 100644 index 3cc5590..0000000 --- a/bundleconfig-local/RELEASE_NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -Place Release Notes here to provide updated Release information \ No newline at end of file diff --git a/bundleconfig-local/etc/appprops/AAFUserRoles.properties b/bundleconfig-local/etc/appprops/AAFUserRoles.properties deleted file mode 100644 index adb7a10..0000000 --- a/bundleconfig-local/etc/appprops/AAFUserRoles.properties +++ /dev/null @@ -1,13 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. - -#If using AAF for Role based authentication/authorization, define your routes/services which will utilize AAF. The AJSC will -#read this file and protect the routes given with the AAF role defined. - -#The following example would protect the JAXRS echo example service provided with the archetype. -#/services/${namespace}/v1/jaxrs-services/jaxrsExample/echo/*=com.att.ajsc.myper|mymachine|manage - -#The following example would protect ALL AJSC services running within your project. -#/**=com.att.ajsc.myperm|mymachine|manage - -#The following example would protect ALL REST services utilizing the Camel restlet routes. -#/rest/**=com.att.ajsc.myperm|mymachine|manage diff --git a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties b/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties deleted file mode 100644 index 08ffefa..0000000 --- a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -#This properties file is for defining any PostProcessorInterceptors that have been created for your AJSC service. - diff --git a/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties b/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties deleted file mode 100644 index 1383071..0000000 --- a/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -#This properties file is for defining any PreProcessorInterceptors that have been created for your AJSC service. - -/**=com.att.ajsc.csi.restmethodmap.RestMethodMapInterceptor diff --git a/bundleconfig-local/etc/appprops/app-intercepts.properties b/bundleconfig-local/etc/appprops/app-intercepts.properties deleted file mode 100644 index c31acbc..0000000 --- a/bundleconfig-local/etc/appprops/app-intercepts.properties +++ /dev/null @@ -1,8 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. - -#This is where all your application intercept strategies must be configured. AJSC reads this property file and adds -#the list of intercepts specified here to the camel context. This can be useful for accessing every exchange object transferred from/to -#each endpoint in the request/response flow and can allow for more precise debugging and/or processing of the exchange. - -#e.g. -#intercepts=org.onap.crud.JaxrsEchoService,packagename.class1name,packagename.class2name diff --git a/bundleconfig-local/etc/appprops/error.properties b/bundleconfig-local/etc/appprops/error.properties deleted file mode 100644 index bafe9c0..0000000 --- a/bundleconfig-local/etc/appprops/error.properties +++ /dev/null @@ -1,164 +0,0 @@ -# Adding comment trying to trigger a build -#------------------------------------------------------------------------------- ---------- -#Key=Disposition:Category:Severity:Error Code:HTTP ResponseCode:RESTError Code:Error Message -#------------------------------------------------------------------------------- ---------- -# testing code, please don't change unless error utility source code changes -AAI_TESTING=5:2:WARN:0000:400:0001:Error code for testing - -# General success -AAI_0000=0:0:INFO:0000:200:0000:Success - -# health check success -AAI_0001=0:0:INFO:0001:200:0001:Success X-FromAppId=%1 X-TransactionId=%2 -AAI_0002=0:0:INFO:0002:200:0001:Successful health check - -# Success with additional info -AAI_0003=0:3:INFO:0003:202:0003:Success with additional info performing %1 on %2. Added %3 with key %4 -AAI_0004=0:3:INFO:0004:202:0003:Added prerequisite object to db - -#--- aairest: 3000-3299 -# svc errors -AAI_3000=5:2:INFO:3000:400:3000:Invalid input performing %1 on %2 -AAI_3001=5:6:INFO:3001:404:3001:Resource not found for %1 using id %2 -AAI_3002=5:1:WARN:3002:400:3002:Error writing output performing %1 on %2 -AAI_3003=5:1:WARN:3003:400:3003:Failed to make edge to missing target node of type %3 with keys %4 performing %1 on %2 -AAI_3005=5:6:WARN:3005:404:3001:Node cannot be directly accessed for read, must be accessed via ancestor(s) -AAI_3006=5:6:WARN:3006:404:3001:Node cannot be directly accessed for write, must be accessed via ancestor(s) -AAI_3007=5:6:INFO:3007:410:3007:This version (%1) of the API is retired, please migrate to %2 -AAI_3008=5:6:ERROR:3008:400:3008:URI is not encoded in UTF-8 -AAI_3009=5:6:ERROR:3009:400:3002:Malformed URL -# pol errors -AAI_3100=5:1:WARN:3100:400:3100:Unsupported operation %1 -AAI_3101=5:1:WARN:3101:403:3101:Attempt by client %1 to execute API %2 -AAI_3102=5:1:WARN:3102:400:3102:Error parsing input performing %1 on %2 -AAI_3300=5:1:WARN:3300:403:3300:Unauthorized -AAI_3301=5:1:WARN:3301:401:3301:Stale credentials -AAI_3302=5:1:WARN:3302:401:3301:Not authenticated -AAI_3303=5:1:ERROR:3303:403:3300:Too many objects would be returned by this request, please refine your request and retry - -#--- aaigen: 4000-4099 -AAI_4000=5:4:ERROR:4000:500:3002:Internal Error -AAI_4001=5:4:FATAL:4001:500:3002:Configuration file not found -AAI_4002=5:4:FATAL:4002:500:3002:Error reading Configuration file -AAI_4003=5:4:ERROR:4003:500:3002:Error writing to log file -AAI_4004=5:4:FATAL:4004:500:3002:Error reading/parsing the error properties file -AAI_4005=5:4:FATAL:4005:500:3002:Missing or invalid configuration parameter -AAI_4006=5:4:FATAL:4006:500:3002:Unexpected error in service -AAI_4007=5:4:ERROR:4007:500:3102:Input parsing error -AAI_4008=5:4:ERROR:4008:500:3002:Output parsing error -AAI_4009=4:0:ERROR:4009:400:3000:Invalid X-FromAppId in header -AAI_4010=4:0:ERROR:4010:400:3000:Invalid X-TransactionId in header -AAI_4011=5:4:ERROR:4011:500:3002:Missing data for REST error response -AAI_4012=5:4:ERROR:4012:500:3002:Bad rule data in RestRules -AAI_4013=5:4:ERROR:4013:500:3002:Error connecting to AAI REST API -AAI_4014=4:0:ERROR:4014:400:3000:Invalid Accept header -AAI_4015=4:0:ERROR:4015:400:3000:You must provide at least one indexed property -AAI_4016=4:0:ERROR:4016:400:3000:The depth parameter must be a number or the string "all" -AAI_4017=5:2:INFO:4017:400:3000:Could not set property -AAI_4018=5:2:ERROR:4018:400:3000:Unable to convert the string to integer -#--- aaidbmap: 5101-5199 -AAI_5101=5:4:FATAL:5101:500:3002:Could not connect to database -AAI_5102=5:4:FATAL:5102:500:3002:Graph database is null after open -AAI_5103=5:4:ERROR:5103:500:3002:Unexpected error during commit -AAI_5104=5:4:ERROR:5104:500:3002:Unexpected error during rollback -AAI_5105=5:4:ERROR:5105:500:3002:Unexpected error reading/updating database -AAI_5106=5:4:WARN:5106:404:3001:Node not found -AAI_5107=5:2:WARN:5107:400:3000:Required information missing -AAI_5108=5:2:WARN:5108:200:0:Unexpected information in request being ignored - -#--- aaidbgen: 6101-6199 -AAI_6101=5:4:ERROR:6101:500:3002:null TitanGraph object passed -AAI_6102=5:4:WARN:6102:400:3000:Passed-in property is not valid for this nodeType -AAI_6103=5:4:WARN:6103:400:3000:Required Node-property not found in input data -AAI_6104=5:4:WARN:6104:400:3000:Required Node-property was passed with no data -AAI_6105=5:4:WARN:6105:400:3000:Node-Key-Property not defined in DbMaps -AAI_6106=5:4:WARN:6106:400:3000:Passed-in property is not valid for this edgeType -AAI_6107=5:4:WARN:6107:400:3000:Required Edge-property not found in input data -AAI_6108=5:4:WARN:6108:400:3000:Required Edge-property was passed with no data -AAI_6109=5:4:WARN:6109:400:3000:Bad dependent Node value -AAI_6110=5:4:ERROR:6110:400:3100:Node cannot be deleted -AAI_6111=5:4:ERROR:6111:400:3000:JSON processing error -AAI_6112=5:4:ERROR:6112:400:3000:More than one node found by getUniqueNode() -AAI_6114=5:4:INFO:6114:404:3001:Node Not Found -AAI_6115=5:4:ERROR:6115:400:3000:Unrecognized NodeType -AAI_6116=5:4:ERROR:6116:400:3000:Unrecognized Property -AAI_6117=5:4:ERROR:6117:400:3000:Uniqueness constraint violated -AAI_6118=5:4:ERROR:6118:400:3000:Required Field not passed. -AAI_6120=5:4:ERROR:6120:400:3000:Bad Parameter Passed -AAI_6121=5:4:ERROR:6121:400:3000:Problem with internal AAI reference data -AAI_6122=5:4:ERROR:6122:400:3000:Data Set not complete in DB for this request -AAI_6123=5:4:ERROR:6123:500:3000:Bad Data found by DataGrooming Tool - Investigate -AAI_6124=5:4:ERROR:6124:500:3000:File read/write error -AAI_6125=5:4:WARN:6125:500:3000:Problem Pulling Data Set -AAI_6126=5:4:ERROR:6126:400:3000:Edge cannot be deleted -AAI_6127=5:4:INFO:6127:404:3001:Edge Not Found -AAI_6128=5:4:INFO:6128:500:3000:Unexpected error -AAI_6129=5:4:INFO:6129:404:3003:Error making edge to target node -AAI_6130=5:4:WARN:6130:412:3000:Precondition Required -AAI_6131=5:4:WARN:6131:412:3000:Precondition Failed -AAI_6132=5:4:WARN:6132:400:3000:Bad Model Definition -AAI_6133=5:4:WARN:6133:400:3000:Bad Named Query Definition -AAI_6134=5:4:ERROR:6134:500:6134:Could not persist transaction to storage back end. Exhausted retry amount -AAI_6135=5:4:WARN:6135:412:3000:Resource version specified on create -AAI_6136=5:4:ERROR:6136:400:3000:Object cannot hold multiple items -AAI_6137=5:4:ERROR:6137:400:3000:Cannot perform writes on multiple vertices -AAI_6138=5:4:ERROR:6138:400:3000:Cannot delete multiple vertices -AAI_6139=5:4:ERROR:6139:404:3000:Attempted to add edge to vertex that does not exist -AAI_6140=5:4:ERROR:6140:400:3000:Edge multiplicity violated -AAI_6141=5:4:WARN:6141:400:3000:Please Refine Query -AAI_6142=5:4:INFO:6142:400:3000:Retrying transaction -AAI_6143=5:4:INFO:6143:400:3000:Ghost vertex found -AAI_6144=5:4:WARN:6144:400:3000:Cycle found in graph -AAI_6145=5:4:ERROR:6145:400:3000:Cannot create a nested/containment edge via relationship -AAI_6146=5:4:ERROR:6146:400:3000:Ambiguous identity map found, use a URI instead - -#--- aaicsvp: 7101-7199 -AAI_7101=5:4:ERROR:7101:500:3002:Unexpected error in CSV file processing -AAI_7102=5:4:ERROR:7102:500:3002:Error in cleanup temporary directory -#AAI_7103=4:2:ERROR:7103:500:3002:Unsupported user -AAI_7104=5:4:ERROR:7104:500:3002:Failed to create directory -AAI_7105=5:4:ERROR:7105:500:3002:Temporary directory exists -AAI_7106=5:4:ERROR:7106:500:3002:Cannot delete -AAI_7107=5:4:ERROR:7107:500:3002:Input file does not exist -AAI_7108=5:4:ERROR:7108:500:3002:Output file does not exist -AAI_7109=5:4:ERROR:7109:500:3002:Error closing file -AAI_7110=5:4:ERROR:7110:500:3002:Error loading/reading properties file -AAI_7111=5:4:ERROR:7111:500:3002:Error executing shell script -AAI_7112=5:4:ERROR:7112:500:3002:Error creating output file -AAI_7113=5:4:ERROR:7113:500:3002:Trailer record error -AAI_7114=5:4:ERROR:7114:500:3002:Input file error -AAI_7115=5:4:ERROR:7115:500:3002:Unexpected error -AAI_7116=5:4:ERROR:7116:500:3002:Request error -AAI_7117=5:4:ERROR:7117:500:3002:Error in get http client object -AAI_7118=5:4:ERROR:7118:500:3002:Script Error -AAI_7119=5:4:ERROR:7119:500:3002:Unknown host - -#--- aaisdnc: 7201-7299 -AAI_7202=5:4:ERROR:7202:500:3002:Error getting connection to odl -AAI_7203=5:4:ERROR:7203:500:3002:Unexpected error calling DataChangeNotification API -AAI_7204=5:4:ERROR:7204:500:3002:Error returned by DataChangeNotification API -AAI_7205=5:4:ERROR:7205:500:3002:Unexpected error running notifySDNCOnUpdate -AAI_7206=5:4:ERROR:7206:500:3002:Invalid data returned from ODL - -#--- NotificationEvent, using UEB space -AAI_7350=5:4:ERROR:7305:500:3002:Notification event creation failed - -#--- aairestctlr: 7401-7499 -AAI_7401=5:4:ERROR:7401:500:3002:Error connecting to AAI REST API -AAI_7402=5:4:ERROR:7402:500:3002:Unexpected error -AAI_7403=5:4:WARN:7403:400:3001:Request error -AAI_7404=5:4:INFO:7404:404:3001:Node not found - -#--- aaiauth: 9101-9199 -AAI_9101=5:0:WARN:9101:403:3300:User is not authorized to perform function -AAI_9102=5:0:WARN:9102:401:3301:Refresh credentials from source -AAI_9103=5:0:WARN:9103:403:3300:User not found -AAI_9104=5:0:WARN:9104:401:3302:Authentication error -AAI_9105=5:0:WARN:9105:403:3300:Authorization error -AAI_9106=5:0:WARN:9106:403:3300:Invalid AppId -#AAI_9107=5:0:WARN:9107:403:3300:No Username in Request -AAI_9107=5:0:WARN:9107:403:3300:SSL is not provided in request, please contact admin - -#--- aaiinstar: 9201-9299 -AAI_9201=5:4:ERROR:9201:500:3002:Unable to send notification -AAI_9202=5:4:ERROR:9202:500:3002:Unable to start a thread diff --git a/bundleconfig-local/etc/appprops/methodMapper.properties b/bundleconfig-local/etc/appprops/methodMapper.properties deleted file mode 100644 index bf51749..0000000 --- a/bundleconfig-local/etc/appprops/methodMapper.properties +++ /dev/null @@ -1,30 +0,0 @@ -// -//Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -// Json object holds the method mapping.Update the JSON object with the proper route to logical mapping based -// on the example provided below : -// "helloWorld" = Service Name -// "method" = http method -// "url" = the url component from the route -// "logicalName"= When a combination of method and url from the route matches the json object , -// the logical name is put in the http header as "x-CSI-ServiceName" and "x-CSI-MethodName" -// "dme2url"= if provided it register the endpoint to GRM, it is optional. This is useful for JAX-RS services. - -{ - "helloWorld": [ - { - "method": "get", - "url": "/services/crud-api/v1/echo-service/echo/{input}", - "logicalName": "GetEcho(Logical)", - "dme2url": "/services/crud-api/v1/echo-service/echo/{input}" - } - ], - "errormessage": - [ - { - "method": "get", - "url": "/services/crud-api/v1/errorMessageLookupService2", - "logicalName": "setCAETHeaders(Logical)" - } - - ] -} diff --git a/bundleconfig-local/etc/sysprops/sys-props.properties b/bundleconfig-local/etc/sysprops/sys-props.properties deleted file mode 100644 index 25725d9..0000000 --- a/bundleconfig-local/etc/sysprops/sys-props.properties +++ /dev/null @@ -1,119 +0,0 @@ -#This file is used for defining AJSC system properties for different configuration schemes and is necessary for the AJSC to run properly. -#The sys-props.properties file is used for running locally. The template.sys-props.properties file will be used when deployed -#to a SOA/CSI Cloud node. - -#AJSC System Properties. The following properties are required for ALL AJSC services. If you are adding System Properties for your -#particular service, please add them AFTER all AJSC related System Properties. - -#For Cadi Authorization, use value="authentication-scheme-1 -CadiAuthN=authentication-scheme-1 - -#For Basic Authorization, use value="authentication-scheme-1 -authN=authentication-scheme-2 - -#Persistence used for AJSC meta-data storage. For most environments, "file" should be used. -ajscPersistence=file - -#For Direct Invocation to be enabled (values=true/false) -directInvocationEnable=false - -# If using hawtio for local development, these properties will allow for faster server startup and usage for local development - -hawtio.authenticationEnabled=false -hawtio.config.pullOnStartup=false - -#Removes the extraneous restlet console output -org.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade - -#server.host property to be enabled for local DME2 related testing -#server.host= - -#Enable/disable SSL (values=true/false). This property also determines which protocol to use (https if true, http otherwise), to register services into GRM through DME2. -enableSSL=false - - -#Enable/disable EJB Container -ENABLE_EJB=false - -#Enable/disable OSGI -isOSGIEnable=false - -#Generate/Skip api docs -isApiDoc=false - -#CSI related variables for CSM framework -csm.hostname=servername - - -#SOA_CLOUD_ENV is used to register your service with dme2 and can be turned off for local development (values=true/false). -SOA_CLOUD_ENV=false - -#CONTINUE_ON_LISTENER_EXCEPTION will exit the application if there is a DME2 exception at the time of registration. -CONTINUE_ON_LISTENER_EXCEPTION=false - -#Jetty Container ThreadCount Configuration Variables -AJSC_JETTY_ThreadCount_MIN=10 -AJSC_JETTY_ThreadCount_MAX=200 -AJSC_JETTY_BLOCKING_QUEUE_SIZE=200 -AJSC_JETTY_IDLETIME_MAX=3000 - -#Camel Context level default threadPool Profile configuration -CAMEL_POOL_SIZE=10 -CAMEL_MAX_POOL_SIZE=20 -CAMEL_KEEP_ALIVE_TIME=60 -CAMEL_MAX_QUEUE_SIZE=1000 - -#GRM/DME2 System Properties -AFT_DME2_CONN_IDLE_TIMEOUTMS=5000 -AJSC_ENV=SOACLOUD - -SOACLOUD_NAMESPACE=com.att.ajsc -SOACLOUD_ENV_CONTEXT=DEV -SOACLOUD_PROTOCOL=http -SOACLOUD_ROUTE_OFFER=DEFAULT - -AFT_LATITUDE=23.4 -AFT_LONGITUDE=33.6 -AFT_ENVIRONMENT=AFTUAT - -#Restlet Component Default Properties -RESTLET_COMPONENT_CONTROLLER_DAEMON=true -RESTLET_COMPONENT_CONTROLLER_SLEEP_TIME_MS=100 -RESTLET_COMPONENT_INBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_MIN_THREADS=1 -RESTLET_COMPONENT_MAX_THREADS=10 -RESTLET_COMPONENT_LOW_THREADS=8 -RESTLET_COMPONENT_MAX_QUEUED=0 -RESTLET_COMPONENT_MAX_CONNECTIONS_PER_HOST=-1 -RESTLET_COMPONENT_MAX_TOTAL_CONNECTIONS=-1 -RESTLET_COMPONENT_OUTBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_PERSISTING_CONNECTIONS=true -RESTLET_COMPONENT_PIPELINING_CONNECTIONS=false -RESTLET_COMPONENT_THREAD_MAX_IDLE_TIME_MS=60000 -RESTLET_COMPONENT_USE_FORWARDED_HEADER=false -RESTLET_COMPONENT_REUSE_ADDRESS=true - -#Externalized jar and properties file location. In CSI environments, there are a few libs that have been externalized to aid -#in CSTEM maintenance of the versions of these libs. The most important to the AJSC is the DME2 lib. Not only is this lib necessary -#for proper registration of your AJSC service on a node, but it is also necessary for running locally as well. Another framework -#used in CSI envs is the CSM framework. These 2 framework libs are shown as "provided" dependencies within the pom.xml. These -#dependencies will be copied into the target/commonLibs folder with the normal "mvn clean package" goal of the AJSC. They will -#then be added to the classpath via AJSC_EXTERNAL_LIB_FOLDERS system property. Any files (mainly property files) that need -#to be on the classpath should be added to the AJSC_EXTERNAL_PROPERTIES_FOLDERS system property. The default scenario when -#testing your AJSC service locally will utilize the target/commonLibs directory for DME2 and CSM related artifacts and 2 -#default csm properties files will be used for local testing with anything CSM knorelated. -#NOTE: we are using maven-replacer-plugin to replace "(doubleUnderscore)basedir(doubleUnderscore)" with ${basedir} within the -#target directory for running locally. Multiple folder locations can be separated by the pipe ("|") character. -#Please, NOTE: for running locally, we are setting this system property in the antBuild/build.xml "runLocal" target and in the -#"runAjsc" profile within the pom.xml. This is to most effectively use maven variables (${basedir}, most specifically. Therefore, -#when running locally, the following 2 properties should be set within the profile(s) themselves. -#Example: target/commonLibs|target/otherLibs -#AJSC_EXTERNAL_LIB_FOLDERS=__basedir__/target/commonLibs -#AJSC_EXTERNAL_PROPERTIES_FOLDERS=__basedir__/ajsc-shared-config/etc -#End of AJSC System Properties - - -# This is the default keystore password for the example keystore included in the test-config -# repository. It can be overwritten using the deploy.yaml env params -KEY_STORE_PASSWORD=OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 -KEY_MANAGER_PASSWORD=OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 diff --git a/pom.xml b/pom.xml index 9fe273b..636f422 100644 --- a/pom.xml +++ b/pom.xml @@ -19,15 +19,15 @@ limitations under the License. ============LICENSE_END========================================================= --> - + 4.0.0 - ajsc-archetype-parent - com.att.ajsc - 2.0.0 + org.onap.oparent + oparent + 1.1.0 + org.onap.aai.gizmo @@ -35,89 +35,134 @@ limitations under the License. 1.2.0-SNAPSHOT aai-gizmo + ${basedir}/target - crud-api - v1 - 2.0.0 - /appl/${project.artifactId} - https://nexus.onap.org - - - /appl/${project.artifactId}/${project.version} - ${basedir}/target/swm/package/nix/dist_files${distFilesRoot} - - - 0 - 9520 + https://nexus.onap.org workstation DEV - google_checks.xml java jacoco - ${project.build.directory}/surefire-reports - - ${project.build.directory}/coverage-reports/jacoco.exec - + ${project.build.directory}/surefire-reports + ${project.build.directory}/coverage-reports/jacoco.exec false ${project.version} 1.3 + + + + + org.springframework.boot + spring-boot-dependencies + 1.5.12.RELEASE + pom + import + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-jetty + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-jersey + + + org.springframework.boot + spring-boot-starter-actuator + + + org.apache.cxf + cxf-rt-frontend-jaxrs + 3.2.4 + + + com.google.guava + guava + 23.0 + + + radeox + radeox + 1.0-b2 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + + + org.mockito + mockito-all + 1.9.5 + test + dom4j dom4j 1.6.1 provided - - - com.att.aft - dme2 - 3.1.200 - - commons-io commons-io 2.4 - + + org.apache.commons + commons-lang3 + 3.3.1 + com.google.code.gson gson 2.6.2 - org.onap.aai.logging-service common-logging 1.2.2 - - - org.glassfish.jersey.core - jersey-client - 2.23 - - - ch.qos.logback - logback-core - 1.1.7 + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + org.slf4j + slf4j-api + + org.onap.aai.event-client event-client-dmaap 1.2.1 + + + org.slf4j + slf4j-api + + org.onap.aai.aai-common @@ -140,19 +185,16 @@ limitations under the License. - org.onap.aai.aai-common aai-auth 1.2.1 - org.eclipse.persistence eclipselink 2.6.2 - org.onap.aai rest-client @@ -167,8 +209,13 @@ limitations under the License. com.jayway.jsonpath json-path 2.2.0 + + + org.slf4j + slf4j-api + + - org.apache.tinkerpop @@ -184,16 +231,18 @@ limitations under the License. org.slf4j jcl-over-slf4j + + org.slf4j + slf4j-api + - org.apache.tinkerpop tinkergraph-gremlin 3.2.3 provided - org.json json @@ -203,45 +252,37 @@ limitations under the License. junit junit - org.skyscreamer jsonassert 1.5.0 test - org.hamcrest hamcrest-library ${version.org.hamcrest.hamcrest-library} test + + org.apache.httpcomponents + httpclient + 4.5 + + + org.apache.httpcomponents + httpcore + 4.4.1 + + + org.springframework.boot + + spring-boot-configuration-processor + + true + - - - central - Maven 2 repository 2 - http://repo2.maven.org/maven2/ - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - - ecomp-staging - ECOMP Staging Repository - ${nexusproxy}/content/repositories/staging/ - - - ${project.artifactId} @@ -293,7 +334,7 @@ limitations under the License. - com.mycila license-maven-plugin @@ -314,7 +355,7 @@ limitations under the License. - --> + org.apache.maven.plugins @@ -373,157 +414,22 @@ limitations under the License. + + org.springframework.boot + spring-boot-maven-plugin + 2.0.1.RELEASE + + + + repackage + + + + - - - runAjsc - - initialize - - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - initialize - - java - - - false - true - java - com.att.ajsc.runner.Runner - - com.att.ajsc - ajsc-runner - - - - ${basedir}/ajsc-shared-config/etc - - - - - ${runAjscHome} - - - - - - AJSC_HOME - ${runAjscHome} - - - CONFIG_HOME - ${basedir}/appconfig-local/ - - - AJSC_CONF_HOME - ${basedir}/bundleconfig-local - - - logback.configurationFile - ${basedir}/ajsc-shared-config/etc/logback.xml - - - - AJSC_SHARED_CONFIG - ${basedir}/ajsc-shared-config - - - - AJSC_EXTERNAL_LIB_FOLDERS - ${basedir}/target/commonLibs - - - AJSC_EXTERNAL_PROPERTIES_FOLDERS - ${basedir}/ajsc-shared-config/etc - - - - AJSC_SERVICE_NAMESPACE - ${module.ajsc.namespace.name} - - - AJSC_SERVICE_VERSION - ${module.ajsc.namespace.version} - - - SOACLOUD_SERVICE_VERSION - ${project.version} - - - server.port - ${serverPort} - - - - - - context=/ - port=${serverPort} - sslport=${sslport} - - - - - - java - - - - com.att.ajsc - ajsc-runner - ${ajscRuntimeVersion} - - - - - - - - - - - - org.apache.httpcomponents - httpclient - 4.5 - - - org.apache.httpcomponents - httpcore - 4.4.1 - - - org.json - json - 20131018 - - - - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - ecomp-javadoc dav:https://ecomp-nexus:8443/repository/aai/gizmo-javadoc/${project.version} diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/conf/jaxrsBeans.groovy b/src/main/ajsc/crud-api_v1/crud-api/v1/conf/jaxrsBeans.groovy deleted file mode 100644 index 8ad9391..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/conf/jaxrsBeans.groovy +++ /dev/null @@ -1,11 +0,0 @@ -beans{ - xmlns cxf: "http://camel.apache.org/schema/cxf" - xmlns jaxrs: "http://cxf.apache.org/jaxrs" - xmlns util: "http://www.springframework.org/schema/util" - - echoService(org.onap.crud.service.JaxrsEchoService) - - util.list(id: 'jaxrsServices') { - ref(bean:'echoService') - } -} \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/docs/README.txt b/src/main/ajsc/crud-api_v1/crud-api/v1/docs/README.txt deleted file mode 100644 index 3707179..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/docs/README.txt +++ /dev/null @@ -1 +0,0 @@ -Place any docs here that you want to access within the ajsc upon deployment of your service. diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/lib/README.txt b/src/main/ajsc/crud-api_v1/crud-api/v1/lib/README.txt deleted file mode 100644 index 639e21b..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/lib/README.txt +++ /dev/null @@ -1 +0,0 @@ -3rd party JAR's needed by your jars (if any) for a ajsc deployment package go here... \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/props/module.props b/src/main/ajsc/crud-api_v1/crud-api/v1/props/module.props deleted file mode 100644 index 17ebc08..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/props/module.props +++ /dev/null @@ -1 +0,0 @@ -EXAMPLE.PROPERTY=EXAMLE_VALUE \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/aaiResources.route b/src/main/ajsc/crud-api_v1/crud-api/v1/routes/aaiResources.route deleted file mode 100644 index 4cc0182..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/aaiResources.route +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/crud.route b/src/main/ajsc/crud-api_v1/crud-api/v1/routes/crud.route deleted file mode 100644 index 65420a3..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/crud.route +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/helloWorld.route b/src/main/ajsc/crud-api_v1/crud-api/v1/routes/helloWorld.route deleted file mode 100644 index bc3e178..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/helloWorld.route +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/jaxrsExample.route b/src/main/ajsc/crud-api_v1/crud-api/v1/routes/jaxrsExample.route deleted file mode 100644 index 5158e4f..0000000 --- a/src/main/ajsc/crud-api_v1/crud-api/v1/routes/jaxrsExample.route +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/main/assemble/ajsc_module_assembly.xml b/src/main/assemble/ajsc_module_assembly.xml deleted file mode 100644 index 359f792..0000000 --- a/src/main/assemble/ajsc_module_assembly.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - ${version} - false - - zip - - - - ${project.basedir}/target/versioned-ajsc/routes/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/routes/ - - *.route - - - - - - ${project.basedir}/target/versioned-ajsc/docs/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/docs/ - - *.* - - - - - - - ${project.basedir}/target/versioned-ajsc/lib/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/lib/ - - *.jar - - - - - ${project.basedir}/target/versioned-ajsc/extJars/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/extJars/ - - *.jar - - - - - - ${project.basedir}/target/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/lib/ - - *.jar - - - - - ${project.basedir}/target/versioned-ajsc/conf/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/conf/ - - *.* - - - - - - - diff --git a/src/main/assemble/ajsc_props_assembly.xml b/src/main/assemble/ajsc_props_assembly.xml deleted file mode 100644 index 6ee4093..0000000 --- a/src/main/assemble/ajsc_props_assembly.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - ${version}_properties - false - - zip - - - - ${project.basedir}/target/versioned-ajsc/props - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/props/ - - *.props - - - - - - - - diff --git a/src/main/assemble/ajsc_runtime_assembly.xml b/src/main/assemble/ajsc_runtime_assembly.xml deleted file mode 100644 index c86d265..0000000 --- a/src/main/assemble/ajsc_runtime_assembly.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - runtimeEnvironment - false - - zip - - - - ${project.basedir}/target/versioned-runtime/context/ - runtime/context/ - - *.context - - - - ${project.basedir}/target/versioned-runtime/serviceProperties/ - runtime/serviceProperties/ - - *.props - - - ${project.basedir}/target/versioned-runtime/shiroRole - runtime/shiroRole/ - - *.json - - - ${project.basedir}/target/versioned-runtime/shiroUser - runtime/shiroUser/ - - *.json - - - ${project.basedir}/target/versioned-runtime/shiroUserRole - runtime/shiroUserRole - - *.json - - - - \ No newline at end of file diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh index 1447175..cbd37bc 100644 --- a/src/main/bin/start.sh +++ b/src/main/bin/start.sh @@ -1,58 +1,26 @@ #!/bin/bash -BASEDIR="/opt/app/crud-api/" -AJSC_HOME="$BASEDIR" -AJSC_CONF_HOME="$AJSC_HOME/bundleconfig/" - -# List of ajsc properties which are exposed for modification at deploy time -declare -a MODIFY_PROP_LIST=("KEY_STORE_PASSWORD" - "KEY_MANAGER_PASSWORD" - "AJSC_JETTY_ThreadCount_MIN" - "AJSC_JETTY_ThreadCount_MAX" - "AJSC_JETTY_BLOCKING_QUEUE_SIZE") -PROP_LIST_LENGTH=${#MODIFY_PROP_LIST[@]} - -for (( i=1; i<${PROP_LIST_LENGTH}+1; i++ )); -do - PROP_NAME=${MODIFY_PROP_LIST[$i-1]} - PROP_VALUE=${!PROP_NAME} - if [ ! -z "$PROP_VALUE" ]; then - sed -i "s/$PROP_NAME.*$/$PROP_NAME=$PROP_VALUE/g" $AJSC_CONF_HOME/etc/sysprops/sys-props.properties - fi -done +APP_HOME="/opt/app/crud-api/" if [ -z "$CONFIG_HOME" ]; then echo "CONFIG_HOME must be set in order to start up process" exit 1 fi -# Add any spring bean configuration files to the Gizmo deployment -if [ -n "$SERVICE_BEANS" ]; then - echo "Adding the following dynamic service beans to the deployment: " - mkdir -p /tmp/crud-api/v1/conf - for f in `ls $SERVICE_BEANS` - do - cp $SERVICE_BEANS/$f /tmp/crud-api/v1/conf - echo "Adding dynamic service bean $SERVICE_BEANS/$f" - done - jar uf /opt/app/crud-api/services/crud-api_v1.zip* -C /tmp/ crud-api - rm -rf /tmp/crud-api +if [ -z "$SERVICE_BEANS" ]; then + echo "SERVICE_BEANS must be set in order to start up process" + exit 1 fi -CLASSPATH="$AJSC_HOME/lib/*" -CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/" -CLASSPATH="$CLASSPATH:$AJSC_HOME/etc/" +if [ -z "$KEY_STORE_PASSWORD" ]; then + echo "KEY_STORE_PASSWORD must be set in order to start up process" + exit 1 +fi -PROPS="-DAJSC_HOME=$AJSC_HOME" -PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/" -PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml" -PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME" -PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=crud-api" -PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1" -PROPS="$PROPS -Dserver.port=9520" +PROPS="-DAPP_HOME=$APP_HOME" PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" +PROPS="$PROPS -DKEY_STORE_PASSWORD=$KEY_STORE_PASSWORD" JVM_MAX_HEAP=${MAX_HEAP:-1024} -echo $CLASSPATH - -exec java -Xmx${JVM_MAX_HEAP}m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=// sslport=9520 +set -x +exec java -Xmx${JVM_MAX_HEAP}m $PROPS -jar ${APP_HOME}/gizmo.jar diff --git a/src/main/config/ajsc-jetty.xml b/src/main/config/ajsc-jetty.xml deleted file mode 100644 index 4ad6fcc..0000000 --- a/src/main/config/ajsc-jetty.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - true - - - /etc/runner-web.xml - /etc/ajsc-override-web.xml - true - - - false - - - /extJars/gizmo.jar,/extJars/json-20160212.jar,/extJars/javax.ws.rs-api-2.0.1.jar,/extJars/jersey-client-2.23.jar - - - - - - - - - - - - - - - - - - - - - - - - /extApps - 10 - true - - - - - - - - - file:/auth/tomcat_keystore - - - - - - - - - - - true - true - - - - - - - - - - - - - http/1.1 - - - - - - - - - - - - - - - - - - - - - - 30000 - - - - - - - - - false - - - diff --git a/src/main/config/ajsc-override-web.xml b/src/main/config/ajsc-override-web.xml deleted file mode 100644 index 84a7920..0000000 --- a/src/main/config/ajsc-override-web.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - InterceptorFilter - /services/* - - - InterceptorFilter - /rest/* - - - - springSecurityFilterChain - /* - - - - ManagementServlet - /mgmt - - - - RestletServlet - /rest/* - - - - CamelServlet - /services/* - - - - jsp - *.jsp - *.jspf - *.jspx - *.xsp - *.JSP - *.JSPF - *.JSPX - *.XSP - - - default - /* - - \ No newline at end of file diff --git a/src/main/config/ajscJetty.jks b/src/main/config/ajscJetty.jks deleted file mode 100644 index 48cdbff4a8344b9bfa164b340c2fd3b4f7020c41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3736 zcmcIm`)`xy75+Zo;@EM*>Rd47o-~jPU}JKFn8b+*gxq6897y6^aPAj^NkW*tv>V%4 zyRF*Rc3M>xRjX8OrCU)iVyiZ!iWb^R6&;0+l1^fqRQ0F+3ws`)k1rMKualnhoO9my z^Y^~zyyrcizq$6eZyrKX6az#}iZwQUHo7o6AH_gG9_fKn6tm)nHbLC!7Kg3UqMFnS z!}nCxtZ~`P?CJNqmyXXx;aI2o792JhsgV548_!HZo2o&;_RpUv+ae~{GJf#q z!MdVh8R!xP4nfL{AQh4e5$xF~Iy}(66IPBsk$|-o5>E$Jn_VvLL1hkp0YpcwRi{JyRN4$I;F!}LQV-;fNJSJM_^pU+{Hynlzw2I@?=fy~jM<2ZK zYMg0YqvWj1I5XlGbA?L-Ou3FzW4(#FkNygOh_9TL3HA6+f68Y+hvRAh<;y5IQ>>7;EBd2S36TyJ}*wf9SB8?IRywf@kmB1)ixQLB5S$xjotN$7L)J zY8rA<+=HTYjwS9ruRHay3dFnnV`w8U64wb&uw;1R4}SN?zux3CtbXF@=fJ1(vcPqa z_;C=W8**~&SZ(DbJ;vQh0!~1fkCxM*20JtK!~~P zR{D;@%HsVhs$l7rP4gheg3(ed51PvZU835#YjL;8Y6yLur?!wkF7(58= z{_wy9!|lv~Yb65KL5G*4!sl1`j#<{vynA=Dxxo}@XUgDs8^-y1;PZ>^>`2=oGpxsM z2GiPBzwF|X@l=7rGcn#Ko?H3xV&1d1yKjJX)MhedfLR54xlO^@Vl$I}M!YN@Hoy`F z&O^9;mi{QqOxq>PdI;iy2;O@(8P1lLn{PU7EQ>&diCc!Szq%nhjAEU?{x0i*DFGG_ zBwui@T^nL}jqFcA#luwbKD$dcvm2KAIjA6Hh*Wq+d!vg*dnOIU1+`nh1Ev-nEWshD zi5~U)`}$zaSO!*ZKO2KJEVJOyHqd7mbf1X^_-gG7!Cg->P+uJziVp&?-E4Lh<7T!7 zTE}J!G3iMS#Mh=Cm#6bZ33u}nENn))zae|$7Y0^_fWIzbL1=Zmv8VAl3l40L&%-|CqzOtKIdAVhpm_jooBJElq=JFqjV2 z@v^!dHcKjlJput7HdVFb4^r4;cc)s6$4nNd;aKpYV|5x1`#oFmw+S;T&J=&B!`~J1 zd(!wC3^{C0qdye#IBae^eY?}t66^`+zR_v&9}Tv+^K%?F&px-;Q|GDn)>rR6A%2ag zM)UvA>myLL_`5>KUqGIVnvwjAs5)#0da42jPVN}&GM8>V0n=eCVQmHPzHDbtnq_eS zY;}k4yai^<2~zGq11`A3Is1@?xi+=$Na&vRSReQzet(b+d zr~LDZ!Kf+>uE<^B&O>qLrJJ%%nLH*zBM;=?KfN03=Z$6e5*Ty8t59%9l7*rw+jfN9 zmUJH;wrc^yteUGYfy#ueLwXT!ls`fcz3j_XfRey^6e+2yW?*8^z2Ar=h zvnn&#vUrn^L71LVrlOQ*|PW9frj&V8Ix8l3)CaF^zwDO~%1DUQGTe;RWhYSm*+l zN8zI>VTe_hLe2roM}OkE1N=7kiK%mgZoy#NyZwrcFj+i==)HHg$Ow3=w%0FS8TAIV d$UppJT1E%vmLWa}Z$I0*0!fDe1J|Dh{|_E2uSEa= diff --git a/src/main/config/jul-redirect.properties b/src/main/config/jul-redirect.properties deleted file mode 100644 index 8b6624d..0000000 --- a/src/main/config/jul-redirect.properties +++ /dev/null @@ -1,13 +0,0 @@ - -# Bridge JUL->slf4j Logging Configuration File -# -# This file bridges the JUL logging infrastructure into -# SLF4J so JUL logs go to logback implementation provided -# in this project. SLF4J also captures log4j and has -# other framework options as well providing a common -# logging infrastructure for capturing all logs from different -# libraries using different frameworks in one place. - -# Global properties -handlers=org.slf4j.bridge.SLF4JBridgeHandler -.level= ALL diff --git a/src/main/config/keyfile b/src/main/config/keyfile deleted file mode 100644 index 882e86a..0000000 --- a/src/main/config/keyfile +++ /dev/null @@ -1,27 +0,0 @@ -ZuIwp0TkyVPDeX1Up-8JtkMWvjsCpoiu1_VKeWrtrvxunvAke8_tiFyHPPyb2nkhepFYj6tXzpfS -rGz5XF_TH9NbsKaP8u0HV5clz2WriYQRvHS85vjY7hXxkpFuLb7zkLAPqTyIDpj7FiW61NzsRUAq -TM8jH16jr7mBNnb56w24mNGOwznMPcIZKcjgZU1ekaPDFpWyhQElU7Y0q_94P_Gkk45r66Hj22sU -OiOaaftmudZlswLw8-8Zaakqf2yW9HjMVfuYCwSodBHCW5rdB3Ctb5W36rnD_AQco3Ky2PgPmqvk -QkJYuUHpbuDqVHqLOajlKSIGMTIqAIBg51fRaaONtD-Q5xzY8E5wO1YWTLKcP5tsNvUpzM8Wu3NS -ynpGpUcvlTqWWsGzTbzOyamyKkdNdx97sSqjM25Zh1-ps48h6cddGYWpab7SUvqRCS11QBUyLTry -2iwTEHMhHRIbo7PO99ALQfuq9gI1zKGfurJdvLBeBaFs5SCF0AiCZ3WcDO8Rv3HpxVZ2_ShbDxb0 -eMoO6SotXu51fj8Y3-WqsfZziQyEsHyqpg5uQ6yUtz01h5YHLEoVuotF1U4agmQR6kEkYk-wNOiZ -v-8gaA9gtbLoAdKhuKFxQgQLNMf6GzVzZNujbmDzLoZAP_mXAv29aBPaf64Ugzv-Oa5GZdBgD-Xd -_pahML-ionw99r0TnkpShYmDqMKhMdjaP3m87WIAZkIB-L-VTyKcEsJ4340VSzCOsv3waiM0S89u -4cMcG5y-PLY8IoipIlLUPTWD3SjcQ9DV1Dt3T5KjdWLsj48D3W4K4e9PB8yxs0gtUjgVUR2_xEir -G5eDO9Ac1eHFWGDFFP0SgG-TbHJUKlvy9mwLzmU0fC3xPjhqmIr-v0HxF7HN-tmb1LHDorno8tSN -u7kUGcKSchIiFfvkd066crUb2mH7PnXTaWmAjyVj9VsBExFUYEdpHMAV4sAP9-RxZGDRt46UhrDK -QZvvNhBVyOEjHPHWI4vl1r1v8HNH1_2jZu5DVJWyHWR56aCo1lhFH9_X6UAHUHbnXViDONZOVXlT -9-WD0tk2zJGuwrhdZDAnPnAmjfwbwbpnr5Hmex1i1JiD7WVyP1kbfoej2TmdiYbxr9oBYaGQ29JI -aHod7MQCLtvL1z5XgnDPLZ4y3_9SbqHKYbNa8UgZkTLF5EacGThYVFDLA9cbafHDtR1kMGE3vv4D -EJ-0pAYTOGmKlVI7DwNyKsY9JTyudrxTqhOxi9jgcJNWiUaNe9yhL8Pyc2YBqUTTYhh_a2d1rvkZ -0Gh1crviVxqBrIkRKaMRXZ4f1vDLz-3NvG_vwPOo8WRFo5nGmSdTw7CjBaigJ_cYCfDhoP11pEnw -cndsZNcHs-v05LlxeIIMDD_f5Bvz-il_DLA4eK2HqgLdxh8ziSDl2azk14MJY4amzz6reEXUuKLV -RsZGf_jbDGKhE2HuDQ5ovoLOi4OqE1oRuqh-dGxitrYouP2SN1l_1tCEMRth86FMV-6AQtZsvdUo -y9MtQ7e35atjA8nHtgADlDTmJBKQiUHUsOZ77p1qp17HAFMovUkc739opfEYnKUn6Itpw5Ipm_Is -ra6chJUfMpOFof5rb5OjqFAN27c_-mPo1lQU3ndYlKGh_n5V8ufX6v2Yri8WzOPf6hjVYotkmoMP -NPAICDCB8W5ddBjsopzLVVEtaXDu9Qj6-zf77hT4iQ7rBd2Ner8iLqN3Kis0dvkNM3_uH8onau1G -Y_YYw7PPSZyd2S_7Dd6G-IG4ayO6e5DD6oUwwekyiQI_3rTXNa_wldGxqW9u818010ekE4Qdlfcj -beIn7fAeaOjReZ87hRgWyMs-EgTVHw8RL3yI_O6VvRTVRONRF1Y4C_-IYa8z-bfrwXx3BBd9TTgb -EnS9wVOyC2OgUN6BhPLGLhxzkJ05nEjizXEc9t5EPYoSRwesajGGrrG_0-qWbuU5hKLPLkyeJLHb -5HXOTVsrUR59Vov2M3_EswkxcImblox3k3VS2yihZMGyfqLzZIUXgd8ufkevKKU6DxwacGTb \ No newline at end of file diff --git a/src/main/config/runner-web.xml b/src/main/config/runner-web.xml deleted file mode 100644 index b51aff4..0000000 --- a/src/main/config/runner-web.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - contextConfigLocation - /WEB-INF/spring-servlet.xml, - classpath:applicationContext.xml - - - - - spring.profiles.default - nooauth - - - - org.springframework.web.context.ContextLoaderListener - - - - ManagementServlet - ajsc.ManagementServlet - - - - - InterceptorFilter - ajsc.filters.InterceptorFilter - - preProcessor_interceptor_config_file - /etc/PreProcessorInterceptors.properties - - - postProcessor_interceptor_config_file - /etc/PostProcessorInterceptors.properties - - - - - - RestletServlet - ajsc.restlet.RestletSpringServlet - - org.restlet.component - restletComponent - - - - - CamelServlet - ajsc.servlet.AjscCamelServlet - - - - - springSecurityFilterChain - org.springframework.web.filter.DelegatingFilterProxy - - - - spring - org.springframework.web.servlet.DispatcherServlet - 1 - - - - - - - - jsp - org.apache.jasper.servlet.JspServlet - - - - - - - - - default - org.eclipse.jetty.servlet.DefaultServlet - - dirAllowed - true - - - - diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 07fe188..10c4dd0 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -15,7 +15,7 @@ RUN export JAVA_HOME # Build up the deployment folder structure RUN mkdir -p $MICRO_HOME -ADD swm/package/nix/dist_files/appl/gizmo/* $MICRO_HOME/ +COPY gizmo.jar $MICRO_HOME/ RUN mkdir -p $BIN_HOME COPY *.sh $BIN_HOME RUN chmod 755 $BIN_HOME/* diff --git a/src/main/java/org/onap/crud/CrudApplication.java b/src/main/java/org/onap/crud/CrudApplication.java new file mode 100644 index 0000000..d1446ba --- /dev/null +++ b/src/main/java/org/onap/crud/CrudApplication.java @@ -0,0 +1,46 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs + * ================================================================================ + * 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========================================================= + */ +package org.onap.crud; + +import java.util.HashMap; +import java.util.Map; +import org.eclipse.jetty.util.security.Password; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.context.annotation.ImportResource; + +/** + * Crud application class - SpringApplication.run + */ +@SpringBootApplication +@ImportResource({"file:${SERVICE_BEANS}/*.xml"}) +public class CrudApplication extends SpringBootServletInitializer{// NOSONAR + public static void main(String[] args) {// NOSONAR + String keyStorePassword = System.getProperty("KEY_STORE_PASSWORD"); + if(keyStorePassword==null || keyStorePassword.isEmpty()){ + throw new RuntimeException("Env property KEY_STORE_PASSWORD not set"); + } + Map props = new HashMap<>(); + props.put("server.ssl.key-store-password", Password.deobfuscate(keyStorePassword)); + new CrudApplication().configure(new SpringApplicationBuilder(CrudApplication.class).properties(props)).run(args); + } +} diff --git a/src/main/java/org/onap/crud/config/JerseyConfig.java b/src/main/java/org/onap/crud/config/JerseyConfig.java new file mode 100644 index 0000000..654ff81 --- /dev/null +++ b/src/main/java/org/onap/crud/config/JerseyConfig.java @@ -0,0 +1,39 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs + * ================================================================================ + * 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========================================================= + */ +package org.onap.crud.config; + +import org.glassfish.jersey.server.ResourceConfig; +import org.onap.crud.service.CrudRestService; +import org.onap.crud.service.JaxrsEchoService; +import org.springframework.stereotype.Component; + +/** + * Registers Crud Rest interface as JAX-RS endpoints. + */ +@Component +public class JerseyConfig extends ResourceConfig { + + public JerseyConfig(CrudRestService crudRestService, JaxrsEchoService jaxrsEchoService) { + register(crudRestService); + register(jaxrsEchoService); + } + +} diff --git a/src/main/java/org/onap/crud/event/envelope/GraphEventEnvelope.java b/src/main/java/org/onap/crud/event/envelope/GraphEventEnvelope.java index 13370a2..d793930 100644 --- a/src/main/java/org/onap/crud/event/envelope/GraphEventEnvelope.java +++ b/src/main/java/org/onap/crud/event/envelope/GraphEventEnvelope.java @@ -1,16 +1,15 @@ /** * ============LICENSE_START======================================================= - * Gizmo + * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. - * Copyright © 2017 Amdocs - * All rights reserved. + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * 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 + * 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, @@ -18,8 +17,6 @@ * 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. */ package org.onap.crud.event.envelope; diff --git a/src/main/java/org/onap/crud/event/envelope/GraphEventHeader.java b/src/main/java/org/onap/crud/event/envelope/GraphEventHeader.java index f70127d..4f914cf 100644 --- a/src/main/java/org/onap/crud/event/envelope/GraphEventHeader.java +++ b/src/main/java/org/onap/crud/event/envelope/GraphEventHeader.java @@ -1,16 +1,15 @@ /** * ============LICENSE_START======================================================= - * Gizmo + * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. - * Copyright © 2017 Amdocs - * All rights reserved. + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * 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 + * 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, @@ -18,8 +17,6 @@ * 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. */ package org.onap.crud.event.envelope; diff --git a/src/main/java/org/onap/crud/event/response/GraphEventResponseHandler.java b/src/main/java/org/onap/crud/event/response/GraphEventResponseHandler.java index 1fa056e..8146aa3 100644 --- a/src/main/java/org/onap/crud/event/response/GraphEventResponseHandler.java +++ b/src/main/java/org/onap/crud/event/response/GraphEventResponseHandler.java @@ -1,16 +1,15 @@ /** * ============LICENSE_START======================================================= - * Gizmo + * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. - * Copyright © 2017 Amdocs - * All rights reserved. + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * 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 + * 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, @@ -18,8 +17,6 @@ * 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. */ package org.onap.crud.event.response; diff --git a/src/main/java/org/onap/crud/event/response/GraphEventResponseMessage.java b/src/main/java/org/onap/crud/event/response/GraphEventResponseMessage.java index 5e4c6bd..1b7c390 100644 --- a/src/main/java/org/onap/crud/event/response/GraphEventResponseMessage.java +++ b/src/main/java/org/onap/crud/event/response/GraphEventResponseMessage.java @@ -1,16 +1,15 @@ /** * ============LICENSE_START======================================================= - * Gizmo + * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. - * Copyright © 2017 Amdocs - * All rights reserved. + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * 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 + * 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, @@ -18,8 +17,6 @@ * 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. */ package org.onap.crud.event.response; diff --git a/src/main/java/org/onap/crud/service/CrudRestService.java b/src/main/java/org/onap/crud/service/CrudRestService.java index 2af205a..b9062b0 100644 --- a/src/main/java/org/onap/crud/service/CrudRestService.java +++ b/src/main/java/org/onap/crud/service/CrudRestService.java @@ -20,20 +20,6 @@ */ package org.onap.crud.service; -import com.google.gson.JsonElement; - -import org.apache.cxf.jaxrs.ext.PATCH; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aaiauth.auth.Auth; -import org.onap.crud.exception.CrudException; -import org.onap.crud.logging.CrudServiceMsgs; -import org.onap.crud.logging.LoggingUtil; -import org.onap.crud.util.CrudProperties; -import org.onap.crud.util.CrudServiceConstants; -import org.onap.crud.util.CrudServiceUtil; -import org.slf4j.MDC; - import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.HashMap; @@ -57,7 +43,20 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; +import org.apache.cxf.jaxrs.ext.PATCH; +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.aaiauth.auth.Auth; +import org.onap.crud.exception.CrudException; +import org.onap.crud.logging.CrudServiceMsgs; +import org.onap.crud.logging.LoggingUtil; +import org.onap.crud.util.CrudProperties; +import org.onap.crud.util.CrudServiceConstants; +import org.onap.crud.util.CrudServiceUtil; +import org.slf4j.MDC; +import com.google.gson.JsonElement; +@Path("/services/inventory") public class CrudRestService { private AbstractGraphDataService graphDataService; @@ -72,14 +71,13 @@ public class CrudRestService { this.graphDataService = graphDataService; this.auth = new Auth(CrudServiceConstants.CRD_AUTH_FILE); } - + // For unit testing public CrudRestService(AbstractGraphDataService graphDataService, Auth auth) throws Exception { this.graphDataService = graphDataService; this.auth = auth; } - public enum Action { POST, GET, PUT, DELETE, PATCH } diff --git a/src/main/java/org/onap/crud/service/JaxrsEchoService.java b/src/main/java/org/onap/crud/service/JaxrsEchoService.java index 1c1e54b..dc01435 100644 --- a/src/main/java/org/onap/crud/service/JaxrsEchoService.java +++ b/src/main/java/org/onap/crud/service/JaxrsEchoService.java @@ -20,10 +20,6 @@ */ package org.onap.crud.service; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.crud.logging.LoggingUtil; - import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -34,8 +30,13 @@ import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.crud.logging.LoggingUtil; +import org.springframework.stereotype.Component; - +@Component +@Path("/services/gizmo/v1/echo-service/") public class JaxrsEchoService { private static Logger logger = LoggerFactory.getInstance() diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..2a65bc3 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,10 @@ +server.port=9520 + +SERVICE_BEANS=dynamic/conf + +server.ssl.key-store=${CONFIG_HOME}/auth/tomcat_keystore +server.ssl.enabled=true +server.ssl.client-auth=need +server.ssl.enabled-protocols=TLSv1.1,TLSv1.2 + +logging.config=classpath:logback.xml \ No newline at end of file diff --git a/ajsc-shared-config/etc/logback.xml b/src/main/resources/logback.xml similarity index 99% rename from ajsc-shared-config/etc/logback.xml rename to src/main/resources/logback.xml index 99adb1f..9a8d99a 100644 --- a/ajsc-shared-config/etc/logback.xml +++ b/src/main/resources/logback.xml @@ -2,7 +2,7 @@ - + diff --git a/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context b/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context deleted file mode 100644 index 8514196..0000000 --- a/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context +++ /dev/null @@ -1 +0,0 @@ -{"context":{"contextClass":"ajsc.Context","contextId":"__module_ajsc_namespace_name__:__module_ajsc_namespace_version__","contextName":"__module_ajsc_namespace_name__","contextVersion":"__module_ajsc_namespace_version__","description":"__module_ajsc_namespace_name__ Context"}} \ No newline at end of file diff --git a/src/main/runtime/context/default#0.context b/src/main/runtime/context/default#0.context deleted file mode 100644 index d1b5ab4..0000000 --- a/src/main/runtime/context/default#0.context +++ /dev/null @@ -1 +0,0 @@ -{"context":{"contextClass":"ajsc.Context","contextId":"default:0","contextName":"default","contextVersion":"0","description":"Default Context"}} \ No newline at end of file diff --git a/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json b/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json deleted file mode 100644 index d0954cf..0000000 --- a/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json +++ /dev/null @@ -1 +0,0 @@ -{"deploymentPackage":{"Class":"ajsc.DeploymentPackage","Id":"__module.ajsc.namespace.name__:__module_ajsc_namespace_version__","namespace":"__module_ajsc_namespace_name__","namespaceVersion":"__module_ajsc_namespace_version__","description":"__module_ajsc_namespace_name__ __module_ajsc_namespace_version__ - default description","userId":"ajsc"}} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/ajscadmin.json b/src/main/runtime/shiroRole/ajscadmin.json deleted file mode 100644 index f5e981e..0000000 --- a/src/main/runtime/shiroRole/ajscadmin.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"ajscadmin","name":"ajscadmin","permissions":"[ajscadmin:*, ajsc:*]"} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json b/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 2dae9f5..0000000 --- a/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"contextadmin:__module_ajsc_namespace_name__","name":"contextadmin:__module_ajsc_namespace_name__","permissions":"[]"} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/contextadmin#default.json b/src/main/runtime/shiroRole/contextadmin#default.json deleted file mode 100644 index 5de814e..0000000 --- a/src/main/runtime/shiroRole/contextadmin#default.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"contextadmin:default","name":"contextadmin:default","permissions":"[]"} \ No newline at end of file diff --git a/src/main/runtime/shiroUser/ajsc.json b/src/main/runtime/shiroUser/ajsc.json deleted file mode 100644 index f4c7855..0000000 --- a/src/main/runtime/shiroUser/ajsc.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserClass":"ajsc.auth.ShiroUser","shiroUserId":"ajsc","passwordHash":"9471697417008c880720ba54c6038791ad7e98f3b88136fe34f4d31a462dd27a","permissions":"[*:*]","username":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json b/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json deleted file mode 100644 index cb8d483..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:ajscadmin","roleId":"ajscadmin","userId":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json b/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 95d2361..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:contextadmin:__module_ajsc_namespace_name__","roleId":"contextadmin:__module_ajsc_namespace_name__","userId":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json b/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json deleted file mode 100644 index 2bd5063..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:contextadmin:default","roleId":"contextadmin:default","userId":"ajsc"} \ No newline at end of file diff --git a/src/test/java/org/onap/crud/event/GraphEventEnvelopeTest.java b/src/test/java/org/onap/crud/event/GraphEventEnvelopeTest.java index 51100d5..e280c95 100644 --- a/src/test/java/org/onap/crud/event/GraphEventEnvelopeTest.java +++ b/src/test/java/org/onap/crud/event/GraphEventEnvelopeTest.java @@ -1,3 +1,23 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs + * ================================================================================ + * 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========================================================= + */ package org.onap.crud.event; import static org.hamcrest.Matchers.is; diff --git a/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java b/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java index 5c0da98..9330556 100644 --- a/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java +++ b/src/test/java/org/onap/crud/event/response/GraphEventResponseHandlerTest.java @@ -1,3 +1,23 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs + * ================================================================================ + * 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========================================================= + */ package org.onap.crud.event.response; import static org.hamcrest.Matchers.is; diff --git a/src/test/java/org/onap/crud/test/util/TestUtil.java b/src/test/java/org/onap/crud/test/util/TestUtil.java index 69732ae..1fcb46e 100644 --- a/src/test/java/org/onap/crud/test/util/TestUtil.java +++ b/src/test/java/org/onap/crud/test/util/TestUtil.java @@ -1,3 +1,23 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs + * ================================================================================ + * 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========================================================= + */ package org.onap.crud.test.util; import java.io.File; diff --git a/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java b/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java index 22fead0..4e6590d 100644 --- a/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java +++ b/src/test/java/org/onap/schema/RelationshipSchemaLoaderTest.java @@ -20,18 +20,16 @@ */ package org.onap.schema; -import static org.junit.Assert.*; -import edu.emory.mathcs.backport.java.util.Arrays; -import org.junit.Before; -import org.junit.Test; -import org.onap.crud.exception.CrudException; - +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; - -import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; +import org.onap.crud.exception.CrudException; public class RelationshipSchemaLoaderTest { -- 2.16.6