From a0d3e8ee8d78d41e4a58437983bc4c894d0024df Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Tue, 6 Feb 2018 15:06:44 -0500 Subject: [PATCH] Update traversal from AJSC 2 to Spring Boot Issue-ID: AAI-799 Change-Id: I6500f661db704726f529f665203a9c0605e8193e Signed-off-by: Venkata Harish K Kajur --- aai-traversal/ajsc-shared-config/README.txt | 6 - .../etc/basic-logback_root_logger_level_off.xml | 107 -- .../etc/csm-config-app.properties | 183 ---- .../etc/csm-framework-app.properties | 11 - aai-traversal/antBuild/build.xml | 228 ----- aai-traversal/bundleconfig-local/README.txt | 9 - aai-traversal/bundleconfig-local/RELEASE_NOTES.txt | 1 - .../appprops/PreProcessorInterceptors.properties | 3 - .../etc/appprops/app-intercepts.properties | 6 - .../etc/service-file-monitor.properties | 5 - aai-traversal/bundleconfig-local/symlinks.txt | 6 - aai-traversal/pom.xml | 1053 +++++++++++++------- .../ajsc-aai/v1/conf/FileMonitorBeans.xml | 20 - .../ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy | 23 - .../ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml | 98 -- .../ajsc/ajsc-aai_v1/ajsc-aai/v1/docs/README.txt | 1 - .../ajsc/ajsc-aai_v1/ajsc-aai/v1/lib/README.txt | 1 - .../ajsc-aai_v1/ajsc-aai/v1/props/module.props | 1 - .../ajsc/ajsc-aai_v1/ajsc-aai/v1/routes/aai.route | 4 - .../src/main/assemble/ajsc_module_assembly.xml | 66 -- .../src/main/assemble/ajsc_props_assembly.xml | 23 - .../src/main/assemble/ajsc_runtime_assembly.xml | 44 - aai-traversal/src/main/assembly/descriptor.xml | 32 + aai-traversal/src/main/config/ajsc-jetty.xml | 164 --- .../src/main/config/ajsc-jolokia-override-web.xml | 46 - .../src/main/config/ajsc-override-web.xml | 41 - aai-traversal/src/main/config/ajsc-request.xml | 49 - .../src/main/config/hazelcast-client.properties | 25 - .../src/main/config/jul-redirect.properties | 13 - aai-traversal/src/main/config/keyfile | 27 - aai-traversal/src/main/config/runner-web.xml | 106 -- aai-traversal/src/main/docker/Dockerfile | 22 + .../src/main/{resources => }/docker/aai.sh | 0 aai-traversal/src/main/docker/docker-entrypoint.sh | 119 +++ .../src/main/java/org/onap/aai/Profiles.java | 12 + .../src/main/java/org/onap/aai/TraversalApp.java | 130 +++ .../ajsc_aai/JaxrsErrorMessageLookupService.java | 99 -- .../org/onap/aai/ajsc_aai/JaxrsUserService.java | 55 - .../filemonitor/ServicePropertiesListener.java | 21 - .../ajsc_aai/filemonitor/ServicePropertiesMap.java | 127 --- .../filemonitor/ServicePropertyService.java | 21 - .../ajsc_aai/util/ServicePropertiesMapBean.java | 38 - .../main/java/org/onap/aai/config/DmaapConfig.java | 43 - .../org/onap/aai/config/JettyPasswordDecoder.java | 14 + .../java/org/onap/aai/config/PasswordDecoder.java | 6 + .../aai/config/PropertyPasswordConfiguration.java | 62 ++ .../onap/aai/interceptors/AAIContainerFilter.java | 22 + .../onap/aai/interceptors/AAIHeaderProperties.java | 18 +- .../aai/interceptors/AAILogJAXRSInInterceptor.java | 286 ------ .../interceptors/AAILogJAXRSOutInterceptor.java | 303 ------ .../aai/interceptors/PostAaiAjscInterceptor.java | 66 -- .../aai/interceptors/PreAaiAjscInterceptor.java | 63 -- .../org/onap/aai/interceptors/package-info.java | 17 + .../post/AAIResponseFilterPriority.java | 13 + .../aai/interceptors/post/ResetLoggingContext.java | 50 + .../post/ResponseHeaderManipulation.java | 30 + .../post/ResponseTransactionLogging.java | 106 ++ .../interceptors/pre/AAIRequestFilterPriority.java | 18 + .../aai/interceptors/pre/HeaderValidation.java | 88 ++ .../pre/RequestHeaderManipulation.java | 71 ++ .../aai/interceptors/pre/RequestModification.java | 77 ++ .../pre/RequestTransactionLogging.java | 113 +++ .../aai/interceptors/pre/SetLoggingContext.java | 70 ++ .../org/onap/aai/rest/retired/RetiredConsumer.java | 2 +- .../java/org/onap/aai/rest/util/EchoResponse.java | 3 +- .../java/org/onap/aai/web/JerseyConfiguration.java | 127 +++ .../java/org/onap/aai/web/LocalHostAccessLog.java | 39 + .../java/org/onap/aai/web/WebConfiguration.java | 27 + .../src/main/resources/application.properties | 72 ++ aai-traversal/src/main/resources/docker/Dockerfile | 31 - .../src/main/resources/docker/commonLibs/README | 1 - .../src/main/resources/docker/docker-entrypoint.sh | 134 --- .../src/main/resources/docker/init-chef.sh | 61 -- .../main/resources}/etc/.gitignore | 0 .../resources}/etc/appprops/Introscope.properties | 0 .../appprops/PostProcessorInterceptors.properties | 0 .../etc/appprops/aaiEventDMaaPPublisher.properties | 0 .../resources}/etc/appprops/aaiconfig.properties | 0 .../resources}/etc/appprops/default-logback.xml | 0 .../main/resources}/etc/appprops/error.properties | 0 .../etc/appprops/gremlin-server-config.yaml | 0 .../resources}/etc/appprops/logging.properties | 0 .../etc/appprops/methodMapper.properties | 0 .../resources}/etc/appprops/preferredRoute.txt | 0 .../etc/appprops/titan-cached.properties | 0 .../etc/appprops/titan-realtime.properties | 0 .../main/resources}/etc/auth/aai_keystore | Bin .../main/resources}/etc/query/stored-queries.json | 0 .../closed-loop-named-query-1.0.json | 0 .../getClfiRoadmTailSummary-1.0.json | 193 ++-- .../named-query-json/getComplexByPnfName-1.0.json | 0 .../named-query-json/getComponentList-1.0.json | 0 .../named-query-json/getComponentList-1.1.json | 0 .../named-query-json/getComponentList-1.2.json | 0 .../getDHVComplexHostname-1.0.json | 0 .../getDHVComplexLocationId-1.0.json | 0 .../named-query-json/getDHVLogicalLink-1.0.json | 0 .../getDHVLogicalLinkByCircuitId-1.0.json | 0 .../getDHVServiceTopology-1.0.json | 0 .../getDHVServiceTopology-1.1.json | 0 .../getDHVServiceTopology2-1.0.json | 0 .../getL3networkCloudRegionByNetworkRole-1.0.json | 0 .../getLogicalLinkByCloudRegionId-1.0.json | 0 .../getPinterfacePhysicalLinkBySvcInstId-1.0.json | 0 .../getRouterRoadmTailSummary-1.0.json | 247 +++-- .../getServiceInstanceModel-1.0.json | 0 .../getServiceInstanceSummary-1.0.json | 0 .../getSvcSubscriberModelInfo-1.0.json | 0 .../getTenantInfoAtSvcInstance-1.0.json | 0 .../getTenantInfoAtSvcSubscription-1.0.json | 0 .../getVnfVlanByCircuitId-1.0.json | 0 .../named-query-json/getVserver-1.0.json | 0 .../named-query-json/getWlBundleId-1.0.json | 0 .../vnf-to-esr-system-info-1.0.json | 0 .../vnf-to-service-instance-1.0.json | 0 .../etc/scriptdata/resource-model-json/000-README | 0 .../etc/scriptdata/service-model-json/000-README | 0 .../scriptdata/widget-model-json/action-1.0.json | 0 .../widget-model-json/action-data-1.0.json | 0 .../widget-model-json/allotted-resource-1.0.json | 0 .../widget-model-json/availability-zone-1.0.json | 0 .../widget-model-json/az-and-dvs-switches-1.0.json | 0 .../widget-model-json/class-of-service-1.0.json | 0 .../widget-model-json/cloud-region-1.0.json | 0 .../scriptdata/widget-model-json/complex-1.0.json | 0 .../widget-model-json/configuration-1.0.json | 0 .../widget-model-json/connector-1.0.json | 0 .../constrained-element-set-1.0.json | 0 .../widget-model-json/ctag-assignment-1.0.json | 0 .../widget-model-json/ctag-pool-1.0.json | 0 .../scriptdata/widget-model-json/customer-1.0.json | 0 .../widget-model-json/cvlan-tag-entry-1.0.json | 0 .../widget-model-json/dvs-switch-1.0.json | 0 .../widget-model-json/edge-prop-names-1.0.json | 0 .../widget-model-json/element-choice-set-1.0.json | 0 .../widget-model-json/entitlement-1.0.json | 0 .../widget-model-json/esr-system-info-1.0.json | 0 .../scriptdata/widget-model-json/flavor-1.0.json | 0 .../widget-model-json/generic-vnf-1.0.json | 0 .../widget-model-json/group-assignment-1.0.json | 0 .../scriptdata/widget-model-json/image-1.0.json | 0 .../widget-model-json/include-node-filter-1.0.json | 0 .../widget-model-json/instance-group-1.0.json | 0 .../widget-model-json/inventory-item-1.0.json | 0 .../widget-model-json/inventory-item-data-1.0.json | 0 .../widget-model-json/ipsec-configuration-1.0.json | 0 .../scriptdata/widget-model-json/key-data-1.0.json | 0 .../widget-model-json/l-interface-1.0.json | 0 .../l3-interface-ipv4-address-list-1.0.json | 0 .../l3-interface-ipv6-address-list-1.0.json | 0 .../widget-model-json/l3-network-1.0.json | 0 .../widget-model-json/lag-interface-1.0.json | 0 .../scriptdata/widget-model-json/lag-link-1.0.json | 0 .../scriptdata/widget-model-json/license-1.0.json | 0 .../license-key-resource-1.0.json | 0 .../widget-model-json/logical-link-1.0.json | 0 .../widget-model-json/metadatum-1.0.json | 0 .../scriptdata/widget-model-json/model-1.0.json | 0 .../widget-model-json/model-constraint-1.0.json | 0 .../widget-model-json/model-element-1.0.json | 0 .../widget-model-json/model-ver-1.0.json | 0 .../multicast-configuration-1.0.json | 0 .../widget-model-json/named-query-1.0.json | 0 .../widget-model-json/named-query-element-1.0.json | 0 .../widget-model-json/network-policy-1.0.json | 0 .../widget-model-json/network-profile-1.0.json | 0 .../scriptdata/widget-model-json/newvce-1.0.json | 0 .../widget-model-json/oam-network-1.0.json | 0 .../widget-model-json/p-interface-1.0.json | 0 .../widget-model-json/physical-link-1.0.json | 0 .../etc/scriptdata/widget-model-json/pnf-1.0.json | 0 .../widget-model-json/port-group-1.0.json | 0 .../widget-model-json/property-constraint-1.0.json | 0 .../scriptdata/widget-model-json/pserver-1.0.json | 0 .../widget-model-json/related-lookup-1.0.json | 0 .../widget-model-json/reserved-prop-names-1.0.json | 0 .../widget-model-json/result-data-1.0.json | 0 .../route-table-reference-1.0.json | 0 .../widget-model-json/routing-instance-1.0.json | 0 .../widget-model-json/secondary-filter-1.0.json | 0 .../segmentation-assignment-1.0.json | 0 .../scriptdata/widget-model-json/service-1.0.json | 0 .../widget-model-json/service-capability-1.0.json | 0 .../widget-model-json/service-instance-1.0.json | 0 .../service-subscription-1.0.json | 0 .../widget-model-json/site-pair-1.0.json | 0 .../widget-model-json/site-pair-set-1.0.json | 0 .../scriptdata/widget-model-json/snapshot-1.0.json | 0 .../scriptdata/widget-model-json/sriov-vf-1.0.json | 0 .../widget-model-json/start-node-filter-1.0.json | 0 .../scriptdata/widget-model-json/subnet-1.0.json | 0 .../tagged-inventory-item-list-1.0.json | 0 .../scriptdata/widget-model-json/tenant-1.0.json | 0 .../widget-model-json/tunnel-xconnect-1.0.json | 0 .../widget-model-json/update-node-key-1.0.json | 0 .../etc/scriptdata/widget-model-json/vce-1.0.json | 0 .../widget-model-json/vf-module-1.0.json | 0 .../widget-model-json/vig-server-1.0.json | 0 .../widget-model-json/virtual-data-center-1.0.json | 0 .../etc/scriptdata/widget-model-json/vlan-1.0.json | 0 .../widget-model-json/vnf-image-1.0.json | 0 .../etc/scriptdata/widget-model-json/vnfc-1.0.json | 0 .../scriptdata/widget-model-json/volume-1.0.json | 0 .../widget-model-json/volume-group-1.0.json | 0 .../etc/scriptdata/widget-model-json/vpe-1.0.json | 0 .../scriptdata/widget-model-json/vpls-pe-1.0.json | 0 .../widget-model-json/vpn-binding-1.0.json | 0 .../scriptdata/widget-model-json/vserver-1.0.json | 0 .../etc/scriptdata/widget-model-json/zone-1.0.json | 0 .../resources}/etc/sysprops/sys-props.properties | 0 .../etc/sysprops/template.sys-props.properties | 0 .../main/resources}/localhost-access-logback.xml | 1 + .../etc => src/main/resources}/logback.xml | 72 +- .../main/{config => resources}/realm.properties | 0 ...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 - aai-traversal/src/main/runtime/shiroUser/ajsc.json | 1 - .../main/runtime/shiroUserRole/ajsc#ajscadmin.json | 1 - ...ontextadmin#__module.ajsc.namespace.name__.json | 1 - .../shiroUserRole/ajsc#contextadmin#default.json | 1 - aai-traversal/src/main/scripts/common_functions.sh | 56 ++ aai-traversal/src/main/scripts/deleteNamedQuery.sh | 18 +- aai-traversal/src/main/scripts/deleteTool.sh | 4 +- aai-traversal/src/main/scripts/getTool.sh | 4 +- .../src/main/scripts/install/updateQueryData.sh | 8 +- aai-traversal/src/main/scripts/putTool.sh | 35 +- .../src/main/swm/package/nix/common/deinstall.env | 10 + .../swm/package/nix/common/install_postproc.sh} | 34 +- .../swm/package/nix/deinstall/preproc/pre_proc | 4 + .../app/aai-traversal/docker-compose.template.yaml | 51 + .../dist_files/opt/app/aai-traversal/execTool.sh | 58 ++ .../opt/app/aai-traversal/kill_resources.sh | 7 + .../opt/app/aai-traversal/start_resources.sh | 6 + .../opt/app/aai-traversal/stop_resources.sh | 6 + .../swm/package/nix/initinst/postproc/post_proc | 4 + .../swm/package/nix/install/postproc/post_proc | 4 + .../main/swm/package/nix/install/preproc/pre_proc | 4 + aai-traversal/src/main/xjb/bindings.xjb | 21 - .../java/org/onap/aai/AAIGremlinQueryTest.java | 126 +++ .../org/onap/aai/TraversalTestConfiguration.java | 125 +++ .../ModelBasedProcessingInvalidDataTest.java | 3 +- .../aai/dbgraphgen/ModelBasedProcessingTest.java | 3 +- .../aai/dbgraphmap/SearchGraphNamedQueryTest.java | 6 +- .../org/onap/aai/dbgraphmap/SearchGraphTest.java | 5 +- .../interceptors/AAILogJAXRSInInterceptorTest.java | 204 ---- .../AAILogJAXRSOutInterceptorTest.java | 111 --- .../interceptors/PostAaiAjscInterceptorTest.java | 75 -- .../interceptors/PreAaiAjscInterceptorTest.java | 63 -- .../aai/rest/search/GetCustomQueryConfigTest.java | 2 +- .../search/ModelAndNamedQueryRestProviderTest.java | 2 +- .../java/org/onap/aai/rest/search/QueryTest.java | 2 +- .../onap/aai/rest/search/SearchProviderTest.java | 2 +- .../org/onap/aai/rest/search/SimpleFormatTest.java | 2 +- .../aai/retiredcustomer/JaxrsUserServiceTest.java | 111 --- .../aai/util/AAIAppServletContextListenerTest.java | 178 ---- .../src/test/resources/application-test.properties | 70 ++ .../etc/appprops/aaiconfig.properties | 117 --- .../bundleconfig-local/etc/auth/aai_policy.json | 37 - .../etc/scriptdata/resource-model-json/000-README | 10 - .../etc/scriptdata/service-model-json/000-README | 10 - .../resources/config/etc/titan-cached.properties | 39 - .../resources/config/etc/titan-realtime.properties | 36 - aai-traversal/src/test/resources/log4j.properties | 3 - aai-traversal/src/test/resources/logback.xml | 373 ++++++- .../test/resources/payloads/templates/pserver.json | 3 + .../src/test/resources/test_aaiconfig.properties | 99 -- pom.xml | 324 +----- 271 files changed, 3300 insertions(+), 4777 deletions(-) delete mode 100644 aai-traversal/ajsc-shared-config/README.txt delete mode 100644 aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml delete mode 100644 aai-traversal/ajsc-shared-config/etc/csm-config-app.properties delete mode 100644 aai-traversal/ajsc-shared-config/etc/csm-framework-app.properties delete mode 100644 aai-traversal/antBuild/build.xml delete mode 100644 aai-traversal/bundleconfig-local/README.txt delete mode 100644 aai-traversal/bundleconfig-local/RELEASE_NOTES.txt delete mode 100644 aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties delete mode 100644 aai-traversal/bundleconfig-local/etc/appprops/app-intercepts.properties delete mode 100644 aai-traversal/bundleconfig-local/etc/service-file-monitor.properties delete mode 100644 aai-traversal/bundleconfig-local/symlinks.txt delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/docs/README.txt delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/lib/README.txt delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/props/module.props delete mode 100644 aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/routes/aai.route delete mode 100644 aai-traversal/src/main/assemble/ajsc_module_assembly.xml delete mode 100644 aai-traversal/src/main/assemble/ajsc_props_assembly.xml delete mode 100644 aai-traversal/src/main/assemble/ajsc_runtime_assembly.xml create mode 100644 aai-traversal/src/main/assembly/descriptor.xml delete mode 100644 aai-traversal/src/main/config/ajsc-jetty.xml delete mode 100644 aai-traversal/src/main/config/ajsc-jolokia-override-web.xml delete mode 100644 aai-traversal/src/main/config/ajsc-override-web.xml delete mode 100644 aai-traversal/src/main/config/ajsc-request.xml delete mode 100644 aai-traversal/src/main/config/hazelcast-client.properties delete mode 100644 aai-traversal/src/main/config/jul-redirect.properties delete mode 100644 aai-traversal/src/main/config/keyfile delete mode 100644 aai-traversal/src/main/config/runner-web.xml create mode 100644 aai-traversal/src/main/docker/Dockerfile rename aai-traversal/src/main/{resources => }/docker/aai.sh (100%) create mode 100644 aai-traversal/src/main/docker/docker-entrypoint.sh create mode 100644 aai-traversal/src/main/java/org/onap/aai/Profiles.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/TraversalApp.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/config/JettyPasswordDecoder.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/config/PasswordDecoder.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/config/PropertyPasswordConfiguration.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/AAIContainerFilter.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java delete mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/package-info.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/post/AAIResponseFilterPriority.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResetLoggingContext.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseHeaderManipulation.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/AAIRequestFilterPriority.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/HeaderValidation.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestHeaderManipulation.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestModification.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/interceptors/pre/SetLoggingContext.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/web/LocalHostAccessLog.java create mode 100644 aai-traversal/src/main/java/org/onap/aai/web/WebConfiguration.java create mode 100644 aai-traversal/src/main/resources/application.properties delete mode 100644 aai-traversal/src/main/resources/docker/Dockerfile delete mode 100644 aai-traversal/src/main/resources/docker/commonLibs/README delete mode 100644 aai-traversal/src/main/resources/docker/docker-entrypoint.sh delete mode 100644 aai-traversal/src/main/resources/docker/init-chef.sh rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/.gitignore (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/Introscope.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/PostProcessorInterceptors.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/aaiEventDMaaPPublisher.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/aaiconfig.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/default-logback.xml (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/error.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/gremlin-server-config.yaml (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/logging.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/methodMapper.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/preferredRoute.txt (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/titan-cached.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/appprops/titan-realtime.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/auth/aai_keystore (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/query/stored-queries.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/closed-loop-named-query-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json (83%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getComplexByPnfName-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getComponentList-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getComponentList-1.1.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getComponentList-1.2.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVComplexHostname-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVComplexLocationId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVLogicalLink-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVLogicalLinkByCircuitId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVServiceTopology-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVServiceTopology-1.1.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getDHVServiceTopology2-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getL3networkCloudRegionByNetworkRole-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getLogicalLinkByCloudRegionId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getPinterfacePhysicalLinkBySvcInstId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json (85%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getServiceInstanceModel-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getServiceInstanceSummary-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getSvcSubscriberModelInfo-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getTenantInfoAtSvcInstance-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getTenantInfoAtSvcSubscription-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getVnfVlanByCircuitId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getVserver-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/getWlBundleId-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/vnf-to-esr-system-info-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/named-query-json/vnf-to-service-instance-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/resource-model-json/000-README (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/service-model-json/000-README (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/action-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/action-data-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/allotted-resource-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/availability-zone-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/az-and-dvs-switches-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/class-of-service-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/cloud-region-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/complex-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/configuration-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/connector-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/constrained-element-set-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/ctag-assignment-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/ctag-pool-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/customer-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/cvlan-tag-entry-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/dvs-switch-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/edge-prop-names-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/element-choice-set-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/entitlement-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/esr-system-info-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/flavor-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/generic-vnf-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/group-assignment-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/image-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/include-node-filter-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/instance-group-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/inventory-item-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/inventory-item-data-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/ipsec-configuration-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/key-data-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/l-interface-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/l3-interface-ipv4-address-list-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/l3-interface-ipv6-address-list-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/l3-network-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/lag-interface-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/lag-link-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/license-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/license-key-resource-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/logical-link-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/metadatum-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/model-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/model-constraint-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/model-element-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/model-ver-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/multicast-configuration-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/named-query-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/named-query-element-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/network-policy-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/network-profile-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/newvce-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/oam-network-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/p-interface-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/physical-link-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/pnf-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/port-group-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/property-constraint-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/pserver-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/related-lookup-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/reserved-prop-names-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/result-data-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/route-table-reference-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/routing-instance-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/secondary-filter-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/segmentation-assignment-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/service-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/service-capability-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/service-instance-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/service-subscription-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/site-pair-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/site-pair-set-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/snapshot-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/sriov-vf-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/start-node-filter-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/subnet-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/tagged-inventory-item-list-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/tenant-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/tunnel-xconnect-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/update-node-key-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vce-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vf-module-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vig-server-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/virtual-data-center-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vlan-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vnf-image-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vnfc-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/volume-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/volume-group-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vpe-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vpls-pe-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vpn-binding-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/vserver-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/scriptdata/widget-model-json/zone-1.0.json (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/sysprops/sys-props.properties (100%) rename aai-traversal/{bundleconfig-local => src/main/resources}/etc/sysprops/template.sys-props.properties (100%) rename aai-traversal/{ajsc-shared-config/etc => src/main/resources}/localhost-access-logback.xml (97%) rename aai-traversal/{ajsc-shared-config/etc => src/main/resources}/logback.xml (86%) rename aai-traversal/src/main/{config => resources}/realm.properties (100%) delete mode 100644 aai-traversal/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context delete mode 100644 aai-traversal/src/main/runtime/context/default#0.context delete mode 100644 aai-traversal/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json delete mode 100644 aai-traversal/src/main/runtime/shiroRole/ajscadmin.json delete mode 100644 aai-traversal/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json delete mode 100644 aai-traversal/src/main/runtime/shiroRole/contextadmin#default.json delete mode 100644 aai-traversal/src/main/runtime/shiroUser/ajsc.json delete mode 100644 aai-traversal/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json delete mode 100644 aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json delete mode 100644 aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json create mode 100644 aai-traversal/src/main/scripts/common_functions.sh create mode 100644 aai-traversal/src/main/swm/package/nix/common/deinstall.env rename aai-traversal/src/{test/resources/inmemory_titan.properties => main/swm/package/nix/common/install_postproc.sh} (57%) create mode 100644 aai-traversal/src/main/swm/package/nix/deinstall/preproc/pre_proc create mode 100644 aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml create mode 100644 aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/execTool.sh create mode 100644 aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/kill_resources.sh create mode 100644 aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/start_resources.sh create mode 100644 aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/stop_resources.sh create mode 100644 aai-traversal/src/main/swm/package/nix/initinst/postproc/post_proc create mode 100644 aai-traversal/src/main/swm/package/nix/install/postproc/post_proc create mode 100644 aai-traversal/src/main/swm/package/nix/install/preproc/pre_proc delete mode 100644 aai-traversal/src/main/xjb/bindings.xjb create mode 100644 aai-traversal/src/test/java/org/onap/aai/AAIGremlinQueryTest.java create mode 100644 aai-traversal/src/test/java/org/onap/aai/TraversalTestConfiguration.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java delete mode 100644 aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java create mode 100644 aai-traversal/src/test/resources/application-test.properties delete mode 100644 aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties delete mode 100644 aai-traversal/src/test/resources/bundleconfig-local/etc/auth/aai_policy.json delete mode 100644 aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/resource-model-json/000-README delete mode 100644 aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/service-model-json/000-README delete mode 100644 aai-traversal/src/test/resources/config/etc/titan-cached.properties delete mode 100644 aai-traversal/src/test/resources/config/etc/titan-realtime.properties delete mode 100644 aai-traversal/src/test/resources/log4j.properties create mode 100644 aai-traversal/src/test/resources/payloads/templates/pserver.json delete mode 100644 aai-traversal/src/test/resources/test_aaiconfig.properties diff --git a/aai-traversal/ajsc-shared-config/README.txt b/aai-traversal/ajsc-shared-config/README.txt deleted file mode 100644 index a82eb64..0000000 --- a/aai-traversal/ajsc-shared-config/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -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/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml b/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml deleted file mode 100644 index 047da14..0000000 --- a/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml +++ /dev/null @@ -1,107 +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/aai-traversal/ajsc-shared-config/etc/csm-config-app.properties b/aai-traversal/ajsc-shared-config/etc/csm-config-app.properties deleted file mode 100644 index b4d0476..0000000 --- a/aai-traversal/ajsc-shared-config/etc/csm-config-app.properties +++ /dev/null @@ -1,183 +0,0 @@ -Global.ExtendedProperty.AuthoritativeServers=${ChangeMe_csm.acfshost}:${ChangeMe_csm.acfsport} - -# -# The settings in this file control the behavior of the CSM Framework. -# The majority of the settings in this file adhere to the following -# pattern: -# -# [EntityType].[EntityId].[PropertyName]=[PropertyValue] -# -# Where: -# -# [EntityType] Identifies the type of entity (service or -# service group) that's being configured. -# [EntityId] Identifies the individual entity. -# [PropertyName] Identifies the property that is being set. -# [PropertyValue] Is the actual property value. -# -# In the formatting sample above, the EntityType can be setto one of the -# following values: -# -# * 'Service' if an individual service is being configured. -# * 'Group 'if a service group is being configured. -# -# The reference to 'entity' in the above description is intentionally -# generic. The CSM Framework supports the configuration of individual -# services as well as groups of services. The type of entity that is -# actually being configured is determined by the value of the -# [EntityType] portion of the property. -# -# There are two values for [EntityId] that have a special meaning within -# the CSM Framework: -# -# -# DefaultService - Identifies the default configuration for any service -# that is not explicitly configured elsewhere in this file. -# -# DefaultServiceGroup - This identifies the entity that provides the -# default configuration for any service group that is not explicitly -# configured elsewhere in this file. -# -# DO NOT use either of these as the identifier for any of your -# application-specific services or service groups. -# -# The CSM Framework treats all entity identifiers in a case-insensitive -# manner. The entity ids 'Service1' and 'SERVICE1' are equivalant. All -# properties with the same [EntityId] will be applied to the same -# configuration. The CSM Framework framework also treats property names -# in a case-insensitive manner. 'MaxRequestCount' and 'MAXREQUESTCOUNT' -# are considered equivalent within the CSM framework. -# -# The following properties are supported by the CSM Framework. Any -# properties that are entity-specific will include the '[EntityId].' -# prefix. -# -# [EntityType].[EntityId].Enabled - Indicates if the entity is enabled -# or disabled by default. The value of this property must be either -# 'true' or 'false'. -# -# [EntityType].[EntityId].MaxRequestCount - The maximum number of -# requests that can be running at any point in time. Once this limit is -# reached, the service is considered to be 'flooded', and subsequent -# requests are refused until the request count drops to the level -# specified by the RestartThreshold property. Once the restart -# threshold is reached, the service will be 'restarted' based on the -# values of the 'RestartFrequency' and 'RestartIncrement' properties. -# The value of this property must be a numeric value. -# The default value for this property is 20. -# -# [EntityType].[EntityId].MaxStalledRequestCount - the maximum number of -# 'stalled' requests that are allowed before subsequent requests are -# refused -# The value of this property must be a numeric value. -# The default value for this property is 10. -# -# [EntityType].[EntityId].RestartThreshold - the process count level at -# which requests will be allowed to proceed whenever a service becomes -# 'flooded'. This property is only used if the total process count -# reaches the level set by the 'MaxRequestCount' property. Once that -# occurs, subsequent requests will be refused until the active request -# count drops to the level specified by this property. Once the active -# request count drops to the level specified by this property, the -# service will be 'restarted' based on the values of the -# 'RestartFrequency' and 'RestartIncrement' properties. To cause the -# CSM framework to allow subsequent requests to proceed as soon as the -# active request count drops below level level set by the -# 'MaxRequestCount' property, just set this property to either -1 or 1 -# less than the value of the 'MaxRequestCount' property. -# The value of this property must be a numeric value. -# The default value for this property is -1. -# -# [EntityType].[EntityId].RestartIncrement - This property, along with -# the 'RestartFrequency' property helps determine how quickly the active -# request count will rise to the 'maximum request count' whenever a -# service is 'restarted' after becoming 'flooded'. The -# 'RestartFrequency' property determines how frequenty the permissable -# number of active requests will be increased. This property determines -# how much the permissible number of active requests will increase by -# whenever it is raised. If this property is set to a positive value, -# then the 'RestartFrequency' property must also be set to a positive -# value. If this property is set to 0, then the 'RestartFrequency' -# property must also be set to 0. In other words, either both -# properties are 0 or both properties are greater than 0. When both -# properties are set to 0, then the permissable number of active -# requests immediately rises back up to the maximum request count once -# it has droppedback down to the 'restart threshold'. When both -# properties are greater than 0, then the permissable number of active -# requests gradually rises to the maximum request count. -# The value of this property must be a numeric value greater than or equal to 0. -# The default value for this property is 0. -# -# [EntityType].[EntityId].RestartFrequency - This property, along with -# the 'RestartIncrement' property helps determine how quickly the active -# request count will rise to the 'maximum request count' whenever a -# service is 'restarted' after becoming 'flooded'. The -# 'RestartIncrement' property determines how quickly the permissable -# number of active requests will be increased. This property determines -# how frequently that increase will occur. If this property is set to -# a positive value, then the 'RestartIncrement' property must also be -# set to a positive value. If this property is set to 0, then the -# 'RestartIncrement' property must also be set to 0. In other words, -# either both properties are 0 or both properties are greater than 0. -# When both properties are set to 0, then the permissable number of -# active requests immediately rises back up to the maximum request count -# once it has droppedback down to the 'restart threshold'. When both -# properties are greater than 0, then the permissable number of active -# requests gradually rises to the maximum request count. -# The value of this property must be a numeric value greater than or equal to 0. -# The default value for this property is 0. -# -# [EntityType].[EntityId].ServiceGroupId - This property is only -# relevant for entities that are configured as services (i.e. the -# [EntityType] portion of the property is set to 'Service'). When the -# 'ServiceGroupId' property is set to a non-blank value, the behavior of -# the service is controled by the configuration of the corresponding -# service group. There is no default value for this property. -# -# [EntityType].[EntityId].Timeout - the timeout, in milliseconds, for -# each process that is controlled by this configuration. Once the -# duration of a process exceeds this value, the process will be -# considered to have entered a 'stalled' state. The default value for -# this property is 10000. -# -# FrameworkEnabled: - This is the one property that is not specific to a -# single entity. This property determines whether the entire CSM -# Framework is enabled or disabled. When disabled, the CSM Framework -# does not track any process counts. All requests to access a service -# are allowed, regardless of the current level of activity. The value -# of this property must be either 'true' or 'false'. -# - -# -# Enables the CSM Framework so that it can manage interactions with external -# services and/or resources. To disable the CSM Framework, simply set -# this property to false. -# -FrameworkEnabled=true - -# -# These are the default settings for any service that is no explicitly configured -# below. A few things to note about this configuration: -# 1) The "Enabled" property is not explicitly set. Instead, we are relying -# on the default value of 'true'. -# 2) The Timeout and Type properties are also not explicitly set. Again, we -# are relying on the default values for these properties. -# -Service.DefaultService.Enabled=true -Service.DefaultService.MaxRequestCount=30 -Service.DefaultService.MaxStalledRequestCount=20 -Service.DefaultService.Timeout=30000 -Service.DefaultService.RestartThreshold=-1 -Service.DefaultService.AutoPurgeAfter=150000 - - -# -# These are the default settings for any service group that is referenced in -# a service configuration but not configured below. -# -# Currently CSI does not use any service group configurations! -# -#Group.DefaultGroup.MaxRequestCount=-1 -#Group.DefaultGroup.MaxStalledRequestCount=-1 -#Group.DefaultGroup.RestartThreshold=-1 -#Group.DefaultGroup.Timeout=-1 diff --git a/aai-traversal/ajsc-shared-config/etc/csm-framework-app.properties b/aai-traversal/ajsc-shared-config/etc/csm-framework-app.properties deleted file mode 100644 index 140fde3..0000000 --- a/aai-traversal/ajsc-shared-config/etc/csm-framework-app.properties +++ /dev/null @@ -1,11 +0,0 @@ -# The csm-persist-to property identifies the file that the CSM Framework -# will write the current configuration to whenever it is told to save it's -# configuration. -# -#csm-persist-to=/opt/app/myapplication/csm.properties.persisted - -#Important . Please specify absolute path starting from the root directory for Property csm-persist-to -#(Giving relative path may result in undesired results in case the applcation is restarted from a different directory than the original start directory ) -#In the following example , relative path is specfied since the directory structure varies on diff env - -csm-persist-to=/opt/app/q103csi1m8/DATA/${ChangeMe_RELEASE}/${ChangeMe_CLUSTER}_ACFS_csm.properties.persisted diff --git a/aai-traversal/antBuild/build.xml b/aai-traversal/antBuild/build.xml deleted file mode 100644 index 346380c..0000000 --- a/aai-traversal/antBuild/build.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-traversal/bundleconfig-local/README.txt b/aai-traversal/bundleconfig-local/README.txt deleted file mode 100644 index a915213..0000000 --- a/aai-traversal/bundleconfig-local/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -The bundleconfig-local directory contains the necessary configuration files to be used for running locally. When running -locally, the "mvn -P runLocal" or the "mvn -P runAjsc" profiles will be using this bundleconfig-local directory as the AJSC_CONF -directory. When deploying to a CSI env, the bundleconfig-csi directory will be copied to the ultimate installation/bundleconfig -directory and will be used for your AJSC service once installed. If you are not deploying to a CSI env, please look at the -antBuild/build.xml file for help in some simple copying of the appropriate folders/files for a NON-CSI env. - -The ajsc-shared-config directory houses the shared configurations that will be used in CSI envs. This includes the logging -functionality of the logback.xml and some csm related artifacts that may be necessary to use while running locally. -When running locally, the system property, "AJSC_SHARED_CONFIG", will point to this location to utilize the logback.xml. \ No newline at end of file diff --git a/aai-traversal/bundleconfig-local/RELEASE_NOTES.txt b/aai-traversal/bundleconfig-local/RELEASE_NOTES.txt deleted file mode 100644 index a567d9b..0000000 --- a/aai-traversal/bundleconfig-local/RELEASE_NOTES.txt +++ /dev/null @@ -1 +0,0 @@ -Place Release Notes here to provide updated Release information for CSTEM to better help manage your service in the CSI environment. \ No newline at end of file diff --git a/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties b/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties deleted file mode 100644 index 1620bea..0000000 --- a/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties +++ /dev/null @@ -1,3 +0,0 @@ -#This properties file is for defining any PreProcessorInterceptors that have been created for your AJSC service. - -/**=com.att.ajsc.csi.restmethodmap.RestMethodMapInterceptor,org.onap.aai.interceptors.PreAaiAjscInterceptor diff --git a/aai-traversal/bundleconfig-local/etc/appprops/app-intercepts.properties b/aai-traversal/bundleconfig-local/etc/appprops/app-intercepts.properties deleted file mode 100644 index 3230921..0000000 --- a/aai-traversal/bundleconfig-local/etc/appprops/app-intercepts.properties +++ /dev/null @@ -1,6 +0,0 @@ -#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.openecomp.aai.ajsc_aai.JaxrsEchoService,packagename.class1name,packagename.class2name diff --git a/aai-traversal/bundleconfig-local/etc/service-file-monitor.properties b/aai-traversal/bundleconfig-local/etc/service-file-monitor.properties deleted file mode 100644 index 4d9bee9..0000000 --- a/aai-traversal/bundleconfig-local/etc/service-file-monitor.properties +++ /dev/null @@ -1,5 +0,0 @@ -#This properties file is used for defining any file paths that you would like to have monitored. - -#user config file paths go here as (key-value) pairs. File extension will have to be either .properties or .json in order for it to be monitored. -#file1=/opt/app/yourService/file.properties - diff --git a/aai-traversal/bundleconfig-local/symlinks.txt b/aai-traversal/bundleconfig-local/symlinks.txt deleted file mode 100644 index 70f2c0d..0000000 --- a/aai-traversal/bundleconfig-local/symlinks.txt +++ /dev/null @@ -1,6 +0,0 @@ -#This file provides the definitions of sym-links to CSTEM that will be used by your project once installed on a CSI node. - -link_jre=ajsc-shared-config -link_csi-csm=ajsc-shared-config -link_csi-dme=ajsc-shared-config -link_introscope=ajsc-shared-config diff --git a/aai-traversal/pom.xml b/aai-traversal/pom.xml index 02452d5..a2097e5 100644 --- a/aai-traversal/pom.xml +++ b/aai-traversal/pom.xml @@ -1,81 +1,322 @@ - - + + 4.0.0 - - org.onap.aai.traversal - traversal - 1.2.0-SNAPSHOT - + org.onap.aai.traversal aai-traversal - aai-traversal - http://maven.apache.org 1.2.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-parent + 1.5.1.RELEASE + + - https://nexus.onap.org - https://nexus.onap.org - - UTF-8 - ${basedir}/target/swm/package/nix/dist_files/ - yyyyMMdd'T'HHmmss - 1.0.0 + ${basedir}/target/classes/META-INF/traversal/swagger + service.json + com.att.ajsc.ajsc6configdemo.service.rs + 1.8 + local + org-onap-aai + ajsc-svc-account + com.att.ajsc + org.onap.aai.TraversalApp + + 1.2.1-SNAPSHOT + 1.2.1-SNAPSHOT + 1.2.1-SNAPSHOT + 1.0.2 + + java jacoco ${project.build.directory}/surefire-reports ${project.build.directory}/coverage-reports/jacoco.exec false ${project.version} - + + + 0.0.24 + 4.9 + + 1.5.8 + 1.2.17 + + 1.9.2 + 1.10 + 1.9 + + 1.3.0 + 1.8.20 + 4.5.2 + 1.8.36 + 1.6.1 + 2.6 + 1.0.0 + 1.2.3 + 2.0.0.0 + 2.7.8 + 16.0 + 1.0.0 + 3.0.1-incubating + 1.0.2 + 3.0.4 + 1.1.1 + 1.10.19 + 1.6.2 + 1.48 + 20090211 + 2.3.21 + 2.2.11 + 2.6.2 + 1.9 + 1.2 + 2.7 + 0.2.12 + 4.4 + 2.2.0 + 5.15.3 + 4.5.3 + 4.3.2.RELEASE + 0.4.11 + 1.0.3.RELEASE + + 2.8.5 + 0.0.7 + 1.4.0 + + 9.4.1.v20170120 + + 0.23.0 + + docker.io + + + localhost:5000 + + + ${project.build.directory}/${project.artifactId}-${project.version}-build/ + + onap + true + + 4.3.6.RELEASE + 1.2.0 + 1.2 + + + https://nexus.onap.org + /content/sites/site/org/onap/aai/traversal/${project.artifactId}/${project.version} + /content/repositories/releases/ + /content/repositories/snapshots/ + + 4.1.9.Final + 4.0.37.Final + 2.8.11.1 + 2.4.4 + + 4.3.6.RELEASE + + + yyyyMMdd'T'HHmmss + true true + 4.7 + + + + docker + + + + io.fabric8 + docker-maven-plugin + ${docker.fabric.version} + + true + 1.23 + + + ${docker.push.registry}/${aai.docker.namespace}/aai-traversal:%l + + @ + + latest + ${aai.docker.version}-STAGING-${maven.build.timestamp} + ${aai.docker.version}-STAGING-latest + + try + ${project.basedir}/src/main/docker + + + + + ${aai.build.directory} + /${project.artifactId} + + + + + + + + + + + clean-images + pre-clean + + remove + + + true + + + + generate-images + package + + build + + + + push-images + deploy + + push + + + + + + + + + + runAjsc + + ${maven.skip.tests} + + + pre-integration-test + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + run-spring-boot + package + + java + + + + + ${start-class} + + + snapshot.location + ${snapshot.file} + + + java + + + + + + - org.onap.aai.aai-common - aai-schema - ${aai.schema.version} - - - org.onap.aai.aai-common - aai-core - ${aai.core.version} + org.springframework.boot + spring-boot-starter-jersey + + + com.sun.jersey + jersey-servlet + + + org.springframework.boot + spring-boot-starter-tomcat + + - - com.rabbitmq - amqp-client - 3.6.1 + net.sf.jopt-simple + jopt-simple + ${jopt.simple.version} - log4j - apache-log4j-extras - 1.2.17 + io.swagger + swagger-core + ${io.swagger.version} - log4j - log4j + javax.ws.rs + jsr311-api - - commons-beanutils - commons-beanutils - 1.9.2 + io.swagger + swagger-annotations + ${io.swagger.version} - - org.apache.commons - commons-compress - 1.10 + io.swagger + swagger-jersey-jaxrs + ${io.swagger.version} + + + org.glassfish.jersey.media + jersey-media-multipart + + + jersey-core + com.sun.jersey + + + jersey-json + com.sun.jersey + + + jersey-server + com.sun.jersey + + + jersey-client + com.sun.jersey + + + jsr311-api + javax.ws.rs + + + jersey-multipart + com.sun.jersey.contribs + + - commons-configuration commons-configuration - 1.9 + ${commons.configuration.version} commons-lang @@ -83,93 +324,37 @@ - - - org.codehaus.jackson - jackson-core-asl - 1.9.13 - - - - org.codehaus.jackson - jackson-mapper-asl - 1.9.13 - - - - org.apache.httpcomponents - httpmime - 4.5.2 - - - - - com.att.ajsc - ajsc-runner - ${ajscRuntimeVersion} - - - com.att.ajsc - ajsc-core - ${ajscRuntimeVersion} - provided - - - - - dom4j - dom4j - 1.6.1 - - commons-lang commons-lang - 2.6 + ${commons.lang.version} - com.att.eelf eelf-core - 1.0.0 + ${eelf.core.version} - ch.qos.logback logback-core - 1.1.7 + ${logback.version} - ch.qos.logback logback-classic - 1.1.7 + ${logback.version} - ch.qos.logback logback-access - 1.1.7 + ${logback.version} - org.hamcrest hamcrest-junit - 2.0.0.0 + ${hamcrest.junit.version} - - org.codehaus.janino - janino - 2.7.8 - - - commons-collections - commons-collections - - junit junit @@ -178,12 +363,12 @@ com.google.guava guava - 16.0 + ${google.guava.version} com.thinkaurelius.titan titan-core - 1.0.0 + ${titan.version} org.slf4j @@ -194,18 +379,22 @@ com.thinkaurelius.titan titan-cassandra - 1.0.0 + ${titan.version} org.slf4j slf4j-log4j12 + + org.codehaus.jackson + jackson-mapper-asl + com.thinkaurelius.titan titan-hbase - 1.0.0 + ${titan.version} org.slf4j @@ -217,7 +406,7 @@ org.apache.tinkerpop gremlin-driver - 3.0.1-incubating + ${gremlin.driver.version} org.apache.hbase @@ -232,6 +421,30 @@ log4j log4j + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-json + + + com.sun.jersey + jersey-server + + + com.sun.jersey.contribs + jersey-guice + + + commons-httpclient + commons-httpclient + + + org.codehaus.jackson + jackson-mapper-asl + @@ -256,181 +469,365 @@ - - com.sun.jersey - jersey-json - 1.18 - - - jivesoftware - smack - 3.0.4 - - com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - 2.1.4 - - - com.googlecode.json-simple - json-simple - 1.1.1 - com.sun.jersey - jersey-client - 1.18 - - - org.springframework - spring-web - - - org.springframework.ws - spring-ws - 1.5.2 - - - - org.springframework - spring-core - 4.2.5.RELEASE + com.fasterxml.jackson.core + jackson-databind + ${jackson.core.version} org.mockito mockito-all - 1.10.19 + ${mockito.version} test org.powermock powermock-module-junit4 - 1.6.2 + ${powermock.version} test org.powermock powermock-api-mockito - 1.6.2 + ${powermock.version} test com.beust jcommander - 1.48 + ${jcommander.version} org.json json - 20090211 + ${json.version} org.freemarker freemarker - 2.3.14 + ${freemarker.version} javax.xml.bind jaxb-api - 2.2.11 + ${jaxb.version} com.sun.xml.bind jaxb-impl - 2.2.11 + ${jaxb.version} com.sun.xml.bind jaxb-core - 2.2.11 + ${jaxb.version} com.sun.xml.bind jaxb-xjc - 2.2.11 + ${jaxb.version} org.eclipse.persistence eclipselink - 2.6.2 + ${eclipse.persistence.version} org.eclipse.persistence org.eclipse.persistence.moxy - 2.6.2 + ${eclipse.persistence.version} compile org.powermock powermock-module-javaagent - 1.6.2 + ${powermock.version} test org.powermock powermock-module-junit4-rule-agent - 1.6.2 + ${powermock.version} test com.github.fge json-patch - 1.9 + ${json.patch.version} org.javatuples javatuples - 1.2 + ${javatuples.version} compile com.google.code.gson gson - 2.7 + ${gson.version} com.att.nsa dmaapClient - 0.2.12 + ${dmaap.client.version} + + + org.slf4j + slf4j-log4j12 + + + com.att.aft + dme2 + + + + + com.bazaarvoice.jolt + jolt-complete + ${jolt.version} + + + com.jayway.jsonpath + json-path + ${json.path.version} + + + + org.apache.activemq + activemq-broker + ${activemq.version} + + + org.apache.activemq + activemq-client + ${activemq.version} + + + org.onap.aai.aai-common + aai-core + ${aai.core.version} + + + com.sun.jersey + jersey-core + + + org.codehaus.jackson + jackson-mapper-asl + + + + org.onap.aai.aai-common + aai-schema + ${aai-schema.version} + + + org.springframework + spring-jms + ${spring.jms.version} + + + com.sun.jersey + jersey-core + + + + + org.apache.httpcomponents - httpcore - 4.4 + httpclient + ${httpclient.version} - com.bazaarvoice.jolt - jolt-complete - 0.0.24 + org.springframework.boot + spring-boot-devtools + + + org.skyscreamer + jsonassert + ${jsonassert.version} + test + + + org.eclipse.jetty + jetty-util + ${eclipse.jetty.version} + + + + org.springframework.security + spring-security-rsa + ${spring.security.version} + + + org.bouncycastle + bcpkix-jdk15on + + + + + org.onap.aai.aai-common + aai-client-loadbalancer + ${aai.client.loadbalancer.version} + + + io.netty + netty-handler + + + com.sun.jersey.contribs + jersey-apache-client4 + + + + + io.netty + netty-handler + ${netty.handler.version} + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-jetty + + + org.springframework + spring-web + ${spring.web.version} + + + io.netty + netty-all + ${netty.version} + + + org.codehaus.groovy + groovy + ${groovy.version} + indy + + + org.springframework + spring-test + ${spring.test.version} + test + + + org.springframework.boot + spring-boot-test + test org.antlr antlr4-runtime - 4.7 + ${antlr.version} org.antlr antlr4-maven-plugin - 4.7 + ${antlr.version} + + + org.sonatype.sisu + sisu-guava + + + - traversal + + + ${project.basedir}/src/main/swm + ${project.build.directory}/swm + false + + + ${project.basedir}/src/main/resources + + application.properties + dme2.properties + logback.xml + localhost-access-logback.xml + + ${project.build.directory}/swm/package/nix/dist_files/opt/app/aai-traversal/appconfig + + false + + + ${project.basedir}/src/main/resources + + **/* + + true + + + ${project.basedir}/src/main/resources/etc/appprops/ + + titan-realtime.properties + titan-cached.properties + aaiconfig.properties + + ${project.build.directory}/swm/package/nix/dist_files/opt/app/aai-traversal/appconfig + + false + + + ${project.basedir}/src/main/resources/etc/auth/ + + aai-client-cert.p12 + tomcat_keystore + + ${project.build.directory}/swm/package/nix/dist_files/opt/app/aai-traversal/appconfig + + true + + + ${project.basedir}/src/main/resources/ + + logback.xml + localhost-access-logback.xml + + ${project.build.directory}/swm/package/nix/dist_files/opt/app/aai-traversal/appconfig + + true + + + ${project.basedir}/src/main/docker + + **/* + + ${aai.build.directory} + true + + - - org.jsonschema2pojo - jsonschema2pojo-maven-plugin - 0.4.13 - - jsonschema - src/main/resources/json - ${project.build.directory}/generated-sources - jackson2 - true - - org.apache.maven.plugins maven-dependency-plugin @@ -457,28 +854,17 @@ org.onap.aai.aai-common aai-schema ${aai.core.version} - bundleconfig-local/etc + ${project.basedir}/src/main/resources/etc oxm/*.xml - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - -noverify ${argLine} - - . - bundleconfig-local - - - org.codehaus.groovy.maven gmaven-plugin + 1.0 validate @@ -505,122 +891,75 @@ - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - copy-docker-file - package - - copy-resources - - - ${dockerLocation} - true - - - ${basedir}/src/main/resources/docker - true - - **/* - - - - - - - copy-commonlibs-file - package - - copy-resources - - - ${dockerLocation}/commonLibs - true - - - ${basedir}/target/commonLibs - false - - *.jar - - - - - - - - - io.fabric8 - docker-maven-plugin - 0.16.5 - - true - 1.23 - - - ${docker.push.registry}/onap/aai-traversal:%l - - - latest - ${project.version}-STAGING-${maven.build.timestamp} - ${aai.docker.version}-STAGING-latest - - try - ${dockerLocation} - ${dockerLocation}/Dockerfile - - - - - - - clean-images - pre-clean - - remove - - - true - onap/aai-traversal:%l - - - - generate-images - generate-sources - - build - - - - push-images - deploy - - build - push - - - onap/aai-traversal:%l - - - - + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-gpg-plugin + + true + + + + org.codehaus.groovy.maven + gmaven-plugin + + + exec-maven-plugin + org.codehaus.mojo + + + org.apache.maven.plugins + maven-javadoc-plugin + + -Xdoclint:none + + + + maven-assembly-plugin + + + src/main/assembly/descriptor.xml + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + -noverify ${argLine} + alphabetical + + org.codehaus.mojo sonar-maven-plugin - 3.2 + 3.3 org.jacoco jacoco-maven-plugin - 0.7.7.201606060606 + 0.7.9 true + + **/**/models/**/*.class + @@ -633,6 +972,19 @@ + + post-unit-test + test + + report + + + + ${project.build.directory}/coverage-reports/jacoco.exec + + ${project.reporting.outputDirectory}/jacoco + + @@ -656,6 +1008,21 @@ ecomp-staging + + org.springframework.boot + spring-boot-maven-plugin + + ${start-class} + ZIP + + + + + repackage + + + + org.antlr antlr4-maven-plugin @@ -672,45 +1039,35 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 2.8 + + + unpack-schema-dependency + initialize + + unpack + + + + + + + org.onap.aai.aai-common + aai-schema + ${aai-schema.version} + src/main/resources/etc + oxm/*.xml + + + + + + - - - - passwordGenerator - - initialize - - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - initialize - - java - - - org.eclipse.jetty.util.security.Password - - user - aaiDomain2 - - - - - - java - - - - - - - @@ -731,4 +1088,20 @@ + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}${release.path} + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}${snapshot.path} + + + ecomp-site + dav:${nexusproxy}${site.path} + + diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml deleted file mode 100644 index 37e929d..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy deleted file mode 100644 index 0749aa4..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy +++ /dev/null @@ -1,23 +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" - - SearchProvider(org.onap.aai.rest.search.SearchProvider) - ModelAndNamedQueryRestProvider(org.onap.aai.rest.search.ModelAndNamedQueryRestProvider) - QueryConsumer(org.onap.aai.rest.QueryConsumer) - - V3ThroughV7Retired(org.onap.aai.rest.retired.V3ThroughV7Consumer) - - EchoResponse(org.onap.aai.rest.util.EchoResponse) - - - util.list(id: 'jaxrsServices') { - - ref(bean:'SearchProvider') - ref(bean:'ModelAndNamedQueryRestProvider') - ref(bean:'QueryConsumer') - ref(bean:'V3ThroughV7Retired') - ref(bean:'EchoResponse') - } -} \ No newline at end of file diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml deleted file mode 100644 index 7dda68b..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JMS.BROKER.URL=tcp://localhost:61446 - JMS.QUEUE.NAME=IN_QUEUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/docs/README.txt b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/docs/README.txt deleted file mode 100644 index 3707179..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/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/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/lib/README.txt b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/lib/README.txt deleted file mode 100644 index 639e21b..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/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/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/props/module.props b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/props/module.props deleted file mode 100644 index 17ebc08..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/props/module.props +++ /dev/null @@ -1 +0,0 @@ -EXAMPLE.PROPERTY=EXAMLE_VALUE \ No newline at end of file diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/routes/aai.route b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/routes/aai.route deleted file mode 100644 index 6a86246..0000000 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/routes/aai.route +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/aai-traversal/src/main/assemble/ajsc_module_assembly.xml b/aai-traversal/src/main/assemble/ajsc_module_assembly.xml deleted file mode 100644 index 4ec4e28..0000000 --- a/aai-traversal/src/main/assemble/ajsc_module_assembly.xml +++ /dev/null @@ -1,66 +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/aai-traversal/src/main/assemble/ajsc_props_assembly.xml b/aai-traversal/src/main/assemble/ajsc_props_assembly.xml deleted file mode 100644 index 5b8a6fa..0000000 --- a/aai-traversal/src/main/assemble/ajsc_props_assembly.xml +++ /dev/null @@ -1,23 +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/aai-traversal/src/main/assemble/ajsc_runtime_assembly.xml b/aai-traversal/src/main/assemble/ajsc_runtime_assembly.xml deleted file mode 100644 index e37d366..0000000 --- a/aai-traversal/src/main/assemble/ajsc_runtime_assembly.xml +++ /dev/null @@ -1,44 +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/aai-traversal/src/main/assembly/descriptor.xml b/aai-traversal/src/main/assembly/descriptor.xml new file mode 100644 index 0000000..11c7ba2 --- /dev/null +++ b/aai-traversal/src/main/assembly/descriptor.xml @@ -0,0 +1,32 @@ + + build + false + + dir + + + + ${project.basedir}/src/main/resources + /resources + + **/* + + + + ${project.basedir}/src/main/scripts + /bin + + **/* + + + + ${project.build.directory} + /lib + + *.jar + + + + diff --git a/aai-traversal/src/main/config/ajsc-jetty.xml b/aai-traversal/src/main/config/ajsc-jetty.xml deleted file mode 100644 index b74b071..0000000 --- a/aai-traversal/src/main/config/ajsc-jetty.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - true - - - /etc/runner-web.xml - /etc/ajsc-override-web.xml - true - - - false - - - - /extJars/aai-core-.jar, - /extJars/traversal.jar, - /extJars/logback-core-1.1.7.jar, - /extJars/logback-access-1.1.7.jar, - /extJars/eelf-core-1.0.0.jar, - /extJars/slf4j-api-1.7.21.jar - - - - - - - - - - - - - - - - - - - - - - - - /bundleconfig/etc/localhost-access-logback.xml - - - - - - - - - - - - - - - - - - - /extApps - 10 - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http/1.1 - - - file:/bundleconfig/etc/auth/aai_keystore - - - - - - - - - - - false - - - SSL - SSLv2 - SSLv2Hello - SSLv3 - TLSv1 - - - - - - - - - - - - - - - - - - - - - - - 30000 - - - - - - - - - false - - - - - Test Realm - /etc/realm.properties - 5 - - - - - diff --git a/aai-traversal/src/main/config/ajsc-jolokia-override-web.xml b/aai-traversal/src/main/config/ajsc-jolokia-override-web.xml deleted file mode 100644 index b242129..0000000 --- a/aai-traversal/src/main/config/ajsc-jolokia-override-web.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - InterceptorFilter - /services/* - - - InterceptorFilter - /rest/* - - - - springSecurityFilterChain - /* - - - - ManagementServlet - /mgmt - - - - RestletServlet - /rest/* - - - - CamelServlet - /services/* - - - - jolokia-agent - org.jolokia.http.AgentServlet - 2 - - - - jolokia-agent - /jolokia/* - - - \ No newline at end of file diff --git a/aai-traversal/src/main/config/ajsc-override-web.xml b/aai-traversal/src/main/config/ajsc-override-web.xml deleted file mode 100644 index 61e2836..0000000 --- a/aai-traversal/src/main/config/ajsc-override-web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - WriteableRequestFilter - /* - - - InterceptorFilter - /* - - - InterceptorFilter - /rest/* - - - - springSecurityFilterChain - /* - - - - ManagementServlet - /mgmt - - - - RestletServlet - /rest/* - - - - CamelServlet - /* - - - - - \ No newline at end of file diff --git a/aai-traversal/src/main/config/ajsc-request.xml b/aai-traversal/src/main/config/ajsc-request.xml deleted file mode 100644 index 5d09b7a..0000000 --- a/aai-traversal/src/main/config/ajsc-request.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/aai-traversal/src/main/config/hazelcast-client.properties b/aai-traversal/src/main/config/hazelcast-client.properties deleted file mode 100644 index 2624d3f..0000000 --- a/aai-traversal/src/main/config/hazelcast-client.properties +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (c) 2008-2013, Hazelcast, Inc. 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. -# - -hazelcast.client.group.name = ajsc -hazelcast.client.group.pass = ajscpass -hazelcast.client.connection.timeout = 30000 -hazelcast.client.connection.attempts.limit = 3 -hazelcast.client.reconnection.timeout = 5000 -hazelcast.client.reconnection.attempts.limit= 5 -hazelcast.client.shuffle.addresses = false -hazelcast.client.update.automatic = true -hazelcast.client.addresses = localhost, 127.0.0.1 \ No newline at end of file diff --git a/aai-traversal/src/main/config/jul-redirect.properties b/aai-traversal/src/main/config/jul-redirect.properties deleted file mode 100644 index 8b6624d..0000000 --- a/aai-traversal/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/aai-traversal/src/main/config/keyfile b/aai-traversal/src/main/config/keyfile deleted file mode 100644 index 6a1657e..0000000 --- a/aai-traversal/src/main/config/keyfile +++ /dev/null @@ -1,27 +0,0 @@ -ctRt8XTd7N57kcm0npZOWSDF5I69w9K97cQS_ep0AgxgHmYB0WtYblsrMGuHfyS1o4697zLiIeoS -Nn5kE1kedl4c4HevfuwfoJpWyiugYusNOqbTGQJ1MHOwqiBEJnjXepZEoz1btaW_hDO7uz-BoD4t -SxwNRwVQpcg0_CmBX-yIW2YCIECoxZH9_X_8fcXYHP2VgFxxBpvjgycNQlyN15_VSuLwn3Wj0W8_ -8chRxGURyhp8iEBSb4tIdN5jXkhCma7AP7wreMufFQqXjdfWqIisJPfIpS3znl5IiTOZP22XhHay -gq2KFwABVqjM71m5czEz1ojGkbFEAGImrY-VFHuug2u4ss4VW7TGeJst0z7I5vrn5M6i9Eb6xiGh -jNUebRCV3cYGrtD9SlvjJBVVeP_3OrkxlD4oktx-JTRJzYtXADB5if2gtpYxy84kqrz7ltr5rXUH -zSG7ujKCXOOE_Wk6vQPSjYPnum6R_mxOorCNCvtf6ne85Xd81DZlJM-CleVNdOU7g1xie-gBZPAX -bOvWf6p_pVNmH76v-m4XLAAUqEzt-9PvNmirODiDiY5bNz6l-1ejw8IyQYb37e_3sN_LjF7A9HgB -Dia7kNjsfB7_2vB7R4qjwNLsmTMnQCDANnNpl9VpotZ4blPhhOWhB1Tg3lxc-z-VRV7GBbl_2eQd -3eYUT1Z5Li184W4-pft_TCaDJ1NyaJd1CQxQEuIORdq5B6Q2L9SMmmOOh82Czu5_Ro80IGikHXHp -Lqf2fIaceY_IBAeGp2iPjtXdkghV24vIT49oRfqf6sBKAPy-88xILnMWM6M5bMCETKn7UvM1kV5y -ZQYlsi-36n73ETZyiFs1PLqe8D6dRURrcBG_B9i1MafNiWa-elG6E0X0pSK9CadchSA0KRMaKtfE -6-iyUqE-bx-0ELTbV2y7gLdu5MVtjRmQB5ozoaBq8ik4-jAWAsKpTv4DfWoMp9DkRENlKeauayuT -j_VAGhqy07pIntQKtbK9EP0tndSKtF3WLwHel1I5C3lthhkxxfzpxURBxO1ZJMFJZ6rLu1Ku03zw -LJ7nFFR_YfJ7tnGZE4PEt7MOZNiNoD3__9PthO5HmZdk1gPMrKlojU1hyR3IlbVShUst6rA3MkWk -MD-zlw9mhNgaV3xvPJ945pYPe4C6qIwxXoiXGHyhv_0MpcvuMW-pUuAZXfkuiqNwQnpUTLBD0YJw -uwMbE7sN40e6-BSxEiMOab7s2gShbaK9JjCMQUH_vAuQSZjU4sn53jsS7U4DHntzgxVYttIwGZaU -b-1R7jYphNJnCI8rPB_xjJ0OMssNKT7lYRgG_ZuKvifYvJWt-NwD0z2qoePcRGExXuioRDNR4SlB --RN33dYhp6vRsHKT1oLpl-UJB6dqJlZ2dCsfc7vT1Vs0SYidRYXCUJNBSePI4-1LMlHKOqGASBcg -pl589601-EtO7ch3RoaL26rNXzA-umUWYRPQPZ76wcgK2j4k5Ndub5dWK9jI6UW3RbF6ixe0Yw2j -_Pipt4EX8R6-sb87D69JOOnZlFVB6EcCO07Q7j6DavpUNHlLmDmPgArqODh002scvW1ryMxBR2XE -m3kGQh2IFh5Qru8duxblEYE-lmHGxXVgDtKiKgHwPTkaxcquEtZTEJxaIJIgoKj7SgMzdfbeLlJM -RwbdvExmnRT9ivFImeIV7ACPnfBP3URd82kTG8FyiMvSpdCLL16FWOd9gjZuMstqZrmIVF8tO2WT -COMIx-jqvQD2zS1Ul5p0szJaf-CxBjy7-cJIaAyEToR1T5bBFtQt4sEFxG7XG0cCoXShqclL70TV -W13X5pY55YwHkCR4mRjc0o0ZKStY3OADVLFom1bC9AmMBqU4PsKNAX29LT37WE-I23tQgzid0Ix9 -JuVzlbOTvi19uLYbltrHavU3UbVhYxNNI7Y7tM02xfq3LhGqZG5EPS-WAB9bBixHQqw78cd9iqIr -hHlZW80l1kgs1ezMqgxfwDuiFOZIu9UWQ6vSnTAvfhwJhcr77gSk5Gu957uxzleaS4gVwTYU diff --git a/aai-traversal/src/main/config/runner-web.xml b/aai-traversal/src/main/config/runner-web.xml deleted file mode 100644 index 8a3a316..0000000 --- a/aai-traversal/src/main/config/runner-web.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - contextConfigLocation - /WEB-INF/spring-servlet.xml, - classpath:applicationContext.xml - - - - - spring.profiles.default - nooauth - - - - org.springframework.web.context.ContextLoaderListener - - - - ManagementServlet - ajsc.ManagementServlet - - - - WriteableRequestFilter - com.att.ajsc.csi.writeablerequestfilter.WriteableRequestFilter - - - - 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 - - - - - - spring - / - - - - - org.onap.aai.util.AAIAppServletContextListener - - - - - Open Source - /aai/* - - - admin - - - CONFIDENTIAL - - - - - BASIC - Test Realm - - - - admin - - - diff --git a/aai-traversal/src/main/docker/Dockerfile b/aai-traversal/src/main/docker/Dockerfile new file mode 100644 index 0000000..3e4cd77 --- /dev/null +++ b/aai-traversal/src/main/docker/Dockerfile @@ -0,0 +1,22 @@ +FROM aaionap/aai-common:1.2.0 + + +# Add the proper files into the docker image from your build +WORKDIR /opt/app/aai-traversal + +# Expose the ports for outside linux to use +# 8446 is the important one to be used +EXPOSE 8446 + + +HEALTHCHECK --interval=40s --timeout=10s --retries=3 CMD nc -z -v localhost 8446 || exit 1 + +ENTRYPOINT ["/bin/bash", "/opt/app/aai-traversal/docker-entrypoint.sh"] + +RUN mkdir -p /opt/aaihome/aaiadmin /opt/aai/logroot/AAI-GQ + +VOLUME /opt/aai/logroot/AAI-GQ + +COPY /maven/aai-traversal/ . + +ENV AAI_BUILD_VERSION @aai.docker.version@ diff --git a/aai-traversal/src/main/resources/docker/aai.sh b/aai-traversal/src/main/docker/aai.sh similarity index 100% rename from aai-traversal/src/main/resources/docker/aai.sh rename to aai-traversal/src/main/docker/aai.sh diff --git a/aai-traversal/src/main/docker/docker-entrypoint.sh b/aai-traversal/src/main/docker/docker-entrypoint.sh new file mode 100644 index 0000000..efaba95 --- /dev/null +++ b/aai-traversal/src/main/docker/docker-entrypoint.sh @@ -0,0 +1,119 @@ +### +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# 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========================================================= +### + +APP_HOME=$(pwd); +RESOURCES_HOME=${APP_HOME}/resources/; + +export CHEF_CONFIG_REPO=${CHEF_CONFIG_REPO:-aai-config}; +export CHEF_GIT_URL=${CHEF_GIT_URL:-http://gerrit.onap.org/r/aai}; +export CHEF_CONFIG_GIT_URL=${CHEF_CONFIG_GIT_URL:-$CHEF_GIT_URL}; +export CHEF_DATA_GIT_URL=${CHEF_DATA_GIT_URL:-$CHEF_GIT_URL}; + +export SERVER_PORT=${SERVER_PORT:-8446}; + +export RESOURCES_HOSTNAME=${RESOURCES_HOSTNAME:-aai-resources.api.simpledemo.onap.org}; +export RESOURCES_PORT=${RESOURCES_PORT:-8447}; + +USER_ID=${LOCAL_USER_ID:-9001} +GROUP_ID=${LOCAL_GROUP_ID:-9001} + +if [ $(cat /etc/passwd | grep aaiadmin | wc -l) -eq 0 ]; then + + ln -s bin scripts + ln -s /opt/aai/logroot/AAI-GQ logs + + groupadd aaiadmin -g ${GROUP_ID} || { + echo "Unable to create the group id for ${GROUP_ID}"; + exit 1; + } + useradd --shell=/bin/bash -u ${USER_ID} -g ${GROUP_ID} -o -c "" -m aaiadmin || { + echo "Unable to create the user id for ${USER_ID}"; + exit 1; + } +fi; + +chown -R aaiadmin:aaiadmin /opt/app /opt/aai/logroot /var/chef +find /opt/app/ -name "*.sh" -exec chmod +x {} + + +if [ -f ${APP_HOME}/aai.sh ]; then + mv ${APP_HOME}/aai.sh /etc/profile.d/aai.sh + chmod 755 /etc/profile.d/aai.sh +fi; + +if [ -z ${DISABLE_UPDATE_QUERY} ]; then + UPDATE_QUERY_RAN_FILE="updateQueryRan.txt"; + gosu aaiadmin /opt/app/aai-traversal/bin/install/updateQueryData.sh + gosu aaiadmin touch ${UPDATE_QUERY_RAN_FILE}; +fi + +JAVA_CMD="exec gosu aaiadmin java"; + +JVM_OPTS="${PRE_JVM_OPTS} -XX:+UnlockDiagnosticVMOptions"; +JVM_OPTS="${JVM_OPTS} -XX:+UnsyncloadClass"; +JVM_OPTS="${JVM_OPTS} -XX:+UseConcMarkSweepGC"; +JVM_OPTS="${JVM_OPTS} -XX:+CMSParallelRemarkEnabled"; +JVM_OPTS="${JVM_OPTS} -XX:+UseCMSInitiatingOccupancyOnly"; +JVM_OPTS="${JVM_OPTS} -XX:CMSInitiatingOccupancyFraction=70"; +JVM_OPTS="${JVM_OPTS} -XX:+ScavengeBeforeFullGC"; +JVM_OPTS="${JVM_OPTS} -XX:+CMSScavengeBeforeRemark"; +JVM_OPTS="${JVM_OPTS} -XX:-HeapDumpOnOutOfMemoryError"; +JVM_OPTS="${JVM_OPTS} -XX:+UseParNewGC"; +JVM_OPTS="${JVM_OPTS} -verbose:gc"; +JVM_OPTS="${JVM_OPTS} -XX:+PrintGCDetails"; +JVM_OPTS="${JVM_OPTS} -XX:+PrintGCTimeStamps"; +JVM_OPTS="${JVM_OPTS} -XX:MaxPermSize=512M"; +JVM_OPTS="${JVM_OPTS} -XX:PermSize=512M"; +JVM_OPTS="${JVM_OPTS} -server"; +JVM_OPTS="${JVM_OPTS} -XX:NewSize=512m"; +JVM_OPTS="${JVM_OPTS} -XX:MaxNewSize=512m"; +JVM_OPTS="${JVM_OPTS} -XX:SurvivorRatio=8"; +JVM_OPTS="${JVM_OPTS} -XX:+DisableExplicitGC"; +JVM_OPTS="${JVM_OPTS} -verbose:gc"; +JVM_OPTS="${JVM_OPTS} -XX:+UseParNewGC"; +JVM_OPTS="${JVM_OPTS} -XX:+CMSParallelRemarkEnabled"; +JVM_OPTS="${JVM_OPTS} -XX:+CMSClassUnloadingEnabled"; +JVM_OPTS="${JVM_OPTS} -XX:+UseConcMarkSweepGC"; +JVM_OPTS="${JVM_OPTS} -XX:-UseBiasedLocking"; +JVM_OPTS="${JVM_OPTS} -XX:ParallelGCThreads=4"; +JVM_OPTS="${JVM_OPTS} -XX:LargePageSizeInBytes=128m"; +JVM_OPTS="${JVM_OPTS} -XX:+PrintGCDetails"; +JVM_OPTS="${JVM_OPTS} -XX:+PrintGCTimeStamps"; +JVM_OPTS="${JVM_OPTS} -Xloggc:/opt/app/aai-traversal/logs/ajsc-jetty/gc/aai_gc.log"; +JVM_OPTS="${JVM_OPTS} -Dsun.net.inetaddr.ttl=180"; +JVM_OPTS="${JVM_OPTS} -XX:+HeapDumpOnOutOfMemoryError"; +JVM_OPTS="${JVM_OPTS} -XX:HeapDumpPath=/opt/app/aai-traversal/logs/ajsc-jetty/heap-dump"; +JVM_OPTS="${JVM_OPTS} ${POST_JVM_OPTS}"; + +JAVA_OPTS="${PRE_JAVA_OPTS} -DAJSC_HOME=$APP_HOME"; +JAVA_OPTS="${JAVA_OPTS} -Dserver.port=${SERVER_PORT}"; +JAVA_OPTS="${JAVA_OPTS} -DBUNDLECONFIG_DIR=./resources"; +JAVA_OPTS="${JAVA_OPTS} -Dserver.local.startpath=${RESOURCES_HOME}"; +JAVA_OPTS="${JAVA_OPTS} -DAAI_CHEF_ENV=${AAI_CHEF_ENV}"; +JAVA_OPTS="${JAVA_OPTS} -DSCLD_ENV=${SCLD_ENV}"; +JAVA_OPTS="${JAVA_OPTS} -DAFT_ENVIRONMENT=${AFT_ENVIRONMENT}"; +JAVA_OPTS="${JAVA_OPTS} -DlrmName=com.att.ajsc.traversal"; +JAVA_OPTS="${JAVA_OPTS} -DAAI_BUILD_NUMBER=${AAI_BUILD_NUMBER}"; +JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom"; +JAVA_OPTS="${JAVA_OPTS} -Dloader.path=$APP_HOME/resources"; +JAVA_OPTS="${JAVA_OPTS} ${POST_JAVA_OPTS}"; + +JAVA_MAIN_JAR=$(ls lib/aai-traversal-*SNAPSHOT.jar); + +${JAVA_CMD} ${JVM_OPTS} ${JAVA_OPTS} -jar ${JAVA_MAIN_JAR}; diff --git a/aai-traversal/src/main/java/org/onap/aai/Profiles.java b/aai-traversal/src/main/java/org/onap/aai/Profiles.java new file mode 100644 index 0000000..0b1292d --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/Profiles.java @@ -0,0 +1,12 @@ +package org.onap.aai; + +public final class Profiles { + + public static final String DMAAP = "dmaap"; + public static final String DME2 = "dme2"; + + public static final String ONE_WAY_SSL = "one-way-ssl"; + public static final String TWO_WAY_SSL = "two-way-ssl"; + + private Profiles(){} +} diff --git a/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java b/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java new file mode 100644 index 0000000..fb97908 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java @@ -0,0 +1,130 @@ +package org.onap.aai; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.onap.aai.config.PropertyPasswordConfiguration; +import org.onap.aai.dbmap.AAIGraph; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.ModelInjestor; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.util.AAIConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.core.env.Environment; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import java.util.UUID; + +@SpringBootApplication +// Component Scan provides a way to look for spring beans +// It only searches beans in the following packages +// Any method annotated with @Bean annotation or any class +// with @Component, @Configuration, @Service will be picked up +@ComponentScan(basePackages = { + "org.onap.aai.config", + "org.onap.aai.web", + "org.onap.aai.tasks", + "org.onap.aai.rest", + "com.att.ajsc.common" +}) +@EnableAutoConfiguration(exclude = { + DataSourceAutoConfiguration.class, + DataSourceTransactionManagerAutoConfiguration.class, + HibernateJpaAutoConfiguration.class +}) +public class TraversalApp { + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(TraversalApp.class.getName()); + + private static final String APP_NAME = "aai-traversal"; + + @Autowired + private Environment env; + + @PostConstruct + private void init() throws AAIException { + System.setProperty("org.onap.aai.serverStarted", "false"); + setDefaultProps(); + + LoggingContext.save(); + LoggingContext.component("init"); + LoggingContext.partnerName("NA"); + LoggingContext.targetEntity(APP_NAME); + LoggingContext.requestId(UUID.randomUUID().toString()); + LoggingContext.serviceName(APP_NAME); + LoggingContext.targetServiceName("contextInitialized"); + + logger.info("AAI Server initialization started..."); + + // Setting this property to allow for encoded slash (/) in the path parameter + // This is only needed for tomcat keeping this as temporary + System.setProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "true"); + + logger.info("Starting AAIGraph connections and the ModelInjestor"); + + if(env.acceptsProfiles(Profiles.TWO_WAY_SSL) && env.acceptsProfiles(Profiles.ONE_WAY_SSL)){ + logger.warn("You have seriously misconfigured your application"); + } + + AAIConfig.init(); + ModelInjestor.getInstance(); + AAIGraph.getInstance(); + } + + @PreDestroy + public void cleanup(){ + logger.info("Shutting down both realtime and cached connections"); + AAIGraph.getInstance().graphShutdown(); + } + + public static void main(String[] args) { + + setDefaultProps(); + SpringApplication app = new SpringApplication(TraversalApp.class); + app.setRegisterShutdownHook(true); + app.addInitializers(new PropertyPasswordConfiguration()); + Environment env = app.run(args).getEnvironment(); + + logger.info( + "Application '{}' is running on {}!" , + env.getProperty("spring.application.name"), + env.getProperty("server.port") + ); + + logger.info("Traversal MicroService Started"); + logger.error("Traversal MicroService Started"); + logger.debug("Traversal MicroService Started"); + System.out.println("Traversal Microservice Started"); + } + + public static void setDefaultProps(){ + + if (System.getProperty("file.separator") == null) { + System.setProperty("file.separator", "/"); + } + + String currentDirectory = System.getProperty("user.dir"); + + if (System.getProperty("AJSC_HOME") == null) { + System.setProperty("AJSC_HOME", "."); + } + + if(currentDirectory.contains(APP_NAME)){ + if (System.getProperty("BUNDLECONFIG_DIR") == null) { + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); + } + } else { + if (System.getProperty("BUNDLECONFIG_DIR") == null) { + System.setProperty("BUNDLECONFIG_DIR", "aai-traversal/src/main/resources"); + } + } + + } +} diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java deleted file mode 100644 index 6aa1f29..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.ajsc_aai; - -//import java.util.HashMap; -//import java.util.Map; - -//import javax.ws.rs.GET; -//import javax.ws.rs.HeaderParam; -//import javax.ws.rs.Path; -//import javax.ws.rs.PathParam; -//import javax.ws.rs.Produces; - -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.web.context.ContextLoader; -//import org.springframework.web.context.WebApplicationContext; - -//import ajsc.ErrorMessageLookupService; - -//@Path("/errormessage") -//public class JaxrsErrorMessageLookupService { - - //private final static Logger logger = LoggerFactory - //.getLogger(ErrorMessageLookupService.class); - - //* - //Gets the message. - - //@param input the input - //@param errorCode the error code - //@param appId the app id - //@param operation the operation - //@param messageText the message text - //@param isRESTService the is REST service - //@param faultEntity the fault entity - //@param ConvID the conv ID - //@return the message - //@GET - //@Path("/emls") - //@Produces("text/plain") - //public String getMessage(@PathParam("input") String input, - //@HeaderParam("errorCode") String errorCode, - //@HeaderParam("appId") String appId, - //@HeaderParam("operation") String operation, - //@HeaderParam("messageText") String messageText, - //@HeaderParam("isRESTService") String isRESTService, - //@HeaderParam("faultEntity") String faultEntity, - //@HeaderParam("ConvID") String ConvID) { - - //Map headers = new HashMap(); - //headers.put(errorCode, errorCode); - //headers.put(appId, appId); - //headers.put(operation, operation); - //headers.put(messageText, messageText); - //headers.put(isRESTService, isRESTService); - //headers.put(faultEntity, faultEntity); - //headers.put(ConvID, ConvID); - - //WebApplicationContext applicationContext = ContextLoader - //.getCurrentWebApplicationContext(); - - //ErrorMessageLookupService e = (ErrorMessageLookupService) applicationContext - //.getBean("errorMessageLookupService"); - - //String message = e.getExceptionDetails(appId, operation, errorCode, - //messageText,isRESTService, faultEntity, ConvID); - - //System.out.println("Error code = " + errorCode); - //System.out.println("appId = " + appId); - //System.out.println("operation = " + operation); - //System.out.println("messageText = " + messageText); - //System.out.println("isRESTService = " + isRESTService); - //System.out.println("faultEntity = " + faultEntity); - //System.out.println("ConvID = " + ConvID); - //return "The exception message is:\n " + message; - //} - -//} - diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java deleted file mode 100644 index 29cf62a..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.ajsc_aai; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import java.util.Map; -import java.util.HashMap; - -@Path("/user") -public class JaxrsUserService { - - private static final Map userIdToNameMap; - static { - userIdToNameMap = new HashMap<>(); - userIdToNameMap.put("userID1","Name1"); - userIdToNameMap.put("userID2","Name2"); - } - - /** - * Lookup user. - * - * @param userId the user id - * @return the string - */ - @GET - @Path("/{userId}") - @Produces("text/plain") - public String lookupUser(@PathParam("userId") String userId) { - String name = userIdToNameMap.get(userId); - return name != null ? name : "unknown id"; - } - -} diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java deleted file mode 100644 index c806045..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java deleted file mode 100644 index 7274c61..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.ajsc_aai.filemonitor; - -import java.io.File; -import java.io.FileInputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class ServicePropertiesMap -{ - private static HashMap> mapOfMaps = new HashMap>(); - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(ServicePropertiesMap.class); - - /** - * Refresh. - * - * @param file the file - * @throws Exception the exception - */ - public static void refresh(File file) throws Exception - { - try - { - LOGGER.info("Loading properties - " + (file != null?file.getName():"")); - - //Store .json & .properties files into map of maps - String filePath = file.getPath(); - - if(filePath.lastIndexOf(".json")>0){ - - ObjectMapper om = new ObjectMapper(); - TypeReference> typeRef = new TypeReference>() {}; - HashMap propMap = om.readValue(file, typeRef); - HashMap lcasePropMap = new HashMap(); - for (String key : propMap.keySet() ) - { - String lcaseKey = ifNullThenEmpty(key); - lcasePropMap.put(lcaseKey, propMap.get(key)); - } - - mapOfMaps.put(file.getName(), lcasePropMap); - - - }else if(filePath.lastIndexOf(".properties")>0){ - Properties prop = new Properties(); - FileInputStream fis = new FileInputStream(file); - prop.load(fis); - - @SuppressWarnings("unchecked") - HashMap propMap = new HashMap((Map)prop); - - mapOfMaps.put(file.getName(), propMap); - } - - LOGGER.info("File - " + file.getName() + " is loaded into the map and the corresponding system properties have been refreshed"); - } - catch (Exception e) - { - LOGGER.error("File " + (file != null?file.getName():"") + " cannot be loaded into the map ", e); - throw new Exception("Error reading map file " + (file != null?file.getName():""), e); - } - } - - /** - * Gets the property. - * - * @param fileName the file name - * @param propertyKey the property key - * @return the property - */ - public static String getProperty(String fileName, String propertyKey) - { - HashMap propMap = mapOfMaps.get(fileName); - return propMap!=null?propMap.get(ifNullThenEmpty(propertyKey)):""; - } - - /** - * Gets the properties. - * - * @param fileName the file name - * @return the properties - */ - public static HashMap getProperties(String fileName){ - return mapOfMaps.get(fileName); - } - - /** - * If null then empty. - * - * @param key the key - * @return the string - */ - private static String ifNullThenEmpty(String key) { - if (key == null) { - return ""; - } else { - return key; - } - } - -} diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java deleted file mode 100644 index c806045..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ diff --git a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java deleted file mode 100644 index 71c290b..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.ajsc_aai.util; - -import org.onap.aai.ajsc_aai.filemonitor.ServicePropertiesMap; - -public class ServicePropertiesMapBean { - - /** - * Gets the property. - * - * @param propFileName the prop file name - * @param propertyKey the property key - * @return the property - */ - public static String getProperty(String propFileName, String propertyKey) { - return ServicePropertiesMap.getProperty(propFileName, propertyKey); - } -} diff --git a/aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java b/aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java deleted file mode 100644 index 247ecf7..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.config; - -import org.apache.activemq.broker.BrokerService; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class DmaapConfig { - - @Bean(destroyMethod = "stop") - public BrokerService brokerService() throws Exception { - - BrokerService broker = new BrokerService(); - broker.addConnector("tcp://localhost:61446"); - broker.setPersistent(false); - broker.setUseJmx(false); - broker.setSchedulerSupport(false); - broker.start(); - - return broker; - } -} diff --git a/aai-traversal/src/main/java/org/onap/aai/config/JettyPasswordDecoder.java b/aai-traversal/src/main/java/org/onap/aai/config/JettyPasswordDecoder.java new file mode 100644 index 0000000..069d71b --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/config/JettyPasswordDecoder.java @@ -0,0 +1,14 @@ +package org.onap.aai.config; + +import org.eclipse.jetty.util.security.Password; + +public class JettyPasswordDecoder implements PasswordDecoder { + + @Override + public String decode(String input) { + if (input.startsWith("OBF:")) { + return Password.deobfuscate(input); + } + return Password.deobfuscate("OBF:" + input); + } +} diff --git a/aai-traversal/src/main/java/org/onap/aai/config/PasswordDecoder.java b/aai-traversal/src/main/java/org/onap/aai/config/PasswordDecoder.java new file mode 100644 index 0000000..131bc6e --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/config/PasswordDecoder.java @@ -0,0 +1,6 @@ +package org.onap.aai.config; + +public interface PasswordDecoder { + + String decode(String input); +} diff --git a/aai-traversal/src/main/java/org/onap/aai/config/PropertyPasswordConfiguration.java b/aai-traversal/src/main/java/org/onap/aai/config/PropertyPasswordConfiguration.java new file mode 100644 index 0000000..a282f85 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/config/PropertyPasswordConfiguration.java @@ -0,0 +1,62 @@ +package org.onap.aai.config; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.CompositePropertySource; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.EnumerablePropertySource; +import org.springframework.core.env.MapPropertySource; +import org.springframework.core.env.PropertySource; +import org.springframework.stereotype.Component; + +public class PropertyPasswordConfiguration implements ApplicationContextInitializer { + + private static final Pattern decodePasswordPattern = Pattern.compile("password\\((.*?)\\)"); + + private PasswordDecoder passwordDecoder = new JettyPasswordDecoder(); + + @Override + public void initialize(ConfigurableApplicationContext applicationContext) { + ConfigurableEnvironment environment = applicationContext.getEnvironment(); + for (PropertySource propertySource : environment.getPropertySources()) { + Map propertyOverrides = new LinkedHashMap<>(); + decodePasswords(propertySource, propertyOverrides); + if (!propertyOverrides.isEmpty()) { + PropertySource decodedProperties = new MapPropertySource("decoded "+ propertySource.getName(), propertyOverrides); + environment.getPropertySources().addBefore(propertySource.getName(), decodedProperties); + } + } + } + + private void decodePasswords(PropertySource source, Map propertyOverrides) { + if (source instanceof EnumerablePropertySource) { + EnumerablePropertySource enumerablePropertySource = (EnumerablePropertySource) source; + for (String key : enumerablePropertySource.getPropertyNames()) { + Object rawValue = source.getProperty(key); + if (rawValue instanceof String) { + String decodedValue = decodePasswordsInString((String) rawValue); + propertyOverrides.put(key, decodedValue); + } + } + } + } + + private String decodePasswordsInString(String input) { + if (input == null) return null; + StringBuffer output = new StringBuffer(); + Matcher matcher = decodePasswordPattern.matcher(input); + while (matcher.find()) { + String replacement = passwordDecoder.decode(matcher.group(1)); + matcher.appendReplacement(output, replacement); + } + matcher.appendTail(output); + return output.toString(); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIContainerFilter.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIContainerFilter.java new file mode 100644 index 0000000..062cb27 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIContainerFilter.java @@ -0,0 +1,22 @@ +package org.onap.aai.interceptors; + +import java.util.UUID; + +import org.onap.aai.util.FormatDate; + +public abstract class AAIContainerFilter { + + protected String genDate() { + FormatDate fd = new FormatDate("YYMMdd-HH:mm:ss:SSS"); + return fd.getDateTime(); + } + + protected boolean isValidUUID(String transId) { + try { + UUID.fromString(transId); + } catch (IllegalArgumentException e) { + return false; + } + return true; + } +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java index 733383a..8eca9b6 100644 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java @@ -21,7 +21,21 @@ */ package org.onap.aai.interceptors; -public class AAIHeaderProperties { - +public final class AAIHeaderProperties { + + private AAIHeaderProperties(){} + public static final String REQUEST_CONTEXT = "aai-request-context"; + + public static final String HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; + + public static final String TRANSACTION_ID = "X-TransactionId"; + + public static final String FROM_APP_ID = "X-FromAppId"; + + public static final String AAI_TX_ID = "X-AAI-TXID"; + + public static final String AAI_REQUEST = "X-REQUEST"; + + public static final String AAI_REQUEST_TS = "X-REQUEST-TS"; } diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java deleted file mode 100644 index 155d387..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java +++ /dev/null @@ -1,286 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.ws.rs.core.MediaType; - -import org.apache.commons.io.IOUtils; -import org.apache.cxf.helpers.CastUtils; -import org.apache.cxf.interceptor.LoggingMessage; -import org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor; -import org.apache.cxf.message.Message; -import org.onap.aai.exceptions.AAIException; -import org.onap.aai.logging.ErrorLogHelper; -import org.onap.aai.rest.util.EchoResponse; -import org.onap.aai.util.AAIConfig; -import org.onap.aai.util.AAIConstants; -import org.onap.aai.util.FormatDate; -import org.onap.aai.util.HbaseSaltPrefixer; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import org.slf4j.MDC; - -public class AAILogJAXRSInInterceptor extends JAXRSInInterceptor { - - protected final String COMPONENT = "aairest"; - protected final String CAMEL_REQUEST ="CamelHttpUrl"; - private static final Pattern uuidPattern = Pattern.compile("^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"); - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(AAILogJAXRSInInterceptor.class); - - /** - * {@inheritDoc} - */ - public void handleMessage(Message message) { - - boolean go = false; - String uri = null; - String query = null; - try { - - uri = (String)message.get(CAMEL_REQUEST); - if (uri != null) { - query = (String)message.get(Message.QUERY_STRING); - } - - if (AAIConfig.get(AAIConstants.AAI_LOGGING_HBASE_INTERCEPTOR).equalsIgnoreCase("true") && - AAIConfig.get(AAIConstants.AAI_LOGGING_HBASE_ENABLED).equalsIgnoreCase("true")) { - go = true; - message.getExchange().put("AAI_LOGGING_HBASE_ENABLED", 1); - if (AAIConfig.get(AAIConstants.AAI_LOGGING_HBASE_LOGREQUEST).equalsIgnoreCase("true") ) { - message.getExchange().put("AAI_LOGGING_HBASE_LOGREQUEST", 1); - } - if (AAIConfig.get(AAIConstants.AAI_LOGGING_HBASE_LOGRESPONSE).equalsIgnoreCase("true") ) { - message.getExchange().put("AAI_LOGGING_HBASE_LOGRESPONSE", 1); - } - } - if (AAIConfig.get(AAIConstants.AAI_LOGGING_TRACE_ENABLED).equalsIgnoreCase("true") ) { - go = true; - message.getExchange().put("AAI_LOGGING_TRACE_ENABLED", 1); - if (AAIConfig.get(AAIConstants.AAI_LOGGING_TRACE_LOGREQUEST).equalsIgnoreCase("true") ) { - message.getExchange().put("AAI_LOGGING_TRACE_LOGREQUEST", 1); - } - if (AAIConfig.get(AAIConstants.AAI_LOGGING_TRACE_LOGRESPONSE).equalsIgnoreCase("true") ) { - message.getExchange().put("AAI_LOGGING_TRACE_LOGRESPONSE", 1); - } - } - } catch (AAIException e1) { - ErrorLogHelper.logException(e1); - } - - if ((uri != null) && (uri.contains(EchoResponse.echoPath))) { - // if it's a health check, we don't want to log ANYTHING if it's a lightweight one - if (query == null) { - if (message.getExchange().containsKey("AAI_LOGGING_HBASE_ENABLED")) { - message.getExchange().remove("AAI_LOGGING_HBASE_ENABLED"); - } - if (message.getExchange().containsKey("AAI_LOGGING_TRACE_ENABLED")) { - message.getExchange().remove("AAI_LOGGING_TRACE_ENABLED"); - } - go = false; - } - } - else if ((uri != null) && (uri.contains("/translog/"))) { - // if it's a translog query, we don't want to log the responses - if (message.getExchange().containsKey("AAI_LOGGING_HBASE_LOGRESPONSE")) { - message.getExchange().remove("AAI_LOGGING_HBASE_LOGRESPONSE"); - } - if (message.getExchange().containsKey("AAI_LOGGING_TRACE_LOGRESPONSE")) { - message.getExchange().remove("AAI_LOGGING_TRACE_LOGRESPONSE"); - } - } - - if (go == false) { // there's nothing to do - return; - } - - // DONE: get a TXID based on hostname, time (YYYYMMDDHHMMSSMILLIS, and LoggingMessage.nextId(); 20150326145301-1 - String now = genDate(); - - message.getExchange().put("AAI_RQST_TM", now); - - String id = (String)message.getExchange().get(LoggingMessage.ID_KEY); - - String fullId = null; - try { - if (id == null) { - id = LoggingMessage.nextId(); - } - fullId = AAIConfig.get(AAIConstants.AAI_NODENAME) + "-" + now + "-" + id; - fullId = HbaseSaltPrefixer.getInstance().prependSalt(fullId); - message.getExchange().put(LoggingMessage.ID_KEY, fullId); - } catch (AAIException e1) { - LOGGER.debug("config problem", e1); - } - - if (fullId == null) { - fullId = now + "-" + id; - fullId = HbaseSaltPrefixer.getInstance().prependSalt(fullId); - } - message.put(LoggingMessage.ID_KEY, fullId); - final LoggingMessage buffer = new LoggingMessage("Message", fullId); - - Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); - if (responseCode != null) { - buffer.getResponseCode().append(responseCode); - } - - String encoding = (String)message.get(Message.ENCODING); - - if (encoding != null) { - buffer.getEncoding().append(encoding); - } - String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD); - if (httpMethod != null) { - buffer.getHttpMethod().append(httpMethod); - } - - String ct = (String)message.get(Message.CONTENT_TYPE); - if (ct != null) { - if ("*/*".equals(ct)) { - message.put(Message.CONTENT_TYPE, MediaType.APPLICATION_JSON); - ct = MediaType.APPLICATION_JSON; - } - buffer.getContentType().append(ct); - - } - Object headers = message.get(Message.PROTOCOL_HEADERS); - if (headers != null) { - buffer.getHeader().append(headers); - - Map> headersList = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS)); - String transId = ""; - List xt = headersList.get("X-TransactionId"); - String newTransId = transId; - boolean missingTransId = false; - boolean replacedTransId = false; - String logMsg = null; - if (xt != null) { - for (String transIdValue : xt) { - transId = transIdValue; - } - Matcher matcher = uuidPattern.matcher(transId); - if (!matcher.find()) { - replacedTransId = true; - // check if there's a colon, and check the first group? - if (transId.contains(":")) { - String[] uuidParts = transId.split(":"); - Matcher matcher2 = uuidPattern.matcher(uuidParts[0]); - if (matcher2.find()) { - newTransId = uuidParts[0]; - } else { - // punt, we tried to find it, it has a colon but no UUID-1 - newTransId = UUID.randomUUID().toString(); - } - } else { - newTransId = UUID.randomUUID().toString(); - } - } - } else { - newTransId = UUID.randomUUID().toString(); - missingTransId = true; - } - - if (missingTransId || replacedTransId) { - List txList = new ArrayList(); - txList.add(newTransId); - headersList.put("X-TransactionId", txList); - if (missingTransId) { - logMsg = "Missing requestID. Assigned " + newTransId; - } else if (replacedTransId) { - logMsg = "Replaced invalid requestID of " + transId + " Assigned " + newTransId; - } - MDC.put("RequestId",newTransId); - } - else { - MDC.put("RequestId",transId); - } - - - List fromAppIdList = headersList.get("X-FromAppId"); - if (fromAppIdList != null) { - String fromAppId = null; - for (String fromAppIdValue : fromAppIdList) { - fromAppId = fromAppIdValue; - } - MDC.put("PartnerName",fromAppId); - } - - List contentType = headersList.get("Content-Type"); - if (contentType == null) { - ct = (String)message.get(Message.CONTENT_TYPE); - headersList.put(Message.CONTENT_TYPE, Collections.singletonList(ct)); - } - - LOGGER.auditEvent("REST " + httpMethod + " " + ((query != null)? uri+"?"+query : uri) + " HbaseTxId=" + fullId); - LOGGER.info(logMsg); - } - - - if (uri != null) { - buffer.getAddress().append(uri); - if (query != null) { - buffer.getAddress().append("?").append(query); - } - } - - InputStream is = message.getContent(InputStream.class); - if (is != null) { - try { - String currentPayload = IOUtils.toString(is, "UTF-8"); - IOUtils.closeQuietly(is); - buffer.getPayload().append(currentPayload); - is = IOUtils.toInputStream(currentPayload, "UTF-8"); - message.setContent(InputStream.class, is); - IOUtils.closeQuietly(is); - } catch (Exception e) { - // It's ok to not have request input content - // throw new Fault(e); - } - } - - // this will be saved in the message exchange, and can be pulled out later... - message.getExchange().put(fullId + "_REQUEST", buffer.toString()); - } - - /** - * Gen date. - * - * @param aaiLogger the aai logger - * @param logline the logline - * @return the string - */ - protected String genDate() { - FormatDate fd = new FormatDate("YYMMdd-HH:mm:ss:SSS"); - return fd.getDateTime(); - } - -} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java deleted file mode 100644 index a280023..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java +++ /dev/null @@ -1,303 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import java.io.OutputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.cxf.helpers.CastUtils; -import org.apache.cxf.interceptor.LoggingMessage; -import org.apache.cxf.io.CacheAndWriteOutputStream; -import org.apache.cxf.io.CachedOutputStream; -import org.apache.cxf.io.CachedOutputStreamCallback; -import org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor; -import org.apache.cxf.message.Message; -import org.onap.aai.exceptions.AAIException; -import org.onap.aai.logging.ErrorLogHelper; -import org.onap.aai.util.AAIConfig; -import org.onap.aai.util.AAIConstants; -import org.onap.aai.util.FormatDate; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; - -// right after the request is complete, there may be content -public class AAILogJAXRSOutInterceptor extends JAXRSOutInterceptor { - - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(AAILogJAXRSOutInterceptor.class); - - protected final String COMPONENT = "aairest"; - protected final String CAMEL_REQUEST = "CamelHttpUrl"; - - /** - * {@inheritDoc} - */ - public void handleMessage(Message message) { - - String fullId = (String) message.getExchange().get(LoggingMessage.ID_KEY); - - Map> headers = CastUtils.cast((Map) message.get(Message.PROTOCOL_HEADERS)); - if (headers == null) { - headers = new HashMap>(); - } - - headers.put("X-AAI-TXID", Collections.singletonList(fullId)); - message.put(Message.PROTOCOL_HEADERS, headers); - - Message outMessage = message.getExchange().getOutMessage(); - final OutputStream os = outMessage.getContent(OutputStream.class); - if (os == null) { - return; - } - - // we only want to register the callback if there is good reason for it. - if (message.getExchange().containsKey("AAI_LOGGING_HBASE_ENABLED") || message.getExchange().containsKey("AAI_LOGGING_TRACE_ENABLED")) { - - final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(os); - message.setContent(OutputStream.class, newOut); - newOut.registerCallback(new LoggingCallback(message, os)); - } - - } - - class LoggingCallback implements CachedOutputStreamCallback { - - private final Message message; - private final OutputStream origStream; - - public LoggingCallback(final Message msg, final OutputStream os) { - this.message = msg; - this.origStream = os; - } - - public void onFlush(CachedOutputStream cos) { - - } - - public void onClose(CachedOutputStream cos) { - - String getValue = ""; - String postValue = ""; - String logValue = ""; - - try { - logValue = AAIConfig.get("aai.transaction.logging"); - getValue = AAIConfig.get("aai.transaction.logging.get"); - postValue = AAIConfig.get("aai.transaction.logging.post"); - } catch (AAIException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - if (!message.getExchange().containsKey("AAI_LOGGING_HBASE_ENABLED") && !message.getExchange().containsKey("AAI_LOGGING_TRACE_ENABLED")) { - return; - } - - String fullId = (String) message.getExchange().get(LoggingMessage.ID_KEY); - - Message inMessage = message.getExchange().getInMessage(); - String transId = null; - String fromAppId = null; - - Map> headersList = CastUtils.cast((Map) inMessage.get(Message.PROTOCOL_HEADERS)); - if (headersList != null) { - List xt = headersList.get("X-TransactionId"); - if (xt != null) { - for (String transIdValue : xt) { - transId = transIdValue; - } - } - List fa = headersList.get("X-FromAppId"); - if (fa != null) { - for (String fromAppIdValue : fa) { - - fromAppId = fromAppIdValue; - } - } - } - - String httpMethod = (String) inMessage.get(Message.HTTP_REQUEST_METHOD); - - String uri = (String) inMessage.get(CAMEL_REQUEST); - String fullUri = uri; - if (uri != null) { - String query = (String) message.get(Message.QUERY_STRING); - if (query != null) { - fullUri = uri + "?" + query; - } - } - - String request = (String) message.getExchange().get(fullId + "_REQUEST"); - - Message outMessage = message.getExchange().getOutMessage(); - - final LoggingMessage buffer = new LoggingMessage("OUTMessage", fullId); - - // should we check this, and make sure it's not an error? - Integer responseCode = (Integer) outMessage.get(Message.RESPONSE_CODE); - if (responseCode == null) { - responseCode = 200; // this should never happen, but just in - // case we don't get one - } - buffer.getResponseCode().append(responseCode); - - String encoding = (String) outMessage.get(Message.ENCODING); - - if (encoding != null) { - buffer.getEncoding().append(encoding); - } - - String ct = (String) outMessage.get(Message.CONTENT_TYPE); - if (ct != null) { - buffer.getContentType().append(ct); - } - - Object headers = outMessage.get(Message.PROTOCOL_HEADERS); - if (headers != null) { - buffer.getHeader().append(headers); - } - - Boolean ss = false; - if (responseCode >= 200 && responseCode <= 299) { - ss = true; - } - String response = buffer.toString(); - - // this should have been set by the in interceptor - String rqstTm = (String) message.getExchange().get("AAI_RQST_TM"); - - // just in case it wasn't, we'll put this here. not great, but it'll - // have a val. - if (rqstTm == null) { - rqstTm = genDate(); - } - - - String respTm = genDate(); - - try { - String actualRequest = request; - StringBuilder builder = new StringBuilder(); - cos.writeCacheTo(builder, 100000); - // here comes my xml: - String payload = builder.toString(); - - String actualResponse = response; - if (payload == null) { - - } else { - actualResponse = response + payload; - } - - // we only log to AAI log if it's eanbled in the config props - // file - if (message.getExchange().containsKey("AAI_LOGGING_TRACE_ENABLED")) { - - if (message.getExchange().containsKey("AAI_LOGGING_TRACE_LOGREQUEST")) { - - // strip newlines from request - String traceRequest = actualRequest; - traceRequest = traceRequest.replace("\n", " "); - traceRequest = traceRequest.replace("\r", ""); - traceRequest = traceRequest.replace("\t", ""); - LOGGER.debug(traceRequest); - } - if (message.getExchange().containsKey("AAI_LOGGING_TRACE_LOGRESPONSE")) { - // strip newlines from response - String traceResponse = actualResponse; - traceResponse = traceResponse.replace("\n", " "); - traceResponse = traceResponse.replace("\r", ""); - traceResponse = traceResponse.replace("\t", ""); - - LOGGER.debug(traceResponse); - } - } - - // we only log to HBASE if it's enabled in the config props file - // TODO: pretty print XML/JSON. we might need to get the payload - // and envelope seperately - if (message.getExchange().containsKey("AAI_LOGGING_HBASE_ENABLED")) { - if (!message.getExchange().containsKey("AAI_LOGGING_HBASE_LOGREQUEST")) { - actualRequest = "loggingDisabled"; - } - if (!message.getExchange().containsKey("AAI_LOGGING_HBASE_LOGRESPONSE")) { - actualResponse = "loggingDisabled"; - } - - LOGGER.debug("action={}, urlin={}, HbTransId={}", httpMethod, fullUri, fullId); - - if (logValue.equals("false")) { - } else if (getValue.equals("false") && httpMethod.equals("GET")) { - } else if (postValue.equals("false") && httpMethod.equals("POST")) { - } else { - putTransaction(transId, responseCode.toString(), rqstTm, respTm, fromAppId + ":" + transId, fullUri, httpMethod, request, response, actualResponse); - - } - } - } catch (Exception ex) { - // ignore - } - - message.setContent(OutputStream.class, origStream); - - LOGGER.auditEvent("HTTP Response Code: {}", responseCode.toString()); - } - - } - - protected String genDate() { - FormatDate fd = new FormatDate("YYMMdd-HH:mm:ss:SSS"); - return fd.getDateTime(); - } - - public String putTransaction(String tid, String status, String rqstTm, String respTm, String srcId, String rsrcId, String rsrcType, String rqstBuf, String respBuf, String actualResponse) { - String tm = null; - - if (tid == null || "".equals(tid)) { - tm = this.genDate(); - tid = tm + "-"; - } - - String htid = tid; - - if (rqstTm == null || "".equals(rqstTm)) { - rqstTm = tm; - } - - if (respTm == null || "".equals(respTm)) { - respTm = tm; - } - - try { - LOGGER.debug(" transactionId:" + tid + " status: " + status + " rqstDate: " + rqstTm + " respDate: " + respTm + " sourceId: " + srcId + " resourceId: " - + rsrcId + " resourceType: " + rsrcType + " payload rqstBuf: " + rqstBuf + " payload respBuf: " + respBuf + " Payload Error Messages: " + actualResponse); - return htid; - } catch (Exception e) { - ErrorLogHelper.logError("AAI_4000", "Exception updating HBase:"); - return htid; - } - - } -} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java deleted file mode 100644 index 1849b10..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.onap.aai.logging.LoggingContext; -import org.onap.aai.logging.LoggingContext.StatusCode; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; - -import ajsc.beans.interceptors.AjscInterceptor; - -public class PostAaiAjscInterceptor implements AjscInterceptor { - - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(PostAaiAjscInterceptor.class); - - private static class LazyAaiAjscInterceptor { - public static final PostAaiAjscInterceptor INSTANCE = new PostAaiAjscInterceptor(); - } - - public static PostAaiAjscInterceptor getInstance() { - return LazyAaiAjscInterceptor.INSTANCE; - } - - @Override - public boolean allowOrReject(HttpServletRequest req, HttpServletResponse resp, Map paramMap) - throws Exception { - final int httpStatusCode = resp.getStatus(); - LoggingContext.responseCode(Integer.toString(httpStatusCode)); - if ( httpStatusCode < 200 || httpStatusCode > 299 ) { - LoggingContext.statusCode(StatusCode.ERROR); - LoggingContext.responseDescription("Error"); - LOGGER.error(req.getRequestURL() + " call failed with responseCode=" + httpStatusCode); - } - else { - LoggingContext.responseDescription(LoggingContext.responseMap.get(LoggingContext.SUCCESS)); - LoggingContext.statusCode(StatusCode.COMPLETE); - LOGGER.info(req.getRequestURL() + " call succeeded"); - } - LoggingContext.clear(); - return true; - } -} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java deleted file mode 100644 index b510d4b..0000000 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.onap.aai.logging.LoggingContext; - -import ajsc.beans.interceptors.AjscInterceptor; - -public class PreAaiAjscInterceptor implements AjscInterceptor { - private final static String TARGET_ENTITY = "aai-traversal"; - - private static class LazyAaiAjscInterceptor { - public static final PreAaiAjscInterceptor INSTANCE = new PreAaiAjscInterceptor(); - } - - public static PreAaiAjscInterceptor getInstance() { - return LazyAaiAjscInterceptor.INSTANCE; - } - - @Override - public boolean allowOrReject(HttpServletRequest req, HttpServletResponse resp, Map paramMap) - throws Exception { - - LoggingContext.init(); - - String serviceName = req.getMethod() + " " + req.getRequestURI().toString(); - LoggingContext.partnerName(req.getHeader("X-FromAppId")); - String queryStr = req.getQueryString(); - if ( queryStr != null ) { - serviceName = serviceName + "?" + queryStr; - } - LoggingContext.serviceName(serviceName); - LoggingContext.targetEntity(TARGET_ENTITY); - LoggingContext.targetServiceName("allowOrReject"); - LoggingContext.requestId(req.getHeader("X-TransactionId")); - LoggingContext.successStatusFields(); - return true; - } -} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/package-info.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/package-info.java new file mode 100644 index 0000000..131d46c --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/package-info.java @@ -0,0 +1,17 @@ +/** + * Interceptors package is subdivided to pre and post interceptors + * If you want to add an additional interceptor you would need to add + * the priority level to AAIRequestFilterPriority or AAIResponsePriority + * to give a value which indicates the order in which the interceptor + * will be triggered and also you will add that value like here + * + *
+ *     
+ *         @Priority(AAIRequestFilterPriority.YOUR_PRIORITY)
+ *         public class YourInterceptor extends AAIContainerFilter implements ContainerRequestFilter {
+ *
+ *         }
+ *     
+ * 
+ */ +package org.onap.aai.interceptors; \ No newline at end of file diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/post/AAIResponseFilterPriority.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/AAIResponseFilterPriority.java new file mode 100644 index 0000000..d14c24f --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/AAIResponseFilterPriority.java @@ -0,0 +1,13 @@ +package org.onap.aai.interceptors.post; + +public final class AAIResponseFilterPriority { + + private AAIResponseFilterPriority() {} + + public static final int HEADER_MANIPULATION = 1000; + + public static final int RESPONSE_TRANS_LOGGING = 2000; + + public static final int RESET_LOGGING_CONTEXT = 3000; + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResetLoggingContext.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResetLoggingContext.java new file mode 100644 index 0000000..d1b74d2 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResetLoggingContext.java @@ -0,0 +1,50 @@ +package org.onap.aai.interceptors.post; + +import java.io.IOException; + +import javax.annotation.Priority; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.container.ContainerResponseFilter; + +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; +import org.springframework.beans.factory.annotation.Autowired; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +@Priority(AAIResponseFilterPriority.RESET_LOGGING_CONTEXT) +public class ResetLoggingContext extends AAIContainerFilter implements ContainerResponseFilter { + + private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(ResetLoggingContext.class); + + @Autowired + private HttpServletRequest httpServletRequest; + + @Override + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) + throws IOException { + + this.cleanLoggingContext(); + + } + + private void cleanLoggingContext() { + final String responseCode = LoggingContext.responseCode(); + String url = httpServletRequest.getRequestURL().toString(); + + if (responseCode != null && responseCode.startsWith("ERR.")) { + LoggingContext.statusCode(StatusCode.ERROR); + LOGGER.error(url + " call failed with responseCode=" + responseCode); + } else { + LoggingContext.statusCode(StatusCode.COMPLETE); + LOGGER.info(url + " call succeeded"); + } + + LoggingContext.clear(); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseHeaderManipulation.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseHeaderManipulation.java new file mode 100644 index 0000000..a26334f --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseHeaderManipulation.java @@ -0,0 +1,30 @@ +package org.onap.aai.interceptors.post; + +import java.io.IOException; + +import javax.annotation.Priority; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.container.ContainerResponseFilter; + +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; + +@Priority(AAIResponseFilterPriority.HEADER_MANIPULATION) +public class ResponseHeaderManipulation extends AAIContainerFilter implements ContainerResponseFilter { + + + @Override + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) + throws IOException { + + updateResponseHeaders(requestContext, responseContext); + + } + + private void updateResponseHeaders(ContainerRequestContext requestContext, + ContainerResponseContext responseContext) { + responseContext.getHeaders().add(AAIHeaderProperties.AAI_TX_ID, requestContext.getProperty(AAIHeaderProperties.AAI_TX_ID)); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java new file mode 100644 index 0000000..7b18e45 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java @@ -0,0 +1,106 @@ +package org.onap.aai.interceptors.post; + +import java.io.IOException; +import java.util.Objects; +import java.util.Optional; + +import javax.annotation.Priority; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.container.ContainerResponseFilter; + +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.util.AAIConfig; +import org.springframework.beans.factory.annotation.Autowired; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.gson.JsonObject; + +@Priority(AAIResponseFilterPriority.RESPONSE_TRANS_LOGGING) +public class ResponseTransactionLogging extends AAIContainerFilter implements ContainerResponseFilter { + + private static final EELFLogger TRANSACTION_LOGGER = EELFManager.getInstance().getLogger(ResponseTransactionLogging.class); + + @Autowired + private HttpServletResponse httpServletResponse; + + @Override + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) + throws IOException { + + this.transLogging(requestContext, responseContext); + + } + + private void transLogging(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { + + String logValue; + String getValue; + String postValue; + + try { + logValue = AAIConfig.get("aai.transaction.logging"); + getValue = AAIConfig.get("aai.transaction.logging.get"); + postValue = AAIConfig.get("aai.transaction.logging.post"); + } catch (AAIException e) { + return; + } + + String transId = requestContext.getHeaderString(AAIHeaderProperties.TRANSACTION_ID); + String fromAppId = requestContext.getHeaderString(AAIHeaderProperties.FROM_APP_ID); + String fullUri = requestContext.getUriInfo().getRequestUri().toString(); + String requestTs = (String)requestContext.getProperty(AAIHeaderProperties.AAI_REQUEST_TS); + + String httpMethod = requestContext.getMethod(); + + String status = Integer.toString(responseContext.getStatus()); + + String request = (String)requestContext.getProperty(AAIHeaderProperties.AAI_REQUEST); + String response = this.getResponseString(responseContext); + + if (!Boolean.parseBoolean(logValue)) { + } else if (!Boolean.parseBoolean(getValue) && "GET".equals(httpMethod)) { + } else if (!Boolean.parseBoolean(postValue) && "POST".equals(httpMethod)) { + } else { + + JsonObject logEntry = new JsonObject(); + logEntry.addProperty("transactionId", transId); + logEntry.addProperty("status", status); + logEntry.addProperty("rqstDate", requestTs); + logEntry.addProperty("respDate", this.genDate()); + logEntry.addProperty("sourceId", fromAppId + ":" + transId); + logEntry.addProperty("resourceId", fullUri); + logEntry.addProperty("resourceType", httpMethod); + logEntry.addProperty("rqstBuf", Objects.toString(request, "")); + logEntry.addProperty("respBuf", Objects.toString(response, "")); + + try { + TRANSACTION_LOGGER.debug(logEntry.toString()); + } catch (Exception e) { + ErrorLogHelper.logError("AAI_4000", "Exception writing transaction log."); + } + } + + } + + private String getResponseString(ContainerResponseContext responseContext) { + JsonObject response = new JsonObject(); + response.addProperty("ID", responseContext.getHeaderString(AAIHeaderProperties.AAI_TX_ID)); + response.addProperty("Content-Type", this.httpServletResponse.getContentType()); + response.addProperty("Response-Code", responseContext.getStatus()); + response.addProperty("Headers", responseContext.getHeaders().toString()); + Optional entityOptional = Optional.ofNullable(responseContext.getEntity()); + if(entityOptional.isPresent()){ + response.addProperty("Entity", entityOptional.get().toString()); + } else { + response.addProperty("Entity", ""); + } + return response.toString(); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/AAIRequestFilterPriority.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/AAIRequestFilterPriority.java new file mode 100644 index 0000000..b3fc1b1 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/AAIRequestFilterPriority.java @@ -0,0 +1,18 @@ +package org.onap.aai.interceptors.pre; + +public final class AAIRequestFilterPriority { + + private AAIRequestFilterPriority() {} + + public static final int REQUEST_TRANS_LOGGING = 1000; + + public static final int HEADER_VALIDATION = 2000; + + public static final int SET_LOGGING_CONTEXT = 3000; + + public static final int AUTHORIZATION = 4000; + + public static final int HEADER_MANIPULATION = 5000; + + public static final int REQUEST_MODIFICATION = 6000; +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/HeaderValidation.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/HeaderValidation.java new file mode 100644 index 0000000..88a492f --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/HeaderValidation.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * 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========================================================= + */ + +package org.onap.aai.interceptors.pre; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +import javax.annotation.Priority; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.PreMatching; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; +import org.onap.aai.logging.ErrorLogHelper; + +@PreMatching +@Priority(AAIRequestFilterPriority.HEADER_VALIDATION) +public class HeaderValidation extends AAIContainerFilter implements ContainerRequestFilter { + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + Optional oResp; + + String transId = requestContext.getHeaderString(AAIHeaderProperties.TRANSACTION_ID); + String fromAppId = requestContext.getHeaderString(AAIHeaderProperties.FROM_APP_ID); + + List acceptHeaderValues = requestContext.getAcceptableMediaTypes(); + + oResp = this.validateHeaderValuePresence(fromAppId, "AAI_4009", acceptHeaderValues); + if (oResp.isPresent()) { + requestContext.abortWith(oResp.get()); + return; + } + oResp = this.validateHeaderValuePresence(transId, "AAI_4010", acceptHeaderValues); + if (oResp.isPresent()) { + requestContext.abortWith(oResp.get()); + return; + } + + if (!this.isValidUUID(transId)) { + transId = UUID.randomUUID().toString(); + requestContext.getHeaders().get(AAIHeaderProperties.TRANSACTION_ID).clear(); + requestContext.getHeaders().add(AAIHeaderProperties.TRANSACTION_ID, transId); + } + + } + + private Optional validateHeaderValuePresence(String value, String errorCode, + List acceptHeaderValues) { + Response response = null; + AAIException aaie; + if (value == null) { + aaie = new AAIException(errorCode); + return Optional.of(Response.status(aaie.getErrorObject().getHTTPResponseCode()) + .entity(ErrorLogHelper.getRESTAPIErrorResponse(acceptHeaderValues, aaie, new ArrayList<>())) + .build()); + } + + return Optional.ofNullable(response); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestHeaderManipulation.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestHeaderManipulation.java new file mode 100644 index 0000000..63a92cf --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestHeaderManipulation.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * 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========================================================= + */ + +package org.onap.aai.interceptors.pre; + +import java.io.IOException; +import java.util.Collections; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.annotation.Priority; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.PreMatching; +import javax.ws.rs.core.MultivaluedMap; + +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; +import org.springframework.beans.factory.annotation.Autowired; + +@PreMatching +@Priority(AAIRequestFilterPriority.HEADER_MANIPULATION) +public class RequestHeaderManipulation extends AAIContainerFilter implements ContainerRequestFilter { + + @Autowired + private HttpServletRequest httpServletRequest; + + private static final Pattern versionedEndpoint = Pattern.compile("^/aai/(v\\d+)"); + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + String uri = httpServletRequest.getRequestURI(); + this.addRequestContext(uri, requestContext.getHeaders()); + + } + + private void addRequestContext(String uri, MultivaluedMap requestHeaders) { + + String rc = ""; + + Matcher match = versionedEndpoint.matcher(uri); + if (match.find()) { + rc = match.group(1); + } + + if (requestHeaders.containsKey(AAIHeaderProperties.REQUEST_CONTEXT)) { + requestHeaders.remove(AAIHeaderProperties.REQUEST_CONTEXT); + } + requestHeaders.put(AAIHeaderProperties.REQUEST_CONTEXT, Collections.singletonList(rc)); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestModification.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestModification.java new file mode 100644 index 0000000..a5f8789 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestModification.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * 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========================================================= + */ + +package org.onap.aai.interceptors.pre; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.annotation.Priority; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.PreMatching; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; + +import org.onap.aai.interceptors.AAIContainerFilter; + +@PreMatching +@Priority(AAIRequestFilterPriority.HEADER_VALIDATION) +public class RequestModification extends AAIContainerFilter implements ContainerRequestFilter { + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + this.cleanDME2QueryParams(requestContext); + + } + + private void cleanDME2QueryParams(ContainerRequestContext request) { + UriBuilder builder = request.getUriInfo().getRequestUriBuilder(); + MultivaluedMap queries = request.getUriInfo().getQueryParameters(); + + String[] blacklist = { "version", "envContext", "routeOffer" }; + Set blacklistSet = Arrays.stream(blacklist).collect(Collectors.toSet()); + + boolean remove = true; + + for (String param : blacklistSet) { + if (!queries.containsKey(param)) { + remove = false; + break; + } + } + + if (remove) { + for (Map.Entry> query : queries.entrySet()) { + String key = query.getKey(); + if (blacklistSet.contains(key)) { + builder.replaceQueryParam(key); + } + } + } + request.setRequestUri(builder.build()); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java new file mode 100644 index 0000000..83d89ae --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java @@ -0,0 +1,113 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * 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========================================================= + */ + +package org.onap.aai.interceptors.pre; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Random; +import java.util.UUID; + +import javax.annotation.Priority; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.PreMatching; +import javax.ws.rs.core.MediaType; + +import org.glassfish.jersey.message.internal.ReaderWriter; +import org.glassfish.jersey.server.ContainerException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; +import org.onap.aai.util.HbaseSaltPrefixer; +import org.springframework.beans.factory.annotation.Autowired; + +import com.google.gson.JsonObject; + +@PreMatching +@Priority(AAIRequestFilterPriority.REQUEST_TRANS_LOGGING) +public class RequestTransactionLogging extends AAIContainerFilter implements ContainerRequestFilter { + + @Autowired + private HttpServletRequest httpServletRequest; + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + String currentTimeStamp = genDate(); + String fullId = this.getAAITxIdToHeader(currentTimeStamp); + this.addToRequestContext(requestContext, AAIHeaderProperties.AAI_TX_ID, fullId); + this.addToRequestContext(requestContext, AAIHeaderProperties.AAI_REQUEST, this.getRequest(requestContext, fullId)); + this.addToRequestContext(requestContext, AAIHeaderProperties.AAI_REQUEST_TS, currentTimeStamp); + } + + private void addToRequestContext(ContainerRequestContext requestContext, String name, String aaiTxIdToHeader) { + requestContext.setProperty(name, aaiTxIdToHeader); + } + + private String getAAITxIdToHeader(String currentTimeStamp) { + String txId = UUID.randomUUID().toString(); + try { + txId = HbaseSaltPrefixer.getInstance().prependSalt(AAIConfig.get(AAIConstants.AAI_NODENAME) + "-" + + currentTimeStamp + "-" + new Random(System.currentTimeMillis()).nextInt(99999)); + } catch (AAIException e) { + } + + return txId; + } + + private String getRequest(ContainerRequestContext requestContext, String fullId) { + + JsonObject request = new JsonObject(); + request.addProperty("ID", fullId); + request.addProperty("Http-Method", requestContext.getMethod()); + String contentType = httpServletRequest.getContentType(); + + if(contentType == null){ + contentType = MediaType.APPLICATION_JSON; + requestContext.getHeaders().add("Content-Type", contentType); + } + + request.addProperty("Content-Type", contentType); + request.addProperty("Headers", requestContext.getHeaders().toString()); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + InputStream in = requestContext.getEntityStream(); + + try { + if (in.available() > 0) { + ReaderWriter.writeTo(in, out); + byte[] requestEntity = out.toByteArray(); + request.addProperty("Payload", new String(requestEntity, "UTF-8")); + requestContext.setEntityStream(new ByteArrayInputStream(requestEntity)); + } + } catch (IOException ex) { + throw new ContainerException(ex); + } + + return request.toString(); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/SetLoggingContext.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/SetLoggingContext.java new file mode 100644 index 0000000..76de206 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/SetLoggingContext.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * 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========================================================= + */ + +package org.onap.aai.interceptors.pre; + +import java.io.IOException; + +import javax.annotation.Priority; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.PreMatching; + +import org.onap.aai.interceptors.AAIContainerFilter; +import org.onap.aai.interceptors.AAIHeaderProperties; +import org.onap.aai.logging.LoggingContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; + +@PreMatching +@Priority(AAIRequestFilterPriority.SET_LOGGING_CONTEXT) +public class SetLoggingContext extends AAIContainerFilter implements ContainerRequestFilter { + + @Autowired + private Environment environment; + + @Autowired + private HttpServletRequest httpServletRequest; + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + String uri = httpServletRequest.getRequestURI(); + String queryString = httpServletRequest.getQueryString(); + + if(queryString != null && !queryString.isEmpty()){ + uri = uri + "?" + queryString; + } + + String httpMethod = requestContext.getMethod(); + String transId = requestContext.getHeaderString(AAIHeaderProperties.TRANSACTION_ID); + String fromAppId = requestContext.getHeaderString(AAIHeaderProperties.FROM_APP_ID); + + LoggingContext.init(); + LoggingContext.requestId(transId); + LoggingContext.partnerName(fromAppId); + LoggingContext.targetEntity(environment.getProperty("spring.application.name")); + LoggingContext.component(fromAppId); + LoggingContext.serviceName(httpMethod + " " + uri); + LoggingContext.targetServiceName(httpMethod + " " + uri); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java index 0188142..301fa5c 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java @@ -35,7 +35,7 @@ import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; -import org.apache.cxf.jaxrs.ext.PATCH; +import io.swagger.jaxrs.PATCH; import org.onap.aai.exceptions.AAIException; import org.onap.aai.logging.ErrorLogHelper; diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java index 55a07e4..1dfc99f 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java @@ -42,11 +42,12 @@ import org.onap.aai.restcore.RESTAPI; /** * The Class EchoResponse. */ +@Path("/util") public class EchoResponse extends RESTAPI { protected static String authPolicyFunctionName = "util"; - public static final String echoPath = "/util/echo"; + public static final String echoPath = "/echo"; /** * Simple health-check API that echos back the X-FromAppId and X-TransactionId to clients. diff --git a/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java b/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java new file mode 100644 index 0000000..96fd2a2 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java @@ -0,0 +1,127 @@ +package org.onap.aai.web; + +import org.glassfish.jersey.filter.LoggingFilter; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.servlet.ServletProperties; +import org.onap.aai.rest.QueryConsumer; +import org.onap.aai.rest.retired.V3ThroughV7Consumer; +import org.onap.aai.rest.search.ModelAndNamedQueryRestProvider; +import org.onap.aai.rest.search.SearchProvider; +import org.onap.aai.rest.util.EchoResponse; +import org.reflections.Reflections; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Profile; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +import javax.annotation.Priority; +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.ContainerResponseFilter; +import java.util.List; +import java.util.Set; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +@Component +@ApplicationPath("/aai") +public class JerseyConfiguration extends ResourceConfig { + + private static final Logger log = Logger.getLogger(JerseyConfiguration.class.getName()); + + private Environment env; + + @Autowired + public JerseyConfiguration(Environment env) { + + this.env = env; + + register(SearchProvider.class); + register(ModelAndNamedQueryRestProvider.class); + register(QueryConsumer.class); + + register(V3ThroughV7Consumer.class); + register(EchoResponse.class); + + //Request Filters + registerFiltersForRequests(); + // Response Filters + registerFiltersForResponses(); + + property(ServletProperties.FILTER_FORWARD_ON_404, true); + + // Following registers the request headers and response headers + // If the LoggingFilter second argument is set to true, it will print response value as well + if ("true".equalsIgnoreCase(env.getProperty("aai.request.logging.enabled"))) { + register(new LoggingFilter(log, false)); + } + } + + public void registerFiltersForRequests() { + + // Find all the classes within the interceptors package + Reflections reflections = new Reflections("org.onap.aai.interceptors"); + // Filter them based on the clazz that was passed in + Set> filters = reflections.getSubTypesOf(ContainerRequestFilter.class); + + + // Check to ensure that each of the filter has the @Priority annotation and if not throw exception + for (Class filterClass : filters) { + if (filterClass.getAnnotation(Priority.class) == null) { + throw new RuntimeException("Container filter " + filterClass.getName() + " does not have @Priority annotation"); + } + } + + // Turn the set back into a list + List> filtersList = filters + .stream() + .filter(f -> { + if (f.isAnnotationPresent(Profile.class) + && !env.acceptsProfiles(f.getAnnotation(Profile.class).value())) { + return false; + } + return true; + }) + .collect(Collectors.toList()); + + // Sort them by their priority levels value + filtersList.sort((c1, c2) -> Integer.valueOf(c1.getAnnotation(Priority.class).value()).compareTo(c2.getAnnotation(Priority.class).value())); + + // Then register this to the jersey application + filtersList.forEach(this::register); + } + + public void registerFiltersForResponses() { + + // Find all the classes within the interceptors package + Reflections reflections = new Reflections("org.onap.aai.interceptors"); + // Filter them based on the clazz that was passed in + Set> filters = reflections.getSubTypesOf(ContainerResponseFilter.class); + + + // Check to ensure that each of the filter has the @Priority annotation and if not throw exception + for (Class filterClass : filters) { + if (filterClass.getAnnotation(Priority.class) == null) { + throw new RuntimeException("Container filter " + filterClass.getName() + " does not have @Priority annotation"); + } + } + + // Turn the set back into a list + List> filtersList = filters.stream() + .filter(f -> { + if (f.isAnnotationPresent(Profile.class) + && !env.acceptsProfiles(f.getAnnotation(Profile.class).value())) { + return false; + } + return true; + }) + .collect(Collectors.toList()); + + // Sort them by their priority levels value + filtersList.sort((c1, c2) -> Integer.valueOf(c1.getAnnotation(Priority.class).value()).compareTo(c2.getAnnotation(Priority.class).value())); + + // Then register this to the jersey application + filtersList.forEach(this::register); + } + +} diff --git a/aai-traversal/src/main/java/org/onap/aai/web/LocalHostAccessLog.java b/aai-traversal/src/main/java/org/onap/aai/web/LocalHostAccessLog.java new file mode 100644 index 0000000..4344e36 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/web/LocalHostAccessLog.java @@ -0,0 +1,39 @@ +package org.onap.aai.web; + +import ch.qos.logback.access.jetty.RequestLogImpl; +import org.eclipse.jetty.server.handler.HandlerCollection; +import org.eclipse.jetty.server.handler.RequestLogHandler; +import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; +import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory; +import org.springframework.boot.context.embedded.jetty.JettyServerCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Arrays; + +@Configuration +public class LocalHostAccessLog { + + @Bean + public EmbeddedServletContainerFactory jettyConfigBean(){ + JettyEmbeddedServletContainerFactory jef = new JettyEmbeddedServletContainerFactory(); + jef.addServerCustomizers((JettyServerCustomizer) server -> { + + HandlerCollection handlers = new HandlerCollection(); + + Arrays.stream(server.getHandlers()).forEach(handlers::addHandler); + + RequestLogHandler requestLogHandler = new RequestLogHandler(); + requestLogHandler.setServer(server); + + RequestLogImpl requestLogImpl = new RequestLogImpl(); + requestLogImpl.setResource("/localhost-access-logback.xml"); + requestLogImpl.start(); + + requestLogHandler.setRequestLog(requestLogImpl); + handlers.addHandler(requestLogHandler); + server.setHandler(handlers); + }); + return jef; + } +} diff --git a/aai-traversal/src/main/java/org/onap/aai/web/WebConfiguration.java b/aai-traversal/src/main/java/org/onap/aai/web/WebConfiguration.java new file mode 100644 index 0000000..a85fcf9 --- /dev/null +++ b/aai-traversal/src/main/java/org/onap/aai/web/WebConfiguration.java @@ -0,0 +1,27 @@ +package org.onap.aai.web; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +@Configuration +public class WebConfiguration { + + @Bean + public WebMvcConfigurerAdapter forwardToIndex() { + return new WebMvcConfigurerAdapter() { + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addViewController("/swagger").setViewName( + "redirect:/swagger/index.html"); + registry.addViewController("/swagger/").setViewName( + "redirect:/swagger/index.html"); + registry.addViewController("/docs").setViewName( + "redirect:/docs/html/index.html"); + registry.addViewController("/docs/").setViewName( + "redirect:/docs/html/index.html"); + } + }; + } +} \ No newline at end of file diff --git a/aai-traversal/src/main/resources/application.properties b/aai-traversal/src/main/resources/application.properties new file mode 100644 index 0000000..bdb7535 --- /dev/null +++ b/aai-traversal/src/main/resources/application.properties @@ -0,0 +1,72 @@ +# The following info parameters are being referenced by ajsc6 +info.build.artifact=aai-traversal +info.build.name=traversal +info.build.description=Traversal Microservice +info.build.version=1.1.0 + +spring.application.name=aai-traversal +spring.jersey.type=filter + +server.contextPath=/ +spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + +spring.profiles.active=production +#The max number of active threads in this pool +server.tomcat.max-threads=200 +#The minimum number of threads always kept alive +server.tomcat.min-Spare-Threads=25 +#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads +server.tomcat.max-idle-time=60000 + + +#Add this properties only if you want to change the URL, AJSC Framework interceptors will intercept +#com.att.ajsc.common.interceptors.PreInterceptor.url=/** +#com.att.ajsc.common.interceptors.PostInterceptor.url=/** + +#Servlet context parameters +server.context_parameters.p-name=value #context parameter with p-name as key and value as value. +kubernetes.namespace=org-onap-aai + +# If you get an application startup failure that the port is already taken +# If thats not it, please check if the key-store file path makes sense +server.local.startpath=aai-traversal/src/main/resources/ +server.basic.auth.location=${server.local.startpath}etc/auth/realm.properties + +server.port=8446 +server.ssl.enabled-protocols=TLSv1.1,TLSv1.2 +server.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore +server.ssl.key-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0) +server.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore +server.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0) +server.ssl.client-auth=want +server.ssl.key-store-type=JKS + +# JMS bind address host port +jms.bind.address=tcp://localhost:61647 +dmaap.ribbon.eureka.enabled=false +dmaap.ribbon.listOfServers=localhost:3904 +# Number of milliseconds to wait before making ping requests again +dmaap.ribbon.ServerListRefreshInterval=75000 +dmaap.ribbon.NFLoadBalancerPingInterval=75000 +dmaap.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.AvailabilityFilteringRule +dmaap.ribbon.NFLoadBalancerPingClassName=org.onap.aai.config.HttpPingImpl +dmaap.ribbon.EnableMarkingServerDownOnReachingFailureLimit=true +dmaap.ribbon.ServerDownFailureLimit=1 +# This needs to be verified but it seems that adding this property should automatically +# Make the dmaap client change the url from http to https depending on the server +dmaap.ribbon.securePorts=3905 + +# Custom Dmaap Specific Configuration +dmaap.ribbon.username= +dmaap.ribbon.password= +dmaap.ribbon.health.endpoint=/topics/AAI-EVENT +# Number of seconds to wait for the ping to work and might need to increase this if the pings are all failing +dmaap.ribbon.pingport.timeout=3 + +niws.loadbalancer.dmaap.filterCircuitTripped=true +niws.loadbalancer.dmaap.connectionFailureCountThreshold=3 +niws.loadbalancer.dmaap.circuitTripMaxTimeoutSeconds=180 +#dmaap.ribbon.retryableStatusCodes=404,503 +#dmaap.ribbon.retryableStatusCodes.MaxAutoRetriesNextServer=2 +#dmaap.ribbon.retryableStatusCodes.MaxAutoRetries=2 +#dmaap.ribbon.retryableStatusCodes.OkToRetryOnAllOperations=true diff --git a/aai-traversal/src/main/resources/docker/Dockerfile b/aai-traversal/src/main/resources/docker/Dockerfile deleted file mode 100644 index dc28e15..0000000 --- a/aai-traversal/src/main/resources/docker/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM aaionap/aai-common:1.1.0 - -RUN mkdir -p /opt/aaihome/aaiadmin /opt/aai/logroot/AAI-RES /opt/app/aai-traversal/bin /opt/app/aai-traversal/extApps; - -# Add the proper files into the docker image from your build -ADD ./opt/app/aai-traversal /opt/app/aai-traversal -ADD ./commonLibs/ /opt/app/commonLibs/ -ADD init-chef.sh /opt/app/aai-traversal/init-chef.sh -ADD docker-entrypoint.sh /opt/app/aai-traversal/docker-entrypoint.sh -ADD aai.sh /etc/profile.d/aai.sh - -# Change the permissions of aai shell script and all scripts in the microservice to be executable -RUN chmod 644 /etc/profile.d/aai.sh && \ - find /opt/app/aai-traversal -name "*.sh" -exec chmod 755 {} + - -# Set the log directory to be mountable so the logs will be persisted -VOLUME /opt/aai/logroot/AAI-GQ - -# Expose the ports that needs to be available from the container -EXPOSE 8447 - -# During the startup of the container, this will be the starting directory -WORKDIR /opt/app/aai-traversal - -# When the container is started this is the entrypoint script -# that docker will run. Make sure this script doesn't end abruptly -# Docker entrypoint will run exec command to make that main process -# Using the exec form here will ensure the java process is main - -ENTRYPOINT ["/bin/bash", "/opt/app/aai-traversal/docker-entrypoint.sh"] - diff --git a/aai-traversal/src/main/resources/docker/commonLibs/README b/aai-traversal/src/main/resources/docker/commonLibs/README deleted file mode 100644 index 00e36c0..0000000 --- a/aai-traversal/src/main/resources/docker/commonLibs/README +++ /dev/null @@ -1 +0,0 @@ -// this file's presence ensures commonLibs folder is present when image is created \ No newline at end of file diff --git a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh deleted file mode 100644 index 1a57d9a..0000000 --- a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh +++ /dev/null @@ -1,134 +0,0 @@ -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -# Set the current path to be the application home and common libs home -export APP_HOME=$(pwd); -COMMONLIBS_HOME="/opt/app/commonLibs"; - -export CHEF_CONFIG_REPO=${CHEF_CONFIG_REPO:-aai-config}; -export CHEF_GIT_URL=${CHEF_GIT_URL:-http://gerrit.onap.org/r/aai}; -export CHEF_CONFIG_GIT_URL=${CHEF_CONFIG_GIT_URL:-$CHEF_GIT_URL}; -export CHEF_DATA_GIT_URL=${CHEF_DATA_GIT_URL:-$CHEF_GIT_URL}; - -export RESOURCES_HOSTNAME=${RESOURCES_HOSTNAME:-aai-resources.api.simpledemo.onap.org}; -export RESOURCES_PORT=${RESOURCES_PORT:-8447}; - -USER_ID=${LOCAL_USER_ID:-9001} - -if [ $(cat /etc/passwd | grep aaiadmin | wc -l) -eq 0 ]; then - useradd --shell=/bin/bash -u ${USER_ID} -o -c "" -m aaiadmin || { - echo "Unable to create the user id for ${USER_ID}"; - exit 1; - } -fi; - -chown -R aaiadmin:aaiadmin /opt/app /var/chef /opt/aai/logroot - -gosu aaiadmin ./init-chef.sh || { - echo "Unable to run init chef script, please check logs"; - exit 1; -} - -httpPort=8086; -httpsPort=8446; - -AAI_CORE_JAR=$(ls ${APP_HOME}/extJars/aai-core*.jar); - -# Get the basename of the aai-core-X.Y.Z-SNAPSHOT.jar -# Then extract the X.Y.Z-SNAPSHOT part -AAI_CORE_VERSION=$(basename ${AAI_CORE_JAR} | grep -o '[0-9]*\.[0-9]*\.[0-9]*[^.]*'); - - -cd ${APP_HOME}; - -# If the variable DISABLE_UPDATE_QUERY is empty -# then the update query date shell script will be ran -# This makes it configurable to run update query or not - -if [ -z ${DISABLE_UPDATE_QUERY} ]; then - - while ! nc -z ${RESOURCES_HOSTNAME} ${RESOURCES_PORT} ; - do - echo "Waiting for resources to be up"; - sleep 5; - done - - UPDATE_QUERY_RAN_FILE="updateQueryRan.txt"; - - AAICONFIG_FILE=/opt/app/aai-traversal/bundleconfig/etc/appprops/aaiconfig.properties; - - if [ ! -f ${UPDATE_QUERY_RAN_FILE} ]; then - OLD_RESOURCES_URL=$(grep -o "^aai.server.url=.*" ${AAICONFIG_FILE} | cut -d"=" -f2-); - TEMP_RESOURCES_URL=https://${RESOURCES_HOSTNAME}:${RESOURCES_PORT}/aai/v11/; - sed -i "s%^aai.server.url=.*$%aai.server.url=${TEMP_RESOURCES_URL}%g" ${AAICONFIG_FILE}; - gosu aaiadmin /opt/app/aai-traversal/bin/install/updateQueryData.sh - touch ${UPDATE_QUERY_RAN_FILE}; - sed -i "s%^aai.server.url=.*$%aai.server.url=${OLD_RESOURCES_URL}%g" ${AAICONFIG_FILE}; - fi -fi - -CP=${COMMONLIBS_HOME}/*; -CP="$CP":${APP_HOME}/etc; -CP="$CP":${APP_HOME}/lib/*; -CP="$CP":${APP_HOME}/extJars/logback-access-1.1.7.jar; -CP="$CP":${APP_HOME}/extJars/logback-core-1.1.7.jar; -CP="$CP":${AAI_CORE_JAR}; - -# You can add additional jvm options by adding environment variable JVM_PRE_OPTS -# If you need to add more jvm options at the end then you can use JVM_POST_OPTS -JVM_OPTS="${JVM_PRE_OPTS} ${JVM_OPTS}"; -JVM_OPTS="${JVM_OPTS} -server -XX:NewSize=512m -XX:MaxNewSize=512m"; -JVM_OPTS="${JVM_OPTS} -XX:SurvivorRatio=8"; -JVM_OPTS="${JVM_OPTS} -XX:+DisableExplicitGC -verbose:gc -XX:+UseParNewGC"; -JVM_OPTS="${JVM_OPTS} -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"; -JVM_OPTS="${JVM_OPTS} -XX:+UseConcMarkSweepGC -XX:-UseBiasedLocking"; -JVM_OPTS="${JVM_OPTS} -XX:ParallelGCThreads=4"; -JVM_OPTS="${JVM_OPTS} -XX:LargePageSizeInBytes=128m "; -JVM_OPTS="${JVM_OPTS} -XX:+PrintGCDetails -XX:+PrintGCTimeStamps"; -JVM_OPTS="${JVM_OPTS} -Xloggc:${APP_HOME}/logs/gc/graph-query_gc.log"; -JVM_OPTS="${JVM_OPTS} -XX:+HeapDumpOnOutOfMemoryError"; -JVM_OPTS="${JVM_OPTS} ${JVM_POST_OPTS}"; - -# You can add additional java options by adding environment variable JAVA_PRE_OPTS -# If you need to add more jvm options at the end then you can use JAVA_POST_OPTS -JAVA_OPTS="${JAVA_PRE_OPTS} ${JAVA_OPTS}"; -JAVA_OPTS="${JAVA_OPTS} -Dsun.net.inetaddr.ttl=180"; -JAVA_OPTS="${JAVA_OPTS} -Dhttps.protocols=TLSv1.1,TLSv1.2"; -JAVA_OPTS="${JAVA_OPTS} -DSOACLOUD_SERVICE_VERSION=1.0.1"; -JAVA_OPTS="${JAVA_OPTS} -DAJSC_HOME=${APP_HOME}"; -JAVA_OPTS="${JAVA_OPTS} -DAJSC_CONF_HOME=${APP_HOME}/bundleconfig"; -JAVA_OPTS="${JAVA_OPTS} -DAJSC_SHARED_CONFIG=${APP_HOME}/bundleconfig"; -JAVA_OPTS="${JAVA_OPTS} -DAFT_HOME=${APP_HOME}"; -JAVA_OPTS="${JAVA_OPTS} -DAAI_CORE_VERSION=${AAI_CORE_VERSION}"; -JAVA_OPTS="${JAVA_OPTS} -Daai-core.version=${AAI_CORE_VERSION}"; -JAVA_OPTS="${JAVA_OPTS} -Dlogback.configurationFile=${APP_HOME}/bundleconfig/etc/logback.xml"; -JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}"; - -JAVA_ARGS="${JAVA_PRE_ARGS} ${JAVA_ARGS}"; -JAVA_ARGS="${JAVA_ARGS} context=/"; -JAVA_ARGS="${JAVA_ARGS} port=$httpPort"; -JAVA_ARGS="${JAVA_ARGS} sslport=$httpsPort"; -JAVA_ARGS="${JAVA_ARGS} ${JAVA_POST_ARGS}"; - -JAVA_CMD="exec gosu aaiadmin java"; -# Run the following command as aai-admin using gosu and make that process main -${JAVA_CMD} -cp ${CLASSPATH}:${CP} ${JVM_OPTS} ${JAVA_OPTS} com.att.ajsc.runner.Runner ${JAVA_ARGS} "$@" diff --git a/aai-traversal/src/main/resources/docker/init-chef.sh b/aai-traversal/src/main/resources/docker/init-chef.sh deleted file mode 100644 index a8802db..0000000 --- a/aai-traversal/src/main/resources/docker/init-chef.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -############################################################################## -# Script to initialize the chef-repo branch and.chef -# -############################################################################## - -cd /var/chef; - -if [ ! -d "aai-config" ]; then - - git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_CONFIG_GIT_URL}/${CHEF_CONFIG_REPO}.git aai-config || { - echo "Error: Unable to clone the aai-config repo with url: ${CHEF_GIT_URL}/${CHEF_CONFIG_REPO}.git"; - exit 1; - } - -fi - -if [ -d "aai-config/cookbooks/aai-traversal" ]; then - - (cd aai-config/cookbooks/aai-traversal/ && \ - for f in $(ls); do mv $f ../; done && \ - cd ../ && rmdir aai-traversal); - -fi; - -if [ ! -d "aai-data" ]; then - - git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_DATA_GIT_URL}/aai-data.git aai-data || { - echo "Error: Unable to clone the aai-data repo with url: ${CHEF_GIT_URL}"; - exit 1; - } - -fi - -chef-solo \ - -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \ - -j /var/chef/aai-config/cookbooks/runlist-aai-traversal.json \ - -E ${AAI_CHEF_ENV}; - diff --git a/aai-traversal/bundleconfig-local/etc/.gitignore b/aai-traversal/src/main/resources/etc/.gitignore similarity index 100% rename from aai-traversal/bundleconfig-local/etc/.gitignore rename to aai-traversal/src/main/resources/etc/.gitignore diff --git a/aai-traversal/bundleconfig-local/etc/appprops/Introscope.properties b/aai-traversal/src/main/resources/etc/appprops/Introscope.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/Introscope.properties rename to aai-traversal/src/main/resources/etc/appprops/Introscope.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties b/aai-traversal/src/main/resources/etc/appprops/PostProcessorInterceptors.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties rename to aai-traversal/src/main/resources/etc/appprops/PostProcessorInterceptors.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/aaiEventDMaaPPublisher.properties b/aai-traversal/src/main/resources/etc/appprops/aaiEventDMaaPPublisher.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/aaiEventDMaaPPublisher.properties rename to aai-traversal/src/main/resources/etc/appprops/aaiEventDMaaPPublisher.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-traversal/src/main/resources/etc/appprops/aaiconfig.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties rename to aai-traversal/src/main/resources/etc/appprops/aaiconfig.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml b/aai-traversal/src/main/resources/etc/appprops/default-logback.xml similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml rename to aai-traversal/src/main/resources/etc/appprops/default-logback.xml diff --git a/aai-traversal/bundleconfig-local/etc/appprops/error.properties b/aai-traversal/src/main/resources/etc/appprops/error.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/error.properties rename to aai-traversal/src/main/resources/etc/appprops/error.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml b/aai-traversal/src/main/resources/etc/appprops/gremlin-server-config.yaml similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml rename to aai-traversal/src/main/resources/etc/appprops/gremlin-server-config.yaml diff --git a/aai-traversal/bundleconfig-local/etc/appprops/logging.properties b/aai-traversal/src/main/resources/etc/appprops/logging.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/logging.properties rename to aai-traversal/src/main/resources/etc/appprops/logging.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/methodMapper.properties b/aai-traversal/src/main/resources/etc/appprops/methodMapper.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/methodMapper.properties rename to aai-traversal/src/main/resources/etc/appprops/methodMapper.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/preferredRoute.txt b/aai-traversal/src/main/resources/etc/appprops/preferredRoute.txt similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/preferredRoute.txt rename to aai-traversal/src/main/resources/etc/appprops/preferredRoute.txt diff --git a/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties b/aai-traversal/src/main/resources/etc/appprops/titan-cached.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties rename to aai-traversal/src/main/resources/etc/appprops/titan-cached.properties diff --git a/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties b/aai-traversal/src/main/resources/etc/appprops/titan-realtime.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties rename to aai-traversal/src/main/resources/etc/appprops/titan-realtime.properties diff --git a/aai-traversal/bundleconfig-local/etc/auth/aai_keystore b/aai-traversal/src/main/resources/etc/auth/aai_keystore similarity index 100% rename from aai-traversal/bundleconfig-local/etc/auth/aai_keystore rename to aai-traversal/src/main/resources/etc/auth/aai_keystore diff --git a/aai-traversal/bundleconfig-local/etc/query/stored-queries.json b/aai-traversal/src/main/resources/etc/query/stored-queries.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/query/stored-queries.json rename to aai-traversal/src/main/resources/etc/query/stored-queries.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/closed-loop-named-query-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/closed-loop-named-query-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/closed-loop-named-query-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/closed-loop-named-query-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json similarity index 83% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json index 5c4f4fb..a30e797 100644 --- a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json +++ b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getClfiRoadmTailSummary-1.0.json @@ -1,101 +1,94 @@ -{ - "named-query-uuid" : "4f448e43-339f-4c1c-85f6-896c444e25ca", - "named-query-name" : "GetClfiRoadmTailSummary", - "named-query-version" : "1.0", - "description" : "Named query - Get CLFI ROADM Tail Summary", - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "link-name", "link-type", "operational-status", "speed-value", "speed-units" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "interface-name", "interface-role", "port-description", "equipment-identifier" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "pnf-name", "pnf-name2", "equip-model", "equip-type", "frame-id" ], - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" - } ] - } ] - } - }, { - "property-collect-list" : [ "link-name", "link-name2", "link-type", "link-role", "operational-status"], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "service-instance-id", "service-instance-name", "operational-status" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "service-type" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "global-customer-id", "subscriber-name" ], - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "c1d4305f-cdbd-4bbe-9069-a2f4978fd89e" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "2e1a602a-acd8-4f78-94ff-618b802a303b" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "82194af1-3c2c-485a-8f44-420e22a9eaa4" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" - } ] - } ] - } - } ] - } +{ + "named-query-uuid" : "4f448e43-339f-4c1c-85f6-896c444e25ca", + "named-query-name" : "GetClfiRoadmTailSummary", + "named-query-version" : "1.0", + "description" : "Named query - Get CLFI ROADM Tail Summary", + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" + } ] + } ] + } + }, { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "c1d4305f-cdbd-4bbe-9069-a2f4978fd89e" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "2e1a602a-acd8-4f78-94ff-618b802a303b" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "82194af1-3c2c-485a-8f44-420e22a9eaa4" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" + } ] + } ] + } + } ] + } } \ No newline at end of file diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComplexByPnfName-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComplexByPnfName-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComplexByPnfName-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComplexByPnfName-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.1.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.1.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.1.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.1.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.2.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.2.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getComponentList-1.2.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getComponentList-1.2.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVComplexHostname-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVComplexHostname-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVComplexHostname-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVComplexHostname-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVComplexLocationId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVComplexLocationId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVComplexLocationId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVComplexLocationId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVLogicalLink-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVLogicalLink-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVLogicalLink-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVLogicalLink-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVLogicalLinkByCircuitId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVLogicalLinkByCircuitId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVLogicalLinkByCircuitId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVLogicalLinkByCircuitId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology-1.1.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology-1.1.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology-1.1.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology-1.1.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology2-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology2-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getDHVServiceTopology2-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getDHVServiceTopology2-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getL3networkCloudRegionByNetworkRole-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getL3networkCloudRegionByNetworkRole-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getL3networkCloudRegionByNetworkRole-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getL3networkCloudRegionByNetworkRole-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getLogicalLinkByCloudRegionId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getLogicalLinkByCloudRegionId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getLogicalLinkByCloudRegionId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getLogicalLinkByCloudRegionId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getPinterfacePhysicalLinkBySvcInstId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getPinterfacePhysicalLinkBySvcInstId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getPinterfacePhysicalLinkBySvcInstId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getPinterfacePhysicalLinkBySvcInstId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json similarity index 85% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json index 0fb6dd5..6f775e8 100644 --- a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json +++ b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getRouterRoadmTailSummary-1.0.json @@ -1,129 +1,120 @@ -{ - "named-query-uuid" : "cbf22b8a-f29a-4b9b-a466-a878095b258a", - "named-query-name" : "GetRouterRoadmTailSummary", - "named-query-version" : "1.0", - "description" : "Named query - Get Router ROADM Tail Summary", - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "pnf-name", "pnf-name2", "equip-model", "equip-type", "frame-id" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "interface-name", "port-description", "equipment-identifier" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "link-name", "link-type", "operational-status", "speed-value", "speed-units" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "interface-name", "interface-role", "port-description", "equipment-identifier" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "pnf-name", "equip-model", "equip-type", "frame-id" ], - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" - } ] - } ] - } - }, { - "property-collect-list" : [ "link-name", "link-name2", "link-type", "link-role", "operational-status" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "service-instance-id", "service-instance-name", "operational-status" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "service-type" ], - "named-query-elements" : { - "named-query-element" : [ { - "property-collect-list" : [ "global-customer-id", "subscriber-name" ], - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "c1d4305f-cdbd-4bbe-9069-a2f4978fd89e" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "2e1a602a-acd8-4f78-94ff-618b802a303b" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "82194af1-3c2c-485a-8f44-420e22a9eaa4" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" - } ] - } ] - } - } ] - }, - "relationship-list" : { - "relationship" : [ { - "related-to" : "model", - "relationship-data" : [ { - "relationship-key" : "model.model-invariant-id", - "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" - } ] - } ] - } - } ] - } +{ + "named-query-uuid" : "cbf22b8a-f29a-4b9b-a466-a878095b258a", + "named-query-name" : "GetRouterRoadmTailSummary", + "named-query-version" : "1.0", + "description" : "Named query - Get Router ROADM Tail Summary", + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" + } ] + } ] + } + }, { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "named-query-elements" : { + "named-query-element" : [ { + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "c1d4305f-cdbd-4bbe-9069-a2f4978fd89e" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "2e1a602a-acd8-4f78-94ff-618b802a303b" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "82194af1-3c2c-485a-8f44-420e22a9eaa4" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "fe012535-2c31-4a39-a739-612374c638a0" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "94043c37-4e73-439c-a790-0fdd697924cd" + } ] + } ] + } + } ] + }, + "relationship-list" : { + "relationship" : [ { + "related-to" : "model", + "relationship-data" : [ { + "relationship-key" : "model.model-invariant-id", + "relationship-value" : "862b25a1-262a-4961-bdaa-cdc55d69785a" + } ] + } ] + } + } ] + } } \ No newline at end of file diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getServiceInstanceModel-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getServiceInstanceModel-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getServiceInstanceModel-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getServiceInstanceModel-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getServiceInstanceSummary-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getServiceInstanceSummary-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getServiceInstanceSummary-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getServiceInstanceSummary-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getSvcSubscriberModelInfo-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getSvcSubscriberModelInfo-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getSvcSubscriberModelInfo-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getSvcSubscriberModelInfo-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getTenantInfoAtSvcInstance-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getTenantInfoAtSvcInstance-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getTenantInfoAtSvcInstance-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getTenantInfoAtSvcInstance-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getTenantInfoAtSvcSubscription-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getTenantInfoAtSvcSubscription-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getTenantInfoAtSvcSubscription-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getTenantInfoAtSvcSubscription-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getVnfVlanByCircuitId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getVnfVlanByCircuitId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getVnfVlanByCircuitId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getVnfVlanByCircuitId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getVserver-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getVserver-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getVserver-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getVserver-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getWlBundleId-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getWlBundleId-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/getWlBundleId-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/getWlBundleId-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/vnf-to-esr-system-info-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/vnf-to-esr-system-info-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/vnf-to-esr-system-info-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/vnf-to-esr-system-info-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/vnf-to-service-instance-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/named-query-json/vnf-to-service-instance-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/named-query-json/vnf-to-service-instance-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/named-query-json/vnf-to-service-instance-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/resource-model-json/000-README b/aai-traversal/src/main/resources/etc/scriptdata/resource-model-json/000-README similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/resource-model-json/000-README rename to aai-traversal/src/main/resources/etc/scriptdata/resource-model-json/000-README diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/service-model-json/000-README b/aai-traversal/src/main/resources/etc/scriptdata/service-model-json/000-README similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/service-model-json/000-README rename to aai-traversal/src/main/resources/etc/scriptdata/service-model-json/000-README diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/action-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/action-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/action-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/action-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/action-data-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/action-data-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/action-data-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/action-data-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/allotted-resource-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/allotted-resource-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/allotted-resource-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/allotted-resource-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/availability-zone-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/availability-zone-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/availability-zone-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/availability-zone-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/az-and-dvs-switches-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/az-and-dvs-switches-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/az-and-dvs-switches-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/az-and-dvs-switches-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/class-of-service-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/class-of-service-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/class-of-service-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/class-of-service-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/cloud-region-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/cloud-region-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/cloud-region-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/cloud-region-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/complex-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/complex-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/complex-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/complex-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/configuration-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/configuration-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/configuration-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/configuration-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/connector-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/connector-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/connector-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/connector-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/constrained-element-set-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/constrained-element-set-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/constrained-element-set-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/constrained-element-set-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ctag-assignment-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ctag-assignment-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ctag-assignment-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ctag-assignment-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ctag-pool-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ctag-pool-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ctag-pool-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ctag-pool-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/customer-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/customer-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/customer-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/customer-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/cvlan-tag-entry-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/cvlan-tag-entry-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/cvlan-tag-entry-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/cvlan-tag-entry-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/dvs-switch-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/dvs-switch-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/dvs-switch-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/dvs-switch-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/edge-prop-names-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/edge-prop-names-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/edge-prop-names-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/edge-prop-names-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/element-choice-set-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/element-choice-set-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/element-choice-set-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/element-choice-set-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/entitlement-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/entitlement-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/entitlement-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/entitlement-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/esr-system-info-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/esr-system-info-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/esr-system-info-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/esr-system-info-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/flavor-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/flavor-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/flavor-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/flavor-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/generic-vnf-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/generic-vnf-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/generic-vnf-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/generic-vnf-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/group-assignment-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/group-assignment-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/group-assignment-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/group-assignment-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/image-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/image-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/image-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/image-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/include-node-filter-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/include-node-filter-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/include-node-filter-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/include-node-filter-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/instance-group-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/instance-group-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/instance-group-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/instance-group-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/inventory-item-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/inventory-item-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/inventory-item-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/inventory-item-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/inventory-item-data-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/inventory-item-data-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/inventory-item-data-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/inventory-item-data-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ipsec-configuration-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ipsec-configuration-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/ipsec-configuration-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/ipsec-configuration-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/key-data-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/key-data-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/key-data-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/key-data-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l-interface-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l-interface-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l-interface-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l-interface-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-interface-ipv4-address-list-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-interface-ipv4-address-list-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-interface-ipv4-address-list-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-interface-ipv4-address-list-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-interface-ipv6-address-list-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-interface-ipv6-address-list-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-interface-ipv6-address-list-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-interface-ipv6-address-list-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-network-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-network-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/l3-network-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/l3-network-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/lag-interface-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/lag-interface-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/lag-interface-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/lag-interface-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/lag-link-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/lag-link-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/lag-link-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/lag-link-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/license-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/license-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/license-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/license-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/license-key-resource-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/license-key-resource-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/license-key-resource-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/license-key-resource-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/logical-link-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/logical-link-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/logical-link-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/logical-link-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/metadatum-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/metadatum-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/metadatum-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/metadatum-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-constraint-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-constraint-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-constraint-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-constraint-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-element-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-element-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-element-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-element-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-ver-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-ver-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/model-ver-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/model-ver-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/multicast-configuration-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/multicast-configuration-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/multicast-configuration-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/multicast-configuration-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/named-query-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/named-query-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/named-query-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/named-query-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/named-query-element-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/named-query-element-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/named-query-element-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/named-query-element-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/network-policy-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/network-policy-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/network-policy-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/network-policy-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/network-profile-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/network-profile-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/network-profile-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/network-profile-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/newvce-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/newvce-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/newvce-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/newvce-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/oam-network-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/oam-network-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/oam-network-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/oam-network-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/p-interface-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/p-interface-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/p-interface-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/p-interface-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/physical-link-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/physical-link-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/physical-link-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/physical-link-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/pnf-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/pnf-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/pnf-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/pnf-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/port-group-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/port-group-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/port-group-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/port-group-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/property-constraint-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/property-constraint-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/property-constraint-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/property-constraint-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/pserver-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/pserver-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/pserver-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/pserver-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/related-lookup-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/related-lookup-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/related-lookup-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/related-lookup-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/reserved-prop-names-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/reserved-prop-names-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/reserved-prop-names-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/reserved-prop-names-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/result-data-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/result-data-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/result-data-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/result-data-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/route-table-reference-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/route-table-reference-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/route-table-reference-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/route-table-reference-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/routing-instance-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/routing-instance-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/routing-instance-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/routing-instance-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/secondary-filter-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/secondary-filter-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/secondary-filter-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/secondary-filter-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/segmentation-assignment-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/segmentation-assignment-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/segmentation-assignment-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/segmentation-assignment-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-capability-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-capability-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-capability-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-capability-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-instance-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-instance-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-instance-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-instance-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-subscription-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-subscription-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/service-subscription-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/service-subscription-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/site-pair-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/site-pair-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/site-pair-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/site-pair-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/site-pair-set-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/site-pair-set-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/site-pair-set-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/site-pair-set-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/snapshot-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/snapshot-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/snapshot-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/snapshot-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/sriov-vf-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/sriov-vf-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/sriov-vf-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/sriov-vf-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/start-node-filter-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/start-node-filter-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/start-node-filter-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/start-node-filter-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/subnet-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/subnet-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/subnet-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/subnet-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tagged-inventory-item-list-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tagged-inventory-item-list-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tagged-inventory-item-list-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tagged-inventory-item-list-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tenant-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tenant-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tenant-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tenant-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tunnel-xconnect-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tunnel-xconnect-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/tunnel-xconnect-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/tunnel-xconnect-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/update-node-key-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/update-node-key-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/update-node-key-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/update-node-key-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vce-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vce-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vce-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vce-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vf-module-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vf-module-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vf-module-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vf-module-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vig-server-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vig-server-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vig-server-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vig-server-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/virtual-data-center-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/virtual-data-center-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/virtual-data-center-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/virtual-data-center-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vlan-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vlan-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vlan-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vlan-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vnf-image-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vnf-image-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vnf-image-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vnf-image-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vnfc-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vnfc-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vnfc-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vnfc-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/volume-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/volume-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/volume-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/volume-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/volume-group-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/volume-group-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/volume-group-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/volume-group-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpe-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpe-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpe-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpe-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpls-pe-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpls-pe-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpls-pe-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpls-pe-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpn-binding-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpn-binding-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vpn-binding-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vpn-binding-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vserver-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vserver-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/vserver-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/vserver-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/zone-1.0.json b/aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/zone-1.0.json similarity index 100% rename from aai-traversal/bundleconfig-local/etc/scriptdata/widget-model-json/zone-1.0.json rename to aai-traversal/src/main/resources/etc/scriptdata/widget-model-json/zone-1.0.json diff --git a/aai-traversal/bundleconfig-local/etc/sysprops/sys-props.properties b/aai-traversal/src/main/resources/etc/sysprops/sys-props.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/sysprops/sys-props.properties rename to aai-traversal/src/main/resources/etc/sysprops/sys-props.properties diff --git a/aai-traversal/bundleconfig-local/etc/sysprops/template.sys-props.properties b/aai-traversal/src/main/resources/etc/sysprops/template.sys-props.properties similarity index 100% rename from aai-traversal/bundleconfig-local/etc/sysprops/template.sys-props.properties rename to aai-traversal/src/main/resources/etc/sysprops/template.sys-props.properties diff --git a/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml b/aai-traversal/src/main/resources/localhost-access-logback.xml similarity index 97% rename from aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml rename to aai-traversal/src/main/resources/localhost-access-logback.xml index fbcfd25..a318796 100644 --- a/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml +++ b/aai-traversal/src/main/resources/localhost-access-logback.xml @@ -22,6 +22,7 @@ --> + ${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log diff --git a/aai-traversal/ajsc-shared-config/etc/logback.xml b/aai-traversal/src/main/resources/logback.xml similarity index 86% rename from aai-traversal/ajsc-shared-config/etc/logback.xml rename to aai-traversal/src/main/resources/logback.xml index 71b6585..4bdc015 100644 --- a/aai-traversal/ajsc-shared-config/etc/logback.xml +++ b/aai-traversal/src/main/resources/logback.xml @@ -22,21 +22,29 @@ --> - ${module.ajsc.namespace.name} + + + + + + + - + + + + + + + - - ERROR - ACCEPT - DENY - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n + + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} @@ -155,7 +163,7 @@ - ${eelfLogPattern} + ${eelfTransLogPattern} @@ -209,7 +217,7 @@ - ${eelfLogPattern} + ${eelfMetricLogPattern} + @@ -240,8 +249,6 @@ - - @@ -251,9 +258,10 @@ - + + @@ -263,7 +271,9 @@ - + + + @@ -282,10 +292,16 @@ + + + + + + @@ -325,42 +341,27 @@ "%d [%thread] %-5level %logger{1024} - %msg%n" - - 1000 - true - 0 - - - - 1000 - true - 0 - - - - - - + - + - + @@ -373,6 +374,7 @@ + @@ -384,10 +386,6 @@ - - - - diff --git a/aai-traversal/src/main/config/realm.properties b/aai-traversal/src/main/resources/realm.properties similarity index 100% rename from aai-traversal/src/main/config/realm.properties rename to aai-traversal/src/main/resources/realm.properties diff --git a/aai-traversal/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context b/aai-traversal/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context deleted file mode 100644 index 8514196..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/context/default#0.context b/aai-traversal/src/main/runtime/context/default#0.context deleted file mode 100644 index d1b5ab4..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json b/aai-traversal/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json deleted file mode 100644 index d0954cf..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroRole/ajscadmin.json b/aai-traversal/src/main/runtime/shiroRole/ajscadmin.json deleted file mode 100644 index f5e981e..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json b/aai-traversal/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 2dae9f5..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroRole/contextadmin#default.json b/aai-traversal/src/main/runtime/shiroRole/contextadmin#default.json deleted file mode 100644 index 5de814e..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroUser/ajsc.json b/aai-traversal/src/main/runtime/shiroUser/ajsc.json deleted file mode 100644 index f4c7855..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json b/aai-traversal/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json deleted file mode 100644 index cb8d483..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json b/aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 95d2361..0000000 --- a/aai-traversal/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/aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json b/aai-traversal/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json deleted file mode 100644 index 2bd5063..0000000 --- a/aai-traversal/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/aai-traversal/src/main/scripts/common_functions.sh b/aai-traversal/src/main/scripts/common_functions.sh new file mode 100644 index 0000000..8bd881a --- /dev/null +++ b/aai-traversal/src/main/scripts/common_functions.sh @@ -0,0 +1,56 @@ +#!/bin/ksh + +# Common functions that can be used throughout multiple scripts +# In order to call these functions, this file needs to be sourced + +# Checks if the user that is currently running is aaiadmin +check_user(){ + + userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) + + if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 + fi +} + +# Sources the profile and sets the project home +source_profile(){ + . /etc/profile.d/aai.sh + PROJECT_HOME=/opt/app/aai-traversal +} + +# Runs the spring boot jar based on which main class +# to execute and which logback file to use for that class +execute_spring_jar(){ + + className=$1; + logbackFile=$2; + + shift 2; + + EXECUTABLE_JAR=$(ls ${PROJECT_HOME}/lib/aai-traversal-*SNAPSHOT.jar); + + JAVA_OPTS="${JAVA_PRE_OPTS}"; + JAVA_OPTS="-DAJSC_HOME=$PROJECT_HOME"; + JAVA_OPTS="$JAVA_OPTS -DBUNDLECONFIG_DIR=resources"; + JAVA_OPTS="$JAVA_OPTS -Daai.home=$PROJECT_HOME "; + JAVA_OPTS="$JAVA_OPTS -Dhttps.protocols=TLSv1.1,TLSv1.2"; + JAVA_OPTS="$JAVA_OPTS -Dloader.main=${className}"; + JAVA_OPTS="$JAVA_OPTS -Dlogback.configurationFile=${logbackFile}"; + JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}"; + + ${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@" +} + +# Prints the start date and the script that the user called +start_date(){ + echo + echo `date` " Starting $0" +} + +# Prints the end date and the script that the user called +end_date(){ + echo + echo `date` " Done $0" +} diff --git a/aai-traversal/src/main/scripts/deleteNamedQuery.sh b/aai-traversal/src/main/scripts/deleteNamedQuery.sh index 2d19a9c..43aaae7 100644 --- a/aai-traversal/src/main/scripts/deleteNamedQuery.sh +++ b/aai-traversal/src/main/scripts/deleteNamedQuery.sh @@ -22,15 +22,11 @@ # # -# This script deletes the named query in bundleconfig/etc/scriptdata/named-query-json directory +# This script deletes the named query in resources/etc/scriptdata/named-query-json directory # PROGNAME=$(basename $0) -<<<<<<< HEAD -OUTFILE=$PROJECT_HOME/logs/misc/${PROGNAME}.log.$(date +\%Y-\%m-\%d) -======= OUTFILE=/opt/app/aai-traversal/logs/misc/${PROGNAME}.log.$(date +\%Y-\%m-\%d) ->>>>>>> codecloud/release/1802 #OUTFILE=/c/temp/${PROGNAME}.log.$(date +\%Y-\%m-\%d) TS=$(date "+%Y-%m-%d %H:%M:%S") @@ -49,23 +45,15 @@ error_exit () { } j=0 -<<<<<<< HEAD -for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/named-query-json/*.json|sort -f` -======= -for filepath in `ls /opt/app/aai-traversal/bundleconfig/etc/scriptdata/named-query-json/*.json|sort -f` ->>>>>>> codecloud/release/1802 -#for filepath in `ls /c/sources/aai/aaigitnew/bundleconfig-local/etc/scriptdata/named-query-json/*.json|sort -f` +for filepath in `ls /opt/app/aai-traversal/resources/etc/scriptdata/named-query-json/*.json|sort -f` +#for filepath in `ls /c/sources/aai/aaigitnew/resources-local/etc/scriptdata/named-query-json/*.json|sort -f` do j=$(expr "$j" + 1) filename=$(basename $filepath) echo "Begin deleteTool for named-query $filename" | tee -a $OUTFILE vers=`grep named-query-uuid $filepath|cut -d':' -f2|cut -d'"' -f2` resource=service-design-and-creation/named-queries/named-query/$vers -<<<<<<< HEAD -echo "y" | $PROJECT_HOME/scripts/deleteTool.sh $resource >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j -======= echo "y" | /opt/app/aai-traversal/scripts/deleteTool.sh $resource >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j ->>>>>>> codecloud/release/1802 echo "End deleteTool for named-query $filename" | tee -a $OUTFILE done diff --git a/aai-traversal/src/main/scripts/deleteTool.sh b/aai-traversal/src/main/scripts/deleteTool.sh index 60c3e1c..8d51437 100644 --- a/aai-traversal/src/main/scripts/deleteTool.sh +++ b/aai-traversal/src/main/scripts/deleteTool.sh @@ -50,7 +50,7 @@ fi . /etc/profile.d/aai.sh PROJECT_HOME=/opt/app/aai-traversal -prop_file=$PROJECT_HOME/bundleconfig/etc/appprops/aaiconfig.properties +prop_file=$PROJECT_HOME/resources/etc/appprops/aaiconfig.properties log_dir=$PROJECT_HOME/logs/misc today=$(date +\%Y-\%m-\%d) @@ -80,7 +80,7 @@ fi if [ $MISSING_PROP = false ]; then if [ $USEBASICAUTH = false ]; then - AUTHSTRING="--cert $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPrivateKey.pem" + AUTHSTRING="--cert $PROJECT_HOME/resources/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/resources/etc/auth/aaiClientPrivateKey.pem" else AUTHSTRING="-u $CURLUSER:$CURLPASSWORD" fi diff --git a/aai-traversal/src/main/scripts/getTool.sh b/aai-traversal/src/main/scripts/getTool.sh index 39d4e87..df0456f 100644 --- a/aai-traversal/src/main/scripts/getTool.sh +++ b/aai-traversal/src/main/scripts/getTool.sh @@ -46,7 +46,7 @@ fi . /etc/profile.d/aai.sh PROJECT_HOME=/opt/app/aai-traversal -prop_file=$PROJECT_HOME/bundleconfig/etc/appprops/aaiconfig.properties +prop_file=$PROJECT_HOME/resources/etc/appprops/aaiconfig.properties log_dir=$PROJECT_HOME/logs/misc today=$(date +\%Y-\%m-\%d) @@ -76,7 +76,7 @@ fi if [ $MISSING_PROP = false ]; then if [ $USEBASICAUTH = false ]; then - AUTHSTRING="--cert $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPrivateKey.pem" + AUTHSTRING="--cert $PROJECT_HOME/resources/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/resources/etc/auth/aaiClientPrivateKey.pem" else AUTHSTRING="-u $CURLUSER:$CURLPASSWORD" fi diff --git a/aai-traversal/src/main/scripts/install/updateQueryData.sh b/aai-traversal/src/main/scripts/install/updateQueryData.sh index 3c7f1bf..a5723d0 100644 --- a/aai-traversal/src/main/scripts/install/updateQueryData.sh +++ b/aai-traversal/src/main/scripts/install/updateQueryData.sh @@ -41,7 +41,7 @@ error_exit () { } j=0 -for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/widget-model-json/*.json|sort -f` +for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/widget-model-json/*.json|sort -f` do j=$(expr "$j" + 1) filename=$(basename $filepath) @@ -54,7 +54,7 @@ echo "End putTool for widget $filename" | tee -a $OUTFILE done j=0 -for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/named-query-json/*.json|sort -f` +for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/named-query-json/*.json|sort -f` do j=$(expr "$j" + 1) filename=$(basename $filepath) @@ -67,7 +67,7 @@ echo "End putTool for named-query $filename" | tee -a $OUTFILE done j=0 -for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/resource-model-json/*.json|sort -f` +for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/resource-model-json/*.json|sort -f` do j=$(expr "$j" + 1) filename=$(basename $filepath) @@ -80,7 +80,7 @@ echo "End putTool for resource model $filename" | tee -a $OUTFILE done j=0 -for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/service-model-json/*.json|sort -f` +for filepath in `ls $PROJECT_HOME/resources/etc/scriptdata/service-model-json/*.json|sort -f` do j=$(expr "$j" + 1) filename=$(basename $filepath) diff --git a/aai-traversal/src/main/scripts/putTool.sh b/aai-traversal/src/main/scripts/putTool.sh index be273a2..6630d8f 100644 --- a/aai-traversal/src/main/scripts/putTool.sh +++ b/aai-traversal/src/main/scripts/putTool.sh @@ -22,14 +22,9 @@ # # -<<<<<<< HEAD -# The script is called with a resource, filepath and an optional argument to -# ignore HTTP failure codes which would otherwise indicate a failure. -======= # The script is called with a resource, filepath, an optional argument to # ignore HTTP failure codes which would otherwise indicate a failure, # and an optional argument to display more data. ->>>>>>> codecloud/release/1802 # It invokes a PUT on the resource with the file using curl # Uses aaiconfig.properties for authorization type and url. The HTTP response # code is checked. Responses between 200 and 299 are considered success. @@ -51,8 +46,6 @@ contains() { fi } -<<<<<<< HEAD -======= display_usage() { cat <>>>>>> codecloud/release/1802 # remove leading slash when present RESOURCE=`echo $1 | sed "s,^/,,"` if [ -z $RESOURCE ]; then @@ -98,12 +90,10 @@ fi . /etc/profile.d/aai.sh PROJECT_HOME=/opt/app/aai-traversal -prop_file=$PROJECT_HOME/bundleconfig/etc/appprops/aaiconfig.properties +prop_file=$PROJECT_HOME/resources/etc/appprops/aaiconfig.properties log_dir=$PROJECT_HOME/logs/misc today=$(date +\%Y-\%m-\%d) -<<<<<<< HEAD -======= RETURNRESPONSE=false if [ ${#} -ne 2 ]; then if [ "$3" = "-display" ]; then @@ -116,7 +106,6 @@ if [ ${#} -ne 3 ]; then fi fi ->>>>>>> codecloud/release/1802 MISSING_PROP=false RESTURL=`grep ^aai.server.url= $prop_file |cut -d'=' -f2 |tr -d "\015"` if [ -z $RESTURL ]; then @@ -143,26 +132,19 @@ fi if [ $MISSING_PROP = false ]; then if [ $USEBASICAUTH = false ]; then - AUTHSTRING="--cert $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPrivateKey.pem" + AUTHSTRING="--cert $PROJECT_HOME/resources/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/resources/etc/auth/aaiClientPrivateKey.pem" else AUTHSTRING="-u $CURLUSER:$CURLPASSWORD" fi -<<<<<<< HEAD - result=`curl --request PUT -sL -w "%{http_code}" -o /dev/null -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T $JSONFILE $RESTURL$RESOURCE` - #echo "result is $result." - RC=0; - if [ $? -eq 0 ]; then -======= - + if [ $RETURNRESPONSE = true ]; then - curl --request PUT -sL -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T $JSONFILE $RESTURL$RESOURCE | python -mjson.tool + curl --request PUT -sL -k $AUTHSTRING -H "Content-Type: application/json" -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T $JSONFILE $RESTURL$RESOURCE | python -mjson.tool RC=$? else - result=`curl --request PUT -sL -w "%{http_code}" -o /dev/null -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T $JSONFILE $RESTURL$RESOURCE` + result=`curl --request PUT -sL -w "%{http_code}" -o /dev/null -k $AUTHSTRING -H "Content-Type: application/json" -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T $JSONFILE $RESTURL$RESOURCE` #echo "result is $result." RC=0; if [ $? -eq 0 ]; then ->>>>>>> codecloud/release/1802 case $result in +([0-9])?) #if [[ "$result" -eq 412 || "$result" -ge 200 && $result -lt 300 ]] @@ -191,18 +173,11 @@ if [ $MISSING_PROP = false ]; then ;; esac -<<<<<<< HEAD - else - echo "FAILED to send request to $RESTURL" - RC=-1 - fi -======= else echo "FAILED to send request to $RESTURL" RC=-1 fi fi ->>>>>>> codecloud/release/1802 else echo "usage: $0 resource file [expected-failure-codes]" RC=-1 diff --git a/aai-traversal/src/main/swm/package/nix/common/deinstall.env b/aai-traversal/src/main/swm/package/nix/common/deinstall.env new file mode 100644 index 0000000..fb0a9f5 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/common/deinstall.env @@ -0,0 +1,10 @@ + +# This file is used to set the environment which the install_*.sh files +# will use when executing. Only set variables that must be derived at +# installation time here. For variables that should be set by the installer +# in SWM, add VariableDescriptor elements to the descriptor.xml. Place +# logical steps in the install_preproc.sh or install_postproc.sh. + +. `dirname $0`/common.env + +AAI_USER=aaiadmin;export AAI_USER diff --git a/aai-traversal/src/test/resources/inmemory_titan.properties b/aai-traversal/src/main/swm/package/nix/common/install_postproc.sh similarity index 57% rename from aai-traversal/src/test/resources/inmemory_titan.properties rename to aai-traversal/src/main/swm/package/nix/common/install_postproc.sh index cf4bbfd..ab5f2b7 100644 --- a/aai-traversal/src/test/resources/inmemory_titan.properties +++ b/aai-traversal/src/main/swm/package/nix/common/install_postproc.sh @@ -1,23 +1,39 @@ -# +#!/bin/sh + +### # ============LICENSE_START======================================================= # org.onap.aai # ================================================================================ -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# 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 -# +# +# 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. -# +### + +############################################################################## +# - SCLD GRM SERVICE +# - Copyright 2009 AT&T Intellectual Properties +############################################################################## + + +. `dirname $0`/install.env + +cd ${ROOT_DIR}; + +TEMPLATE_YAML_FILE=${ROOT_DIR}/docker-compose.template.yaml +YAML_FILE=${ROOT_DIR}/docker-compose.yaml + +sh ${UTILPATH}/findreplace.sh ${TEMPLATE_YAML_FILE} ${YAML_FILE} || exit 200 +rm ${TEMPLATE_YAML_FILE} -storage.backend=inmemory +exit 0 diff --git a/aai-traversal/src/main/swm/package/nix/deinstall/preproc/pre_proc b/aai-traversal/src/main/swm/package/nix/deinstall/preproc/pre_proc new file mode 100644 index 0000000..5f88c41 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/deinstall/preproc/pre_proc @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ../../common +exec sh -x ./deinstall_preproc.sh diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml new file mode 100644 index 0000000..74ae555 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml @@ -0,0 +1,51 @@ +# +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# Copyright © 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. +# + +# SCLD_ENV is for the environment context for dme2 +# AAI_CHEF_ENV is used for both dme2 properites and +# also used by chef to generate appropriate properties + +version: '2' +services: + aai-traversal: + image: __REGISTRY__/__NAMESPACE__/aai-traversal:__IMAGE_VERSION__ + network_mode: host + environment: + - LOCAL_USER_ID=__LOCAL_USER_ID__ + - LOCAL_GROUP_ID=__LOCAL_GROUP_ID__ + volumes: + - /opt/aai/logroot/AAI-GQ:/opt/aai/logroot/AAI-GQ + - /opt/app/aai-traversal/appconfig/aai-client-cert.p12:/opt/app/aai-traversal/resources/etc/auth/aai-client-cert.p12 + - /opt/app/aai-traversal/appconfig/tomcat_keystore:/opt/app/aai-traversal/resources/etc/auth/tomcat_keystore + - /opt/app/aai-traversal/appconfig/aai_policy.json:/opt/app/aai-traversal/resources/etc/auth/aai_policy.json + - /opt/app/aai-traversal/appconfig/aaiconfig.properties:/opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties + - /opt/app/aai-traversal/appconfig/application.properties:/opt/app/aai-traversal/resources/application.properties + - /opt/app/aai-traversal/appconfig/dme2.properties:/opt/app/aai-traversal/resources/dme2.properties + - /opt/app/aai-traversal/appconfig/localhost-access-logback.xml:/opt/app/aai-traversal/resources/localhost-access-logback.xml + - /opt/app/aai-traversal/appconfig/logback.xml:/opt/app/aai-traversal/resources/logback.xml + - /opt/app/aai-traversal/appconfig/titan-cached.properties:/opt/app/aai-traversal/resources/etc/appprops/titan-cached.properties + - /opt/app/aai-traversal/appconfig/titan-realtime.properties:/opt/app/aai-traversal/resources/etc/appprops/titan-realtime.properties + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/execTool.sh b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/execTool.sh new file mode 100644 index 0000000..ab634c0 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/execTool.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +export WORKING_DIR="$( cd "$(dirname "$0")" ; pwd -P )/" + +DOCKER_COMPOSE_CMD="docker-compose -f ${WORKING_DIR}/docker-compose.yaml"; + +ARG=$1; + +if [ -z "$ARG" ]; then + echo "Error: You need to at least provide one argument which is the script to execute"; + exit 1; +fi; + +if [ "${ARG}" = "--debug" ]; then + + SCRIPT_NAME=$2; + + if [ -z "$SCRIPT_NAME" ]; then + echo "Error: You need to provide the tool name after specifying the --debug flag"; + exit 1; + fi; + + shift 2; + +else + SCRIPT_NAME=$1; + shift 1; +fi; + +CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} ps -q aai-traversal); + +if [ $? -ne 0 ]; then + echo "Error: seems like the container is not running, please run the commands to start aai-traversal"; + exit 1; +fi; + +if [ ${SCRIPT_NAME} = "putTool.sh" ]; then + + PAYLOAD_FILE=$2; + + if [ ! -z "${PAYLOAD_FILE}" ] && [ -f "${PAYLOAD_FILE}" ]; then + docker cp ${PAYLOAD_FILE} ${CONTAINER_NAME}:/tmp/$(basename ${PAYLOAD_FILE}) + fi; +fi; + +${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal ls /opt/app/aai-traversal/scripts/${SCRIPT_NAME} && { + + if [ "${ARG}" = "--debug" ]; then + ${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal bash -x /opt/app/aai-traversal/scripts/${SCRIPT_NAME} "$@" + else + ${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal /opt/app/aai-traversal/scripts/${SCRIPT_NAME} "$@" + fi; + + exit 0; +} || { + echo "Unable to find the tool in the /opt/app/aai-traversal/scripts"; + exit 1; +} diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/kill_resources.sh b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/kill_resources.sh new file mode 100644 index 0000000..00855da --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/kill_resources.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-traversal + +docker-compose -f ${PROJECT_HOME}/docker-compose.yaml stop && \ + docker-compose -f ${PROJECT_HOME}/docker-compose.yaml rm -f diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/start_resources.sh b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/start_resources.sh new file mode 100644 index 0000000..61819d4 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/start_resources.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-traversal + +docker-compose -f ${PROJECT_HOME}/docker-compose.yaml up -d || exit 200 diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/stop_resources.sh b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/stop_resources.sh new file mode 100644 index 0000000..009e597 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/stop_resources.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-traversal + +docker-compose -f ${PROJECT_HOME}/docker-compose.yaml stop || exit 200 diff --git a/aai-traversal/src/main/swm/package/nix/initinst/postproc/post_proc b/aai-traversal/src/main/swm/package/nix/initinst/postproc/post_proc new file mode 100644 index 0000000..d017750 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/initinst/postproc/post_proc @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ../../common +exec sh -x ./install_postproc.sh diff --git a/aai-traversal/src/main/swm/package/nix/install/postproc/post_proc b/aai-traversal/src/main/swm/package/nix/install/postproc/post_proc new file mode 100644 index 0000000..d017750 --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/install/postproc/post_proc @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ../../common +exec sh -x ./install_postproc.sh diff --git a/aai-traversal/src/main/swm/package/nix/install/preproc/pre_proc b/aai-traversal/src/main/swm/package/nix/install/preproc/pre_proc new file mode 100644 index 0000000..3f1b26f --- /dev/null +++ b/aai-traversal/src/main/swm/package/nix/install/preproc/pre_proc @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ../../common +exec sh -x ./install_preproc.sh diff --git a/aai-traversal/src/main/xjb/bindings.xjb b/aai-traversal/src/main/xjb/bindings.xjb deleted file mode 100644 index b7629d3..0000000 --- a/aai-traversal/src/main/xjb/bindings.xjb +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/onap/aai/AAIGremlinQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/AAIGremlinQueryTest.java new file mode 100644 index 0000000..4210596 --- /dev/null +++ b/aai-traversal/src/test/java/org/onap/aai/AAIGremlinQueryTest.java @@ -0,0 +1,126 @@ +package org.onap.aai; + +import com.jayway.jsonpath.JsonPath; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.config.PropertyPasswordConfiguration; +import org.onap.aai.exceptions.AAIException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.embedded.LocalServerPort; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Import; +import org.springframework.http.*; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.client.RestTemplate; + +import javax.ws.rs.core.Response; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertNotNull; + +/** + * A sample junit test using spring boot that provides the ability to spin + * up the application from the junit layer and run rest requests against + * SpringBootTest annotation with web environment requires which spring boot + * class to load and the random port starts the application on a random port + * and injects back into the application for the field with annotation LocalServerPort + *

+ * + * This can be used to potentially replace a lot of the fitnesse tests since + * they will be testing against the same thing except fitnesse uses hbase + */ +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = TraversalApp.class) +@TestPropertySource(locations = "classpath:application-test.properties") +@ContextConfiguration(initializers = PropertyPasswordConfiguration.class) +@Import(TraversalTestConfiguration.class) +public class AAIGremlinQueryTest { + + private HttpTestUtil httpTestUtil; + + private String pserverUri; + + private String hostname; + + @Autowired + RestTemplate restTemplate; + + @LocalServerPort + int randomPort; + + private HttpEntity httpEntity; + + private HttpHeaders headers; + + private String baseUrl; + + @Before + public void setup() throws Exception { + + httpTestUtil = new HttpTestUtil(); + + hostname = UUID.randomUUID().toString(); + + pserverUri ="/aai/v11/cloud-infrastructure/pservers/pserver/" + hostname; + + Map pserverMap = new HashMap<>(); + pserverMap.put("hostname", hostname); + String payload = PayloadUtil.getTemplatePayload("pserver.json", pserverMap); + httpTestUtil.doPut(pserverUri, payload); + + headers = new HttpHeaders(); + + headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.add("Real-Time", "true"); + headers.add("X-FromAppId", "JUNIT"); + headers.add("X-TransactionId", "JUNIT"); + + baseUrl = "https://localhost:" + randomPort; + } + + @Test + public void testPserverCount() throws Exception { + Map gremlinQueryMap = new HashMap<>(); + gremlinQueryMap.put("gremlin-query", "g.V().has('hostname', '" + hostname + "').count()"); + + String payload = PayloadUtil.getTemplatePayload("gremlin-query.json", gremlinQueryMap); + + ResponseEntity responseEntity = null; + + String endpoint = "/aai/v11/query?format=console"; + + httpEntity = new HttpEntity(payload, headers); + responseEntity = restTemplate.exchange(baseUrl + endpoint, HttpMethod.PUT, httpEntity, String.class); + assertThat(responseEntity.getStatusCode(), is(HttpStatus.OK)); + + String result = JsonPath.read(responseEntity.getBody().toString(), "$.results[0].result"); + assertThat(result, is("1")); + } + + @After + public void tearDown() throws UnsupportedEncodingException, AAIException { + + Response response = httpTestUtil.doGet(pserverUri); + + assertNotNull("Expected the response to be returned", response); + assertThat(response.getStatus(), is(200)); + + String body = response.getEntity().toString(); + String resourceVersion = JsonPath.read(body, "$.resource-version"); + + response = httpTestUtil.doDelete(pserverUri, resourceVersion); + assertNotNull("Expected the response to be returned", response); + assertThat(response.getStatus(), is(204)); + } +} diff --git a/aai-traversal/src/test/java/org/onap/aai/TraversalTestConfiguration.java b/aai-traversal/src/test/java/org/onap/aai/TraversalTestConfiguration.java new file mode 100644 index 0000000..e4c6f19 --- /dev/null +++ b/aai-traversal/src/test/java/org/onap/aai/TraversalTestConfiguration.java @@ -0,0 +1,125 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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. + */ +package org.onap.aai; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.apache.http.client.HttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.core.env.Environment; +import org.springframework.http.HttpStatus; +import org.springframework.http.client.ClientHttpResponse; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.util.ResourceUtils; +import org.springframework.web.client.ResponseErrorHandler; +import org.springframework.web.client.RestTemplate; + +import javax.net.ssl.SSLContext; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.KeyStore; + +@TestConfiguration +public class TraversalTestConfiguration { + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(TraversalTestConfiguration.class); + + @Autowired + private Environment env; + + /** + * Create a RestTemplate bean, using the RestTemplateBuilder provided + * by the auto-configuration. + */ + @Bean + RestTemplate restTemplate(RestTemplateBuilder builder) throws Exception { + + char[] trustStorePassword = env.getProperty("server.ssl.trust-store-password").toCharArray(); + char[] keyStorePassword = env.getProperty("server.ssl.key-store-password").toCharArray(); + + String keyStore = env.getProperty("server.ssl.key-store"); + String trustStore = env.getProperty("server.ssl.trust-store"); + + SSLContextBuilder sslContextBuilder = SSLContextBuilder.create(); + + if(env.acceptsProfiles("two-way-ssl")){ + sslContextBuilder = sslContextBuilder.loadKeyMaterial(loadPfx(keyStore, keyStorePassword), keyStorePassword); + } + + SSLContext sslContext = sslContextBuilder + .loadTrustMaterial(ResourceUtils.getFile(trustStore), trustStorePassword) + .build(); + + HttpClient client = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier((s, sslSession) -> true) + .build(); + + RestTemplate restTemplate = builder + .requestFactory(new HttpComponentsClientHttpRequestFactory(client)) + .build(); + + restTemplate.setErrorHandler(new ResponseErrorHandler() { + @Override + public boolean hasError(ClientHttpResponse clientHttpResponse) throws IOException { + if (clientHttpResponse.getStatusCode() != HttpStatus.OK) { + + logger.debug("Status code: " + clientHttpResponse.getStatusCode()); + + if (clientHttpResponse.getStatusCode() == HttpStatus.FORBIDDEN) { + logger.debug("Call returned a error 403 forbidden resposne "); + return true; + } + + if(clientHttpResponse.getRawStatusCode() % 100 == 5){ + logger.debug("Call returned a error " + clientHttpResponse.getStatusText()); + return true; + } + } + + return false; + } + + @Override + public void handleError(ClientHttpResponse clientHttpResponse) throws IOException { + } + }); + + return restTemplate; + } + + private KeyStore loadPfx(String file, char[] password) throws Exception { + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + File key = ResourceUtils.getFile(file); + try (InputStream in = new FileInputStream(key)) { + keyStore.load(in, password); + } + return keyStore; + } +} diff --git a/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java index bd3705e..64d77a9 100644 --- a/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java @@ -38,7 +38,6 @@ import com.thinkaurelius.titan.graphdb.types.system.EmptyVertex; import com.thinkaurelius.titan.graphdb.types.vertices.EdgeLabelVertex; import com.thinkaurelius.titan.graphdb.types.vertices.PropertyKeyVertex; import org.apache.commons.lang.ObjectUtils; -import org.apache.openjpa.kernel.exps.Exp; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -81,7 +80,7 @@ public class ModelBasedProcessingInvalidDataTest { @BeforeClass public static void configure() throws Exception { System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); diff --git a/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java index 406d122..dc8871d 100644 --- a/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java @@ -74,10 +74,9 @@ public class ModelBasedProcessingTest { @BeforeClass public static void configure() throws Exception { System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); - } @Before diff --git a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java index 552dbe4..029565d 100644 --- a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java @@ -98,7 +98,7 @@ public class SearchGraphNamedQueryTest { } private void addWidgets() { - String widgetPath = "." + AAIConstants.AAI_FILESEP + "bundleconfig-local" + AAIConstants.AAI_FILESEP + "etc" + + String widgetPath = "." + AAIConstants.AAI_FILESEP + "src/main/resources" + AAIConstants.AAI_FILESEP + "etc" + AAIConstants.AAI_FILESEP + "scriptdata"+ AAIConstants.AAI_FILESEP + "widget-model-json"; File dir = new File(widgetPath); @@ -120,7 +120,7 @@ public class SearchGraphNamedQueryTest { } private void addNamedQueries() { - String namedQueryPath = "." + AAIConstants.AAI_FILESEP + "bundleconfig-local" + AAIConstants.AAI_FILESEP + "etc" + + String namedQueryPath = "." + AAIConstants.AAI_FILESEP + "src/main/resources" + AAIConstants.AAI_FILESEP + "etc" + AAIConstants.AAI_FILESEP + "scriptdata"+ AAIConstants.AAI_FILESEP + "named-query-json"; File dir = new File(namedQueryPath); @@ -152,7 +152,7 @@ public class SearchGraphNamedQueryTest { httpTestUtil = new HttpTestUtil(); System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); searchGraph = new SearchGraph(); diff --git a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java index f624828..ba108a6 100644 --- a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java @@ -27,7 +27,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; -import org.apache.velocity.util.ArrayListWrapper; import org.eclipse.persistence.dynamic.DynamicEntity; import org.junit.Assert; import org.junit.Before; @@ -100,7 +99,7 @@ public class SearchGraphTest { public void setup(){ System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); searchGraph = new SearchGraph(); @@ -376,4 +375,4 @@ public class SearchGraphTest { searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, filter,dbEngine,loader,urlBuilder); } -} \ No newline at end of file +} diff --git a/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java deleted file mode 100644 index 40de5a9..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import org.apache.cxf.message.Exchange; -import org.apache.cxf.message.ExchangeImpl; -import org.apache.cxf.message.Message; -import org.junit.Before; -import org.junit.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.mockito.Mockito.*; - -public class AAILogJAXRSInInterceptorTest { - - private AAILogJAXRSInInterceptor aaiLogJAXRSInInterceptor; - - private Message message; - private Exchange exchange; - private InputStream is; - private Map> headers; - - - @Before - public void setup(){ - - aaiLogJAXRSInInterceptor = new AAILogJAXRSInInterceptor(); - - message = mock(Message.class); - exchange = spy(new ExchangeImpl()); - - is = getClass().getClassLoader().getResourceAsStream("logback.xml"); - - headers = new HashMap<>(); - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("JUNIT")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - } - - @Test - public void testHandleMessageWhenNotCamelRequest() throws IOException { - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - - when(message.get("CamelHttpUrl")).thenReturn("/somestring"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenUUIDHasMultiple() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("jfasodjf:fjaosjfidsaj:afsidjfaodfja")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - - when(message.get("CamelHttpUrl")).thenReturn("/somestring"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenMissingTransactionId() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - - when(message.get("CamelHttpUrl")).thenReturn("/somestring"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenMissingContentType() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("jfasodjf:fjaosjfidsaj:afsidjfaodfja")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - - when(message.get("CamelHttpUrl")).thenReturn("/somestring"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenQueryExistsAndUriEcho() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("jfasodjf:fjaosjfidsaj:afsidjfaodfja")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - when(message.get(Message.QUERY_STRING)).thenReturn(null); - when(exchange.containsKey("AAI_LOGGING_HBASE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_HBASE_ENABLED")).thenReturn(""); - when(exchange.containsKey("AAI_LOGGING_TRACE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_TRACE_ENABLED")).thenReturn(""); - when(message.get("CamelHttpUrl")).thenReturn("/util/echo"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenQueryExistsAndUriTranslog() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("jfasodjf:fjaosjfidsaj:afsidjfaodfja")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - when(message.get(Message.QUERY_STRING)).thenReturn(null); - when(exchange.containsKey("AAI_LOGGING_HBASE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_HBASE_ENABLED")).thenReturn(""); - when(exchange.containsKey("AAI_LOGGING_TRACE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_TRACE_ENABLED")).thenReturn(""); - when(message.get("CamelHttpUrl")).thenReturn("/translog/"); - aaiLogJAXRSInInterceptor.handleMessage(message); - } - - @Test - public void testHandleMessageWhenPutMessageKeyReturnsException() throws IOException { - - Map> headers = new HashMap<>(); - - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("jfasodjf:fjaosjfidsaj:afsidjfaodfja")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(InputStream.class)).thenReturn(is); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - when(message.get(Message.QUERY_STRING)).thenReturn(null); - when(exchange.containsKey("AAI_LOGGING_HBASE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_HBASE_ENABLED")).thenReturn(""); - when(exchange.containsKey("AAI_LOGGING_TRACE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_TRACE_ENABLED")).thenReturn(""); - when(message.get("CamelHttpUrl")).thenReturn("/translog/"); - when(message.get(Message.ENCODING)).thenReturn("http"); - when(message.get(Message.RESPONSE_CODE)).thenReturn(200); - - aaiLogJAXRSInInterceptor.handleMessage(message); - } -} \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java deleted file mode 100644 index 52c6a42..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import org.apache.cxf.io.CacheAndWriteOutputStream; -import org.apache.cxf.message.Exchange; -import org.apache.cxf.message.ExchangeImpl; -import org.apache.cxf.message.Message; -import org.junit.Before; -import org.junit.Test; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.mockito.Mockito.*; - -public class AAILogJAXRSOutInterceptorTest { - - private AAILogJAXRSOutInterceptor aaiLogJAXRSOutInterceptor; - - private Message message; - private Exchange exchange; - private OutputStream out; - private Map> headers; - private Message outMessage; - private Message inMessage; - - - @Before - public void setup(){ - - aaiLogJAXRSOutInterceptor = new AAILogJAXRSOutInterceptor(); - - message = mock(Message.class); - exchange = spy(new ExchangeImpl()); - out = mock(OutputStream.class); - outMessage = mock(Message.class); - inMessage = mock(Message.class); - - - headers = new HashMap<>(); - headers.put("X-FromAppId", Arrays.asList("JUNIT")); - headers.put("X-TransactionId", Arrays.asList("JUNIT")); - headers.put("Content-Type", Arrays.asList("application/json")); - headers.put("Accept", Arrays.asList("application/json")); - } - - @Test - public void testHandleMessageWhenNotCamelRequest() throws IOException { - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(OutputStream.class)).thenReturn(out); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - when(exchange.getOutMessage()).thenReturn(outMessage); - when(outMessage.getContent(OutputStream.class)).thenReturn(out); - when(exchange.containsKey("AAI_LOGGING_HBASE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_HBASE_ENABLED")).thenReturn(""); - - when(message.get("CamelHttpUrl")).thenReturn("/somestring"); - aaiLogJAXRSOutInterceptor.handleMessage(message); - } - - @Test - public void testLogCallBack(){ - - when(message.getExchange()).thenReturn(exchange); - when(message.getContent(OutputStream.class)).thenReturn(out); - when(message.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(message.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - when(exchange.getOutMessage()).thenReturn(outMessage); - - when(outMessage.getContent(OutputStream.class)).thenReturn(out); - when(exchange.containsKey("AAI_LOGGING_HBASE_ENABLED")).thenReturn(true); - when(exchange.remove("AAI_LOGGING_HBASE_ENABLED")).thenReturn(""); - when(exchange.getInMessage()).thenReturn(inMessage); - - when(inMessage.getExchange()).thenReturn(exchange); - when(inMessage.getContent(OutputStream.class)).thenReturn(out); - when(inMessage.get(Message.PROTOCOL_HEADERS)).thenReturn(headers); - when(inMessage.get(Message.CONTENT_TYPE)).thenReturn("*/*"); - - AAILogJAXRSOutInterceptor.LoggingCallback loggingCallback = new AAILogJAXRSOutInterceptor().new LoggingCallback(message, out); - final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(out); - loggingCallback.onClose(newOut); - } - -} \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java deleted file mode 100644 index fcc1ee3..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.onap.aai.logging.LoggingContext; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -public class PostAaiAjscInterceptorTest { - - private PostAaiAjscInterceptor postAaiAjscInterceptor; - - @Before - public void setup(){ - postAaiAjscInterceptor = new PostAaiAjscInterceptor(); - } - - @Test - public void getInstance() throws Exception { - PostAaiAjscInterceptor interceptor = PostAaiAjscInterceptor.getInstance(); - assertNotNull(interceptor); - } - - @Test - public void testAllowOrRejectIfSuccess() throws Exception { - - HttpServletRequest request = Mockito.mock(HttpServletRequest.class); - HttpServletResponse response = Mockito.mock(HttpServletResponse.class); - response.setStatus(200); - Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("/fadsjoifj")); - - boolean success = postAaiAjscInterceptor.allowOrReject(request, response, null); - - assertTrue("Expecting the post interceptor to return success regardless", success); - } - - @Test - public void testAllowOrRejectIfFailure() throws Exception { - - HttpServletRequest request = Mockito.mock(HttpServletRequest.class); - HttpServletResponse response = Mockito.mock(HttpServletResponse.class); - response.setStatus(400); - Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("/fadsjoifj")); - - boolean success = postAaiAjscInterceptor.allowOrReject(request, response, null); - - assertTrue("Expecting the post interceptor to return success regardless", success); - } -} \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java deleted file mode 100644 index 35651c3..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.interceptors; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import javax.servlet.http.HttpServletRequest; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyString; - -public class PreAaiAjscInterceptorTest { - - private PreAaiAjscInterceptor preAaiAjscInterceptor; - - @Before - public void setup(){ - preAaiAjscInterceptor = new PreAaiAjscInterceptor(); - } - - @Test - public void getInstance() throws Exception { - PreAaiAjscInterceptor interceptor = PreAaiAjscInterceptor.getInstance(); - assertNotNull(interceptor); - } - - @Test - public void testAllowOrRejectIfSuccess() throws Exception { - - HttpServletRequest request = Mockito.mock(HttpServletRequest.class); - - Mockito.when(request.getRequestURI()).thenReturn("/fadsjoifj"); - Mockito.when(request.getHeader(anyString())).thenReturn("JUNIT-Test"); - Mockito.when(request.getMethod()).thenReturn("GET"); - - boolean success = preAaiAjscInterceptor.allowOrReject(request, null, null); - - assertTrue("Expecting the post interceptor to return success regardless", success); - } - -} \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/onap/aai/rest/search/GetCustomQueryConfigTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/GetCustomQueryConfigTest.java index 9001f48..5988b43 100644 --- a/aai-traversal/src/test/java/org/onap/aai/rest/search/GetCustomQueryConfigTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/GetCustomQueryConfigTest.java @@ -16,7 +16,7 @@ public class GetCustomQueryConfigTest { @Before public void setUp() throws Exception { System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); configJson = "{\n \"stored-queries\": [{\n" + diff --git a/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java index 9ab7bc5..2acf5ec 100644 --- a/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java @@ -89,7 +89,7 @@ public class ModelAndNamedQueryRestProviderTest { public void setup(){ logger.info("Starting the setup for the integration tests of Rest Endpoints"); System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); modelAndNamedQueryRestProvider = new ModelAndNamedQueryRestProvider(); httpHeaders = mock(HttpHeaders.class); diff --git a/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java index ae54449..25d91ce 100644 --- a/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java @@ -73,7 +73,7 @@ public abstract class QueryTest { public void setUp() throws AAIException, NoEdgeRuleFoundException { System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); MockitoAnnotations.initMocks(this); graph = TinkerGraph.open(); createGraph(); diff --git a/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java index bb04653..102bc2f 100644 --- a/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java @@ -85,7 +85,7 @@ public class SearchProviderTest { public void setup(){ logger.info("Starting the setup for the integration tests of Rest Endpoints"); System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); searchProvider = new SearchProvider(); httpHeaders = mock(HttpHeaders.class); diff --git a/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java index 17ddfc5..106bb44 100644 --- a/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java @@ -76,7 +76,7 @@ public class SimpleFormatTest { public void setUp() throws AAIException, NoEdgeRuleFoundException { System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + System.setProperty("BUNDLECONFIG_DIR", "src/main/resources"); MockitoAnnotations.initMocks(this); graph = TinkerGraph.open(); loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); diff --git a/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java deleted file mode 100644 index 3e323dd..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.retiredcustomer; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.onap.aai.ajsc_aai.JaxrsUserService; -import org.onap.aai.introspection.Version; -import org.onap.aai.rest.retired.RetiredConsumer; - -import javax.ws.rs.core.*; -import java.util.*; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.when; - -public class JaxrsUserServiceTest { - - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - protected JaxrsUserService jaxrsUserService; - protected HttpHeaders httpHeaders; - protected UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); - - @Before - public void setup(){ - logger.info("Starting the setup for the integration tests of Rest Endpoints"); - - jaxrsUserService = new JaxrsUserService(); - httpHeaders = Mockito.mock(HttpHeaders.class); - uriInfo = Mockito.mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - } - @Test - public void lookUpUserTest(){ - when(uriInfo.getPath()).thenReturn("/user?userID1"); - String response = jaxrsUserService.lookupUser("userID1"); - assertNotNull(response); - - - } -} diff --git a/aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java b/aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java deleted file mode 100644 index 9573d1f..0000000 --- a/aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 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. - */ -package org.onap.aai.util; - -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; -import ch.qos.logback.classic.PatternLayout; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.AppenderBase; -import org.apache.commons.lang.ObjectUtils; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.onap.aai.dbmap.AAIGraph; -import org.onap.aai.logging.ErrorLogHelper; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.agent.PowerMockAgent; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.slf4j.LoggerFactory; - -import javax.servlet.ServletContextEvent; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -@PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) -public class AAIAppServletContextListenerTest { - - @Rule - public PowerMockRule rule = new PowerMockRule(); - - static { - PowerMockAgent.initializeIfNeeded(); - } - - private ServletContextEvent arg; - private AAIAppServletContextListener listener; - - /** - * Initialize. - */ - @Before - @PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) - public void initialize(){ - arg = PowerMockito.mock(ServletContextEvent.class); - PowerMockito.mockStatic(AAIGraph.class); - PowerMockito.mockStatic(AAIConfig.class); - PowerMockito.mockStatic(ErrorLogHelper.class); - - listener = new AAIAppServletContextListener(); - configureLog(); - } - - /** - * Test contextDestroyed. - */ - @Test(expected = NullPointerException.class) - @Ignore - public void testContextDestroyed(){ - listener.contextDestroyed(arg); - assertTrue(logContains(Level.DEBUG, "AAI Server shutdown")); - assertTrue(logContains(Level.INFO, "AAI graph shutdown")); - } - - /** - * Test contextInitialized. - */ - @Test - //@Ignore - public void testContextInitialized(){ - listener.contextInitialized(arg); - assertFalse(logContains(Level.DEBUG, "Loading aaiconfig.properties")); - assertFalse(logContains(Level.DEBUG, "Loading error.properties")); - assertFalse(logContains(Level.DEBUG, "Loading graph database")); - assertFalse(logContains(Level.INFO, "AAI Server initialization")); - } - - - /** - * Helper method to check if a String appears in the desired log level. - * - * @param level Log level to use - * @param expected String to search for - * @return True if search String is found, false otherwise - */ - private boolean logContains(Level level, String expected) { - String actual[] = RecordingAppender.messages(); - for (String log : actual) { - if (log.contains(level.toString()) && log.contains(expected)) - return true; - } - return false; - } - - /** - * Set logging level, and initialize log-appender. - */ - private void configureLog() { - org.slf4j.Logger rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - rootLogger.debug("debug"); - // rootLogger.(); - // rootLogger.addAppender(RecordingAppender.appender(new PatternLayout())); - } - -} - - -/** - * Appender class that appends log messages to a String List when some logging event occurs - */ -class RecordingAppender extends AppenderBase { - private static List messages = new ArrayList(); - private static RecordingAppender appender = new RecordingAppender(); - private PatternLayout patternLayout; - - private RecordingAppender() { - super(); - } - - /** - * @param patternLayout Pattern to format log message - * @return Current appender - */ - public static RecordingAppender appender(PatternLayout patternLayout) { - appender.patternLayout = patternLayout; - appender.clear(); - return appender; - } - - @Override - protected void append(ILoggingEvent event) { - messages.add(patternLayout.doLayout(event)); - } - - public void close() {} - - public boolean requiresLayout() { - return false; - } - - /** - * @return Return logs as a String array - */ - public static String[] messages() { - return (String[]) messages.toArray(new String[messages.size()]); - } - - /** - * Clear the message container - */ - private void clear() { - messages.clear(); - } - -} diff --git a/aai-traversal/src/test/resources/application-test.properties b/aai-traversal/src/test/resources/application-test.properties new file mode 100644 index 0000000..9b6934b --- /dev/null +++ b/aai-traversal/src/test/resources/application-test.properties @@ -0,0 +1,70 @@ +# The following info parameters are being referenced by ajsc6 +info.build.artifact=aai-traversal +info.build.name=traversal +info.build.description=Traversal Microservice +info.build.version=1.1.0 + +spring.application.name=aai-traversal +spring.jersey.type=filter + +server.contextPath=/ +spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + +spring.profiles.active=production +#The max number of active threads in this pool +server.tomcat.max-threads=200 +#The minimum number of threads always kept alive +server.tomcat.min-Spare-Threads=25 +#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads +server.tomcat.max-idle-time=60000 + + +#Add this properties only if you want to change the URL, AJSC Framework interceptors will intercept +#com.att.ajsc.common.interceptors.PreInterceptor.url=/** +#com.att.ajsc.common.interceptors.PostInterceptor.url=/** + +#Servlet context parameters +server.context_parameters.p-name=value #context parameter with p-name as key and value as value. +kubernetes.namespace=org-onap-aai + +# If you get an application startup failure that the port is already taken +# If thats not it, please check if the key-store file path makes sense +server.local.startpath=src/main/resources/ +server.basic.auth.location=${server.local.startpath}etc/auth/realm.properties + +server.port=8446 +server.ssl.enabled-protocols=TLSv1.1,TLSv1.2 +server.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore +server.ssl.key-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0) +server.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore +server.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0) +server.ssl.client-auth=want +server.ssl.key-store-type=JKS + +# JMS bind address host port +jms.bind.address=tcp://localhost:61647 +dmaap.ribbon.eureka.enabled=false +dmaap.ribbon.listOfServers=localhost:3904 +# Number of milliseconds to wait before making ping requests again +dmaap.ribbon.ServerListRefreshInterval=75000 +dmaap.ribbon.NFLoadBalancerPingInterval=75000 +dmaap.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.AvailabilityFilteringRule +dmaap.ribbon.NFLoadBalancerPingClassName=org.onap.aai.config.HttpPingImpl +dmaap.ribbon.EnableMarkingServerDownOnReachingFailureLimit=true +dmaap.ribbon.ServerDownFailureLimit=1 +# This needs to be verified but it seems that adding this property should automatically +# Make the dmaap client change the url from http to https depending on the server +dmaap.ribbon.securePorts=3905 + +# Custom Dmaap Specific Configuration +dmaap.ribbon.health.endpoint=/topics/AAI-EVENT +# Number of seconds to wait for the ping to work and might need to increase this if the pings are all failing +dmaap.ribbon.pingport.timeout=3 + +niws.loadbalancer.dmaap.filterCircuitTripped=true +niws.loadbalancer.dmaap.connectionFailureCountThreshold=3 +niws.loadbalancer.dmaap.circuitTripMaxTimeoutSeconds=180 +#dmaap.ribbon.retryableStatusCodes=404,503 +#dmaap.ribbon.retryableStatusCodes.MaxAutoRetriesNextServer=2 +#dmaap.ribbon.retryableStatusCodes.MaxAutoRetries=2 +#dmaap.ribbon.retryableStatusCodes.OkToRetryOnAllOperations=true diff --git a/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties deleted file mode 100644 index 2fdb55e..0000000 --- a/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ /dev/null @@ -1,117 +0,0 @@ -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -#################################################################### -# REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE -# TEMPLATE AND *ALL* DATAFILES -#################################################################### - -aai.config.checktime=1000 - -# this could come from siteconfig.pl? -aai.config.nodename=AutomaticallyOverwritten - -aai.logging.hbase.interceptor=true -aai.logging.hbase.enabled=true -aai.logging.hbase.logrequest=true -aai.logging.hbase.logresponse=true - -aai.logging.trace.enabled=true -aai.logging.trace.logrequest=false -aai.logging.trace.logresponse=false - -aai.transaction.logging=true -aai.transaction.logging.get=true -aai.transaction.logging.post=true - -aai.server.url.base=https://localhost:8446/aai/ -aai.server.url=https://localhost:8446/aai/v10/ -aai.global.callback.url=https://localhost:8446/aai/ - -aai.auth.cspcookies_on=false -aai.dbmodel.filename=ex5.json -aai.truststore.filename=aai_keystore -aai.truststore.passwd.x= -aai.keystore.filename=aai-client-cert.p12 -aai.keystore.passwd.x= - -# for transaction log -hbase.table.name=aailogging-dev1.dev -hbase.notificationTable.name=aainotification-dev1.dev -hbase.table.timestamp.format=YYYYMMdd-HH:mm:ss:SSS -hbase.zookeeper.quorum=ONAPserverTBD -hbase.zookeeper.property.clientPort=2181 -hbase.zookeeper.znode.parent=/hbase-unsecure - -# single primary server -aai.primary.filetransfer.serverlist=ONAPserverTBD -aai.primary.filetransfer.primarycheck=echo:8443/aai/util/echo -aai.primary.filetransfer.pingtimeout=5000 -aai.primary.filetransfer.pingcount=5 - -#rsync properties -aai.rsync.command=rsync -aai.rsync.options.list=-v|-t -aai.rsync.remote.user=aaiadmin -aai.rsync.enabled=y - -aai.notification.current.version=v10 -aai.notificationEvent.default.status=UNPROCESSED -aai.notificationEvent.default.eventType=AAI-EVENT -aai.notificationEvent.default.domain=devINT1 -aai.notificationEvent.default.sourceName=aai -aai.notificationEvent.default.sequenceNumber=0 -aai.notificationEvent.default.severity=NORMAL -aai.notificationEvent.default.version=v10 -# This one lets us enable/disable resource-version checking on updates/deletes -aai.resourceversion.enableflag=true -aai.logging.maxStackTraceEntries=10 -aai.default.api.version=v10 - -# Used by Model-processing code -aai.model.delete.sleep.per.vtx.msec=500 -aai.model.query.resultset.maxcount=30 -aai.model.query.timeout.sec=90 - -aai.model.proc.max.levels=50 -aai.edgeTag.proc.max.levels=50 - -# Used by the ForceDelete tool -aai.forceDel.protected.nt.list=cloud-region -aai.forceDel.protected.edge.count=10 -aai.forceDel.protected.descendant.count=10 - -aai.dmaap.workload.enableEventProcessing=true - -aai.realtime.clients=RO,SDNC,MSO - -aai.server.rebind=g - -#timeout for traversal enabled flag -aai.traversal.timeoutenabled=true - -#timeout app specific -aai.traversal.timeout.appspecific=JUNITTESTAPP1,-1|JUNITTESTAPP2,-1|DCAE-CCS,-1|DCAES,-1|AAI-FILEGEN-GFPIP,-1 - -#default timeout limit added for traversal if not overridden (in ms) -aai.traversal.timeoutlimit=180000 - diff --git a/aai-traversal/src/test/resources/bundleconfig-local/etc/auth/aai_policy.json b/aai-traversal/src/test/resources/bundleconfig-local/etc/auth/aai_policy.json deleted file mode 100644 index 9706ce9..0000000 --- a/aai-traversal/src/test/resources/bundleconfig-local/etc/auth/aai_policy.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "roles": [{ - "name": "testRole", - "functions": [{ - "name": "testFunction", - "methods": [{ - "name": "GET" - }, { - "name": "DELETE" - }, { - "name": "PUT" - } - ] - } - ], - "users": [{ - "username": "testUser" - } - ] - }, { - "name": "testBasicAuth", - "functions": [{ - "name": "testBasicAuthFuncyion", - "methods": [{ - "name": "GET" - } - ] - } - ], - "users": [{ - "user": "testBasicAuthUser", - "pass": "OBF:1ytc1vu91v2p1rxf1mqh1v8s1z0d1msn1san1mqf1z0h1v9u1msl1rvf1v1p1vv11yta" - } - ] - } - ] -} \ No newline at end of file diff --git a/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/resource-model-json/000-README b/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/resource-model-json/000-README deleted file mode 100644 index 9647972..0000000 --- a/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/resource-model-json/000-README +++ /dev/null @@ -1,10 +0,0 @@ -Add resource models here in the order you want them to be added to the graph. - -Recommended that they are spaced by 10's. - -So, if you are adding a resource model it should be: - -100-ipe-resource-model-1.0.json -110-vBgf-resource-model-1.0.json - -This will allow others to insert models between existing models. \ No newline at end of file diff --git a/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/service-model-json/000-README b/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/service-model-json/000-README deleted file mode 100644 index bb30e02..0000000 --- a/aai-traversal/src/test/resources/bundleconfig-local/etc/scriptdata/service-model-json/000-README +++ /dev/null @@ -1,10 +0,0 @@ -Add service models here in the order you want them to be added to the graph. - -Recommended that they are spaced by 10's. - -So, if you are adding a resource model it should be: - -100-connector-service-model-1.0.json -110-service-instance-service-model-1.0.json - -This will allow others to insert models between existing models. \ No newline at end of file diff --git a/aai-traversal/src/test/resources/config/etc/titan-cached.properties b/aai-traversal/src/test/resources/config/etc/titan-cached.properties deleted file mode 100644 index 2333d2a..0000000 --- a/aai-traversal/src/test/resources/config/etc/titan-cached.properties +++ /dev/null @@ -1,39 +0,0 @@ -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -query.fast-property=true -# the following parameters are not reloaded automatically and require a manual bounce -storage.backend=inmemory -storage.hostname=ONAPserverTBD - -#schema.default=none -storage.lock.wait-time=300 -storage.hbase.table=aaigraph-dev1.dev -storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure -#caching on -cache.db-cache = true -cache.db-cache-clean-wait = 20 -cache.db-cache-time = 180000 -cache.db-cache-size = 0.3 - -#load graphson file on startup -load.snapshot.file=false diff --git a/aai-traversal/src/test/resources/config/etc/titan-realtime.properties b/aai-traversal/src/test/resources/config/etc/titan-realtime.properties deleted file mode 100644 index 2d1d21d..0000000 --- a/aai-traversal/src/test/resources/config/etc/titan-realtime.properties +++ /dev/null @@ -1,36 +0,0 @@ -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -query.fast-property=true -# the following parameters are not reloaded automatically and require a manual bounce -storage.backend=inmemory -storage.hostname=ONAPserverTBD - -#schema.default=none -storage.lock.wait-time=300 -storage.hbase.table=aaigraph-dev1.dev -storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure -# Setting db-cache to false ensure the fastest propagation of changes across servers -cache.db-cache = false - -#load graphson file on startup -load.snapshot.file=true diff --git a/aai-traversal/src/test/resources/log4j.properties b/aai-traversal/src/test/resources/log4j.properties deleted file mode 100644 index 2e68f61..0000000 --- a/aai-traversal/src/test/resources/log4j.properties +++ /dev/null @@ -1,3 +0,0 @@ -log4j.logger.org.apache.zookeeper=WARN -log4j.logger.org.apache.hadoop.hbase.zookeeper=WARN -log4j.logger.org.apache.hadoop.hbase.client=WARN \ No newline at end of file diff --git a/aai-traversal/src/test/resources/logback.xml b/aai-traversal/src/test/resources/logback.xml index 38499e0..f79a189 100644 --- a/aai-traversal/src/test/resources/logback.xml +++ b/aai-traversal/src/test/resources/logback.xml @@ -22,14 +22,371 @@ --> + - - - %d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n - - + - - - + + + + + + + + + + + + + + + + + + + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} + + + + + + ${logDirectory}/rest/sane.log + + ${logDirectory}/rest/sane.log.%d{yyyy-MM-dd} + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n + + + + + + 1000 + true + + + + + + INFO + ACCEPT + DENY + + ${logDirectory}/rest/metrics.log + + ${logDirectory}/rest/metrics.log.%d{yyyy-MM-dd} + + + + ${eelfMetricLogPattern} + + + + 1000 + true + + + + + + DEBUG + ACCEPT + DENY + + ${logDirectory}/rest/debug.log + + ${logDirectory}/rest/debug.log.%d{yyyy-MM-dd} + + + + ${eelfLogPattern} + + + + + 1000 + true + + + + + + WARN + + ${logDirectory}/rest/error.log + + ${logDirectory}/rest/error.log.%d{yyyy-MM-dd} + + + + ${eelfErrorLogPattern} + + + + + 1000 + true + + + + + ${logDirectory}/rest/audit.log + + ${logDirectory}/rest/audit.log.%d{yyyy-MM-dd} + + + + ${eelfAuditLogPattern} + + + + + 1000 + true + + + + + + DEBUG + ACCEPT + DENY + + ${logDirectory}/rest/translog.log + + ${logDirectory}/rest/translog.log.%d{yyyy-MM-dd} + + + + ${eelfTransLogPattern} + + + + + 1000 + true + + + + + + WARN + + ${logDirectory}/dmaapAAIEventConsumer/error.log + + ${logDirectory}/dmaapAAIEventConsumer/error.log.%d{yyyy-MM-dd} + + + + ${eelfLogPattern} + + + + + + DEBUG + ACCEPT + DENY + + ${logDirectory}/dmaapAAIEventConsumer/debug.log + + ${logDirectory}/dmaapAAIEventConsumer/debug.log.%d{yyyy-MM-dd} + + + + ${eelfLogPattern} + + + + + INFO + ACCEPT + DENY + + ${logDirectory}/dmaapAAIEventConsumer/metrics.log + + ${logDirectory}/dmaapAAIEventConsumer/metrics.log.%d{yyyy-MM-dd} + + + + ${eelfMetricLogPattern} + + + + + WARN + + ${logDirectory}/external/external.log + + ${logDirectory}/external/external.log.%d{yyyy-MM-dd} + + + + ${eelfLogPattern} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${logDirectory}/perf-audit/Audit-${lrmRVer}-${lrmRO}-${Pid}.log + + + ${logDirectory}/perf-audit/Audit-${lrmRVer}-${lrmRO}-${Pid}.%i.log.zip + + 1 + 9 + + + 5MB + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + ${logDirectory}/perf-audit/Perform-${lrmRVer}-${lrmRO}-${Pid}.log + + + ${logDirectory}/perf-audit/Perform-${lrmRVer}-${lrmRO}-${Pid}.%i.log.zip + + 1 + 9 + + + 5MB + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-traversal/src/test/resources/payloads/templates/pserver.json b/aai-traversal/src/test/resources/payloads/templates/pserver.json new file mode 100644 index 0000000..dbaf2a9 --- /dev/null +++ b/aai-traversal/src/test/resources/payloads/templates/pserver.json @@ -0,0 +1,3 @@ +{ + "hostname": "${hostname}" +} diff --git a/aai-traversal/src/test/resources/test_aaiconfig.properties b/aai-traversal/src/test/resources/test_aaiconfig.properties deleted file mode 100644 index 4f130da..0000000 --- a/aai-traversal/src/test/resources/test_aaiconfig.properties +++ /dev/null @@ -1,99 +0,0 @@ -# -# ============LICENSE_START======================================================= -# org.onap.aai -# ================================================================================ -# Copyright © 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. -# - -#################################################################### -# REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE -# TEMPLATE AND *ALL* DATAFILES -#################################################################### - -aai.config.checktime=1000 - -# this could come from siteconfig.pl? -aai.config.nodename=AutomaticallyOverwritten - -aai.logging.hbase.interceptor=true -aai.logging.hbase.enabled=true -aai.logging.hbase.logrequest=true -aai.logging.hbase.logresponse=true - -aai.logging.trace.enabled=true -aai.logging.trace.logrequest=false -aai.logging.trace.logresponse=false - -aai.auth.cspcookies_on=false -aai.dbmodel.filename=ex5.json - -aai.server.url.base=https://localhost:8446/aai/ -aai.server.url=https://localhost:8446/aai/v12/ - -aai.truststore.filename=aai_keystore -aai.truststore.passwd.x= -aai.keystore.filename=aai-client-cert.p12 -aai.keystore.passwd.x= - -# the following parameters are not reloaded automatically and require a manual bounce -storage.backend=hbase -storage.hostname=ONAPserverTBD -#schema.default=none -storage.lock.wait-time=300 -storage.hbase.table=aaigraph-dev1.dev -storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure -# Setting db-cache to false ensure the fastest propagation of changes across servers -cache.db-cache = false -#cache.db-cache-clean-wait = 20 -#cache.db-cache-time = 180000 -#cache.db-cache-size = 0.5 - -# for transaction log -hbase.table.name=aailogging-dev1.dev -hbase.notificationTable.name=aainotification-dev1.dev -hbase.table.timestamp.format=YYYYMMdd-HH:mm:ss:SSS -hbase.zookeeper.quorum=ONAPserverTBD -hbase.zookeeper.property.clientPort=2181 -hbase.zookeeper.znode.parent=/hbase-unsecure - -# single primary server -aai.primary.filetransfer.serverlist=ONAPserverTBD -aai.primary.filetransfer.primarycheck=echo:8443/aai/util/echo -aai.primary.filetransfer.pingtimeout=5000 -aai.primary.filetransfer.pingcount=5 - -#rsync properties -aai.rsync.command=rsync -aai.rsync.options.list=-v|-t -aai.rsync.remote.user=aaiadmin -aai.rsync.enabled=y - -aai.notification.current.version=v12 -aai.notificationEvent.default.status=UNPROCESSED -aai.notificationEvent.default.eventType=AAI-EVENT -aai.notificationEvent.default.domain=devINT1 -aai.notificationEvent.default.sourceName=aai -aai.notificationEvent.default.sequenceNumber=0 -aai.notificationEvent.default.severity=NORMAL -aai.notificationEvent.default.version=v9 -# This one lets us enable/disable resource-version checking on updates/deletes -aai.resourceversion.enableflag=true -aai.logging.maxStackTraceEntries=10 -aai.default.api.version=v12 - - diff --git a/pom.xml b/pom.xml index 4765c9d..34ed85a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - ajsc-archetype-parent - com.att.ajsc - 2.1.0 - org.onap.aai.traversal traversal 1.2.0-SNAPSHOT @@ -18,234 +13,10 @@ https://nexus.onap.org - https://nexus.onap.org - /content/sites/site/org/onap/aai/traversal/${project.artifactId}/${project.version} - UTF-8 - 1.8 - 1.8 - ActiveAndAvailableInventory-Traversal - v1 - 2.1.0 - 1.2.0 - 1.2 - - - /opt/app/aai-traversal - - - - /opt/app/${project.artifactId} - - ${basedir} - ${aaiAppHome}/target/swm/package/nix/dist_files${distFilesRoot} - - aaiadmin - aaiadmin - org.onap.aai.dev - - - 8083 - 8446 - workstation - DEV - - - 3.0.4 - 0.0.1 - int1-data.graphson - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + /content/sites/site/org/onap/aai/traversal/${project.artifactId}/${project.version} + /content/repositories/releases/ + /content/repositories/snapshots/ - - - - maven.restlet.org - maven.restlet.org - http://maven.restlet.org - - - - - - ecomp-releases - ECOMP Release Repository - ${onap.nexus.url}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${onap.nexus.url}/content/repositories/snapshots/ - - - ecomp-site - dav:${onap.nexus.url}${sitePath} - - - - - jenkins-properties - - - unix - - - - ${env.swmpkgversion} - - - - runAjsc - - initialize - - - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - run ajsc - initialize - - java - - - - false - true - java - com.att.ajsc.runner.Runner - - com.att.ajsc - ajsc-runner - - - - ${runAjscHome} - - - ${runAjscHome}/extJars/logback-access-1.1.7.jar - - ${runAjscHome}/extJars/logback-core-1.1.7.jar - - - ${runAjscHome}/extJars/aai-core-${aai.core.version}.jar - - - - - - - AJSC_HOME - ${runAjscHome} - - - AFT_HOME - ${runAjscHome}/bundleconfig/ - - - AJSC_CONF_HOME - ${aaiAppHome}/bundleconfig-local - - - logback.configurationFile - ${aaiAppHome}/ajsc-shared-config/etc/logback.xml - - - AJSC_SHARED_CONFIG - ${aaiAppHome}/ajsc-shared-config - - - file.separator - / - - - snapshot.location - ${basedir}/ajsc-aai/snapshots/${snapshot.file} - - - - - AJSC_EXTERNAL_LIB_FOLDERS - ${aaiAppHome}/target/commonLibs - - - - AJSC_EXTERNAL_PROPERTIES_FOLDERS - ${aaiAppHome}/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} - - - aai-core.version - ${aai.core.version} - - - - - - context=/ - port=${serverPort} - sslport=${sslport} - - - - - - java - - - - com.att.ajsc - ajsc-runner - ${ajscRuntimeVersion} - - - - - - - @@ -254,29 +25,6 @@ sonar-maven-plugin 3.2 - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - groovy-eclipse-compiler - false - 1.8 - 1.8 - - - - org.codehaus.groovy - groovy-eclipse-compiler - 2.9.0-01 - - - org.codehaus.groovy - groovy-eclipse-batch - 2.3.4-01 - - - org.apache.maven.plugins maven-deploy-plugin @@ -293,7 +41,7 @@ 1.6.7 true - ${onap.nexus.url} + ${nexusproxy} 176c31dfe190a ecomp-staging @@ -313,42 +61,6 @@ - - org.apache.maven.plugins - maven-site-plugin - 3.6 - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.4 - - false - false - - - dependencies - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - -Xdoclint:none - - - - - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.10 - - - @@ -371,5 +83,31 @@ - + + + central + http://repo1.maven.org/maven2 + + + EvoSuite + EvoSuite Repository + http://www.evosuite.org/m2 + + + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}${release.path} + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}${snapshot.path} + + + ecomp-site + dav:${nexusproxy}${site.path} + + -- 2.16.6